com.SecurePlay.SPTMultiPartSimultaneous
Class SPTMultiPartSimultaneousClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.SPTMultiPartSimultaneous.SPTMultiPartSimultaneousClass
All Implemented Interfaces:
SPAbstractTransactionInterface

public class SPTMultiPartSimultaneousClass
extends SPAbstractTransactionClass

This method is an extension of the SPSimultaneous Class to handle multi-part (String Array) simultaneous events

Author:
IT GlobalSecure Inc.
See Also:
SecurePlay License Information
 

Field Summary
 
Fields inherited from class com.SecurePlay.SPAbstractTransactionClass
classAPI, configuration, gameblock, gameinstance, transactionstatus, transtype
 
Fields inherited from class com.SecurePlay.SPRootTransactionClass
EventListenerList, gameID, master, playerIDList, transactionID
 
Constructor Summary
SPTMultiPartSimultaneousClass(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID)
          Overloaded Constructor
 
Method Summary
static boolean APIBcreateTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction.
static SPTMultiPartSimultaneousClass APIcreateTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction.
 java.lang.String[] APIgetSecret(java.lang.String sender)
          This method returns the actual secret for the specified player that this transaction is protecting, if available.
 boolean APIrequestsendHiddenSecret(java.lang.String pid, java.lang.String sender, java.lang.String[] newsecret)
          This method allows any party to request the specified transaction participant send a Secret to support the simultaneous transaction.
 boolean APIsendHiddenSecret(java.lang.String sender, java.lang.String[] newsecret)
          This method allows the specified transaction participant to send the transform of a secret to the other participants in the Simultaneous transaction.
 SPTMultiPartSimultaneousAPIClass APITAOcreateTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction.
 boolean APIverifySimultaneous()
          This method verifies whether a Simultaneous transaction was carried out successfully and responds with a simple Boolean.
protected  SPAbstractTransactionInterface buildSPawn()
          This method provides the unique transaction creation services for spawned Multipart Simultaneous transactions
 SPAbstractTransactionInterface createTransaction(SPGameAPIInterface gameapiobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID)
          This method creates a SPMultiPartSimultaneousClass transaction.
 int getPrpadlength()
          Getter function that returns the property: prpadlength
 SPMap getSecret()
          Getter function that returns the property: secret
 SPMap getSecrettransform()
          Getter function that returns the property: secrettransform
static java.lang.String gettranstype()
          This method gets the transaction type.
 void onrequestsendHiddenSecret(SPMessageClass incoming)
          Handles incoming requests to create a sendHiddenSecret message by specified recipient
 boolean onrevealSecret(SPMessageClass incoming)
          This method handles the incoming message to reveal a secret.
 boolean onsendHiddenSecret(SPMessageClass incoming)
          This method handles incoming sendHiddenSecret messages.
 boolean pronincomingTransaction(SPMessageClass incoming)
          This method provides the unique handlers for incoming Multipart Simultaneous turn message types
 boolean prsendinternalSecrets()
          This method safely sends all of the internal Secrets from participants in the Simultaneous transaction to remote players.
protected  void pruniqueinit()
          Unique initialization
static boolean registerTransaction()
          Registers this transaction.
protected  boolean spawnConfigure(SPAbstractTransactionInterface a)
          This method provides the unique transaction configuration services for spawned Multipart Simultaneous transactions
 SPTMultiPartSimultaneousAPIClass SPgetAPI()
          Gets this class's API
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionClass
APIbeginTransaction, APIcompleteTransaction, APIconfigureTransaction, APIgetGameBlock, APIrequestbeginTransaction, APIrequestCompleteTransaction, APIrequestconfigureTransaction, APIsetGameBlock, APISPawn, getClassAPI, getConfiguration, getGameinstance, getLasterror, getPrivacyFlag, getTransactionstatus, getTransactionType, isPlayerInternal, isPrivateflag, logError, onbeginTransaction, onconfigureTransaction, onconfigureTransaction, onincomingTransaction, onrequestbeginTransaction, onrequestcompleteTransaction, onrequestconfigureTransaction, onSpawn, sendMessage, setGameBlock, setTransactionID, transComplete, transError
 
Methods inherited from class com.SecurePlay.SPRootTransactionClass
APIAddListener, APIClearListeners, APIGetListenerCount, APIGetListeners, APIRemoveListener, getGameID, getMaster, getPlayerIDList, getTransactionID, isPlayerIncluded, SPnotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.SecurePlay.SPAbstractTransactionInterface
getGameID, getMaster, getPlayerIDList, getTransactionID
 

Constructor Detail

SPTMultiPartSimultaneousClass

public SPTMultiPartSimultaneousClass(SPGameInterface gameobj,
                                     java.lang.String master,
                                     java.lang.String[] playerIDList,
                                     boolean privateflag,
                                     java.lang.String transactionID)
Overloaded Constructor

Parameters:
gameobj - SPGameInterface - the game object with which the transaction is associated
master - String - the master of the transaction
playerIDList - String[] - player id list of players who are associated with the transaction
privateflag - boolean - private flag
transactionID - String - the transaction id
Method Detail

pruniqueinit

protected void pruniqueinit()
Unique initialization

Overrides:
pruniqueinit in class SPAbstractTransactionClass

APIsendHiddenSecret

public boolean APIsendHiddenSecret(java.lang.String sender,
                                   java.lang.String[] newsecret)
This method allows the specified transaction participant to send the transform of a secret to the other participants in the Simultaneous transaction.

Parameters:
sender - String - sender of the secret
newsecret - String[] - the secret
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIverifySimultaneous

public boolean APIverifySimultaneous()
This method verifies whether a Simultaneous transaction was carried out successfully and responds with a simple Boolean.

Returns:
Boolean - TRUE, if transaction verified, FALSE, if not.

APIgetSecret

public java.lang.String[] APIgetSecret(java.lang.String sender)
This method returns the actual secret for the specified player that this transaction is protecting, if available.

Parameters:
sender - String - sender of the secret
Returns:
secret - String[] - the secret

onsendHiddenSecret

public boolean onsendHiddenSecret(SPMessageClass incoming)
This method handles incoming sendHiddenSecret messages. These messages include the secrettransform and can sent by any transaction participant.

Parameters:
incoming - SPMessageClass - the message to be sent.
Returns:
result - Boolean: TRUE, if successfully handled, FALSE, if not

prsendinternalSecrets

public boolean prsendinternalSecrets()
This method safely sends all of the internal Secrets from participants in the Simultaneous transaction to remote players. It is automatically triggered by the onsendHiddenSecret method/event once all incoming secret transforms have been received.

Returns:
ressult - Boolean: TRUE, if all internal secrets successfully sent, FALSE, if not.

onrevealSecret

public boolean onrevealSecret(SPMessageClass incoming)
This method handles the incoming message to reveal a secret. The message can come from any participant in the transaction and should include the secretpadded as its sole content. Once all of the secrettransforms have been received, this method will trigger the sending of all local secrets via the prsendInternalSecrets method.

Parameters:
incoming - SPMessageClass - incoming message
Returns:
result - Boolean: TRUE, if handled, FALSE, if not

pronincomingTransaction

public boolean pronincomingTransaction(SPMessageClass incoming)
This method provides the unique handlers for incoming Multipart Simultaneous turn message types

Overrides:
pronincomingTransaction in class SPAbstractTransactionClass
Parameters:
incoming - SPMessageClass - incoming message
Returns:
Boolean - TRUE if successful, FALSE, if unsuccessful

APIrequestsendHiddenSecret

public boolean APIrequestsendHiddenSecret(java.lang.String pid,
                                          java.lang.String sender,
                                          java.lang.String[] newsecret)
This method allows any party to request the specified transaction participant send a Secret to support the simultaneous transaction. It is mainly used for remote debugging purposes.

Parameters:
pid - String - player id, or the master of the transaction
sender - String - sender, or the requestor, can not be master
newsecret - String[] - the secret
Returns:
result - Boolean: TRUE, if request successfully sent, FALSE, if not

onrequestsendHiddenSecret

public void onrequestsendHiddenSecret(SPMessageClass incoming)
Handles incoming requests to create a sendHiddenSecret message by specified recipient

Parameters:
incoming - SPMessageClass - incoming message
Returns:
Boolean - TRUE, if successful, FALSE, if not

buildSPawn

protected SPAbstractTransactionInterface buildSPawn()
This method provides the unique transaction creation services for spawned Multipart Simultaneous transactions

Overrides:
buildSPawn in class SPAbstractTransactionClass
Returns:
tran - SPAbstractTransactionInterface - spawned transaction

spawnConfigure

protected boolean spawnConfigure(SPAbstractTransactionInterface a)
This method provides the unique transaction configuration services for spawned Multipart Simultaneous transactions

Overrides:
spawnConfigure in class SPAbstractTransactionClass
Parameters:
a - SPAbstractTransactionInterface - the transaction to be spawned
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

SPgetAPI

public SPTMultiPartSimultaneousAPIClass SPgetAPI()
Gets this class's API

Returns:
classAPI - SPMultiPartSimultaneousAPIClass

getPrpadlength

public int getPrpadlength()
Getter function that returns the property: prpadlength

Returns:
prpadlength - int

getSecret

public SPMap getSecret()
Getter function that returns the property: secret

Returns:
secret - SPHashtable

getSecrettransform

public SPMap getSecrettransform()
Getter function that returns the property: secrettransform

Returns:
secrettransform - SPHashtable

APIcreateTransaction

public static SPTMultiPartSimultaneousClass APIcreateTransaction(SPGameAPIClass gapi,
                                                                 java.lang.String transmaster,
                                                                 java.lang.String[] playerIDList,
                                                                 boolean privateflag)
This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction.

Parameters:
gapi - SPGameAPIInterface - the game that will be associated with this transaction.
transmaster - String - player id of the master of the transaction
playerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.
privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
Returns:
tran - SPMultiPartSimultaneousClass(but returns the actual object) - if successful, null if not

APIBcreateTransaction

public static boolean APIBcreateTransaction(SPGameAPIClass gapi,
                                            java.lang.String transmaster,
                                            java.lang.String[] playerIDList,
                                            boolean privateflag)
This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction.

Parameters:
gapi - SPGameAPIInterface - the game that will be associated with this transaction.
transmaster - String - player id of the master of the transaction
playerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.
privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

APITAOcreateTransaction

public SPTMultiPartSimultaneousAPIClass APITAOcreateTransaction(SPGameAPIClass gapi,
                                                                java.lang.String transmaster,
                                                                java.lang.String[] playerIDList,
                                                                boolean privateflag)
This method allows the creation of a new MultiPartSimultaneous type, internally controlled transaction. It also sends a message to the other transaction and game participants about this new transaction.

Parameters:
gapi - SPGameAPIInterface - the game that will be associated with this transaction.
transmaster - String - player id of the master of the transaction
playerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.
privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
Returns:
tran - SPMultiPartSimultaneousAPIClass - if successful, null if not

gettranstype

public static java.lang.String gettranstype()
This method gets the transaction type.

Returns:
String

registerTransaction

public static boolean registerTransaction()
Registers this transaction.

Returns:

createTransaction

public SPAbstractTransactionInterface createTransaction(SPGameAPIInterface gameapiobj,
                                                        java.lang.String master,
                                                        java.lang.String[] playerIDList,
                                                        boolean privateflag,
                                                        java.lang.String transactionID)
This method creates a SPMultiPartSimultaneousClass transaction.

Specified by:
createTransaction in interface SPAbstractTransactionInterface
Overrides:
createTransaction in class SPAbstractTransactionClass
Parameters:
gameapiobj - SPGameAPIInterface - the game that will be associated with this transaction.
master - String - player id of the master of the transaction
playerIDList - String[] - This is an array that holds the Player IDs of the players within the game that are participating in this transaction.
privateflag - boolean - This is a flag to describe whether the specific transaction is a private transaction to the non-participating Players.
transactionID - String - transaction id.