com.SecurePlay.SPTMultistepTurn
Class SPTMultistepTurnClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.SPTMultistepTurn.SPTMultistepTurnClass
All Implemented Interfaces:
SPAbstractTransactionInterface

public class SPTMultistepTurnClass
extends SPAbstractTransactionClass

This is implements the multistep transaction. See details under Abstract Transaction Class

Author:
IT GlobalSecure
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
SPTMultistepTurnClass(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 Multistep type, internally controlled transaction.
static SPTMultistepTurnClass APIcreateTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new Multistep type, internally controlled transaction.
 int APIgetStepCount()
          This method returns the current number of steps that have been sent
 java.lang.String[] APIgetStepData(int step)
          This method returns the dataList entry associated with the specified step value
 java.lang.String APIgetStepSource(int step)
          This method returns the PlayerID of the sender of a specific transaction step.
 boolean APIrequestsendStep(java.lang.String pid, java.lang.String sender, java.lang.String[] dataentry)
          This shell request method remotely requests another player to send a transaction step
 boolean APIsendStep(java.lang.String sender, java.lang.String[] dataentry)
          This method sends a transaction step to the other transaction participants.
static SPTMultistepTurnAPIClass APITAOcreateTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new MultiStep type, internally controlled transaction.
protected  SPAbstractTransactionInterface buildSPawn()
          This method provides the unique transaction creation services for spawned Multistep transactions
 SPAbstractTransactionInterface createTransaction(SPGameAPIInterface gameapiobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID)
          This method creates a SPMultistepTurnClass transaction.
 java.util.Vector getPrdataList()
          Getter function that returns the property: prdataList
 java.lang.String[] getPrdatasourceList()
          Getter function that returns the property: prdatasourceList
static java.lang.String gettranstype()
          This method gets the transaction type.
 void onrequestsendStep(SPMessageClass incoming)
          This method handles incoming requests for generation of sendStep transactions.
 boolean onsendStep(SPMessageClass incoming)
          This method handles incoming sendStep requests.
 boolean pronincomingTransaction(SPMessageClass incoming)
          This method provides the unique handlers for incoming Multistep turn message types
static boolean registerTransaction()
          Registers this transaction.
protected  boolean spawnConfigure(SPAbstractTransactionInterface a)
          This method provides the unique transaction configuration services for spawned Multistep transactions
 SPTMultistepTurnAPIClass 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, pruniqueinit, 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

SPTMultistepTurnClass

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

Parameters:
gameobj -
master -
playerIDList -
privateflag -
transactionID -
Method Detail

APIgetStepData

public java.lang.String[] APIgetStepData(int step)
This method returns the dataList entry associated with the specified step value

Parameters:
step - int - steps
Returns:
result - String[] - step data in a String array of a specified step

APIgetStepSource

public java.lang.String APIgetStepSource(int step)
This method returns the PlayerID of the sender of a specific transaction step.

Parameters:
step - int - the step
Returns:
result - String - PlayerID of sender of a specified step

APIsendStep

public boolean APIsendStep(java.lang.String sender,
                           java.lang.String[] dataentry)
This method sends a transaction step to the other transaction participants. This is a generic transaction step with no special processing. Any participant in a transaction can send such a step.

Parameters:
sender - String - id of the sender
dataentry - String[] - data of the step in a String array
Returns:
result - Boolean: TRUE, if request successfully sent, FALSE, if not

onsendStep

public boolean onsendStep(SPMessageClass incoming)
This method handles incoming sendStep requests. It processes them to ensure they are valid and ensures that the information is stored appropriately.

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

pronincomingTransaction

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

Overrides:
pronincomingTransaction in class SPAbstractTransactionClass
Parameters:
incoming - SPMessageClass - incoming message
Returns:
result - Boolean: TRUE, if successfully handled, FALSE, if not

APIrequestsendStep

public boolean APIrequestsendStep(java.lang.String pid,
                                  java.lang.String sender,
                                  java.lang.String[] dataentry)
This shell request method remotely requests another player to send a transaction step

Parameters:
pid - String - player id, the master
sender - Stirng - sender id
dataentry - String[] - the data of the step
Returns:
result - Boolean: TRUE, if request successfully sent, FALSE, if not

onrequestsendStep

public void onrequestsendStep(SPMessageClass incoming)
This method handles incoming requests for generation of sendStep transactions. Only the specified player will handle the request, subject to the invoked api rules method.

Parameters:
incoming - SPMessageClass SPMessageClass - incoming message

APIgetStepCount

public int APIgetStepCount()
This method returns the current number of steps that have been sent

Returns:
stepcount - int - number of steps

buildSPawn

protected SPAbstractTransactionInterface buildSPawn()
This method provides the unique transaction creation services for spawned Multistep 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 Multistep 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 SPTMultistepTurnAPIClass SPgetAPI()
Gets this class's API

Returns:
classAPI - SPMultistepTurnAPIClass

getPrdataList

public java.util.Vector getPrdataList()
Getter function that returns the property: prdataList

Returns:
prdataList - List

getPrdatasourceList

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

Returns:
prdatasourceList - String[]

APIcreateTransaction

public static SPTMultistepTurnClass APIcreateTransaction(SPGameAPIClass gapi,
                                                         java.lang.String transmaster,
                                                         java.lang.String[] playerIDList,
                                                         boolean privateflag)
This method allows the creation of a new Multistep 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 - SPMultistepTurnClass(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 Multistep 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 static SPTMultistepTurnAPIClass APITAOcreateTransaction(SPGameAPIClass gapi,
                                                               java.lang.String transmaster,
                                                               java.lang.String[] playerIDList,
                                                               boolean privateflag)
This method allows the creation of a new MultiStep 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 - SPMultistepTurnAPIClass - 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 SPMultistepTurnClass 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.