Class Model

java.lang.Object
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.
  • Method Details

    • getModelType

      public K_ADMODEL getModelType()
      Gets the type of the model.
      Returns:
      the type of the model
    • getSrvConnection

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

      public SrvLogin getLogin()
      Gets the login for the model.
      Specified by:
      getLogin in interface SrvContext
      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

      public String getModelName()
      Gets the name of the model.
      Returns:
      a name as a string
    • getRepositoryServer

      public RepositoryServer getRepositoryServer()
      Gets the repository server instance which the model corresponds to.
      Returns:
      the repository server
    • asExcellenceModel

      public ExcellenceModel asExcellenceModel()
      Converts this model instance to an ExcellenceModel.
      Returns:
      this casted to ExcellenceModel or null
    • getUsers

      public abstract List<InoUser> getUsers() throws InoNetException, SrvErrorException
      Gets the list of available users from model.
      Returns:
      list of users
      Throws:
      InoNetException
      SrvErrorException
    • getUserRoleList

      public abstract List<String> getUserRoleList(InoUser inoUser) throws InoNetException, SrvErrorException
      Fetch the possible roles
      Parameters:
      inoUser - the Innovator user
      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
    • 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 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:
      InoNetException
      SrvErrorException
    • 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 login
      loginName - 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
    • 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
    • loginModelAdmin

      public abstract void loginModelAdmin() 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();
      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
    • loginSuperUser

      public abstract void loginSuperUser(Boolean login, String pwd) throws InoNetException, SrvErrorException
      Switch superuser mode for login.
      Parameters:
      login - flag for log-in/out
      pwd - the administrator's password
      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
    • 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
    • beginCommandSequence

      public final void beginCommandSequence(String commandName) throws SrvErrorException
      Throws:
      SrvErrorException
    • endCommandSequence

      public final void endCommandSequence()
    • getCommandSequenceId

      public String getCommandSequenceId()
      Specified by:
      getCommandSequenceId in interface SrvContext
    • getCommandSequenceName

      public String getCommandSequenceName()
      Specified by:
      getCommandSequenceName in interface SrvContext
    • isLoginAllowed

      public Boolean isLoginAllowed()
    • isAdminLoginAllowed

      public Boolean isAdminLoginAllowed()
    • isApiAdminLoginAllowed

      public Boolean isApiAdminLoginAllowed()
    • isGuestLoginAllowed

      public Boolean isGuestLoginAllowed()
    • isNormalLoginAllowed

      public Boolean isNormalLoginAllowed()
    • getVersionName

      public String 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.