de.mid.innovator.srv
Class Model

java.lang.Object
  extended by de.mid.innovator.srv.Model
All Implemented Interfaces:
SrvContext
Direct Known Subclasses:
ExcellenceModel

public abstract class Model
extends Object
implements SrvContext

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.


Field Summary
protected  SrvLogin fLogin
           
protected  String fModelName
           
protected  K_ADMODEL fModelType
           
protected  RepositoryServer fRepositoryServer
           
 
Constructor Summary
protected Model(RepositoryServer server, String name, K_ADMODEL modelType)
          protected constructor for internal use only pleas use RepositoryServer.createModel(String, K_ADMODEL, String, String, String, List) to create a new Innovator model.
 
Method Summary
 ExcellenceModel asExcellenceModel()
          Converts this model instance to an ExcellenceModel.
abstract  void delete(String pwd)
          Deletes a model from a repository server.
 boolean equals(SrvContext obj)
           
protected  List<String> getLicUserRoleList(InoUser inoUser)
           
 SrvLogin getLogin()
           
 String getModelName()
          Gets the name of the model.
 K_ADMODEL getModelType()
           
 RepositoryServer getRepositoryServer()
          Gets the repository server instance which the model corresponds to.
 SrvConnection getSrvConnection()
           
protected  byte[] getSSOUserCookie(InoUser inoUser)
           
protected  List<InoUser> getSSOUsers()
           
abstract  List<String> getUserRoleList(InoUser inoUser)
          Fetch the possible roles
abstract  List<InoUser> getUsers()
          Gets the list of available users.
 boolean hasLogin()
          Checks if the model contains any kind of login.
protected  boolean isSingleSignOn()
           
 List<String> listUserRoles(String userName)
          Deprecated. 
abstract  void loginModelAdmin(String aUserName, String pwd)
          Login as model administrator with name and password.
abstract  void loginModelGuest(String pwd)
          Login as model guest with password.
 void loginUser(String role)
          Deprecated. 
abstract  void loginUser(String aUserName, String aCleartextPassword, String role)
          Login as normal user with name and password.
abstract  void logout()
          Logout any user from the model.
protected  void registerModelAtLicServer()
           
abstract  boolean tryReLogin(String aUserName)
          Checks if the given user has a login with the same display.
protected  void unregisterModelAtLicServer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLogin

protected SrvLogin fLogin

fModelName

protected String fModelName

fModelType

protected K_ADMODEL fModelType

fRepositoryServer

protected RepositoryServer fRepositoryServer
Constructor Detail

Model

protected Model(RepositoryServer server,
                String name,
                K_ADMODEL modelType)
protected constructor for internal use only pleas use RepositoryServer.createModel(String, K_ADMODEL, String, String, String, List) to create a new Innovator model.

Parameters:
server - the repository server
name - Name
modelType - type of model
Method Detail

asExcellenceModel

public ExcellenceModel asExcellenceModel()
Converts this model instance to an ExcellenceModel.

Returns:
this casted to ExcellenceModel or null

delete

public abstract void delete(String pwd)
                     throws InoNetException,
                            SrvErrorException
Deletes a model from a repository server. The corresponding server must be prepared for administration with RepositoryServer.repositoryAdminLogin(String)

Parameters:
pwd - the model's administrator password
Throws:
InoNetException
SrvErrorException

equals

public boolean equals(SrvContext obj)
Specified by:
equals in interface SrvContext
Returns:
true, if the given server context is equal to the model, otherwise false

getLicUserRoleList

protected List<String> getLicUserRoleList(InoUser inoUser)
                                   throws InoNetException,
                                          SrvErrorException
Throws:
InoNetException
SrvErrorException

getLogin

public SrvLogin getLogin()
Specified by:
getLogin in interface SrvContext
Returns:
the login instance or null if not logged-in.

getModelName

public String getModelName()
Gets the name of the model.

Returns:
a name as a string

getModelType

public K_ADMODEL getModelType()
Returns:
the type of the model

getRepositoryServer

public RepositoryServer getRepositoryServer()
Gets the repository server instance which the model corresponds to.

Returns:
the repository server

getSrvConnection

public SrvConnection getSrvConnection()
Specified by:
getSrvConnection in interface SrvContext
Returns:
the server connection for the model

getSSOUserCookie

protected byte[] getSSOUserCookie(InoUser inoUser)
                           throws InoNetException
Throws:
InoNetException

getSSOUsers

protected List<InoUser> getSSOUsers()
                             throws InoNetException
Throws:
InoNetException

getUserRoleList

public abstract List<String> getUserRoleList(InoUser inoUser)
                                      throws InoNetException,
                                             SrvErrorException
Fetch the possible roles

Parameters:
inoUser - the Innovator user
Throws:
InoNetException
SrvErrorException

getUsers

public abstract List<InoUser> getUsers()
                                throws InoNetException,
                                       SrvErrorException
Gets the list of available users.

Returns:
list of users
Throws:
InoNetException
SrvErrorException

hasLogin

public boolean hasLogin()
Checks if the model contains any kind of login.

Returns:
true, if the model contains an ADLogin, otherwise false.

isSingleSignOn

protected boolean isSingleSignOn()
                          throws InoNetException
Throws:
InoNetException

listUserRoles

@Deprecated
public List<String> listUserRoles(String userName)
                           throws InoNetException,
                                  SrvErrorException
Deprecated. 

Method renamed please call getUserRoleList(InoUser)

Throws:
InoNetException
SrvErrorException
Since:
11.5

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 calling SystemUtils.getSystemUser();

Parameters:
aUserName - a user name as string or null
pwd - the administrator's password
Throws:
InoNetException
SrvErrorException

loginModelGuest

public abstract void loginModelGuest(String pwd)
                              throws InoNetException,
                                     SrvErrorException
Login as model guest with password.

Parameters:
pwd - the administrator's password
Throws:
InoNetException
SrvErrorException

loginUser

@Deprecated
public void loginUser(String role)
               throws InoNetException,
                      SrvErrorException
Deprecated. 

Throws:
InoNetException
SrvErrorException

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 calling SystemUtils.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 null
role - the user's role or null. If no role is given, the user's role of the last successful login is used.
Throws:
InoNetException
SrvErrorException

logout

public abstract void logout()
                     throws InoNetException,
                            SrvErrorException
Logout any user from the model. This means that the ADModel instance cannot be used in further calls.

Throws:
InoNetException
SrvErrorException

registerModelAtLicServer

protected void registerModelAtLicServer()
                                 throws InoNetException
Throws:
InoNetException

tryReLogin

public abstract boolean tryReLogin(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".

Parameters:
aUserName - 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:
InoNetException
SrvErrorException

unregisterModelAtLicServer

protected void unregisterModelAtLicServer()
                                   throws InoNetException
Throws:
InoNetException