SecurePlayLibray J2SE
v2.1

com.SecurePlay
Class SPTStrobeClass

java.lang.Object
  extended bycom.SecurePlay.SPRootTransactionClass
      extended bycom.SecurePlay.SPAbstractTransactionClass
          extended bycom.SecurePlay.SPTStrobeClass
All Implemented Interfaces:
SPAbstractTransactionInterface
Direct Known Subclasses:
SPTActClass

public class SPTStrobeClass
extends SPAbstractTransactionClass

The Strobe Class is used to provide securely synchronized game play. This is essentially a combination of the Multipart transaction and the Simultaneous transaction. Each participant sends a simultaneous message to the others. Once all sent, then a “tick” or event has occurred. Then another message can be sent and the first message read.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
private  boolean Aactive
          This property indicates which set of simultaneous events can be written (Aactive – boolean TRUE for the A bank) or read (Aactive – boolean TRUE for the B bank)
private  boolean internalsent
           
(package private) static java.lang.String mt_revealSecret
          Static message types that this transaction supports.
(package private) static java.lang.String mt_sendHiddenSecret
          Static message types that this transaction supports.
private  int prpadlength
          This is a private,constant property.
private  SPMap secretA
          This an associative array of simultaneous secrets string Arrays that are being protected through the Simultaneous transaction.
private  SPMap secretB
          This property holds the alternate set of Simultaneous secrets
private  SPMap secrettransformA
          This property is the associative array of irreversible transforms of the secretpadded strings.
private  SPMap secrettransformB
          This property holds the alternate set of Simultaneous secret transformss
(package private) static java.lang.String status_allsent
          transaction status error variable
 
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
SPTStrobeClass()
          Default Constructor
SPTStrobeClass(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String transactionID, java.lang.String AGE, java.lang.String[] configarr)
          Overloaded Constructor
 
Method Summary
private  boolean AActive()
          This method returns whether the “A” bank is active – boolean TRUE - or the “B” bank is active – boolean FALSE.
 SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj, SPMessageClass message)
          Creates a new instance of an SPSecretClass class.
 java.lang.String[] APIgetSecret(java.lang.String sender)
          This method returns the actual secret for the specified player that this STROBE step is protecting, if available.
 java.lang.String APIgetTransactionType()
          This method returns a String of the transactiontype.
 boolean APIsendHiddenSecret(java.lang.String sender, java.lang.String[] newsecret)
          This method allows the specified transaction participant to send the transform of a secret to the other participants in the Simultaneous transaction.
 boolean APIverifyStrobeStep()
          This method verifies whether the just completed STROBE step is valid.
private  boolean BActive()
          This method returns whether the “B” bank is active – boolean TRUE - or the “A” bank is active – boolean FALSE.
static SPAbstractTransactionInterface createStrobe(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String AGE, java.lang.String[] configarr)
          This method creates a SPTStrobeClass transaction.
private  void FlushActive()
          This method resets the transaction that is being read so it can be written by emptying it of info and resetting it.
 int getPrpadlength()
          Getter function that returns the property: prpadlength
 SPMap getSecretA()
          Getter function that returns the property: secretA
 SPMap getSecretB()
          Getter function that returns the property: secretB
 SPMap getSecrettransformA()
          Getter function that returns the property: secrettransformA
 SPMap getSecrettransformB()
          Getter function that returns the property: secrettransformB
static java.lang.String gettranstype()
          This method gets the transaction type.
 boolean isAactive()
          Getter function that returns the property: Aactive
private  boolean isStrobeBankComplete()
           
private  boolean onrevealSecret(SPMessageClass incoming)
          This method handles the incoming message to reveal a secret.
private  boolean onsendHiddenSecret(SPMessageClass incoming)
          This method handles incoming sendHiddenSecret messages.
private  boolean prcheckallsent()
          This method checks to see if all hidden secrets have been sent.
 boolean pronincomingTransaction(SPMessageClass incoming)
          This method provides the unique handlers for incoming Strobe turn message types
private  boolean prsendinternalSecrets()
          This method safely sends all of the internal Secrets from participants in the Simultaneous transaction to remote players.
 void pruniqueinit()
          Uniques initialization
static boolean registerTransaction()
          Registers this transaction.
private  void SwitchActive()
          This method switches whether the A bank is active or the B bank is active
 
Methods inherited from class com.SecurePlay.SPAbstractTransactionClass
APIcompleteTransaction, APIgetAGE, APIgetConfiguration, APIgetGameinstance, APIgetPrivacyFlag, APIgetTransactionstatus, APIisPlayerInternal, APIisTransError, APIsetTransactionID, logError, onincomingTransaction, prinit, 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

prpadlength

private final int prpadlength
This is a private,constant property. It is used to specify the length of the random padding to a transmitted secret. The random padding is necessary to prevent dictionary attacks against secrets. The default setting is 20. Please set appropriately to meet the specific client needs.

See Also:
Constant Field Values

secretA

private SPMap secretA
This an associative array of simultaneous secrets string Arrays that are being protected through the Simultaneous transaction.


secrettransformA

private SPMap secrettransformA
This property is the associative array of irreversible transforms of the secretpadded strings. The secrettransform is sent first to make the secret unmodifiable.


secretB

private SPMap secretB
This property holds the alternate set of Simultaneous secrets


secrettransformB

private SPMap secrettransformB
This property holds the alternate set of Simultaneous secret transformss


Aactive

private boolean Aactive
This property indicates which set of simultaneous events can be written (Aactive – boolean TRUE for the A bank) or read (Aactive – boolean TRUE for the B bank)


internalsent

private boolean internalsent

mt_sendHiddenSecret

static final java.lang.String mt_sendHiddenSecret
Static message types that this transaction supports.

See Also:
Constant Field Values

mt_revealSecret

static final java.lang.String mt_revealSecret
Static message types that this transaction supports.

See Also:
Constant Field Values

status_allsent

static final java.lang.String status_allsent
transaction status error variable

See Also:
Constant Field Values
Constructor Detail

SPTStrobeClass

public SPTStrobeClass()
Default Constructor


SPTStrobeClass

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

Parameters:
gameobj - SPGameInterface - the game object with which the transaction is associated
master - String - the master of the transaction
playerIDList - String[] - player id list of players who are associated with the transaction
privateflag - boolean - private flag
transactionID - String - the transaction id
Method Detail

pruniqueinit

public void pruniqueinit()
Uniques initialization

Overrides:
pruniqueinit in class SPAbstractTransactionClass

APIsendHiddenSecret

public boolean APIsendHiddenSecret(java.lang.String sender,
                                   java.lang.String[] newsecret)
This method allows the specified transaction participant to send the transform of a secret to the other participants in the Simultaneous transaction.

Parameters:
sender - String - sender of the secret
newsecret - String - the secret
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIverifyStrobeStep

public boolean APIverifyStrobeStep()
This method verifies whether the just completed STROBE step is valid.

Returns:
result - Boolean: TRUE, if transaction verified, FALSE, if not.

APIgetSecret

public java.lang.String[] APIgetSecret(java.lang.String sender)
This method returns the actual secret for the specified player that this STROBE step is protecting, if available.

Parameters:
sender - String - sender of the secret
Returns:
secret - String - the secret

onsendHiddenSecret

private boolean onsendHiddenSecret(SPMessageClass incoming)
This method handles incoming sendHiddenSecret messages. These messages include the secrettransform and can sent by any transaction participant.

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

prcheckallsent

private boolean prcheckallsent()
This method checks to see if all hidden secrets have been sent. Once it does, it triggers the revealing of local secrets


prsendinternalSecrets

private boolean prsendinternalSecrets()
This method safely sends all of the internal Secrets from participants in the Simultaneous transaction to remote players. It is automatically triggered by the onsendHiddenSecret method/event once all incoming secret transforms have been received.

Returns:
result - Boolean: TRUE, if all internal secrets successfully sent, FALSE, if not.

onrevealSecret

private boolean onrevealSecret(SPMessageClass incoming)
This method handles the incoming message to reveal a secret. The message can come from any participant in the transaction and should include the secretpadded as its sole content. Once all of the secrettransforms have been received, this method will trigger the sending of all local secrets via the prsendInternalSecrets method.

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

isStrobeBankComplete

private boolean isStrobeBankComplete()

pronincomingTransaction

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

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

BActive

private boolean BActive()
This method returns whether the “B” bank is active – boolean TRUE - or the “A” bank is active – boolean FALSE.

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

AActive

private boolean AActive()
This method returns whether the “A” bank is active – boolean TRUE - or the “B” bank is active – boolean FALSE.

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

SwitchActive

private void SwitchActive()
This method switches whether the A bank is active or the B bank is active


FlushActive

private void FlushActive()
This method resets the transaction that is being read so it can be written by emptying it of info and resetting it.


isAactive

public boolean isAactive()
Getter function that returns the property: Aactive

Returns:
Aactive

getPrpadlength

public int getPrpadlength()
Getter function that returns the property: prpadlength

Returns:
prpadlength - int

getSecretA

public SPMap getSecretA()
Getter function that returns the property: secretA

Returns:
secretA - SPHashtable

getSecretB

public SPMap getSecretB()
Getter function that returns the property: secretB

Returns:
secretB - SPHashtable

getSecrettransformA

public SPMap getSecrettransformA()
Getter function that returns the property: secrettransformA

Returns:
secrettransformA - SPHashtable

getSecrettransformB

public SPMap getSecrettransformB()
Getter function that returns the property: secrettransformB

Returns:
secrettransformB - SPHashtable

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

createStrobe

public static SPAbstractTransactionInterface createStrobe(SPGameInterface gameobj,
                                                          java.lang.String master,
                                                          java.lang.String[] playerIDList,
                                                          boolean privateflag,
                                                          java.lang.String AGE,
                                                          java.lang.String[] configarr)
This method creates a SPTStrobeClass transaction.

Parameters:
gameobj -
master -
playerIDList -
privateflag -
AGE -
configarr -
Returns:
SPAbstractTransactionInterface - returns Strobe 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 class with all the 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.