SecurePlayLibray J2SE
v2.1

com.SecurePlay
Class SPTShipClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.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
private  java.lang.String[] AckList
          This holds the list of SUCCESSFUL acknowledge messages for the current shipment
private  boolean acknowledgeFLAG
          This flag determines whether sent packages need to be acknowledged.
private  int buffersize
          This property determines the maximum size of the shipment that is sent at one time.
private  boolean CompleteFlag
          Flag to indicate shipment complete
private  boolean entireShipmentFLAG
          This flag indicates whether or not entire shipment is stored.
private  SPMap lastReceivedSent
          This stores the last recieved incoming shipments.
private  int lastRecSent
          This value holds the last shipment part number sent.
private  boolean manualSendFLAG
          This flag determines whether MANUAL send is in use.
private  int maxReceiveSendStore
          Maximum acknowledged messages receivecount.
private  java.lang.String mt_ack
           
private  java.lang.String mt_configship
           
private  java.lang.String mt_requestship
           
private  java.lang.String mt_ship
           
private  boolean SendOKFlag
          Flag, ready to send
private  int shipcount
          This value holds the number of shipments SUCCESSFULLY SENT!
private  byte[] shipment
          This holds the currently active/sent shipment - it is held until all Acks are received
private  java.lang.String ShippedObjectClass
          This is the name of the Class that Shipped Object is from.
private  java.lang.String ShippedObjectDistinguishedName
          This is the senders unique name for the class (optional)
private  long totalRecSent
          This value holds the total number of bytes recieved or sent.
private  long totalSize
          This value holds the total size of shipment.
 
Fields inherited from class com.SecurePlay.SPAbstractTransactionClass
AGE, configuration, gameinstance, mt_completeTransaction, mt_error, privateflag, releaseversion, status_error, status_ready, transactionstatus, transtype
 
Fields inherited from class com.SecurePlay.SPRootTransactionClass
comms, EventListenerList, gameID, insend, master, playerIDList, ReSend_altmessage, ReSend_encryptflag, ReSend_messagebody, ReSend_messageID, ReSend_messagetype, ReSend_privateflag, ReSend_receivers, ReSend_sender, secureplay, transactionID
 
Constructor Summary
private SPTShipClass()
          Default Constructor
  SPTShipClass(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID, java.lang.String AGE, boolean AckFlag, boolean ManFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname, byte[] entireshipment)
          Construcotr.
 
Method Summary
 SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj, SPMessageClass message)
          Creates a new instance of an SPSecretClass class.
 byte[] APIgetEntireShipment()
          This method returns the entire shipment, if possible.
 SPMap APIgetLastReceivedSent()
           
 byte[] APIgetLastShipment()
           
 int APIgetShipcount()
           
 byte[] APIgetShipment(int i)
          Return specified recent shipment
 java.lang.String APIgetTransactionType()
          This method returns a String of the transactiontype.
 boolean APIrequestsendShipment(java.lang.String sender)
          This method requests send shipments automatically.
 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.
 boolean APIsetMaxRecieve(int i)
          Allows the maximum size of the byte[] MAP to be increased (growing the size of the buffer).
private  boolean configureTransaction(java.lang.String sender, boolean AckFlag, boolean ManFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname)
          This method just sets the configure parameter of this class much like a setter function.
static SPAbstractTransactionInterface createShip(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String AGE, boolean AckFlag, boolean ManFlag, int bsize, long tsize, java.lang.String classname, java.lang.String instname, byte[] entireshipment)
          This method creates the Ship class
 java.lang.String[] getAckList()
           
 int getBuffersize()
           
 int getLastRecSent()
           
 int getMaxReceiveSendStore()
           
private  java.lang.String[] getPlayersInThisLoc()
          This method retrieves the player id list of players that are internal to this location and are included in this transaction.
 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()
           
private  boolean onrequestsendShipment(SPMessageClass incoming)
           
private  boolean onsendAck(SPMessageClass mess)
          This method handles acknowledgements recieved.
private  boolean onsendShipment(SPMessageClass mess)
          This method recieves shipmetns.
 boolean pronincomingTransaction(SPMessageClass incoming)
          this is a shell for unique incoming transactions
private  boolean putLastReceivedSent(int count, byte[] ship)
          This method adds a shipment to the last recieved sent shipment list.
static boolean registerTransaction()
          Registers this transaction.
private  boolean sendAck(java.lang.String reciever, boolean boolAck, java.lang.String info, int lastSeccessShipCount)
          This method send acknowledgements to the sender of the shipment.
private  boolean sendOneShipment(java.lang.String sender, int shipmentCount, java.lang.String[] recievers, byte[] shipMent, boolean resendflag)
          This method builds a shipment message and sends it.
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionClass
APIcompleteTransaction, APIgetAGE, APIgetConfiguration, APIgetGameinstance, APIgetPrivacyFlag, APIgetTransactionstatus, APIisPlayerInternal, APIisTransError, APIsetTransactionID, logError, onincomingTransaction, prinit, pruniqueinit, setAGE
 
Methods inherited from class com.SecurePlay.SPRootTransactionClass
APIaddListener, APIclearListeners, APIgetGameID, APIgetGetReplayList, APIgetListenerCount, APIgetListeners, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, APIisPlayerIncluded, APIremoveListener, APIReplayRemoveOldSender, APIresendLastMessage, APIsetReplayList, APIsetSecurePlayClass, detectReplay, sendMessage, 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
APIgetGameID, APIgetMaster, APIgetPlayerIDList, APIgetTransactionID, sendMessage
 

Field Detail

mt_ack

private final java.lang.String mt_ack
See Also:
Constant Field Values

mt_ship

private final java.lang.String mt_ship
See Also:
Constant Field Values

mt_requestship

private final java.lang.String mt_requestship
See Also:
Constant Field Values

mt_configship

private final java.lang.String mt_configship
See Also:
Constant Field Values

entireShipmentFLAG

private boolean entireShipmentFLAG
This flag indicates whether or not entire shipment is stored.


acknowledgeFLAG

private boolean acknowledgeFLAG
This flag determines whether sent packages need to be acknowledged.


manualSendFLAG

private boolean manualSendFLAG
This flag determines whether MANUAL send is in use. (TRUE: Manual; FALSE: Automatic)


buffersize

private int buffersize
This property determines the maximum size of the shipment that is sent at one time. If it is set to equal 0, then nothing is stored and all is sent. NOTE: does not make sense to set it to if you are in manual mode, works only with automatic mode.


shipment

private byte[] shipment
This holds the currently active/sent shipment - it is held until all Acks are received


totalSize

private long totalSize
This value holds the total size of shipment. NOTE: the total size is limited by the size of the int, because array types can only support ints as index.


ShippedObjectClass

private java.lang.String ShippedObjectClass
This is the name of the Class that Shipped Object is from.


ShippedObjectDistinguishedName

private java.lang.String ShippedObjectDistinguishedName
This is the senders unique name for the class (optional)


AckList

private java.lang.String[] AckList
This holds the list of SUCCESSFUL acknowledge messages for the current shipment


CompleteFlag

private boolean CompleteFlag
Flag to indicate shipment complete


SendOKFlag

private boolean SendOKFlag
Flag, ready to send


maxReceiveSendStore

private int maxReceiveSendStore
Maximum acknowledged messages receivecount.


lastReceivedSent

private SPMap lastReceivedSent
This stores the last recieved incoming shipments. This can be stored in Array of byte arrays.


shipcount

private int shipcount
This value holds the number of shipments SUCCESSFULLY SENT!


lastRecSent

private int lastRecSent
This value holds the last shipment part number sent.


totalRecSent

private long totalRecSent
This value holds the total number of bytes recieved or sent. NOTE: the total size is limited by the size of the int, because array types can only support ints as index.

Constructor Detail

SPTShipClass

private SPTShipClass()
Default Constructor


SPTShipClass

public SPTShipClass(SPGameInterface gameobj,
                    java.lang.String master,
                    java.lang.String[] playerIDList,
                    boolean privateflag,
                    java.lang.String transactionID,
                    java.lang.String AGE,
                    boolean AckFlag,
                    boolean ManFlag,
                    int bsize,
                    long tsize,
                    java.lang.String classname,
                    java.lang.String instname,
                    byte[] entireshipment)
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

configureTransaction

private boolean configureTransaction(java.lang.String sender,
                                     boolean AckFlag,
                                     boolean ManFlag,
                                     int bsize,
                                     long tsize,
                                     java.lang.String classname,
                                     java.lang.String instname)
This method just sets the configure parameter of this class much like a setter function. It is used by the configure methods.

Parameters:
sender - String - player id of the player who authorized this configure.
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.
Returns:
boolean

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

onsendShipment

private boolean onsendShipment(SPMessageClass mess)
This method recieves shipmetns. It sends acknowledgements to the sender.

Parameters:
mess - SPMessageClass - the message that contains the shipment.
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)
This method requests send shipments automatically.

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

onrequestsendShipment

private boolean onrequestsendShipment(SPMessageClass incoming)

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. This is done by the transaction master. 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

sendOneShipment

private boolean sendOneShipment(java.lang.String sender,
                                int shipmentCount,
                                java.lang.String[] recievers,
                                byte[] shipMent,
                                boolean resendflag)
This method builds a shipment message and sends it. It is used as sender utility function.

Parameters:
sender - String - sender of this shipment.
shipmentCount - int - the shipment number.
recievers - String[] - recievers of this shipment.
shipMent - byte[] - the shipment to be shipped.
resendflag - - boolean - resend flag.
Returns:
boolean

sendAck

private boolean sendAck(java.lang.String reciever,
                        boolean boolAck,
                        java.lang.String info,
                        int lastSeccessShipCount)
This method send acknowledgements to the sender of the shipment.

Parameters:
reciever - String - reciever of the acknowledgement, or the sender of the shipment.
boolAck - boolean - this determines if it is an ACK or a NACK.
info - String - brief description of the ack or an error report of the NACK.
lastSeccessShipCount - int - last good shipment recieved, in case of ACK it should be the last shipment sent.
Returns:
boolean

onsendAck

private boolean onsendAck(SPMessageClass mess)
This method handles acknowledgements recieved.

Parameters:
mess - SPMessageClass - incoming message
Returns:
boolean

putLastReceivedSent

private boolean putLastReceivedSent(int count,
                                    byte[] ship)
This method adds a shipment to the last recieved sent shipment list. it adds them in the order they were sent or reieved, and has a reciever storelimit.

Parameters:
count - int - shipment count.
ship - - byte[] the shipment
Returns:
boolean

pronincomingTransaction

public boolean pronincomingTransaction(SPMessageClass incoming)
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

getPlayersInThisLoc

private java.lang.String[] getPlayersInThisLoc()
This method retrieves the player id list of players that are internal to this location and are included in this transaction.

Returns:
String[]

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.

APIgetLastReceivedSent

public SPMap APIgetLastReceivedSent()
Returns:
Returns the lastreceived series of shipments.

APIsetMaxRecieve

public boolean APIsetMaxRecieve(int i)
Allows the maximum size of the byte[] MAP to be increased (growing the size of the buffer).

Parameters:
i - - int - new size for the array of byte[]s
Returns:
boolean - TRUE, if successful, False, if i < previous value.

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.

APIgetShipcount

public int APIgetShipcount()
Returns:
Returns the shipcount.

APIgetLastShipment

public byte[] APIgetLastShipment()
Returns:
Returns the latest shipment.

APIgetEntireShipment

public byte[] APIgetEntireShipment()
This method returns the entire shipment, if possible.

Returns:
byte[]

APIgetShipment

public byte[] APIgetShipment(int i)
Return specified recent shipment

Parameters:
i - - count of requested shipment
Returns:
byte[] - resulting shipment or NULL, if not successful

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.

gettranstype

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

Returns:
String

registerTransaction

public static boolean registerTransaction()
Registers this transaction.

Returns:
boolean

createShip

public static SPAbstractTransactionInterface createShip(SPGameInterface gameobj,
                                                        java.lang.String master,
                                                        java.lang.String[] playerIDList,
                                                        boolean privateflag,
                                                        java.lang.String AGE,
                                                        boolean AckFlag,
                                                        boolean ManFlag,
                                                        int bsize,
                                                        long tsize,
                                                        java.lang.String classname,
                                                        java.lang.String instname,
                                                        byte[] entireshipment)
This method creates the Ship class

Parameters:
gameobj -
master -
playerIDList -
privateflag -
AGE -
AckFlag -
ManFlag -
bsize -
tsize -
classname -
instname -
entireshipment -
Returns:
SPAbstractTransactionInterface - returns ship class created

APIcreateTransaction

public SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj,
                                                           SPMessageClass message)
Creates a new instance of an SPSecretClass class.

Specified by:
APIcreateTransaction in interface SPAbstractTransactionInterface
Overrides:
APIcreateTransaction in class SPAbstractTransactionClass
Parameters:
gameapiobj - SPGameInterface - game associated with this transaction.
message - SPMessageClass - message that has all the transaction configure info
Returns:
SPAbstractTransactionInterface

APIgetTransactionType

public java.lang.String APIgetTransactionType()
This method returns a String of the transactiontype.

Specified by:
APIgetTransactionType in interface SPAbstractTransactionInterface
Overrides:
APIgetTransactionType in class SPAbstractTransactionClass
Returns:
this.transtype - String - name of transaction type

SecurePlayLibray J2SE
v2.1

2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.