Package de.mid.innovator.srv.excellence
Class ExcellenceModel
- java.lang.Object
-
- de.mid.innovator.srv.Model
-
- de.mid.innovator.srv.excellence.ExcellenceModel
-
- All Implemented Interfaces:
SrvContext
public class ExcellenceModel extends Model
-
-
Field Summary
-
Fields inherited from class de.mid.innovator.srv.Model
fLogin, fModelName, fModelType, fRepositoryServer, versionName
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Model
create(RepositoryServer rep, java.lang.String name, K_ADMODEL modelType, ADModel mdlId)
void
delete(java.lang.String pwd)
Deletes a model from a repository server.ADModel
getADModel()
The instance of ADModel is fetched from the server.java.util.List<java.lang.String>
getUserRoleList(InoUser inoUser)
Fetch the possible rolesjava.util.List<InoUser>
getUsers()
Gets the list of available users.void
loginModelAdmin()
Login as model administrator for SSOvoid
loginModelAdmin(java.lang.String aUserName, java.lang.String pwd)
Login as model administrator with name and password.void
loginModelGuest(java.lang.String pwd)
Login as model guest with password.void
loginSuperUser(java.lang.Boolean login, java.lang.String pwd)
Switch superuser mode for login.void
loginUser(java.lang.String aUserName, java.lang.String aCleartextPassword, java.lang.String role)
Login as normal user with name and password.void
logout()
Logout any user from the model.boolean
tryReLogin(K_LOGINKIND loginKind, java.lang.String loginName)
Checks if the given user has a login with the same display.boolean
tryReLogin(java.lang.String aUserName)
Checks if the given user has a login with the same display.boolean
userHasAdminPrivileges()
-
Methods inherited from class de.mid.innovator.srv.Model
asExcellenceModel, beginCommandSequence, endCommandSequence, equals, getCommandSequenceId, getCommandSequenceName, getLicUserRoleList, getLogin, getModelName, getModelType, getRepositoryServer, getSrvConnection, getSSOUserCookie, getSSOUsers, getVersionName, hasLogin, isSingleSignOn, isVersion, registerModelAtLicServer, unregisterModelAtLicServer
-
-
-
-
Method Detail
-
loginUser
public void loginUser(java.lang.String aUserName, java.lang.String aCleartextPassword, java.lang.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();
- Specified by:
loginUser
in classModel
- 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 null.role
- the user's role or null. If no role is given, the role of the user's last successful login is used.- Throws:
InoNetException
SrvErrorException
-
tryReLogin
public boolean tryReLogin(java.lang.String aUserName) 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".- Specified by:
tryReLogin
in classModel
- Parameters:
aUserName
- the user name to search for.- Returns:
- true if a re-login was performed, otherwise false (a login must then be carried out).
- Throws:
InoNetException
SrvErrorException
-
tryReLogin
public boolean tryReLogin(K_LOGINKIND loginKind, java.lang.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".- Specified by:
tryReLogin
in classModel
- Parameters:
loginKind
- the kind of login.loginName
- the user name to search for.- Returns:
- true if a re-login was performed, otherwise false (a login must then be carried out).
- Throws:
InoNetException
SrvErrorException
-
userHasAdminPrivileges
public boolean userHasAdminPrivileges() throws InoNetException, SrvErrorException
- Throws:
InoNetException
SrvErrorException
-
loginModelAdmin
public void loginModelAdmin(java.lang.String aUserName, java.lang.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();
- Specified by:
loginModelAdmin
in classModel
- Parameters:
aUserName
- a user name as string or nullpwd
- the administrator's password- Throws:
InoNetException
SrvErrorException
-
loginModelAdmin
public void loginModelAdmin() throws InoNetException, SrvErrorException
Login as model administrator for SSO- Specified by:
loginModelAdmin
in classModel
- Throws:
InoNetException
SrvErrorException
-
loginSuperUser
public void loginSuperUser(java.lang.Boolean login, java.lang.String pwd) throws InoNetException, SrvErrorException
Switch superuser mode for login.- Specified by:
loginSuperUser
in classModel
- Parameters:
login
- flag for log-in/outpwd
- the administrator's password- Throws:
InoNetException
SrvErrorException
-
loginModelGuest
public void loginModelGuest(java.lang.String pwd) throws InoNetException, SrvErrorException
Login as model guest with password.- Specified by:
loginModelGuest
in classModel
- Parameters:
pwd
- the administrator's password- Throws:
InoNetException
SrvErrorException
-
logout
public void logout() throws InoNetException, SrvErrorException
Logout any user from the model. This however means that the ADModel instance cannot be used in further calls. Only logout if there is no other application of the user on this machine is connected with the same model.- Specified by:
logout
in classModel
- Throws:
InoNetException
SrvErrorException
-
getADModel
public ADModel getADModel()
The instance of ADModel is fetched from the server. It can be used as an entry point for further model requests.- Returns:
- the model's ADModel instance.
-
create
public static Model create(RepositoryServer rep, java.lang.String name, K_ADMODEL modelType, ADModel mdlId)
-
delete
public void delete(java.lang.String pwd) throws InoNetException, SrvErrorException
Description copied from class:Model
Deletes a model from a repository server. The corresponding server must be prepared for administration withRepositoryServer.repositoryAdminLogin(String)
- Specified by:
delete
in classModel
- Parameters:
pwd
- the model's administrator password- Throws:
InoNetException
SrvErrorException
-
getUsers
public java.util.List<InoUser> getUsers() throws InoNetException, SrvErrorException
Description copied from class:Model
Gets the list of available users.- Specified by:
getUsers
in classModel
- Returns:
- list of users
- Throws:
InoNetException
SrvErrorException
-
getUserRoleList
public java.util.List<java.lang.String> getUserRoleList(InoUser inoUser) throws InoNetException, SrvErrorException
Description copied from class:Model
Fetch the possible roles- Specified by:
getUserRoleList
in classModel
- Parameters:
inoUser
- the Innovator user- Throws:
InoNetException
SrvErrorException
-
-