DESY ACOP Beans Home

com.cosylab.application.state.impl
Class DefaultStateStorage

java.lang.Object
  extended by com.cosylab.application.state.impl.DefaultStateStorage
All Implemented Interfaces:
StateStorage
Direct Known Subclasses:
NewXMLStateStorage, OldXMLStateStorage, SerialStateStorage, TextStateStorage, XMLStateStorage

public abstract class DefaultStateStorage
extends java.lang.Object
implements StateStorage

This class is an abstract class that can be extended by the StateStorage implementators.

Author:
dvitas

Field Summary
protected  StateStorage delegate
           
protected  java.util.ArrayList states
           
 
Constructor Summary
DefaultStateStorage()
           
DefaultStateStorage(StateStorage other)
          Creates a new DefaultStateStorage object.
 
Method Summary
 void add(State state)
          Adds new state to storage.
 void addAll(java.util.List states)
          DOCUMENT ME!
 boolean contains(State st)
          DOCUMENT ME!
protected  java.io.InputStream getInputStream(java.lang.String filePath, java.lang.String fileName)
           
protected  java.io.OutputStream getOutputStream(java.lang.String filePath, java.lang.String fileName)
           
 java.util.List getStates()
          DOCUMENT ME!
 java.util.Iterator iterator()
          Rerurns iterator over states.
abstract  void load(java.lang.String filePath, java.lang.String applicationName)
          DOCUMENT ME! TODO: Add load(InputStream, String) to support loading from non-file sources!
 void remove(State st)
          DOCUMENT ME!
abstract  void store(java.lang.String filePath, java.lang.String applicationName)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cosylab.application.state.StateStorage
load, store
 

Field Detail

states

protected java.util.ArrayList states

delegate

protected StateStorage delegate
Constructor Detail

DefaultStateStorage

public DefaultStateStorage()

DefaultStateStorage

public DefaultStateStorage(StateStorage other)
Creates a new DefaultStateStorage object.

Parameters:
other - DOCUMENT ME!
Method Detail

add

public void add(State state)
Description copied from interface: StateStorage
Adds new state to storage.

Specified by:
add in interface StateStorage
Parameters:
state - the state to be added

addAll

public void addAll(java.util.List states)
Description copied from interface: StateStorage
DOCUMENT ME!

Specified by:
addAll in interface StateStorage
Parameters:
states - DOCUMENT ME!

getInputStream

protected java.io.InputStream getInputStream(java.lang.String filePath,
                                             java.lang.String fileName)

getOutputStream

protected java.io.OutputStream getOutputStream(java.lang.String filePath,
                                               java.lang.String fileName)
                                        throws java.io.IOException
Throws:
java.io.IOException

load

public abstract void load(java.lang.String filePath,
                          java.lang.String applicationName)
                   throws java.io.IOException
Description copied from interface: StateStorage
DOCUMENT ME! TODO: Add load(InputStream, String) to support loading from non-file sources!

Specified by:
load in interface StateStorage
Parameters:
filePath - DOCUMENT ME!
applicationName - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

store

public abstract void store(java.lang.String filePath,
                           java.lang.String applicationName)
                    throws java.io.IOException
DOCUMENT ME!

Specified by:
store in interface StateStorage
Parameters:
filePath - DOCUMENT ME!
applicationName - DOCUMENT ME!
Throws:
java.io.IOException - DOCUMENT ME!

getStates

public java.util.List getStates()
Description copied from interface: StateStorage
DOCUMENT ME!

Specified by:
getStates in interface StateStorage
Returns:
DOCUMENT ME!

contains

public boolean contains(State st)
Description copied from interface: StateStorage
DOCUMENT ME!

Specified by:
contains in interface StateStorage
Parameters:
st - DOCUMENT ME!
Returns:
DOCUMENT ME!

iterator

public java.util.Iterator iterator()
Description copied from interface: StateStorage
Rerurns iterator over states.

Specified by:
iterator in interface StateStorage
Returns:
iterator over states

remove

public void remove(State st)
Description copied from interface: StateStorage
DOCUMENT ME!

Specified by:
remove in interface StateStorage
Parameters:
st - DOCUMENT ME!


Copyright © 2010. All Rights Reserved.