Package de.mid.innovator.srv
Class RepositoryServer
java.lang.Object
de.mid.innovator.client.InoProgram
de.mid.innovator.srv.InoServerProgram
de.mid.innovator.srv.RepositoryServer
- All Implemented Interfaces:
SrvContext
This class represents the Innovator repository server. A repository server
recognizes its own license server and keeps an up-to-date list of the models
contained in it. Note: an instance of this class is different from the server
proxy element of the ADRepository type. To obtain this instance, call
getADRepository() if connected to the server.
A repository server extends a general purpose server program class that provides different kinds of data through the license server requests. The implementation of the interface SrvContext is needed to realize a uniform way to call helper methods, either using a connected server instance or an object of the class model.
- Author:
- MID
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.mid.innovator.client.InoProgram
InoProgram.Type -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryServer(LicenseServer aLicenseServer, int pid, int procStatus, String vers, String host, String user, de.mid.innovator.srv.LicSrvGetSrvPrjListReplyTelegram.SrvConData srvConData, List<Model> modelLst) Also for JNI -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Connects to a running Innovator repository server if not yet connected.createModel(String name, K_ADMODEL modelType, String newAdminPwd, String userCfg, String modelCfg, List<String> addOnList) Creates a newModelin the actual repository server and refreshes the list of models.voidDisconnects from the repository server.booleanequals(SrvContext obj) Compares this server object to an SrvContext implementer.Gets the repository server proxy element.getExcellenceModel(String aModelName, K_ADMODEL aModelType) Gets a model with the given name and type from the list of currently known models.Gets the name of the repository server (which is equal to the directory name where the server stores all data).Gets the license server object which the repository server periodically contacts.getLogin()Implements the method fromSrvContextGets a model with the given name and type from the list of currently known models.Gets the complete list of known models.Searches the list of currently known models in this server for models of the given type.getName()Gets the name of the repository server (which is equal to the directory name where the server stores all data).Implements the method fromSrvContextbooleanhasLogin()Checks whether a previous successful administrator login was performed.booleanbooleanvoidlogout()Logs out from the repository server if still logged-in, otherwise nothing will be done.voidmodifyPassword(String oldPass, String newPass) Modifies the repository server's administration password.voidrefresh()Synchronizes this server object's model list with the actual state known by the license server.voidAuthenticates the user credentials for administration purposes; this is carried out by the repository server.voidshutdown(boolean force) toString()booleanbooleanMethods inherited from class de.mid.innovator.srv.InoServerProgram
getStatusFlagsMethods inherited from class de.mid.innovator.client.InoProgram
getHost, getPid, getProgramType, getUser, getVers
-
Constructor Details
-
RepositoryServer
public RepositoryServer(LicenseServer aLicenseServer, int pid, int procStatus, String vers, String host, String user, de.mid.innovator.srv.LicSrvGetSrvPrjListReplyTelegram.SrvConData srvConData, List<Model> modelLst) Also for JNI- Parameters:
aLicenseServer-pid-procStatus-vers-host-user-srvConData-modelLst-
-
-
Method Details
-
getLicenseServer
Gets the license server object which the repository server periodically contacts.- Returns:
- the server's license server object
-
getName
Gets the name of the repository server (which is equal to the directory name where the server stores all data). -
getFullName
Gets the name of the repository server (which is equal to the directory name where the server stores all data). -
getSrvConnection
Implements the method fromSrvContext- Specified by:
getSrvConnectionin interfaceSrvContext- Returns:
- information needed to connect to a repository server
-
getLogin
Implements the method fromSrvContext- Specified by:
getLoginin interfaceSrvContext- Returns:
- the current login or null if not logged-in
-
hasLogin
public boolean hasLogin()Checks whether a previous successful administrator login was performed.- Returns:
- true, if there is an ADLogin to be queried with
getLogin(), otherwise false
-
isSingleSignOn
- Throws:
InoNetException
-
isVersionModel
- Throws:
InoNetException
-
getStatus
- Throws:
InoNetException
-
getModel
Gets a model with the given name and type from the list of currently known models. This is done without any server communication and may not be up-to-date. Use therefresh()method to synchronize this server object with the current state.- Parameters:
aModelName- the name of the Innovator modelaModelType- the type of model- Returns:
- a model object if found, otherwise null.
-
getExcellenceModel
Gets a model with the given name and type from the list of currently known models. This is done without any server communication and may not be up-to-date. Use therefresh()method to synchronize this server object with the current state.- Parameters:
aModelName- the name of the Innovator eXcellence modelaModelType- the type of eXcellence model- Returns:
- a model object if found, otherwise null.
-
getModels
Searches the list of currently known models in this server for models of the given type. The model list may not be synchronized. Userefresh()to keep it up-to-date.- Parameters:
aModelType- the type of model- Returns:
- a list of models or an empty list if none are found
- See Also:
-
getModels
Gets the complete list of known models. The model list may not be synchronized. Userefresh()to keep it up-to-date.- Returns:
- a list of model objects or an empty list if this server has no models
-
refresh
Synchronizes this server object's model list with the actual state known by the license server. The Innovator license server needs to be communicated with to get the correct data.- Throws:
InoNetException- if a network error occurs.
-
connect
Connects to a running Innovator repository server if not yet connected. As a side effect, the repository server proxy object is received; this provides direct server access. The service is carried out by a contained object of the SrvConnection type that handles all TCP/IP network information.- Throws:
InoNetException- if a network error occurs.- See Also:
-
disconnect
Disconnects from the repository server. The method should be called once for every call made toconnect(). This enables the repository server to finish the corresponding connection.- Throws:
InoNetException- if a network error occurs.
-
userHasAdminPrivileges
- Throws:
InoNetException
-
userHasVersionPrivileges
- Throws:
InoNetException
-
repositoryAdminLogin
Authenticates the user credentials for administration purposes; this is carried out by the repository server.- Parameters:
pwd- the repository server's administration password- Throws:
InoNetException- if a network error occurs.SrvErrorException- if invalid data has been sent to this server.- See Also:
-
logout
Logs out from the repository server if still logged-in, otherwise nothing will be done.- Throws:
InoNetException- if a network error occurs.SrvErrorException- if invalid data has been sent to this server.- See Also:
-
modifyPassword
public void modifyPassword(String oldPass, String newPass) throws InoNetException, SrvErrorException Modifies the repository server's administration password.- Parameters:
oldPass- old password (plain text)newPass- new password (plain text)- Throws:
InoNetException- if a network error occurs.SrvErrorException- if invalid data has been sent to this server.
-
createModel
public Model createModel(String name, K_ADMODEL modelType, String newAdminPwd, String userCfg, String modelCfg, List<String> addOnList) throws InoNetException, SrvErrorException Creates a newModelin the actual repository server and refreshes the list of models.- Parameters:
name- the name of the new modelmodelType- the kind of modelnewAdminPwd- the administrator's password for the new model or nulluserCfg- the name of a valid user configuration or nullmodelCfg- the name of a valid model configuration or nulladdOnList- a list of add-ons which need to be loaded or null- Returns:
- the created model object
- Throws:
InoNetException- if a network error occurs.SrvErrorException- if invalid data has been sent to this server.IllegalArgumentException- if the given model type is different to K_ADMODEL.UML
-
equals
Compares this server object to an SrvContext implementer. If the object to be compared with is an instance of the RepositoryServer class, the two server instances are declared to be equal if they point to the same Innovator server. Otherwise the objects are not equal.This method implements
SrvContext.equals(SrvContext)- Specified by:
equalsin interfaceSrvContext- See Also:
-
toString
- Overrides:
toStringin classInoServerProgram
-
getADRepository
Gets the repository server proxy element.- Returns:
- an ADRepository object, if connected to the server, otherwise null.
-
getCommandSequenceId
- Specified by:
getCommandSequenceIdin interfaceSrvContext
-
getCommandSequenceName
- Specified by:
getCommandSequenceNamein interfaceSrvContext
-
shutdown
public void shutdown(boolean force)
-