|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jp.protection.pub.pro.network.NetworkCheck
public class NetworkCheck
This class provides tracking of the licenses usage over the network using broadcast communication.
Field Summary | |
---|---|
protected int |
fCheckHostPolicy
|
protected int |
fDefaultCheckHostPolicy
|
protected java.net.InetAddress |
fGroup
|
protected java.lang.String |
fHostID
|
protected long |
fHostTimestamp
|
protected java.lang.String |
fLicenseNumber
|
protected java.net.MulticastSocket |
fMulticastSocket
|
protected int |
fNumberCopies
|
protected java.lang.String |
fProductID
|
protected java.util.HashSet |
fResponceAddresses
|
protected int |
fResponseCount
|
protected java.lang.Thread |
fRunnerTread
|
protected boolean |
fRunning
|
protected java.lang.String |
fSignature
|
protected int |
fSocketBufferSize
|
protected java.lang.String |
fSocketGroupName
|
protected int |
fSocketPortNumber
|
protected int |
fSocketTimeout
|
protected int |
fSocketTimeToLive
|
protected boolean |
fVerbose
|
static int |
POLICY_ANY_HOST
Defines that only responses came from any hosts should be counted |
static int |
POLICY_DIFFERENT_HOST
Defines that only responses came from the different hosts should be counted |
static int |
POLICY_SAME_HOST
Defines that only responses came from the same hosts should be counted |
static java.lang.String |
SIGNATURE
|
static int |
SOCKET_BUFFER_SIZE
|
static java.lang.String |
SOCKET_GROUP_NAME
|
static int |
SOCKET_PORT_NUMBER
|
static int |
SOCKET_TIME_TO_LIVE
|
static int |
SOCKET_TIMEOUT
|
Constructor Summary | |
---|---|
NetworkCheck()
Creates a new instance of the NetworkCheck |
Method Summary | |
---|---|
void |
addNetworkCheckListener(NetworkCheckListener l)
Removes listener from the listeners list |
void |
check()
Starts network check (if not started), clears all collected responces and sends request over the network. |
protected boolean |
checkHost(NetworkCheckPacket packet)
|
protected boolean |
checkResponse(NetworkCheckPacket packet)
|
protected void |
createMulticastSocket()
|
protected void |
fireNumberCopiesViolation(NetworkCheck param1,
int param2)
|
int |
getCheckHostPolicy()
Returns check host policy value |
int |
getDefaultCheckHostPolicy()
Returns default check host policy value. |
protected java.net.InetAddress |
getGroup()
|
java.lang.String |
getLicenseNumber()
Returns license number to track |
int |
getNumberCopies()
Returns license number of copies |
java.lang.String |
getProductID()
Returns product identifier to track |
int |
getResponseCount()
Returns number of collected responses |
java.lang.String |
getSignature()
Returns signature value |
int |
getSocketBufferSize()
Returns socket buffer size value. |
java.lang.String |
getSocketGroupName()
Returns socket group name to join. |
int |
getSocketPortNumber()
Returns socket port number. |
int |
getSocketTimeout()
Returns socket timeout value |
int |
getSocketTimeToLive()
Return socket time to live value. |
protected boolean |
isRunning()
|
boolean |
isVerbose()
Checks whether Network Check runs in verbose mode. |
protected void |
processDatagramPacket(java.net.DatagramPacket aDatagramPacket)
|
protected void |
releaseMulticastSocket()
|
void |
removeNetworkCheckListener(NetworkCheckListener l)
Adds a new listener to the listeners list |
protected void |
send(NetworkCheckPacket aPacket)
|
protected void |
sendRequest(java.lang.String aProductID,
java.lang.String aLicenseNumber)
|
protected void |
sendResponse(java.lang.String aProductID,
java.lang.String aLicenseNumber)
|
void |
setCheckHostPolicy(int aCheckHostPolicy)
Specifies check host policy value as one of POLICY_ constants |
void |
setDefaultCheckHostPolicy(int aDefaultCheckHostPolicy)
Specifies default check host policy value as one of POLICY_ constants. |
void |
setLicenseNumber(java.lang.String aLicenseNumber)
Specifies license number to track |
void |
setNumberCopies(int aNumberCopies)
Specifies license number of copies |
void |
setProductID(java.lang.String aProductID)
Specifies product identifier to track |
void |
setSignature(java.lang.String aSignature)
Specifies signature value to unique identify particular vendor. |
void |
setSocketBufferSize(int aSocketBufferSize)
Specifies socket buffer size value. |
void |
setSocketGroupName(java.lang.String aSocketGroupName)
Specifies socket group name to join. |
void |
setSocketPortNumber(int aSocketPortNumber)
Specifies socket port number. |
void |
setSocketTimeout(int aSocketTimeout)
Specifies socket timeout value. |
void |
setSocketTimeToLive(int aSocketTimeToLive)
Specifies socket time to live. |
void |
setVerbose(boolean aVerbose)
Specifies that Network Check should be run in verbose mode. |
void |
start()
Starts listening responses from the network |
void |
stop()
Stops listening responses from the network |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SOCKET_PORT_NUMBER
public static final int SOCKET_TIME_TO_LIVE
public static final java.lang.String SOCKET_GROUP_NAME
public static final int SOCKET_BUFFER_SIZE
public static final int SOCKET_TIMEOUT
public static java.lang.String SIGNATURE
protected int fSocketPortNumber
protected int fSocketTimeToLive
protected java.lang.String fSocketGroupName
protected int fSocketBufferSize
protected int fSocketTimeout
protected java.lang.String fHostID
protected long fHostTimestamp
protected java.lang.String fSignature
protected java.net.MulticastSocket fMulticastSocket
protected java.lang.Thread fRunnerTread
protected boolean fRunning
protected java.util.HashSet fResponceAddresses
protected java.lang.String fProductID
protected java.lang.String fLicenseNumber
protected int fNumberCopies
protected java.net.InetAddress fGroup
protected boolean fVerbose
public static final int POLICY_SAME_HOST
public static final int POLICY_DIFFERENT_HOST
public static final int POLICY_ANY_HOST
protected int fDefaultCheckHostPolicy
protected int fCheckHostPolicy
protected int fResponseCount
Constructor Detail |
---|
public NetworkCheck()
NetworkCheck
Method Detail |
---|
public int getSocketTimeout()
SOCKET_TIMEOUT
by default)public void setSocketTimeout(int aSocketTimeout)
aSocketTimeout
- socket timeout value to set.public int getSocketBufferSize()
SOCKET_BUFFER_SIZE
by default).public void setSocketBufferSize(int aSocketBufferSize)
aSocketBufferSize
- socket buffer size to set.public java.lang.String getSocketGroupName()
SOCKET_GROUP_NAME
by default).public void setSocketGroupName(java.lang.String aSocketGroupName)
aSocketGroupName
- socket group name to setpublic int getSocketTimeToLive()
SOCKET_TIME_TO_LIVE
by default).public void setSocketTimeToLive(int aSocketTimeToLive)
aSocketTimeToLive
- socket time to live set.public int getSocketPortNumber()
SOCKET_PORT_NUMBER
by default).public void setSocketPortNumber(int aSocketPortNumber)
aSocketPortNumber
- socket port number to set.public void start()
public void stop()
protected boolean isRunning()
public java.lang.String getProductID()
public void setProductID(java.lang.String aProductID)
aProductID
- product identifier to setpublic java.lang.String getLicenseNumber()
public void setLicenseNumber(java.lang.String aLicenseNumber)
aLicenseNumber
- license number to set.public int getNumberCopies()
public void setNumberCopies(int aNumberCopies)
aNumberCopies
- license number of copies to setpublic void check()
protected void send(NetworkCheckPacket aPacket)
protected void createMulticastSocket()
protected java.net.InetAddress getGroup() throws java.net.UnknownHostException
java.net.UnknownHostException
protected void releaseMulticastSocket()
public boolean isVerbose()
true
if Network Check runs in verbose mode, false
otherwise.public void setVerbose(boolean aVerbose)
stderr
. Otherwise there is no output in order to prevent the code flow
analysis.
aVerbose
- true
if Network Check should run in verbose mode,
false
otherwise.protected void processDatagramPacket(java.net.DatagramPacket aDatagramPacket)
public int getCheckHostPolicy()
POLICY_
constantspublic void setCheckHostPolicy(int aCheckHostPolicy)
POLICY_
constants
aCheckHostPolicy
- check host policy to setpublic int getDefaultCheckHostPolicy()
POLICY_
constantspublic void setDefaultCheckHostPolicy(int aDefaultCheckHostPolicy)
POLICY_
constants. This value will be used by the
License Host to initialize Network Check when no appropriate value explicitly specified for the license.
aDefaultCheckHostPolicy
- default check host policy to setprotected boolean checkResponse(NetworkCheckPacket packet)
protected boolean checkHost(NetworkCheckPacket packet)
public int getResponseCount()
protected void sendResponse(java.lang.String aProductID, java.lang.String aLicenseNumber)
protected void sendRequest(java.lang.String aProductID, java.lang.String aLicenseNumber)
public java.lang.String getSignature()
SIGNATURE
by default).public void setSignature(java.lang.String aSignature)
aSignature
- signature to setpublic void removeNetworkCheckListener(NetworkCheckListener l)
l
- listener to addpublic void addNetworkCheckListener(NetworkCheckListener l)
l
- listener to removeprotected void fireNumberCopiesViolation(NetworkCheck param1, int param2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |