Package de.mid.innovator.srv
Class LicenseServer
java.lang.Object
de.mid.innovator.srv.LicenseServer
- All Implemented Interfaces:
ILicensingService,INetworkInformationService
The class represents an Innovator license server that provides various
information about running client and server programs. A license server acts
as a name service to enable clients to find running servers. This means that
one license server provides exactly one Innovator network which can be viewed
with the Innovator client programs. An Innovator network consists of exactly
one main license server and several project license servers (acting as
clients to the main license server).
By default, all Innovator UNIX clients use the environment variable INOHOST to determine the Innovator network. On Windows platforms, the license server can be configured in the file inoenv.ini that can be found in the Windows system directory.
As the Innovator Java API uses pure Java code, it is 100% independent of this client configuration; this means that a Java process is free to talk to any license server that is available via TCP/IP connection.
Note: This class can be used to connect either to a project license server or to a main (enterprise) license server.
- Author:
- borschet
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor that instantiates a license server object using host and port from the environment variable INOHOST or property de.mid.innovator.inohost.LicenseServer(int pid, String iHost, String ipAdr, String userName, String displayName) The constructor creates an instance that can be used to communicate with the Innovator license server.LicenseServer(String lHost, int lPort) Only for JNI.LicenseServer(String lHost, int lPort, boolean useTLS, String tlsConfig, boolean useIPv6, boolean useNAT) The constructor creates an instance that can be used to communicate with the Innovator license server. -
Method Summary
Modifier and TypeMethodDescriptionbooleanchkMdlAdmin(InoUser user, String repName, String mdlName, K_ADMODEL mdlType) Returns a flag if repository admin login is allowed.chkVersAdmin(InoUser user, String repName, String mdlName, K_ADMODEL mdlType) Returns a flag if repository admin login is allowed.Returns a flag if repository admin login is allowed.findServer(String repName) Finds a specific running repository server.getHost()Gets the license server's getHost() name.Gets the host id.Returns a list of all known clients.intGets the total number of licenses of a given license type.Gets the licensee.intgetPort()Gets the license server's TCP/IP port.getProxy(de.mid.innovator.srv.LicSrvGetSrvPrjListReplyTelegram.SrvConData conData) The method retrieves the complete list of proxys known by this license server.The method retrieves the complete list of proxys known by this license server.intThe method retrieves the complete list of repository servers known by this license server.getServerStatus(String repName) The method returns a set of runtime status flags of the given repository server.The method retrieves the complete list of repository servers known by this license server.getUser()Returns the info for the current system user.List<de.mid.innovator.srv.LicSrvGetLoginListReplyTelegram.InoUserLogin> getUserRoleList(InoUser inoUser, String repName, String mdlName, K_ADMODEL mdlType) getUserVersRoleList(InoUser inoUser, String repName, String mdlName, K_ADMODEL mdlType, String versName) Retrieves the version of the license server.booleanhasEnvironRight(InoUser user) Returns a flag if configuration of environments is allowed.booleanDetermines whether [is license registered].booleanvoidlockLicense(LicenseServer.License license) Locks another license of given type.voidregisterLicense(String key) Registers a new obtained license.voidregisterProgram(InoProgram.Type progType) voidvoidsetClientInfo(int pid, String iHost, String ipAdr, String userName, String displayName) voidvoidunregisterProgram(InoProgram.Type programType) void
-
Field Details
-
VERS_STRING
- See Also:
-
-
Constructor Details
-
LicenseServer
The default constructor that instantiates a license server object using host and port from the environment variable INOHOST or property de.mid.innovator.inohost.- Throws:
InoNetException
-
LicenseServer
Only for JNI.- Parameters:
lHost-lPort-- Throws:
InoNetException
-
LicenseServer
public LicenseServer(String lHost, int lPort, boolean useTLS, String tlsConfig, boolean useIPv6, boolean useNAT) throws InoNetException The constructor creates an instance that can be used to communicate with the Innovator license server. A host and port can be entered if required to be used when connecting to or disconnecting from the license server.- Parameters:
lHost- optional; the host name as a TCP/IP host name String. If this argument is omitted, the value of the environment variable 'INOHOST' or the 'de.mid.innovator.inohost' system property is used.lPort- optional; the port. It should be omitted if no host name is given.useTLS- optional; Use secure communication via SSL / TLS?tlsConfig- optional; Path and filename of JSON configuration file with path and password of trust store.useIPv6- optional; Use addresses in format IPv6?useNAT- optional; Use NAT(the addresses are not reachable)?- Throws:
InoNetException
-
LicenseServer
public LicenseServer(int pid, String iHost, String ipAdr, String userName, String displayName) throws InoNetException The constructor creates an instance that can be used to communicate with the Innovator license server. A host and port can be entered if required to be used when connecting to or disconnecting from the license server. Shortcut for: licSrv = new LicenseServer(); licSrv.setClientInfo(oid, iHost, ipAdr, userName, displayName);- Parameters:
pid- Process IDiHost- ; the host name of the client as a TCP/IP host name String.ipAdr- ; the IP address of the client.userName- Name of userdisplayName- Name of display- Throws:
InoNetException
-
-
Method Details
-
getHost
Gets the license server's getHost() name.- Specified by:
getHostin interfaceINetworkInformationService- Returns:
- getHost() name as a String
-
isSubscription
- Throws:
InoNetException
-
getPort
public int getPort()Gets the license server's TCP/IP port.- Specified by:
getPortin interfaceINetworkInformationService- Returns:
- a port number
-
getClientInfo
-
setClientInfo
-
getVersion
Retrieves the version of the license server. The method explicitly sends a telegram to the license server to get the version number and caches its value for further calls.- Specified by:
getVersionin interfaceINetworkInformationService- Returns:
- the license server version as an integer value
- Throws:
InoNetException- for any network problems
-
getConnectedProgram
-
getSerialNumber
- Specified by:
getSerialNumberin interfaceILicensingService- Throws:
InoNetException
-
registerProgram
- Specified by:
registerProgramin interfaceILicensingService- Throws:
InoNetExceptionIllegalStateException
-
unregisterProgram
- Throws:
InoNetException
-
unregisterProgram
- Specified by:
unregisterProgramin interfaceILicensingService- Throws:
InoNetException
-
updateConnection
- Throws:
InoNetExceptionIllegalStateException
-
lockLicense
Description copied from interface:ILicensingServiceLocks another license of given type.- Specified by:
lockLicensein interfaceILicensingService- Parameters:
license- The type of the license to lock.- Throws:
InoNetException
-
findServer
Finds a specific running repository server.- Specified by:
findServerin interfaceINetworkInformationService- Parameters:
repName- the name of a repository server (without path or extension)- Returns:
- an instance of
RepositoryServeror null if no such server was found. - Throws:
InoNetException
-
getServerList
The method retrieves the complete list of repository servers known by this license server.- Specified by:
getServerListin interfaceINetworkInformationService- Returns:
- a list of running server instances
- Throws:
InoNetException
-
getSvgServer
The method retrieves the complete list of repository servers known by this license server.- Returns:
- a list of running server instances
- Throws:
InoNetException
-
getProxy
public InoProxyProgram getProxy(de.mid.innovator.srv.LicSrvGetSrvPrjListReplyTelegram.SrvConData conData) throws InoNetException The method retrieves the complete list of proxys known by this license server.- Returns:
- a list of running server instances
- Throws:
InoNetException
-
getProxyList
The method retrieves the complete list of proxys known by this license server.- Returns:
- a list of running server instances
- Throws:
InoNetException
-
getServerStatus
The method returns a set of runtime status flags of the given repository server.- Parameters:
repName- short name of a repository server- Returns:
- the set of status values that can be checked with the members of
the
ServerStatusenumeration - Throws:
InoNetException
-
getInnovatorClients
Returns a list of all known clients. The list contains every getHost() that runs an Innovator application which has been registered at the current license server.- Specified by:
getInnovatorClientsin interfaceINetworkInformationService- Returns:
- A list of all Innovator network clients that are connected to the license server.
- Throws:
InoNetException
-
getUser
Returns the info for the current system user.- Returns:
- A list of all Innovator network clients that are connected to the license server.
- Throws:
InoNetException
-
getUserJWT
- Throws:
InoNetException
-
getUserList
- Throws:
InoNetException
-
getUserLoginList
public List<de.mid.innovator.srv.LicSrvGetLoginListReplyTelegram.InoUserLogin> getUserLoginList() throws InoNetException- Throws:
InoNetException
-
getUserRoleList
public List<String> getUserRoleList(InoUser inoUser, String repName, String mdlName, K_ADMODEL mdlType) throws InoNetException - Throws:
InoNetException
-
getUserVersRoleList
public List<String> getUserVersRoleList(InoUser inoUser, String repName, String mdlName, K_ADMODEL mdlType, String versName) throws InoNetException - Throws:
InoNetException
-
chkMdlAdmin
public LicSrvUserChkMdlAdminReplyTelegram.SsoMdlUserData chkMdlAdmin(InoUser user, String repName, String mdlName, K_ADMODEL mdlType) throws InoNetException Returns a flag if repository admin login is allowed. The information has to be used for the connect- Returns:
- A list of all Innovator network clients that are connected to the license server.
- Throws:
InoNetException
-
chkVersMdlAdmin
public LicSrvUserChkMdlAdminReplyTelegram.SsoMdlUserData chkVersMdlAdmin(InoUser user, String repName, String mdlName, K_ADMODEL mdlType, String versName) throws InoNetException Returns a flag if repository admin login is allowed. The information has to be used for the connect- Returns:
- A list of all Innovator network clients that are connected to the license server.
- Throws:
InoNetException
-
chkVersAdmin
public LicSrvUserChkRepAdminReplyTelegram.SsoUserData chkVersAdmin(InoUser user, String repName, String mdlName, K_ADMODEL mdlType) throws InoNetException Returns a flag if repository admin login is allowed. The information has to be used for the connect- Returns:
- A list of all Innovator network clients that are connected to the license server.
- Throws:
InoNetException
-
hasEnvironRight
Returns a flag if configuration of environments is allowed.- Returns:
- Has the right to configure environments.
- Throws:
InoNetException
-
getHostId
Description copied from interface:ILicensingServiceGets the host id.- Specified by:
getHostIdin interfaceILicensingService- Throws:
InoNetException
-
getMainInohost
- Throws:
InoNetException
-
getInohost
- Throws:
InoNetException
-
getLicensee
Description copied from interface:ILicensingServiceGets the licensee.- Specified by:
getLicenseein interfaceILicensingService- Returns:
- a formatted string
- Throws:
InoNetException
-
canLogout
-
isLicenseRegistered
Description copied from interface:ILicensingServiceDetermines whether [is license registered].- Specified by:
isLicenseRegisteredin interfaceILicensingService- Returns:
- true if [is license registered]; otherwise false
- Throws:
InoNetException
-
registerLicense
Description copied from interface:ILicensingServiceRegisters a new obtained license.- Specified by:
registerLicensein interfaceILicensingService- Parameters:
key- The key.- Throws:
InoNetException
-
sendLicenseFile
- Specified by:
sendLicenseFilein interfaceILicensingService- Throws:
InoNetExceptionIOException
-
getLicenseCount
Description copied from interface:ILicensingServiceGets the total number of licenses of a given license type.- Specified by:
getLicenseCountin interfaceILicensingService- Parameters:
lic- The license.- Returns:
- the number of licenses that can be used parallel
- Throws:
InoNetException
-