Obtaining License Manager Information
Declare Variables/Constants
String CONTACT_SERVER =”localhost”;
Attribute attrAppContext = null;
ApplicationContext appContext = null;
String pcScopeServerInfo = "<sentinelScope/>";
API Calls
To obtain License Manager information, execute the APIs in the specified sequential order only:
>attrAppContext = new Attribute();
>attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
NOTE If instead the LSFORCEHOST or LSHOST environment variables are set, then the above-mentioned steps are not required.
>appContext = new ApplicationContext(attrAppContext);
> String serverInfo = appContext.getInfo(pcScopeServerInfo, LicensingConstants. SNTL_QUERY_SERVER_INFO);
If the appContext.getInfo call is successful, the serverInfo String contains an XML-based output having the detailed information of License Manager.
Notes
In the use case described above, Server Info is obtained when Contact Server is set. For rest of the attributes default value will be obtained.