SecurePlayLibray J2SE
v2.1

com.SecurePlay
Class SPCommsManagerClass

java.lang.Object
  extended bycom.SecurePlay.SPCommsManagerClass
All Implemented Interfaces:
java.lang.Runnable, SPCommsManagerCommsInterface

public class SPCommsManagerClass
extends java.lang.Object
implements SPCommsManagerCommsInterface, java.lang.Runnable

This class manages the communications and various communications services. It is essentially the "router" for the game data.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
private  boolean active
           
private  SPGameInterface gameinstance
          This is the object pointer for the game instance object associated with the comms object.
private  java.lang.String[] internalplayerIDList
          This property holds the array of the IDs of the internal players
private  SPLogInterface messagelog
          This property holds the pointer to the message log object.
private  SPMap playerCommsList
          This associative array holds the mapping between the various game players and their associated comms services IDs.
private  java.lang.String[] prcommsIDList
          This property holds the array of comms services IDs.
private  SPMap prcommsServList
          This associative array holds the mapping between the various comms services IDs and the comms services objects, themsselves.
private  java.lang.String prcommsstatus
          This is a text string that provides the current status of the comms object.
private  boolean prencryptpolicy
          This flag holds the encryption policy flag for the game instance.
private  boolean prsignaturepolicy
          This flag holds the overall signature policy for the game.
(package private)  java.lang.String releaseversion
          IT GlobalSecure release version.
private  SPSecurityManagerInterface securityManager
           
private  java.lang.Thread t1
           
 
Constructor Summary
SPCommsManagerClass(SPGameInterface gameobj, SPLogInterface log, SPSecurityManagerInterface security)
          Overloaded Constructor.
 
Method Summary
 boolean addComms(java.lang.String commsID)
          This method safely adds an available comms service to the game instance.
 boolean APIActivate()
          This method activates the thread
 boolean APIDeactivate()
          This method deactivates the thread
private  void configureCommsManager(SPGameInterface gameobj, SPLogInterface log, SPSecurityManagerInterface security)
          This method configures this Comms Manager Class.
 boolean endGameComms()
          This method safely ends the game comms session.
 SPAbstractCommsInterface getComms(java.lang.String commsID)
          This method safely returns one of the comms services objects associated with this game instance.
 java.lang.String getCommsStatus()
          Gets the comms status.
 boolean getEncryptPolicy()
          This method returns the encryption policy flag.
 SPGameInterface getGameinstance()
          Getter function that returns the property:
 java.lang.String[] getInternalplayerIDList()
          Getter function that returns the property: internalplayerIDList
 SPLogInterface getMessagelog()
          Getter function that returns the property: messagelog
 SPMap getPlayerCommsList()
          Getter function that returns the property: playerCommsList
 java.lang.String[] getPrcommsIDList()
          Getter function that returns the property: prcommsIDList
 SPMap getPrcommsServList()
          Getter function that returns the property: prcommsServList
 SPSecurityManagerInterface getSecurityManager()
           
 boolean getSignaturePolicy()
          This method returns the Signature Policy flag for the game instance.
 boolean isPlayerInternal(java.lang.String pid)
          Checks to see if the player is internal to the game.
 void receiveMessage(SPMessageClass incoming)
          This method safely receives and routes incoming messages.
 boolean removeComms(java.lang.String cid)
          This method safely removes comms service from the game instance.
 void removePlayer(java.lang.String playerID)
          This method safely removes a player from the game instance's comms.
 void run()
          This method activates the thread
 void sendMessage(java.lang.String gid, java.lang.String tid, java.lang.String sender, java.lang.String[] receivers, boolean encryptflag, boolean aprivateflag, java.lang.String messagetype, java.lang.String messID, java.lang.String[] messagebody, java.lang.String[] altmessage)
          This method manages actually sending messages to other game instances via communication services objects.
 boolean setPlayerComms(java.lang.String pid, java.lang.String cid)
          This method safely associates a Player with a comms service and enables relay support for that player via that comms service.
 boolean setSecurityPolicy(boolean sign, boolean encrypt)
          This method safely sets the security policy (encryption and signatures, for the game instance).
protected  void startCommsManager()
          initialize the message log with licensing information
 java.lang.String UpdateCommsStatus()
          This method reviews and updates the status of the comms instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gameinstance

private SPGameInterface gameinstance
This is the object pointer for the game instance object associated with the comms object.


prcommsIDList

private java.lang.String[] prcommsIDList
This property holds the array of comms services IDs. Comms services IDs are the public means to access a comms service object.


prcommsServList

private SPMap prcommsServList
This associative array holds the mapping between the various comms services IDs and the comms services objects, themsselves.


internalplayerIDList

private java.lang.String[] internalplayerIDList
This property holds the array of the IDs of the internal players


prencryptpolicy

private boolean prencryptpolicy
This flag holds the encryption policy flag for the game instance.


prsignaturepolicy

private boolean prsignaturepolicy
This flag holds the overall signature policy for the game.


messagelog

private SPLogInterface messagelog
This property holds the pointer to the message log object.


playerCommsList

private SPMap playerCommsList
This associative array holds the mapping between the various game players and their associated comms services IDs. NOTE: internal players have a virtual comms service "internal".


prcommsstatus

private java.lang.String prcommsstatus
This is a text string that provides the current status of the comms object.


releaseversion

final java.lang.String releaseversion
IT GlobalSecure release version.

See Also:
Constant Field Values

securityManager

private SPSecurityManagerInterface securityManager

t1

private java.lang.Thread t1

active

private boolean active
Constructor Detail

SPCommsManagerClass

public SPCommsManagerClass(SPGameInterface gameobj,
                           SPLogInterface log,
                           SPSecurityManagerInterface security)
Overloaded Constructor.

Parameters:
gameobj - - SPGameInterface - game instance object
log - SPLogInterface - log class associated with this comms manager.
security - SPSecurityManagerInterface - security manager associated with this comms manager.
Method Detail

configureCommsManager

private void configureCommsManager(SPGameInterface gameobj,
                                   SPLogInterface log,
                                   SPSecurityManagerInterface security)
This method configures this Comms Manager Class.

Parameters:
gameobj - SPGameInterface - game associated with this comms manager.
log - SPLogInterface - the log type for this game
security - SPSecurityManagerInterface - security for the game. void

startCommsManager

protected void startCommsManager()
initialize the message log with licensing information


setSecurityPolicy

public boolean setSecurityPolicy(boolean sign,
                                 boolean encrypt)
This method safely sets the security policy (encryption and signatures, for the game instance).

Parameters:
sign - boolean - Signature policy
encrypt - boolean - encryption policy
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

getComms

public SPAbstractCommsInterface getComms(java.lang.String commsID)
This method safely returns one of the comms services objects associated with this game instance.

Parameters:
commsID - String - id of the comms to be retrieved
Returns:
Object - SPAbstractCommsInterface - comms service object handler

addComms

public boolean addComms(java.lang.String commsID)
This method safely adds an available comms service to the game instance.

Parameters:
commsID - String - comms service identifier string
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

removeComms

public boolean removeComms(java.lang.String cid)
This method safely removes comms service from the game instance.

Parameters:
cid - String - id of the comms object to be removed
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

getEncryptPolicy

public boolean getEncryptPolicy()
This method returns the encryption policy flag.

Returns:
result - Boolean: TRUE, if flag set, FALSE, if not.

getSignaturePolicy

public boolean getSignaturePolicy()
This method returns the Signature Policy flag for the game instance.

Returns:
result - Boolean, TRUE, if flag set, FALSE, if not.

endGameComms

public boolean endGameComms()
This method safely ends the game comms session. NOTE: it will not stop incoming messages, only outgoing or relayed messages.

Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

setPlayerComms

public boolean setPlayerComms(java.lang.String pid,
                              java.lang.String cid)
This method safely associates a Player with a comms service and enables relay support for that player via that comms service.

Parameters:
pid - String - player id to be set
cid - String - comms id to be set
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

removePlayer

public void removePlayer(java.lang.String playerID)
This method safely removes a player from the game instance's comms.

Parameters:
playerID - String - id of the player to be removed

UpdateCommsStatus

public java.lang.String UpdateCommsStatus()
This method reviews and updates the status of the comms instance.

Returns:
prcommsstatus - String - the updated prcommsstatus property

sendMessage

public void sendMessage(java.lang.String gid,
                        java.lang.String tid,
                        java.lang.String sender,
                        java.lang.String[] receivers,
                        boolean encryptflag,
                        boolean aprivateflag,
                        java.lang.String messagetype,
                        java.lang.String messID,
                        java.lang.String[] messagebody,
                        java.lang.String[] altmessage)
This method manages actually sending messages to other game instances via communication services objects. Also, for private messages, it sends an alternate message to the parties not recieving the main message.

Parameters:
gid -
tid -
sender -
receivers -
encryptflag -
aprivateflag -
messagetype -
messID -
messagebody -
altmessage -
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

receiveMessage

public void receiveMessage(SPMessageClass incoming)
This method safely receives and routes incoming messages. Only proper, valid messages will be sent on to transactions for processing.

Specified by:
receiveMessage in interface SPCommsManagerCommsInterface
Parameters:
incoming - SPMessageClass - incoming message
Returns:
Boolean - TRUE, if successful, FALSE, if not.

getCommsStatus

public java.lang.String getCommsStatus()
Gets the comms status.

Returns:
prcommsstatus - String - comms status

isPlayerInternal

public boolean isPlayerInternal(java.lang.String pid)
Checks to see if the player is internal to the game.

Parameters:
pid - String - the player id
Returns:
result - boolean:

getGameinstance

public SPGameInterface getGameinstance()
Getter function that returns the property:

Returns:
gameinstance - SPGameInterface

getInternalplayerIDList

public java.lang.String[] getInternalplayerIDList()
Getter function that returns the property: internalplayerIDList

Returns:
internalplayerIDList - String[]

getMessagelog

public SPLogInterface getMessagelog()
Getter function that returns the property: messagelog

Returns:
messagelog - SPLogInterface

getPlayerCommsList

public SPMap getPlayerCommsList()
Getter function that returns the property: playerCommsList

Returns:
playerCommsList - SPMap

getPrcommsIDList

public java.lang.String[] getPrcommsIDList()
Getter function that returns the property: prcommsIDList

Returns:
prcommsIDList - String[]

getPrcommsServList

public SPMap getPrcommsServList()
Getter function that returns the property: prcommsServList

Returns:
prcommsServList - SPHashtable

getSecurityManager

public SPSecurityManagerInterface getSecurityManager()

run

public void run()
This method activates the thread

Specified by:
run in interface java.lang.Runnable

APIActivate

public boolean APIActivate()
This method activates the thread

Returns:
boolean

APIDeactivate

public boolean APIDeactivate()
This method deactivates the thread

Returns:
boolean

SecurePlayLibray J2SE
v2.1

2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.