Package de.mid.innovator.srv
Class Model
java.lang.Object
de.mid.innovator.srv.Model
- All Implemented Interfaces:
SrvContext
- Direct Known Subclasses:
ExcellenceModel
The class represents an Innovator UML 2 model. It supports basic functions
like login and logout, keeps the association to its repository server and
provides the entry point to the ADModel.
-
Method Summary
Modifier and TypeMethodDescriptionConverts this model instance to an ExcellenceModel.final voidbeginCommandSequence(String commandName) abstract voidDeletes a model from a repository server.final voidbooleanequals(SrvContext obj) getLogin()Gets the login for the model.Gets the name of the model.Gets the type of the model.Gets the repository server instance which the model corresponds to.getUserRoleList(InoUser inoUser) Fetch the possible rolesgetUsers()Gets the list of available users from model.Gets the version name of the model.booleanhasLogin()Checks if the model contains any kind of login.booleanChecks if the model is a version model.abstract voidLogin as model administrator with name and password.abstract voidloginModelAdmin(String aUserName, String pwd) Login as model administrator with name and password.abstract voidloginModelGuest(String pwd) Login as model guest with password.abstract voidloginSuperUser(Boolean login, String pwd) Switch superuser mode for login.abstract voidLogin as normal user with name and password.abstract voidlogout()Logout any user from the model.abstract booleantryReLogin(K_LOGINKIND loginKind, String loginName) Checks if the given user has a login with the same display.abstract booleantryReLogin(String aUserName) Checks if the given user has a login with the same display.
-
Method Details
-
getModelType
Gets the type of the model.- Returns:
- the type of the model
-
getSrvConnection
- Specified by:
getSrvConnectionin interfaceSrvContext- Returns:
- the server connection for the model
-
getLogin
Gets the login for the model.- Specified by:
getLoginin interfaceSrvContext- Returns:
- the login instance or null if not logged-in.
-
hasLogin
public boolean hasLogin()Checks if the model contains any kind of login.- Returns:
- true, if the model contains an ADLogin, otherwise false.
-
getModelName
Gets the name of the model.- Returns:
- a name as a string
-
getRepositoryServer
Gets the repository server instance which the model corresponds to.- Returns:
- the repository server
-
asExcellenceModel
Converts this model instance to an ExcellenceModel.- Returns:
- this casted to
ExcellenceModelor null
-
getUsers
Gets the list of available users from model.- Returns:
- list of users
- Throws:
InoNetExceptionSrvErrorException
-
getUserRoleList
public abstract List<String> getUserRoleList(InoUser inoUser) throws InoNetException, SrvErrorException Fetch the possible roles- Parameters:
inoUser- the Innovator user- Throws:
InoNetExceptionSrvErrorException
-
loginUser
public abstract void loginUser(String aUserName, String aCleartextPassword, String role) throws InoNetException, SrvErrorException Login as normal user with name and password. If name is omitted (equal to "" or is null), the system user is used by callingSystemUtils.getSystemUser();- Parameters:
aUserName- the user name or null. If no name is given, the system user name is used.aCleartextPassword- a clear text password for this user or nullrole- the user's role or null. If no role is given, the user's role of the last successful login is used.- Throws:
InoNetExceptionSrvErrorException
-
tryReLogin
Checks if the given user has a login with the same display. If so, the login can be reused. In this case, the model stores the existing login and the ADModel instance and changes its state to "logged-in".- Parameters:
aUserName- the user name to search for If null, all existing user logins and also guest and admin logins are checked- Returns:
- true, if a re-login was performed, otherwise false (a login then needs to be carried out).
- Throws:
InoNetExceptionSrvErrorException
-
tryReLogin
public abstract boolean tryReLogin(K_LOGINKIND loginKind, String loginName) throws InoNetException, SrvErrorException Checks if the given user has a login with the same display. If so, the login can be reused. In this case, the model stores the existing login and the ADModel instance and changes its state to "logged-in".- Parameters:
loginKind- the kind of loginloginName- the user name to search for- Returns:
- true, if a re-login was performed, otherwise false (a login then needs to be carried out).
- Throws:
InoNetExceptionSrvErrorException
-
loginModelAdmin
public abstract void loginModelAdmin(String aUserName, String pwd) throws InoNetException, SrvErrorException Login as model administrator with name and password. If name is omitted (equal to "" or is null), the system user is used by callingSystemUtils.getSystemUser();- Parameters:
aUserName- a user name as string or nullpwd- the administrator's password- Throws:
InoNetExceptionSrvErrorException
-
loginModelAdmin
Login as model administrator with name and password. If name is omitted (equal to "" or is null), the system user is used by callingSystemUtils.getSystemUser();- Throws:
InoNetExceptionSrvErrorException
-
loginModelGuest
Login as model guest with password.- Parameters:
pwd- the administrator's password- Throws:
InoNetExceptionSrvErrorException
-
loginSuperUser
public abstract void loginSuperUser(Boolean login, String pwd) throws InoNetException, SrvErrorException Switch superuser mode for login.- Parameters:
login- flag for log-in/outpwd- the administrator's password- Throws:
InoNetExceptionSrvErrorException
-
logout
Logout any user from the model. This means that the ADModel instance cannot be used in further calls.- Throws:
InoNetExceptionSrvErrorException
-
delete
Deletes a model from a repository server. The corresponding server must be prepared for administration withRepositoryServer.repositoryAdminLogin(String)- Parameters:
pwd- the model's administrator password- Throws:
InoNetExceptionSrvErrorException
-
equals
- Specified by:
equalsin interfaceSrvContext- Returns:
- true, if the given server context is equal to the model, otherwise false
-
beginCommandSequence
- Throws:
SrvErrorException
-
endCommandSequence
public final void endCommandSequence() -
getCommandSequenceId
- Specified by:
getCommandSequenceIdin interfaceSrvContext
-
getCommandSequenceName
- Specified by:
getCommandSequenceNamein interfaceSrvContext
-
isLoginAllowed
-
isAdminLoginAllowed
-
isApiAdminLoginAllowed
-
isGuestLoginAllowed
-
isNormalLoginAllowed
-
getVersionName
Gets the version name of the model.- Returns:
- a name as a string
-
isVersion
public boolean isVersion()Checks if the model is a version model.- Returns:
- true, if the model is a version model.
-