com.SecurePlay.SPTShip
Class SPTShipClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.SPTShip.SPTShipClass
All Implemented Interfaces:
SPAbstractTransactionInterface

public class SPTShipClass
extends SPAbstractTransactionClass

This transaction supports the distribution of Serializable Objects (Classes, Files, Etc.) as well as the slow, incremental distribution.

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
SPTShipClass(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID)
          Construcotr.
 
Method Summary
 boolean APIBcreateShipTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new Ship type, internally controlled transaction.
 boolean APIbeginTransaction(java.lang.String pid)
          DUMMY METHOD!!!
 boolean APIconfigureTransaction(java.lang.String sender, boolean AckFlag, boolean ManFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname, byte[] entireshipment)
          Configure transaction method.
 boolean APIconfigureTransaction(java.lang.String sender, boolean AckFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname)
          Configure transaction method.
 boolean APIconfigureTransaction(java.lang.String pid, java.lang.String[] args)
          DUMMY METHOD!!!
 SPTShipClass APIcreateShipTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new Ship type, internally controlled transaction.
 boolean APIrequestbeginTransaction(java.lang.String pid)
          DUMMY METHOD!!!
 boolean APIrequestConfigureTransaction(java.lang.String sender, boolean AckFlag, boolean ManFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname, byte[] entireshipment)
          Configure transaction method.
 boolean APIrequestConfigureTransaction(java.lang.String sender, boolean AckFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname)
          Configure transaction method.
 boolean APIrequestconfigureTransaction(java.lang.String pid, java.lang.String[] args)
          DUMMY METHOD!!!
 boolean APIrequestsendShipment(java.lang.String sender)
          This method requests send shipments automatically.
 boolean APIrequestsendShipment(java.lang.String sender, byte[] manualShip)
          This method requests sends a shipment manually.
 boolean APIresendShipment(java.lang.String sender, int shipcount, java.lang.String[] recieverIdList)
          This shipment sends the specified shipment, grabbed from the last sent list using the shipment number, to the specified players.
 boolean APIsendShipment(java.lang.String sender)
          This method send shipments automatically.
 boolean APIsendShipment(java.lang.String sender, byte[] manualShip)
          This method sends a shipment manually.
 java.lang.String APISPawn(java.lang.String pid)
          DUMMY METHOD!!!
 SPTShipAPIClass APITAOcreateShipTransaction(SPGameAPIClass gapi, java.lang.String transmaster, java.lang.String[] playerIDList, boolean privateflag)
          This method allows the creation of a new ShipAPI type, internally controlled transaction.
 SPAbstractTransactionInterface createTransaction(SPGameAPIInterface gameapiobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID)
          This method creates a SPSHipClass transaction.
 java.lang.String[] getAckList()
           
 int getBuffersize()
           
 SPMap getLastReceivedSent()
           
 int getLastRecSent()
           
 int getMaxReceiveSendStore()
           
 int getShipcount()
           
 byte[] getShipment()
           
 java.lang.String getShippedObjectClass()
           
 java.lang.String getShippedObjectDistinguishedName()
           
 long getTotalRecSent()
           
 long getTotalSize()
           
static java.lang.String gettranstype()
          This method gets the transaction type.
 boolean isAcknowledgeFLAG()
           
 boolean isCompleteFlag()
           
 boolean isEntireShipmentFLAG()
           
 boolean isManualSendFLAG()
           
 boolean isSendOKFlag()
           
protected  boolean onconfigureTransaction(SPMessageClass incoming)
          This method configures this transaction when a configure transaction message is recieved.
protected  void onrequestconfigureTransaction(SPMessageClass incoming)
          This method safely handles a request from a player who is not the Transaction master to configure the transaction.
protected  boolean pronincomingTransaction(SPMessageClass incoming)
          this is a shell for unique incoming transactions
static boolean registerTransaction()
          Registers this transaction.
 SPTShipAPIClass SPgetAPI()
           
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionClass
APIcompleteTransaction, APIgetGameBlock, APIrequestCompleteTransaction, APIsetGameBlock, buildSPawn, getClassAPI, getConfiguration, getGameinstance, getLasterror, getPrivacyFlag, getTransactionstatus, getTransactionType, isPlayerInternal, isPrivateflag, logError, onbeginTransaction, onconfigureTransaction, onincomingTransaction, onrequestbeginTransaction, onrequestcompleteTransaction, onSpawn, pruniqueinit, sendMessage, setGameBlock, setTransactionID, spawnConfigure, 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

SPTShipClass

public SPTShipClass(SPGameInterface gameobj,
                    java.lang.String master,
                    java.lang.String[] playerIDList,
                    boolean privateflag,
                    java.lang.String transactionID)
Construcotr.

Parameters:
gameobj - SPGameInterface - game associated with this transaction.
master - String - the master of this transaction.
playerIDList - String[] - player id list of player who are included in this transaction.
privateflag - boolean - private flag.
transactionID - String - transactino id.
Method Detail

APIconfigureTransaction

public boolean APIconfigureTransaction(java.lang.String sender,
                                       boolean AckFlag,
                                       int bsize,
                                       long tsize,
                                       java.lang.String classname,
                                       java.lang.String instname)
Configure transaction method. This method configures without the entire shipment set. Because entire shipment is not set manual flag is set to true.

Parameters:
sender - String - player id who is configuring this transaction.
AckFlag - boolean - acknowledgement flag, flag whether or not achknowledgements should be expected before next send of the shipment.
bsize - int - buffer size.
tsize - long - total size. (NOTE: the total size is limited by the size of the int, because array types can only support ints as index.)
classname - String - class name.
instname - String - instance name.
Returns:
boolean

APIconfigureTransaction

public boolean APIconfigureTransaction(java.lang.String sender,
                                       boolean AckFlag,
                                       boolean ManFlag,
                                       int bsize,
                                       long tsize,
                                       java.lang.String classname,
                                       java.lang.String instname,
                                       byte[] entireshipment)
Configure transaction method. This method configures with the entire shipment set. Because entire shipment is set the manual flag can be either true or false.

Parameters:
sender - String - player id who is configuring this transaction.
AckFlag - boolean - acknowledgement flag, flag whether or not achknowledgements should be expected before next send of the shipment.
ManFlag - boolean - manual flag, flag for manual or automatic shipment sending.
bsize - int - buffer size.
tsize - long - total size. (NOTE: the total size is limited by the size of the int, because array types can only support ints as index.)
classname - String - class name.
instname - String - instance name.
entireshipment - byte[] - the entire shipment.
Returns:
boolean

APIrequestConfigureTransaction

public boolean APIrequestConfigureTransaction(java.lang.String sender,
                                              boolean AckFlag,
                                              int bsize,
                                              long tsize,
                                              java.lang.String classname,
                                              java.lang.String instname)
Configure transaction method. This method requests to configures without the entire shipment set. Because entire shipment is not set manual flag is set to true.

Parameters:
sender - String - player id who is configuring this transaction.
AckFlag - boolean - acknowledgement flag, flag whether or not achknowledgements should be expected before next send of the shipment.
bsize - int - buffer size.
tsize - long - total size. (NOTE: the total size is limited by the size of the int, because array types can only support ints as index.)
classname - String - class name.
instname - String - instance name.
Returns:
boolean

APIrequestConfigureTransaction

public boolean APIrequestConfigureTransaction(java.lang.String sender,
                                              boolean AckFlag,
                                              boolean ManFlag,
                                              int bsize,
                                              long tsize,
                                              java.lang.String classname,
                                              java.lang.String instname,
                                              byte[] entireshipment)
Configure transaction method. This method requests to configures with the entire shipment set. Because entire shipment is set the manual flag can be either true or false.

Parameters:
sender - String - player id who is configuring this transaction.
AckFlag - boolean - acknowledgement flag, flag whether or not achknowledgements should be expected before next send of the shipment.
ManFlag - boolean - manual flag, flag for manual or automatic shipment sending.
bsize - int - buffer size.
tsize - long - total size. (NOTE: the total size is limited by the size of the int, because array types can only support ints as index.)
classname - String - class name.
instname - String - instance name.
entireshipment - byte[] - the entire shipment.
Returns:
boolean

onconfigureTransaction

protected boolean onconfigureTransaction(SPMessageClass incoming)
This method configures this transaction when a configure transaction message is recieved.

Overrides:
onconfigureTransaction in class SPAbstractTransactionClass
Parameters:
incoming - SPMessageClass - the incoming configure transaction message.
Returns:
boolean

onrequestconfigureTransaction

protected void onrequestconfigureTransaction(SPMessageClass incoming)
This method safely handles a request from a player who is not the Transaction master to configure the transaction.

Overrides:
onrequestconfigureTransaction in class SPAbstractTransactionClass
Parameters:
incoming - SPMessageClass - incomng message

APIsendShipment

public boolean APIsendShipment(java.lang.String sender,
                               byte[] manualShip)
This method sends a shipment manually.

Parameters:
sender - String - sender of this shipment (master of the transaction)
manualShip - byte[] - the shipment to be sent.
Returns:
boolean

APIsendShipment

public boolean APIsendShipment(java.lang.String sender)
This method send shipments automatically.

Parameters:
sender - String - sender of this shipment.
Returns:
boolean

APIrequestsendShipment

public boolean APIrequestsendShipment(java.lang.String sender,
                                      byte[] manualShip)
This method requests sends a shipment manually.

Parameters:
sender - String - sender of this shipment (master of the transaction)
manualShip - byte[] - the shipment to be sent.
Returns:
boolean

APIrequestsendShipment

public boolean APIrequestsendShipment(java.lang.String sender)
This method requests send shipments automatically.

Parameters:
sender - String - sender of this shipment.
Returns:
boolean

APIresendShipment

public boolean APIresendShipment(java.lang.String sender,
                                 int shipcount,
                                 java.lang.String[] recieverIdList)
This shipment sends the specified shipment, grabbed from the last sent list using the shipment number, to the specified players. NOTE: This method is most likely to be used to send last sent shipments to players who sent nacks for the shipment.

Parameters:
sender -
shipcount -
recieverIdList -
Returns:
boolean

pronincomingTransaction

protected boolean pronincomingTransaction(SPMessageClass incoming)
Description copied from class: SPAbstractTransactionClass
this is a shell for unique incoming transactions

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

APIconfigureTransaction

public boolean APIconfigureTransaction(java.lang.String pid,
                                       java.lang.String[] args)
DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! This configureTransaction method overrides the method in SPAbstractTransactionClass. It is only a dummy function that prevents confusion between configureTransaction methods.

Overrides:
APIconfigureTransaction in class SPAbstractTransactionClass
Parameters:
pid - String - dummy pid.
args - String[] - dummy args array.
Returns:
boolean - always returns false.

APIrequestconfigureTransaction

public boolean APIrequestconfigureTransaction(java.lang.String pid,
                                              java.lang.String[] args)
DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! This APIconfigureTransaction method overrides the method in SPAbstractTransactionClass. It is only a dummy function that prevents confusion between configureTransaction methods.

Overrides:
APIrequestconfigureTransaction in class SPAbstractTransactionClass
Parameters:
pid - String - dummy pid.
args - String[] - dummy args array.
Returns:
boolean - always returns false.

APIbeginTransaction

public boolean APIbeginTransaction(java.lang.String pid)
DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! This method overrides the begin bethod in SPAbstractTransactionClass. It is only a dumm function that prevents people from using it. This SPSHipClass does not need to be begun. All it needs is to be configured and the then its ready to send shipments.

Overrides:
APIbeginTransaction in class SPAbstractTransactionClass
Parameters:
pid - String - dummy pid.
Returns:
boolean - always returns false.

APIrequestbeginTransaction

public boolean APIrequestbeginTransaction(java.lang.String pid)
DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! This method overrides the request begin bethod in SPAbstractTransactionClass. It is only a dumm function that prevents people from using it. This SPSHipClass does not need to be begun. All it needs is to be configured and the then its ready to send shipments.

Overrides:
APIrequestbeginTransaction in class SPAbstractTransactionClass
Parameters:
pid - String - dummy pid.
Returns:
boolean - always returns false.

APISPawn

public java.lang.String APISPawn(java.lang.String pid)
DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!! DUMMY METHOD!!!

Overrides:
APISPawn in class SPAbstractTransactionClass
Parameters:
pid - String - player id must be master of the transaction
Returns:
tid - String - transaction id of the new spawned transaction.

getAckList

public java.lang.String[] getAckList()
Returns:
Returns the ackList.

isAcknowledgeFLAG

public boolean isAcknowledgeFLAG()
Returns:
Returns the acknowledgeFLAG.

getBuffersize

public int getBuffersize()
Returns:
Returns the buffersize.

isCompleteFlag

public boolean isCompleteFlag()
Returns:
Returns the completeFlag.

isEntireShipmentFLAG

public boolean isEntireShipmentFLAG()
Returns:
Returns the entireShipmentFLAG.

getLastReceivedSent

public SPMap getLastReceivedSent()
Returns:
Returns the lastreceived.

getLastRecSent

public int getLastRecSent()
Returns:
Returns the lastsent.

isManualSendFLAG

public boolean isManualSendFLAG()
Returns:
Returns the manualSendFLAG.

getMaxReceiveSendStore

public int getMaxReceiveSendStore()
Returns:
Returns the maxreceivestore.

isSendOKFlag

public boolean isSendOKFlag()
Returns:
Returns the sendOKFlag.

getShipcount

public int getShipcount()
Returns:
Returns the shipcount.

getShipment

public byte[] getShipment()
Returns:
Returns the shipment.

getShippedObjectClass

public java.lang.String getShippedObjectClass()
Returns:
Returns the shippedObjectClass.

getShippedObjectDistinguishedName

public java.lang.String getShippedObjectDistinguishedName()
Returns:
Returns the shippedObjectDistinguishedName.

getTotalSize

public long getTotalSize()
Returns:
Returns the totalSize.

getTotalRecSent

public long getTotalRecSent()
Returns:
Returns the totalRecSent.

SPgetAPI

public SPTShipAPIClass SPgetAPI()
Returns:
Returns the api of this class. SPSHipClass

APIcreateShipTransaction

public SPTShipClass APIcreateShipTransaction(SPGameAPIClass gapi,
                                             java.lang.String transmaster,
                                             java.lang.String[] playerIDList,
                                             boolean privateflag)
This method allows the creation of a new Ship 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 - SPSHipClass - (but returns the actual object) - if successful, null if not

APIBcreateShipTransaction

public boolean APIBcreateShipTransaction(SPGameAPIClass gapi,
                                         java.lang.String transmaster,
                                         java.lang.String[] playerIDList,
                                         boolean privateflag)
This method allows the creation of a new Ship 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.

APITAOcreateShipTransaction

public SPTShipAPIClass APITAOcreateShipTransaction(SPGameAPIClass gapi,
                                                   java.lang.String transmaster,
                                                   java.lang.String[] playerIDList,
                                                   boolean privateflag)
This method allows the creation of a new ShipAPI 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 - SPSHipAPIClass - 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 SPSHipClass 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.