com.indexdata.mkjsf.pazpar2.state
Class StateManager

java.lang.Object
  extended by com.indexdata.mkjsf.pazpar2.state.StateManager
All Implemented Interfaces:
Serializable

public class StateManager
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
StateManager()
           
 
Method Summary
 void addStateListener(StateListener listener)
           
 void checkIn(Pazpar2Command command)
          Registers a Pazpar2 command for execution.
 Pazpar2Command getCommand(String commandName)
           
 Pazpar2State getCurrentState()
           
 boolean hasPendingStateChange(String command)
           
 void hasPendingStateChange(String command, boolean bool)
          Sets a pending-state-change flag for the given command and notifies registered listeners.
 void removeStateListener(StateListener listener)
           
 void setCurrentStateKey(String key)
          Changes the current state key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateManager

public StateManager()
Method Detail

addStateListener

public void addStateListener(StateListener listener)

removeStateListener

public void removeStateListener(StateListener listener)

checkIn

public void checkIn(Pazpar2Command command)
Registers a Pazpar2 command for execution. The state manager will update current state and flag that a request change was made but that it was not yet carried out against Pazpar2. Any command that is created or modified must be checked in like this to come into effect.

Parameters:
command -

getCommand

public Pazpar2Command getCommand(String commandName)

getCurrentState

public Pazpar2State getCurrentState()

setCurrentStateKey

public void setCurrentStateKey(String key)
Changes the current state key. Invoked from the UI to have the state manager switch to another state than the current one.

Parameters:
key -

hasPendingStateChange

public void hasPendingStateChange(String command,
                                  boolean bool)
Sets a pending-state-change flag for the given command and notifies registered listeners. It is up to the listener to reset the flag as needed.

Parameters:
command -
bool -

hasPendingStateChange

public boolean hasPendingStateChange(String command)
Parameters:
command -
Returns:
true if there is a non-executed command change in this state


Copyright © 2013. All Rights Reserved.