com.SecurePlay
Interface SPAbstractTransactionAPIInterface

All Known Implementing Classes:
SPAbstractTransactionAPIClass

public interface SPAbstractTransactionAPIInterface

This is the interface for all the transaction APIs including abstract.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Method Summary
 boolean APIAddListener(SPEventInterface gameobj)
          This method adds a listener object for Game API events
 boolean APIbeginTransaction(java.lang.String pid)
          This action can only be initiated by the Transaction master.
 boolean APIClearListeners()
          This method clears the listener objects for Game API events
 boolean APIcompleteTransaction(java.lang.String pid)
          This method allows the Transaction Master ONLY to complete the transaction.
 boolean APIconfigureTransaction(java.lang.String pid, java.lang.String[] args)
          This method allows the Transaction Master ONLY to configure the transactions unique parameters.
 int APIGetListenerCount()
          This method returns the number of listener objects for Game API events
 java.lang.Object[] APIGetListeners()
          This method returns a list of listener objects for Game API events
 boolean APIRemoveListener(SPEventInterface gameobj)
          This method removes a listener object for Game API events
 boolean APIrequestbeginTransaction(java.lang.String pid)
          This method allows any transaction participant excluding the Transaction master to request that the transaction be begun.
 boolean APIrequestCompleteTransaction(java.lang.String pid)
          This method allows any player, excluding the Transaction master to request that the transactoin be completed.
 boolean APIrequestconfigureTransaction(java.lang.String pid, java.lang.String[] args)
          This method allows any player, excluding the Transaction master, to request that the transaction be configured as described in the configuration array.
 java.lang.String APISPawn(java.lang.String pid)
          This method creates a new transaction with the identical participants and configuration as the spawning transaction.
 SPAbstractTransactionInterface getTransactioninstance()
          Getter function that gets the transaction instance
 boolean rulesbeginTransaction(java.lang.String pid, SPAbstractTransactionInterface transobj)
          This shell method determines if an existing transaction object can be "begun" from a remote request.
 boolean rulescompleteTransaction(java.lang.String pid, SPAbstractTransactionInterface transobj)
          This shell method handles remote requests to complete an existing transaction.
 boolean rulesconfigureTransaction(java.lang.String pid, java.lang.String[] configarr, SPAbstractTransactionInterface transobj)
          This shell method supports remote requests to configure an existing transaction.
 

Method Detail

APIbeginTransaction

public boolean APIbeginTransaction(java.lang.String pid)
This action can only be initiated by the Transaction master. It sends a "beginTransaction" message to all of the transaction participants. A Transaction can only be begun if it has been successfully configured.

Parameters:
pid - String - id of the transaction beginner, must be the master and internal.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIcompleteTransaction

public boolean APIcompleteTransaction(java.lang.String pid)
This method allows the Transaction Master ONLY to complete the transaction. Transactions that are in an error state cannot be cleared by completion.

Parameters:
pid - String - id of the player who is completing the transaction, must be the master and internal.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not.

APIconfigureTransaction

public boolean APIconfigureTransaction(java.lang.String pid,
                                       java.lang.String[] args)
This method allows the Transaction Master ONLY to configure the transactions unique parameters. NOTE, this method will be overridden for individual transaction types.

Parameters:
pid - String - id of the configurer, must be internal.
args - String[] - the configuration array, with configuration details inside.
Returns:
result - Boolean: TRUE if successful, FALSE, if unsuccessful

APIrequestbeginTransaction

public boolean APIrequestbeginTransaction(java.lang.String pid)
This method allows any transaction participant excluding the Transaction master to request that the transaction be begun. This can only be done after the transaction has been configured.

Parameters:
pid - String - the id of the requestor, can not be master, must be internal
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIrequestCompleteTransaction

public boolean APIrequestCompleteTransaction(java.lang.String pid)
This method allows any player, excluding the Transaction master to request that the transactoin be completed.

Parameters:
pid - String - id of the requestor, can not be the master, must be internal.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIrequestconfigureTransaction

public boolean APIrequestconfigureTransaction(java.lang.String pid,
                                              java.lang.String[] args)
This method allows any player, excluding the Transaction master, to request that the transaction be configured as described in the configuration array.

Parameters:
pid - String - the configure requestor, can not be the master, must be internal.
args - String[] - the configuration array, with configuration details.
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

rulesbeginTransaction

public boolean rulesbeginTransaction(java.lang.String pid,
                                     SPAbstractTransactionInterface transobj)
This shell method determines if an existing transaction object can be "begun" from a remote request.

Parameters:
pid - String - player id of the transaction beginner
transobj - SPAbstractTransactionInterface - the transaction object to be begun
Returns:
result - Boolean: TRUE, if allowed, FALSE, if not

rulescompleteTransaction

public boolean rulescompleteTransaction(java.lang.String pid,
                                        SPAbstractTransactionInterface transobj)
This shell method handles remote requests to complete an existing transaction. Only the transaction master can actually complete the transaction.

Parameters:
pid - String - player id of the completer of the transaction
transobj - SPAbstractTransactionInterface - the transaction object to be completed
Returns:
result - Boolean: TRUE, if allowed, FALSE, if not

rulesconfigureTransaction

public boolean rulesconfigureTransaction(java.lang.String pid,
                                         java.lang.String[] configarr,
                                         SPAbstractTransactionInterface transobj)
This shell method supports remote requests to configure an existing transaction. Only the transaction master can actually configure the transaction.

Parameters:
pid - String - player id of the configurer, must be the master
configarr - String[] - the configuration array with the configuration details.
transobj - SPAbstractTransactionInterface - the transaction to be configured
Returns:
result - Boolean: TRUE, if allowed, FALSE, if not

APIAddListener

public boolean APIAddListener(SPEventInterface gameobj)
This method adds a listener object for Game API events

Parameters:
gameobj - SPEventInterface - the object to be added, that inplement the listener interface
Returns:
Boolean - TRUE, if successful, FALSE, if not

APIRemoveListener

public boolean APIRemoveListener(SPEventInterface gameobj)
This method removes a listener object for Game API events

Parameters:
gameobj - SPEventInterface - the object to be removed, that inplement the listener interface

APIGetListeners

public java.lang.Object[] APIGetListeners()
This method returns a list of listener objects for Game API events

Returns:
obj - Object[] - array of listener objects

APIClearListeners

public boolean APIClearListeners()
This method clears the listener objects for Game API events

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

APIGetListenerCount

public int APIGetListenerCount()
This method returns the number of listener objects for Game API events

Returns:
count - int - the number of listeners

APISPawn

public java.lang.String APISPawn(java.lang.String pid)
This method creates a new transaction with the identical participants and configuration as the spawning transaction.

Parameters:
pid - String - player id must be master of the transaction
Returns:
tid - String - transaction id of the new spawned transaction.

getTransactioninstance

public SPAbstractTransactionInterface getTransactioninstance()
Getter function that gets the transaction instance

Returns:
traninstance - SPAbstractTransactionInterface