amwebarsentitlementservice.protocol
Class FileReaderProtocol

java.lang.Object
  |
  +--amwebarsentitlementservice.protocol.AMWebARSProtocol
        |
        +--amwebarsentitlementservice.protocol.FixedProviderProtocol
              |
              +--amwebarsentitlementservice.protocol.FileReaderProtocol
All Implemented Interfaces:
java.lang.Cloneable

public class FileReaderProtocol
extends FixedProviderProtocol


Field Summary
static java.lang.String CONTAINER_DB_FILENAME
           
static java.lang.String KEY_DELIMETER
           
 
Fields inherited from class amwebarsentitlementservice.protocol.FixedProviderProtocol
PROTOCOL_INIT_SUCCESS, PROTOCOL_RUN_SUCCESS, PROTOCOL_SHUTDOWN_SUCCESS
 
Fields inherited from class amwebarsentitlementservice.protocol.AMWebARSProtocol
_initialized, CLASS_NAME_XML_NAME, PROTOCOL_ID_XML_NAME, PROTOCOL_XML_NAME
 
Constructor Summary
FileReaderProtocol(java.lang.String protocol_id)
          Constructor for FileReaderProtocol.
 
Method Summary
 AMWebARSProtocolMemento generateMemento()
           
 ProtocolInitStatus initialize()
          Initializes the protocol.
 ProtocolRunStatus run()
          Runs the protocol.
 void setMemento(AMWebARSProtocolMemento memento)
           
 ProtocolShutdownStatus shutdown()
           
 
Methods inherited from class amwebarsentitlementservice.protocol.FixedProviderProtocol
clone, getPreferedFactory
 
Methods inherited from class amwebarsentitlementservice.protocol.AMWebARSProtocol
equals, getClient, getInstance, getProtocolID, isInitialized, setClient, toString, toXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTAINER_DB_FILENAME

public static final java.lang.String CONTAINER_DB_FILENAME

KEY_DELIMETER

public static final java.lang.String KEY_DELIMETER
Constructor Detail

FileReaderProtocol

public FileReaderProtocol(java.lang.String protocol_id)
Constructor for FileReaderProtocol.
Parameters:
protocol_id -  
Method Detail

initialize

public ProtocolInitStatus initialize()
Description copied from class: AMWebARSProtocol
Initializes the protocol. This has to be done before the protocol runs.
Overrides:
initialize in class AMWebARSProtocol
See Also:
AMWebARSProtocol.initialize()

run

public ProtocolRunStatus run()
Description copied from class: AMWebARSProtocol
Runs the protocol. A protocol's run method has to do the following steps:
  1. Test whether the protocol is initialized. If not, return a new ProtocolRunException with containing an UnsupportedOperationException.
  2. Get the container descriptors to retrieve from the client: getClient().elements();
  3. Retrieve the containers. If one is found remove the corresponding descriptor from the client's descriptor iterator and add the container to the client:
    getClient().addContainer(retrieved_container);
    container_descriptors.remove();
  4. return PROTOCOL_RUN_SUCCESS; if any exception occurs return a new ProtocolRunException.
Overrides:
run in class AMWebARSProtocol
See Also:
AMWebARSProtocol.run()

shutdown

public ProtocolShutdownStatus shutdown()
Overrides:
shutdown in class AMWebARSProtocol
See Also:
AMWebARSProtocol.shutdown()

generateMemento

public AMWebARSProtocolMemento generateMemento()
Overrides:
generateMemento in class FixedProviderProtocol
See Also:
AMWebARSProtocol.generateMemento()

setMemento

public void setMemento(AMWebARSProtocolMemento memento)
Overrides:
setMemento in class FixedProviderProtocol
See Also:
AMWebARSProtocol.setMemento(AMWebARSProtocolMemento)