|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jp.protection.pub.pro.LicenseHostProContext
public class LicenseHostProContext
This class represents context for the License Host by providing access to various system and application properties
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_AVAILABLE_PROCESSORS
|
static java.lang.String |
ATTR_HOST_NAME
|
static java.lang.String |
ATTR_INSTALL_ID
|
static java.lang.String |
ATTR_IP_ADDRESS
|
static java.lang.String |
ATTR_LOCALE
|
static java.lang.String |
ATTR_MAC_ADDRESS
|
static java.lang.String |
ATTR_MAC_ADDRESSES
|
static java.lang.String |
ATTR_USER_NAME
|
protected LicenseHostPro |
fLicenseHost
|
protected boolean |
fVerbose
|
| Constructor Summary | |
|---|---|
LicenseHostProContext(LicenseHostPro aLicenseHost)
Creates a new instance of context. |
|
| Method Summary | |
|---|---|
java.util.Map |
createAttributes(boolean isAcquireMACAddress)
Returns the map of attributes. |
java.util.Map |
createAttributes(java.lang.String aPrefix,
boolean isAcquireMACAddress)
Returns the map of attributes. |
protected void |
error(java.lang.String aMessage)
|
protected void |
error(java.lang.Throwable ex)
|
void |
fillAttributes(java.util.Map anAttributes,
java.lang.String aPrefix,
boolean isAcquireMACAddress)
Fill the map with attributes. |
int |
getActivationNumber(java.lang.String aLicenseNumber)
Returns the activation number for the given license number |
protected static java.lang.String |
getAttributeName(java.lang.String aName,
java.lang.String aPrefix,
java.lang.String aSuffix)
|
int |
getAvailableProcessors()
Returns number of the available processors. |
java.lang.String |
getCpuID()
Returns CPU ID |
java.lang.String |
getCustomLockAttribute()
Returns custom lock attribute |
java.lang.String |
getHostName()
Returns the name of the local host |
java.lang.String[] |
getHostNames()
Returns possible names of the local host |
int |
getInstallID()
Returns the installation ID |
java.lang.String |
getIPAddress()
Returns IP address of the local host |
long |
getMACAddress()
Returns MAC address of primary network card |
long[] |
getMACAddresses()
Returns MAC addresses of all network cards |
java.lang.String |
getMotherboardID()
Returns motherboard ID |
java.lang.String |
getSystemProperty(java.lang.String aName,
java.lang.String aDefaultValue)
Returns the system property indicated by the specified key. |
long |
getTotalPhysicalMemorySize()
Returns total physical memory size in bytes |
java.lang.String |
getUserName()
Returns login name of the current user |
boolean |
isVerbose()
Checks whether the context runs in verbose mode. |
void |
setActivationNumber(java.lang.String aLicenseNumber,
int aValue)
Specifies the activation number for the give license number |
static void |
setNativeLibFolder(java.io.File aFolder)
Specifies location of the folder containing native libraries used to obtain MAC addresses. |
void |
setVerbose(boolean aVerbose)
Specifies that the context should run in verbose mode. |
static java.lang.String |
unqualifiedHostName(java.lang.String aHostName)
Returns unqualified host name: example for example.domain.com |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATTR_AVAILABLE_PROCESSORS
public static final java.lang.String ATTR_IP_ADDRESS
public static final java.lang.String ATTR_HOST_NAME
public static final java.lang.String ATTR_MAC_ADDRESS
public static final java.lang.String ATTR_MAC_ADDRESSES
public static final java.lang.String ATTR_INSTALL_ID
public static final java.lang.String ATTR_USER_NAME
public static final java.lang.String ATTR_LOCALE
protected LicenseHostPro fLicenseHost
protected boolean fVerbose
| Constructor Detail |
|---|
public LicenseHostProContext(LicenseHostPro aLicenseHost)
aLicenseHost - License Host to create context for| Method Detail |
|---|
protected static java.lang.String getAttributeName(java.lang.String aName,
java.lang.String aPrefix,
java.lang.String aSuffix)
public java.util.Map createAttributes(boolean isAcquireMACAddress)
isAcquireMACAddress - specifies whether MAC address of network card should be acquired and put to result.
public java.util.Map createAttributes(java.lang.String aPrefix,
boolean isAcquireMACAddress)
aPrefix - optional prefix to add to each attribute nameisAcquireMACAddress - specifies whether MAC address of network card should be acquired and put to result.
public void fillAttributes(java.util.Map anAttributes,
java.lang.String aPrefix,
boolean isAcquireMACAddress)
aPrefix - optional prefix to add to each attribute nameisAcquireMACAddress - specifies whether MAC address of network card should be acquired and put to result.public java.lang.String getUserName()
public java.lang.String getSystemProperty(java.lang.String aName,
java.lang.String aDefaultValue)
key - the name of the system property.def - a default value.
public int getAvailableProcessors()
public java.lang.String getIPAddress()
throws java.net.UnknownHostException
java.net.UnknownHostException - if local host could not be obtained
public java.lang.String getHostName()
throws java.net.UnknownHostException
java.net.UnknownHostException - if local host could not be obtained
public java.lang.String[] getHostNames()
throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic static java.lang.String unqualifiedHostName(java.lang.String aHostName)
aHostName - qualified host name
public long getMACAddress()
public long[] getMACAddresses()
public java.lang.String getCpuID()
public java.lang.String getMotherboardID()
public long getTotalPhysicalMemorySize()
public java.lang.String getCustomLockAttribute()
public int getInstallID()
public int getActivationNumber(java.lang.String aLicenseNumber)
aLicenseNumber - license number
public void setActivationNumber(java.lang.String aLicenseNumber,
int aValue)
aLicenseNumber - license numberaValue - activation numberpublic static void setNativeLibFolder(java.io.File aFolder)
aFolder - native libraries folderpublic boolean isVerbose()
true if context runs in verbose mode, false
otherwise.public void setVerbose(boolean aVerbose)
std err. Otherwise
there is no output in order to prevent the code flow analysis.
aVerbose - true if context should run in verbose mode,
false otherwise.protected void error(java.lang.String aMessage)
protected void error(java.lang.Throwable ex)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||