SecurePlayLibray J2SE
v2.1

com.SecurePlay.Comms
Class SPAbstractCommsClass

java.lang.Object
  extended bycom.SecurePlay.Comms.SPAbstractCommsClass
All Implemented Interfaces:
SPAbstractCommsInterface
Direct Known Subclasses:
SPCLocalCommsClass, SPCLocalCommsFileClass

public class SPAbstractCommsClass
extends java.lang.Object
implements SPAbstractCommsInterface

This is the SuperClass for comms services classes.

Author:
IT GlobaLSecure
See Also:
SecurePlay License Information
 

Field Summary
private  java.lang.String commsID
          This is the local handle for uniquely identifying a comms service to game instances.
 java.lang.String commstype
          Type of Comms Service
private  SPMap gameplayerList
          This array holds the PlayerIDs of remote players that are supported by this comm service.
private  java.lang.String[] internalGameIDList
          This array holds the gameIDs of the game instances that the comm service is actively supporting.
private  SPMap printernalGameList
          This array holds the gameIDs of the game instances that the comm service is actively supporting.
(package private)  java.lang.String releaseversion
          IT GlobalSecure release version.
 
Constructor Summary
SPAbstractCommsClass()
          Default Construtor
 
Method Summary
 boolean addGame(java.lang.String gid, SPCommsManagerCommsInterface gamcomobj)
          This method adds an internal game to a specific comms service.
 boolean addPlayer(java.lang.String pid, java.lang.String gid)
          This method adds a player ID of a remote player serviced by this comm service.
 boolean APIactivate()
          OPTIONAL - This is a shell method to trigger the activation of a comms service, if necessary.
 boolean APIconfigureCommService()
          This method configures a comm service instance.
 boolean APIdeactivate()
          OPTIONAL - This shell method is used to deactivate a comms service once it is no longer needed.
 java.lang.String getCommsID()
          Getter function that returns the property: commsID
 java.lang.String getCommsServiceType()
          This method returns a unique identifier for the type of comms service instance.
 SPMap getGameplayerList()
          Getter function that returns the property: gameplayerList
 java.lang.String[] getInternalGameIDList()
          Getter function that returns the property: internalGameIDList
 SPMap getPrinternalGameList()
          Getter function that returns the property: printernalGameList
(package private)  int includedPlayerCount(java.lang.String[] playerarray, java.lang.String gid)
          This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList
(package private)  void incoming()
          This is a shell method placeholder for the actual processing of incoming data/datastreams/messages from a network.
 boolean isGameInternal(java.lang.String gid)
          This method returns whether a game is handled internally by a comms service
 void logError()
          This is a shell for future error log.
 void processincoming(SPMessageClass inmess)
          This method processes the incoming message.
protected  boolean prreceive(byte[] message)
          This standard method handles incoming serialized messages that have been separated out of incoming data streams by the incoming method.
protected  boolean prsend(byte[] message)
          This is a shell method for the actual transmission of a serialized message over a network using a specific communications transport.
 boolean removeGame(java.lang.String gid)
          This method removes the association of a game with the comms service.
 boolean removePlayer(java.lang.String pid, java.lang.String gid)
          This method removes a player from the list of remote players served by this comm service.
 int sendMessage(SPMessageClass clearmessage, SPMessageClass alternatemessage)
          This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList (This method takes the message and sends it over the network, if they are served by this comms service.)
 boolean setcommsID(java.lang.String cid)
          This method sets the internal ID for a comms service if it has not been set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commsID

private java.lang.String commsID
This is the local handle for uniquely identifying a comms service to game instances. Different comms services may be based on the same object to have different configurations - depending on implementation.


internalGameIDList

private java.lang.String[] internalGameIDList
This array holds the gameIDs of the game instances that the comm service is actively supporting.


gameplayerList

private SPMap gameplayerList
This array holds the PlayerIDs of remote players that are supported by this comm service. A future upgrade is needed to track which players are associaed with which games.


printernalGameList

private SPMap printernalGameList
This array holds the gameIDs of the game instances that the comm service is actively supporting.


releaseversion

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

See Also:
Constant Field Values

commstype

public final java.lang.String commstype
Type of Comms Service

See Also:
Constant Field Values
Constructor Detail

SPAbstractCommsClass

public SPAbstractCommsClass()
Default Construtor

Method Detail

setcommsID

public boolean setcommsID(java.lang.String cid)
This method sets the internal ID for a comms service if it has not been set. NOTE, this ID is not the public, network, or other ID for the communications service, but simply an internal handler.

Specified by:
setcommsID in interface SPAbstractCommsInterface
Parameters:
cid - String - comms id
Returns:
boolean: TRUE, if succesful, FALSE, if not

getCommsServiceType

public java.lang.String getCommsServiceType()
This method returns a unique identifier for the type of comms service instance.

Specified by:
getCommsServiceType in interface SPAbstractCommsInterface
Returns:
"abstract" - String - unique identifier for type of comms service

addGame

public boolean addGame(java.lang.String gid,
                       SPCommsManagerCommsInterface gamcomobj)
This method adds an internal game to a specific comms service. The connection is to the SPComms class associated with the game to allow incoming messages to be serviced.

Specified by:
addGame in interface SPAbstractCommsInterface
Parameters:
gid - String - game id
gamcomobj - SPCommsManagerCommsInterface - the comms object to be added to a game
Returns:
boolean - TRUE, if successful, FALSE, if not

removeGame

public boolean removeGame(java.lang.String gid)
This method removes the association of a game with the comms service. NOTE: actually the association that is removed is with the game instance's SPComms class instance.

Specified by:
removeGame in interface SPAbstractCommsInterface
Parameters:
gid - String - game id
Returns:
boolean - TRUE, if successful, FALSE, if not

APIconfigureCommService

public boolean APIconfigureCommService()
This method configures a comm service instance. The parameters are variable depending on the specific service. (this is a shell method It returns true if successful, false, if not.)

Returns:
true - Boolean: TRUE, if successful, FALSE, if not

addPlayer

public boolean addPlayer(java.lang.String pid,
                         java.lang.String gid)
This method adds a player ID of a remote player serviced by this comm service.

Specified by:
addPlayer in interface SPAbstractCommsInterface
Parameters:
pid - String - player id to be added
gid - String - game id for the player to be added
Returns:
boolean - TRUE, if successful, FALSE, if not

removePlayer

public boolean removePlayer(java.lang.String pid,
                            java.lang.String gid)
This method removes a player from the list of remote players served by this comm service.

Specified by:
removePlayer in interface SPAbstractCommsInterface
Parameters:
pid - String - player id to ber removed.
gid - String - game id from which the player is to be removed.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

prsend

protected boolean prsend(byte[] message)
This is a shell method for the actual transmission of a serialized message over a network using a specific communications transport.

Parameters:
message - String - the message to be sent
Returns:
true - Boolean: TRUE, if successful, FALSE, if not.

incoming

void incoming()
This is a shell method placeholder for the actual processing of incoming data/datastreams/messages from a network.


prreceive

protected boolean prreceive(byte[] message)
This standard method handles incoming serialized messages that have been separated out of incoming data streams by the incoming method. It parses them into Message Objects and passes them on to the Game Instance.

Parameters:
message - String - the incoming message
Returns:
result - Boolean: TRUE, if successfully handled, FALSE, if not.

includedPlayerCount

int includedPlayerCount(java.lang.String[] playerarray,
                        java.lang.String gid)
This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList

Parameters:
playerarray - String[] - player id list
gid - String - the game id
Returns:
int - the number of players supported by the Comms Service in the input playerID array.

sendMessage

public int sendMessage(SPMessageClass clearmessage,
                       SPMessageClass alternatemessage)
This method returns a number based on the input array to indicate how many of the input array's player IDs are included in the comms service playerIDList (This method takes the message and sends it over the network, if they are served by this comms service.)

Specified by:
sendMessage in interface SPAbstractCommsInterface
Parameters:
clearmessage - SPMessageClass - message for receivers
alternatemessage - SPMessageClass - message or other game players
Returns:
integer - int - Number of remote players that were handled by this comm service for the message (or the number of players supported by the Comms Service in the input playerID array.)

APIactivate

public boolean APIactivate()
OPTIONAL - This is a shell method to trigger the activation of a comms service, if necessary.

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

APIdeactivate

public boolean APIdeactivate()
OPTIONAL - This shell method is used to deactivate a comms service once it is no longer needed. Depending on the comms service, this method may not be necessary

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

logError

public void logError()
This is a shell for future error log.


getCommsID

public java.lang.String getCommsID()
Getter function that returns the property: commsID

Specified by:
getCommsID in interface SPAbstractCommsInterface
Returns:
commsid - String - the comms id.

getGameplayerList

public SPMap getGameplayerList()
Getter function that returns the property: gameplayerList

Specified by:
getGameplayerList in interface SPAbstractCommsInterface
Returns:
gameplayerList - SPMap

getInternalGameIDList

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

Specified by:
getInternalGameIDList in interface SPAbstractCommsInterface
Returns:
internalGameIDList - String[]

getPrinternalGameList

public SPMap getPrinternalGameList()
Getter function that returns the property: printernalGameList

Specified by:
getPrinternalGameList in interface SPAbstractCommsInterface
Returns:
printernalGameList - SPMap

isGameInternal

public boolean isGameInternal(java.lang.String gid)
This method returns whether a game is handled internally by a comms service

Specified by:
isGameInternal in interface SPAbstractCommsInterface
Parameters:
gid - - String
Returns:
boolean - True if game is internal and supported by Comms Service

processincoming

public void processincoming(SPMessageClass inmess)
This method processes the incoming message.

Parameters:
inmess - SPMessageClass - the incoming message void

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.