com.SecurePlay
Class SecurePlayClass

java.lang.Object
  extended bycom.SecurePlay.SecurePlayClass

public class SecurePlayClass
extends java.lang.Object

This is the main Secure Play Library Class.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Constructor Summary
SecurePlayClass()
          Default Constructor.
 
Method Summary
 boolean APIaddGameComms(java.lang.String gid, java.lang.String commsID)
          This method associates a communications service with a game instance.
 boolean APIaddGamePlayer(java.lang.String gid, java.lang.String pid)
          This method associates a Player instance with a Game Instance so the player can participate in the game.
 void APIclearCommsServices()
          This clears all of the comms services associated with the SecurePlay library.
 void APIclearGames()
          This removes all of the Game Instances associated with the SecurePlay library.
 void APIclearPlayers()
          This method removes all of the Player Instances associated with the SecurePlay library.
 boolean APIcreateComms(java.lang.String commsID, SPAbstractCommsInterface commsObj)
          This method creates a comms service.
 boolean APIcreateGame(SPGameInterface game, java.lang.String gameID, java.lang.String master, boolean signaturepolicy, boolean encryptionpolicy)
          Attach an existing Game Instance to the Library with default log and security manager.
 boolean APIcreateGame(SPGameInterface game, java.lang.String gameID, java.lang.String master, boolean signaturepolicy, boolean encryptionpolicy, SPLogInterface log, SPSecurityManagerInterface security)
          Attach an existing Game Instance to the Library, with specified log and security manager.
 boolean APIcreateGame(java.lang.String gameID, java.lang.String master, boolean signaturepolicy, boolean encryptionpolicy)
          Creates a new game instance with defaul log and security manager.
 boolean APIcreateGame(java.lang.String gameID, java.lang.String master, boolean signaturepolicy, boolean encryptionpolicy, SPLogInterface log, SPSecurityManagerInterface security)
          Creates a new game instance with specified log and security manager.
 boolean APIcreatePlayer(SPPlayerInterface player, java.lang.String playerID)
          Attach an existing player Instance to the Library.
 boolean APIcreatePlayer(java.lang.String playerID)
          Adds a player instance.
 boolean APIcreatePlayer(java.lang.String playerID, boolean internalflag)
          Adds a player instance.
 SPAbstractCommsInterface APIgetCommsService(java.lang.String commsID)
          This method uses a commsID and returns the appropriate Communications Service Instance.
 SPGameInterface APIgetGame(java.lang.String gameID)
          This method takes a gameID and returns the associated Game Instance object.
 SPGameAPIInterface APIgetGameAPI(java.lang.String gameID)
          Gets the API of the the game instance in the game list of this library.
 java.lang.String APIgetLicenseSummary()
          This method returns the summary of the license.
 java.lang.String[] APIgetOpenCommServiceIDs()
          This method return
 java.lang.String[] APIgetOpenGameIDs()
          Gets the keys of an associative array(SPHashtable) this.prgamesList and returns them as a String array of open games id list.
 java.lang.String[] APIgetOpenPlayerIDs()
          Gets the keys of an associative array(SPHashtable) this.prplayersList and returns them as a String array of open players id list.
 SPPlayerInterface APIgetPlayer(java.lang.String playerID)
          This method takes a playerID and returns the corresponding Player instance.
 SPRelayInterface APIgetRelayManager()
          Returns the Library's Relay manager.
 boolean APIremoveCommsService(java.lang.String commsID)
          This method removes a Comms Service Instance specified by a commsID from the active SecurePlay library.
 boolean APIremoveGame(java.lang.String gameID)
          This method takes a gameID and removes the Game Instance from the active SecurePlay library.
 boolean APIremovePlayer(java.lang.String playerID)
          This method removes an instance of a Player from the active SecurePlay library.
 boolean APIsetLicenseInfo(java.lang.String pocname, java.lang.String company, java.lang.String siteURL, java.lang.String email, java.lang.String SPSerialNumber, java.lang.String SPLicenseKey)
          Loads registered SecurePlay licensee information.
 boolean APIsetPlayerGameComms(java.lang.String gid, java.lang.String playerID, java.lang.String commsID)
          This method associates a specific comms service with a specific player and a specific game.
 boolean APIsetPlayerGameComms(java.lang.String gid, java.lang.String playerID, java.lang.String commsID, boolean relayflag)
          This method associates a specific comms service with a specific player and a specific game.
 boolean APIsetRelay(SPRelayInterface relay)
          Activate Relay.
 boolean APIsetSOSLicenseInfo(java.lang.String pocname, java.lang.String company, java.lang.String siteURL, java.lang.String email)
          This method is the courtesy licensee information for Simple Open Source licensees.
 boolean checkLicense()
          This method is used to verify that the SecurePlay license information is provided completely and properly.
 java.lang.String getCompany()
          Getter function that returns the property: company
 SPLogInterface getDefaultLog()
          Returns default Log.
 SPSecurityManagerInterface getDefaultSecurityManager()
          Returns default Security Manager.
 java.lang.String getEmail()
          Getter function that returns the property: email
 java.lang.String getPocname()
          Getter function that returns the property: pocname
 SPMap getPrcommsServicesList()
          Getter function that returns the property: prcommsServicesList
 SPMap getPrgamesList()
          Getter function that returns the property: prgamesList
 SPMap getPrplayersList()
          Getter function that returns the property: prplayersList
 java.lang.String getSiteURL()
          Getter function that returns the property: siteURL
 java.lang.String getSPLicenseKey()
          Getter function that returns the property: SPLicenseKey
 java.lang.String getSPSerialNumber()
          Returns the serial number.
 boolean isCommsIncluded(java.lang.String cid)
          This method checks to see if the comms object exists in the comms list of this library.
 boolean isGameIncluded(java.lang.String gid)
          This method checks to see if the game exists in the game list of this library.
 boolean isInitialized()
          Getter function that returns the property: initialized
 boolean isPlayerIncluded(java.lang.String pid)
          This method returns a boolean TRUE if there is a player object specified by the indicated Player ID is included in the Library instance.
 boolean isRelayActive()
          Returns status of relay for this library instance.
 boolean setDefaultLog(SPLogInterface log)
          This method sets the default log to the specified log.
 boolean setDefaultSecurityManager(SPSecurityManagerInterface security)
          This method sets the default security manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurePlayClass

public SecurePlayClass()
Default Constructor. This constructor sets all the lisence related parameters to its default. And it sets the default for Log, SecurityManager, and it also registers Blast Transaction as default transaction for this library.

Method Detail

APIsetSOSLicenseInfo

public boolean APIsetSOSLicenseInfo(java.lang.String pocname,
                                    java.lang.String company,
                                    java.lang.String siteURL,
                                    java.lang.String email)
This method is the courtesy licensee information for Simple Open Source licensees. It provides basic information to a user or viewer of the application that the application follows the Simple Open Source License. See full license terms for further information.

Parameters:
pocname - String - individual who represents the company
company - String - company name.
siteURL - String - company web site.
email - String - company email.
Returns:
boolean - TRUE, if successful, FALSE, if not

APIsetLicenseInfo

public boolean APIsetLicenseInfo(java.lang.String pocname,
                                 java.lang.String company,
                                 java.lang.String siteURL,
                                 java.lang.String email,
                                 java.lang.String SPSerialNumber,
                                 java.lang.String SPLicenseKey)
Loads registered SecurePlay licensee information. Removal, modification, or disablement of this method or any other licensing code is a violation of the SecurePlay library license agreement. This method is used for Commercial Licenses. Simple Open Source licensees use the APIsetSOSLicenseInfo method.

Parameters:
pocname - String - individual who represents the company
company - String - company name.
siteURL - String - company web site.
email - String - company email.
SPSerialNumber - String - serial number of the SecurePlay licensee
SPLicenseKey - String - license key for the registered SecurePlay user.
Returns:
boolean - TRUE, if successful, FALSE, if not

APIcreateGame

public boolean APIcreateGame(java.lang.String gameID,
                             java.lang.String master,
                             boolean signaturepolicy,
                             boolean encryptionpolicy)
Creates a new game instance with defaul log and security manager.

Parameters:
gameID - String - game id of the new game.
master - String - the master of the new game.
signaturepolicy - boolean - signature policy of the game.
encryptionpolicy - boolean - encryption policy of the game.
Returns:
boolean - TRUE, if the game was created successfully, FALSE, otherwise

APIcreateGame

public boolean APIcreateGame(java.lang.String gameID,
                             java.lang.String master,
                             boolean signaturepolicy,
                             boolean encryptionpolicy,
                             SPLogInterface log,
                             SPSecurityManagerInterface security)
Creates a new game instance with specified log and security manager.

Parameters:
gameID - String - game id of the new game.
master - String - the master of the new game.
signaturepolicy - boolean - signature policy of the game.
encryptionpolicy - boolean - encryption policy of the game.
log - SPLogInterface - the log class for this game.
security - SPSecurityManagerInterface - security manager for this game.
Returns:
boolean - TRUE, if the game was created successfully, FALSE, otherwise

APIcreatePlayer

public boolean APIcreatePlayer(java.lang.String playerID,
                               boolean internalflag)
Adds a player instance. NOTE: This method will not be supported in future versions.

Parameters:
playerID - String - player id of the player to be created
internalflag - boolean - internal flag
Returns:
boolean - TRUE, if successful, FALSE, if not

APIcreatePlayer

public boolean APIcreatePlayer(java.lang.String playerID)
Adds a player instance.

Parameters:
playerID - String - player id of the player to be created
Returns:
boolean - TRUE, if successful, FALSE, if not

APIcreateComms

public boolean APIcreateComms(java.lang.String commsID,
                              SPAbstractCommsInterface commsObj)
This method creates a comms service.

Parameters:
commsID - String - id of the comms to be created
commsObj - SPAbstractCommsInterface - comms object to be added
Returns:
boolean - TRUE, if succcessful, FALSE, if not.

APIsetPlayerGameComms

public boolean APIsetPlayerGameComms(java.lang.String gid,
                                     java.lang.String playerID,
                                     java.lang.String commsID)
This method associates a specific comms service with a specific player and a specific game. It also determines whether this SecurePlay library comms service will relay messages to that player.

Parameters:
gid - String - game id to which the players and comms will be set
playerID - String - id of the player to be set
commsID - String - id of th comms to be set
Returns:
boolean - TRUE, if successful, FALSE, if not

APIsetPlayerGameComms

public boolean APIsetPlayerGameComms(java.lang.String gid,
                                     java.lang.String playerID,
                                     java.lang.String commsID,
                                     boolean relayflag)
This method associates a specific comms service with a specific player and a specific game. It also determines whether this SecurePlay library comms service will relay messages to that player. NOTE: This method will not be supported in the next version of the library

Parameters:
gid - String - game id to which the players and comms will be set
playerID - String - id of the player to be set
commsID - String - id of th comms to be set
relayflag - boolean - relay flag (NOTE: this will be removed from future releases)
Returns:
boolean - TRUE, if successful, FALSE, if not

APIaddGamePlayer

public boolean APIaddGamePlayer(java.lang.String gid,
                                java.lang.String pid)
This method associates a Player instance with a Game Instance so the player can participate in the game.

Parameters:
gid - String - id of the game to which the player will be added
pid - String - id of the player to be added
Returns:
boolean - TRUE, if successful, FALSE, if not successful

APIaddGameComms

public boolean APIaddGameComms(java.lang.String gid,
                               java.lang.String commsID)
This method associates a communications service with a game instance.

Parameters:
gid - String - id of the game to which the comms will be added
commsID - String - id of the comms to be added
Returns:
boolean - TRUE if successful, FALSE, if unsuccessful

APIgetGame

public SPGameInterface APIgetGame(java.lang.String gameID)
This method takes a gameID and returns the associated Game Instance object.

Parameters:
gameID - String - id of the game to be retrieved
Returns:
SPGameInterface - returns the actual object

APIgetPlayer

public SPPlayerInterface APIgetPlayer(java.lang.String playerID)
This method takes a playerID and returns the corresponding Player instance.

Parameters:
playerID - String - id of the player to be retrieved
Returns:
SPPlayerInterface - returns the actual object

APIgetCommsService

public SPAbstractCommsInterface APIgetCommsService(java.lang.String commsID)
This method uses a commsID and returns the appropriate Communications Service Instance.

Parameters:
commsID - String - id of the comms to be retrieved
Returns:
SPAbstractCommsInterface - returns the actual object

APIremoveGame

public boolean APIremoveGame(java.lang.String gameID)
This method takes a gameID and removes the Game Instance from the active SecurePlay library.

Parameters:
gameID - String - id of the game to be removed
Returns:
boolean - TRUE, if successful, FALSE, if not

APIremovePlayer

public boolean APIremovePlayer(java.lang.String playerID)
This method removes an instance of a Player from the active SecurePlay library.

Parameters:
playerID - String - id of the player to be removed
Returns:
boolean - TRUE, if successful, FALSE, if not

APIremoveCommsService

public boolean APIremoveCommsService(java.lang.String commsID)
This method removes a Comms Service Instance specified by a commsID from the active SecurePlay library.

Parameters:
commsID - String - id of the comms to be removed
Returns:
boolean - TRUE, if successful, FALSE, if not.

APIclearGames

public void APIclearGames()
This removes all of the Game Instances associated with the SecurePlay library. Use with caution.

Returns:
void

APIclearPlayers

public void APIclearPlayers()
This method removes all of the Player Instances associated with the SecurePlay library.

Returns:
void

APIclearCommsServices

public void APIclearCommsServices()
This clears all of the comms services associated with the SecurePlay library. It should be used with great caution.

Returns:
void

checkLicense

public boolean checkLicense()
This method is used to verify that the SecurePlay license information is provided completely and properly.

Returns:
boolean - TRUE, if license information is set properly. FALSE, if not

APIgetGameAPI

public SPGameAPIInterface APIgetGameAPI(java.lang.String gameID)
Gets the API of the the game instance in the game list of this library.

Parameters:
gameID - String - id of the gameAPI to be retrieved
Returns:
SPGameAPIInterface - the API of game instance in prgameList array

APIgetOpenCommServiceIDs

public java.lang.String[] APIgetOpenCommServiceIDs()
This method return

Returns:
String[] - array of open comms services id list

APIgetOpenGameIDs

public java.lang.String[] APIgetOpenGameIDs()
Gets the keys of an associative array(SPHashtable) this.prgamesList and returns them as a String array of open games id list.

Returns:
String[] - array of open games id list

APIgetOpenPlayerIDs

public java.lang.String[] APIgetOpenPlayerIDs()
Gets the keys of an associative array(SPHashtable) this.prplayersList and returns them as a String array of open players id list.

Returns:
String[] - array of open players id list

isPlayerIncluded

public boolean isPlayerIncluded(java.lang.String pid)
This method returns a boolean TRUE if there is a player object specified by the indicated Player ID is included in the Library instance.

Parameters:
pid - String - the player id to be checked
Returns:
boolean - TRUE, if successful, FALSE, if not successful

isGameIncluded

public boolean isGameIncluded(java.lang.String gid)
This method checks to see if the game exists in the game list of this library.

Parameters:
gid - String - the game id to be checked
Returns:
boolean - TRUE, if successful, FALSE, if not successful

isCommsIncluded

public boolean isCommsIncluded(java.lang.String cid)
This method checks to see if the comms object exists in the comms list of this library.

Parameters:
cid - String - the comms id to be checked
Returns:
boolean - TRUE, if successful, FALSE, if not successful

APIcreateGame

public boolean APIcreateGame(SPGameInterface game,
                             java.lang.String gameID,
                             java.lang.String master,
                             boolean signaturepolicy,
                             boolean encryptionpolicy)
Attach an existing Game Instance to the Library with default log and security manager.

Parameters:
game - SPGameInterface - the game object to be attached
gameID - String - game id of the new game.
master - String - the master of the new game.
signaturepolicy - boolean - signature policy of the game.
encryptionpolicy - boolean - encryption policy of the game.
Returns:
boolean - TRUE, if the game was created successfully, FALSE, otherwise

APIcreateGame

public boolean APIcreateGame(SPGameInterface game,
                             java.lang.String gameID,
                             java.lang.String master,
                             boolean signaturepolicy,
                             boolean encryptionpolicy,
                             SPLogInterface log,
                             SPSecurityManagerInterface security)
Attach an existing Game Instance to the Library, with specified log and security manager.

Parameters:
game - SPGameInterface - the game object to be attached
gameID - String - game id of the new game.
master - String - the master of the new game.
signaturepolicy - boolean - signature policy of the game.
encryptionpolicy - boolean - encryption policy of the game.
log - SPLogInterface - the log class for this game.
security - SPSecurityManagerInterface - security manager for this game.
Returns:
boolean - TRUE, if the game was created successfully, FALSE, otherwise

APIcreatePlayer

public boolean APIcreatePlayer(SPPlayerInterface player,
                               java.lang.String playerID)
Attach an existing player Instance to the Library.

Parameters:
player - SPPlayerInterface - the player object to be attached
playerID - String - the player id
Returns:
boolean - TRUE, if successful, FALSE, if not successful

getCompany

public java.lang.String getCompany()
Getter function that returns the property: company

Returns:
String - company

getEmail

public java.lang.String getEmail()
Getter function that returns the property: email

Returns:
String - email

isInitialized

public boolean isInitialized()
Getter function that returns the property: initialized

Returns:
boolean - initialized?

getPocname

public java.lang.String getPocname()
Getter function that returns the property: pocname

Returns:
String - the individual who is the contact for the SecurePlay license for use of the library.

getPrcommsServicesList

public SPMap getPrcommsServicesList()
Getter function that returns the property: prcommsServicesList

Returns:
SPMap - prcommsServicesList

getPrgamesList

public SPMap getPrgamesList()
Getter function that returns the property: prgamesList

Returns:
SPMap - prgamesList

getPrplayersList

public SPMap getPrplayersList()
Getter function that returns the property: prplayersList

Returns:
SPMap - prgamesList

getSiteURL

public java.lang.String getSiteURL()
Getter function that returns the property: siteURL

Returns:
String - site URL.

getSPLicenseKey

public java.lang.String getSPLicenseKey()
Getter function that returns the property: SPLicenseKey

Returns:
String - license key.

getSPSerialNumber

public java.lang.String getSPSerialNumber()
Returns the serial number.

Returns:
String - serial number

APIgetLicenseSummary

public java.lang.String APIgetLicenseSummary()
This method returns the summary of the license.

Returns:
String - the summary of the license

APIgetRelayManager

public SPRelayInterface APIgetRelayManager()
Returns the Library's Relay manager.

Returns:
SPRelayInterface - relay class.

APIsetRelay

public boolean APIsetRelay(SPRelayInterface relay)
Activate Relay.

Returns:
boolean - true if activated.

isRelayActive

public boolean isRelayActive()
Returns status of relay for this library instance.

Returns:
boolean - true if activated.

getDefaultLog

public SPLogInterface getDefaultLog()
Returns default Log.

Returns:
SPLogInterface - default Log.

getDefaultSecurityManager

public SPSecurityManagerInterface getDefaultSecurityManager()
Returns default Security Manager.

Returns:
SPSSecurityManagerClass - default Security Manager.

setDefaultLog

public boolean setDefaultLog(SPLogInterface log)
This method sets the default log to the specified log.

Parameters:
log - SPLogInterface - the new default log
Returns:
Boolean - true;

setDefaultSecurityManager

public boolean setDefaultSecurityManager(SPSecurityManagerInterface security)
This method sets the default security manager.

Parameters:
security -
Returns:
boolean