com.sdm.quasar.client.jsf.dialog.features
Class DoubleSubmitCheckerFeature

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialog.AbstractFeature
      extended bycom.sdm.quasar.client.jsf.dialog.features.DoubleSubmitCheckerFeature
All Implemented Interfaces:
DoubleSubmitCheckerService, Feature, Service, SystemInfoProvider

public class DoubleSubmitCheckerFeature
extends AbstractFeature
implements DoubleSubmitCheckerService

Author:
clucke TODO register as service on dialog destruction, to remove the diid when being notified

Constructor Summary
DoubleSubmitCheckerFeature()
           
 
Method Summary
protected  void dispose()
          Called when the feature or dialog is disposed.
 java.lang.Integer getSequenceNumber(DialogInstanceId diid)
          Returns the sequence-number for a specific dialog-instance.
 void incrementSequenceNumber(DialogInstanceId diid)
          Increments the sequence-number for a specific dialog-instance.
protected  void init()
          Called when the feature is initializing.
 boolean isSequenceNumberValid(DialogInstanceId diid, java.lang.Integer requestSeqNbr)
          Check if a sequence-number is valid.
protected  void removeSequenceNumberInformation(DialogInstanceId diid)
          Removes the sequence number information for the given dialog-instance id.
protected  void setSequenceNumber(DialogInstanceId diid, java.lang.Integer requestSeqNbr)
          Sets the sequence number for the given dialog-instance in a map and keeps track of this data during requests.
 
Methods inherited from class com.sdm.quasar.client.core.dialog.AbstractFeature
activate, attachDialogControl, collectSystemInfo, deactivate, disposeFeature, getDialogControl, isInitialized, prepare, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleSubmitCheckerFeature

public DoubleSubmitCheckerFeature()
Method Detail

isSequenceNumberValid

public boolean isSequenceNumberValid(DialogInstanceId diid,
                                     java.lang.Integer requestSeqNbr)
Description copied from interface: DoubleSubmitCheckerService
Check if a sequence-number is valid.

Specified by:
isSequenceNumberValid in interface DoubleSubmitCheckerService
Parameters:
diid - the dialog-instance id
requestSeqNbr - the sequence-number
Returns:
true if valid, false if outdated

getSequenceNumber

public java.lang.Integer getSequenceNumber(DialogInstanceId diid)
Description copied from interface: DoubleSubmitCheckerService
Returns the sequence-number for a specific dialog-instance.

Specified by:
getSequenceNumber in interface DoubleSubmitCheckerService
Parameters:
diid - the dialog-instance id
Returns:
the current sequence-number

incrementSequenceNumber

public void incrementSequenceNumber(DialogInstanceId diid)
Description copied from interface: DoubleSubmitCheckerService
Increments the sequence-number for a specific dialog-instance.

Specified by:
incrementSequenceNumber in interface DoubleSubmitCheckerService
Parameters:
diid - the dialog-instance id

setSequenceNumber

protected void setSequenceNumber(DialogInstanceId diid,
                                 java.lang.Integer requestSeqNbr)
Sets the sequence number for the given dialog-instance in a map and keeps track of this data during requests.

Parameters:
diid -
requestSeqNbr -

removeSequenceNumberInformation

protected void removeSequenceNumberInformation(DialogInstanceId diid)
Removes the sequence number information for the given dialog-instance id.

Parameters:
diid -

dispose

protected void dispose()
                throws DisposeException
Description copied from class: AbstractFeature
Called when the feature or dialog is disposed. Override this method to clean up resources and free memory when disposing.

Specified by:
dispose in class AbstractFeature
Throws:
DisposeException

init

protected void init()
Description copied from class: AbstractFeature
Called when the feature is initializing. This is normally done, when the feature is connected to the lifecycle of the DialogControl installed to. To access the DialogControl use the AbstractFeature.getDialogControl() method.

Override this method to perform some action on initialization e.g. register public services.

Specified by:
init in class AbstractFeature