SecurePlayLibray J2SE
v2.1

com.SecurePlay
Class SPTMultiPartSimultaneousClass

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

public class SPTMultiPartSimultaneousClass
extends SPAbstractTransactionClass

This method is an extension of the SPSimultaneous Class to handle multi-part (String Array) simultaneous events

Author:
IT GlobalSecure Inc.
See Also:
SecurePlay License Information
 

Field Summary
private  java.lang.String[] manualplayers
          Internal players that want to do manual reveal of secrets
private static java.lang.String mt_revealSecret
          Static message types that this transaction supports.
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 secret
          This an associative array of simultaneous secrets string Arrays that are being protected through the Simultaneous transaction.
private  java.lang.String[] secretreceivedlist
           
private  SPMap secrettransform
          This property is the associative array of irreversible transforms of the secretpadded strings.
private  boolean sentinternalsecrets
           
protected static java.lang.String status_allreceived
          transaction status ready variable
protected static java.lang.String status_allsent
          transaction status ready variable
protected static java.lang.String status_secretrevealed
          transaction status complete variable
protected static java.lang.String status_secretrevealedlist
          transaction status error variable
protected static java.lang.String status_secretsent
          transaction status ready 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
SPTMultiPartSimultaneousClass()
          Default Constructor
SPTMultiPartSimultaneousClass(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
 SPAbstractTransactionInterface APIcreateTransaction(SPGameInterface gameapiobj, SPMessageClass message)
          Creates a new instance of an SPTSimultaneousClass class.
 java.lang.String[] APIgetSecret(java.lang.String sender)
          This method returns the actual secret for the specified player that this transaction is protecting, if available.
 java.lang.String APIgetTransactionType()
          This method returns a String of the transactiontype.
 boolean APIrevealSecret(java.lang.String sender)
          This method sends the secretpadded value to the specified remote players.
 boolean APIsendHiddenSecret(java.lang.String sender, boolean manflag, 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 APIverifySimultaneous()
          This method verifies whether a Simultaneous transaction was carried out successfully and responds with a simple Boolean.
static SPAbstractTransactionInterface createMultiPartSimultaneous(SPGameInterface gameobj, java.lang.String master, java.lang.String[] playerIDList, boolean privateflag, java.lang.String AGE, java.lang.String[] configarr)
          This method creates a SPTSimultaneousClass transaction.
 int getPrpadlength()
          Getter function that returns the property: prpadlength
 SPMap getSecret()
          Getter function that returns the property: secret
 SPMap getSecrettransform()
          Getter function that returns the property: secrettransform
static java.lang.String gettranstype()
          This method gets the transaction type.
 boolean onrevealSecret(SPMessageClass incoming)
          This method handles the incoming message to reveal a secret.
 boolean onsendHiddenSecret(SPMessageClass incoming)
          This method handles incoming sendHiddenSecret messages.
 boolean pronincomingTransaction(SPMessageClass incoming)
          This method provides the unique handlers for incoming Multipart Simultaneous turn message types
private  boolean prsendinternalSecrets()
          This method safely sends all of the internal Secrets from participants in the Simultaneous transaction to remote players.
protected  void pruniqueinit()
          Unique initialization
static boolean registerTransaction()
          Registers this transaction.
 
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

secret

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


secrettransform

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


manualplayers

private java.lang.String[] manualplayers
Internal players that want to do manual reveal of secrets


secretreceivedlist

private java.lang.String[] secretreceivedlist

mt_sendHiddenSecret

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

See Also:
Constant Field Values

mt_revealSecret

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

See Also:
Constant Field Values

status_allsent

protected static final java.lang.String status_allsent
transaction status ready variable

See Also:
Constant Field Values

status_allreceived

protected static final java.lang.String status_allreceived
transaction status ready variable

See Also:
Constant Field Values

status_secretsent

protected static final java.lang.String status_secretsent
transaction status ready variable

See Also:
Constant Field Values

status_secretrevealed

protected static final java.lang.String status_secretrevealed
transaction status complete variable

See Also:
Constant Field Values

status_secretrevealedlist

protected static final java.lang.String status_secretrevealedlist
transaction status error variable

See Also:
Constant Field Values

sentinternalsecrets

private boolean sentinternalsecrets
Constructor Detail

SPTMultiPartSimultaneousClass

public SPTMultiPartSimultaneousClass()
Default Constructor


SPTMultiPartSimultaneousClass

public SPTMultiPartSimultaneousClass(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

protected void pruniqueinit()
Unique initialization

Overrides:
pruniqueinit in class SPAbstractTransactionClass

APIsendHiddenSecret

public boolean APIsendHiddenSecret(java.lang.String sender,
                                   boolean manflag,
                                   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
manflag - - boolean - manual reveal of secret
newsecret - String[] - the secret
Returns:
result - Boolean: TRUE, if successful, FALSE, if not

APIrevealSecret

public boolean APIrevealSecret(java.lang.String sender)
This method sends the secretpadded value to the specified remote players.

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

APIverifySimultaneous

public boolean APIverifySimultaneous()
This method verifies whether a Simultaneous transaction was carried out successfully and responds with a simple Boolean.

Returns:
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 transaction is protecting, if available.

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

onsendHiddenSecret

public 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 - the message to be sent.
Returns:
result - Boolean: TRUE, if successfully handled, FALSE, if not

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:
ressult - Boolean: TRUE, if all internal secrets successfully sent, FALSE, if not.

onrevealSecret

public 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

pronincomingTransaction

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

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

getPrpadlength

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

Returns:
prpadlength - int

getSecret

public SPMap getSecret()
Getter function that returns the property: secret

Returns:
secret - SPHashtable

getSecrettransform

public SPMap getSecrettransform()
Getter function that returns the property: secrettransform

Returns:
secrettransform - 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

createMultiPartSimultaneous

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

Parameters:
gameobj -
master -
playerIDList -
privateflag -
AGE -
configarr -
Returns:
SPAbstractTransactionInterface - returns MultiPartSimultaneous class created

APIcreateTransaction

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

Specified by:
APIcreateTransaction in interface SPAbstractTransactionInterface
Overrides:
APIcreateTransaction in class SPAbstractTransactionClass
Parameters:
gameapiobj - SPGameInterface - game associated with this transaction.
message - SPMessageClass - incoming message
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.