com.SecurePlay.SPTRandom
Class SPTRandomAPIClass

java.lang.Object
  extended bycom.SecurePlay.SPAbstractTransactionAPIClass
      extended bycom.SecurePlay.SPTRandom.SPTRandomAPIClass
All Implemented Interfaces:
SPAbstractTransactionAPIInterface

public class SPTRandomAPIClass
extends SPAbstractTransactionAPIClass

API version of SPRandomClass

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
 
Fields inherited from class com.SecurePlay.SPAbstractTransactionAPIClass
transactioninstance
 
Constructor Summary
SPTRandomAPIClass(SPTRandomClass transactioninstance)
          Overloaded Constructor
 
Method Summary
 boolean APIcompleteTransaction(java.lang.String pid)
          This method overrides the SPAbstractTransactionClass method.
 boolean APIconfigureTransaction(java.lang.String sender, int decksize, boolean replacement, int expiration)
          Thi smethod configures this Random class.
 boolean APIconfigureTransaction(java.lang.String sender, java.lang.String[] configarr)
          This method allows the Transaction Master ONLY to configure the transactions unique parameters.
 boolean APIgenerateRandomEvent(java.lang.String sender, java.lang.String[] receivers, boolean privacy, int count)
          This method handles either requests or local generation of random events by the Random master.
 java.lang.String[] APIgetlastRandomEvents()
          This method returns an array that includes the last set of random events provided by the Random master.
 int APIgetRandomEvent(int index)
          This method returns a random event from the dealtEventList property as specified by the index.
 boolean rulesconfigureTransaction(java.lang.String pid, java.lang.String[] configarr, SPAbstractTransactionInterface transobj)
          This shell method supports remote requests to configure an existing transaction.
 boolean rulesgenerateRandomEvent(java.lang.String source, java.lang.String[] receivers, boolean privacy, int count, SPTRandomClass transobj)
          This is a shell function to request the remote invocation of a generateRandomEvents method.
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionAPIClass
APIAddListener, APIbeginTransaction, APIClearListeners, APIGetListenerCount, APIGetListeners, APIRemoveListener, APIrequestbeginTransaction, APIrequestCompleteTransaction, APIrequestconfigureTransaction, APISPawn, getTransactioninstance, rulesbeginTransaction, rulescompleteTransaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPTRandomAPIClass

public SPTRandomAPIClass(SPTRandomClass transactioninstance)
Overloaded Constructor

Parameters:
transactioninstance -
Method Detail

APIcompleteTransaction

public boolean APIcompleteTransaction(java.lang.String pid)
This method overrides the SPAbstractTransactionClass method. It supports the distribution of the Random master player key to allow the Random to be subsequently verified.

Specified by:
APIcompleteTransaction in interface SPAbstractTransactionAPIInterface
Overrides:
APIcompleteTransaction in class SPAbstractTransactionAPIClass
Parameters:
pid - String - ID of requesting Player
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIconfigureTransaction

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

Specified by:
APIconfigureTransaction in interface SPAbstractTransactionAPIInterface
Overrides:
APIconfigureTransaction in class SPAbstractTransactionAPIClass
Parameters:
sender - String - id of the configurer, must be internal.
configarr - String[] - the configuration array, with configuration details inside.
Returns:
result - Boolean: TRUE if successful, FALSE, if unsuccessful

APIconfigureTransaction

public boolean APIconfigureTransaction(java.lang.String sender,
                                       int decksize,
                                       boolean replacement,
                                       int expiration)
Thi smethod configures this Random class.

Parameters:
sender - String - sender
decksize - int - deck size
replacement - boolean - replacement true or false
expiration - int - expiration
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIgenerateRandomEvent

public boolean APIgenerateRandomEvent(java.lang.String sender,
                                      java.lang.String[] receivers,
                                      boolean privacy,
                                      int count)
This method handles either requests or local generation of random events by the Random master. Either a request message will be sent to the Random master or the Random master will generate the number of random events specified by (count) and send them to the specified receivers. This value is protected based on the privacy flag.

Parameters:
sender - String - sender
receivers - String - player id list of the recievers
privacy - boolean - privacy policy
count - int - the number of random events to be generated
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIgetlastRandomEvents

public java.lang.String[] APIgetlastRandomEvents()
This method returns an array that includes the last set of random events provided by the Random master.

Returns:
rmevents - String[] - the last batch of random events

APIgetRandomEvent

public int APIgetRandomEvent(int index)
This method returns a random event from the dealtEventList property as specified by the index.

Parameters:
index - int - the specifier of the random event
Returns:
rmevent - int - the corresponding dealtEventList entry to the index

rulesgenerateRandomEvent

public boolean rulesgenerateRandomEvent(java.lang.String source,
                                        java.lang.String[] receivers,
                                        boolean privacy,
                                        int count,
                                        SPTRandomClass transobj)
This is a shell function to request the remote invocation of a generateRandomEvents method. This is probably the most likely rules function to be overwritten by game specific rules logic

Parameters:
source - String - source
receivers - String[] - receivers
privacy - boolean - privace flag
count - int - count
transobj - SPRandomClass - the Random class
Returns:
Boolean - TRUE, if request accepted, 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.

Specified by:
rulesconfigureTransaction in interface SPAbstractTransactionAPIInterface
Overrides:
rulesconfigureTransaction in class SPAbstractTransactionAPIClass
Parameters:
pid - String - player id of the requester
configarr - Vector - configuration details in a vactor
transobj - SPAbstractTransactionClass - the transaction to be configured
Returns:
result - Boolean: TRUE, if allowed, FALSE, if not