Class Model

  • All Implemented Interfaces:
    SrvContext
    Direct Known Subclasses:
    ExcellenceModel

    public abstract class Model
    extends java.lang.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 Detail

      • fModelName

        protected java.lang.String fModelName
      • versionName

        protected java.lang.String versionName
    • Method Detail

      • getModelType

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

        public SrvLogin getLogin()
        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 java.lang.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
      • loginUser

        public abstract 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 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​(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".
        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,
                                           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".
        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​(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 calling SystemUtils.getSystemUser();
        Parameters:
        aUserName - a user name as string or null
        pwd - the administrator's 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
      • endCommandSequence

        public final void endCommandSequence()
      • getVersionName

        public java.lang.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.