com.almende.eve.state
Class FileStateFactory

java.lang.Object
  extended by com.almende.eve.state.FileStateFactory
All Implemented Interfaces:
StateFactory

public class FileStateFactory
extends Object
implements StateFactory


Constructor Summary
FileStateFactory(AgentFactory agentFactory, Map<String,Object> params)
          This constructor is called when constructed by the AgentFactory
FileStateFactory(String path)
           
 
Method Summary
 FileState create(String agentId)
          Create a state with given id.
 void delete(String agentId)
          Delete a state.
 boolean exists(String agentId)
          Test if a state with given agentId exists
 FileState get(String agentId)
          Get state with given id.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileStateFactory

public FileStateFactory(AgentFactory agentFactory,
                        Map<String,Object> params)
This constructor is called when constructed by the AgentFactory

Parameters:
agentFactory -
params -

FileStateFactory

public FileStateFactory(String path)
Method Detail

get

public FileState get(String agentId)
Get state with given id. Will return null if not found

Specified by:
get in interface StateFactory
Parameters:
agentId -
Returns:
state

create

public FileState create(String agentId)
                 throws Exception
Create a state with given id. Will throw an exception when already. existing.

Specified by:
create in interface StateFactory
Parameters:
agentId -
Returns:
state
Throws:
Exception

delete

public void delete(String agentId)
Delete a state. If the state does not exist, nothing will happen.

Specified by:
delete in interface StateFactory
Parameters:
agentId -

exists

public boolean exists(String agentId)
Test if a state with given agentId exists

Specified by:
exists in interface StateFactory
Parameters:
agentId -
Returns:
exists

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Almende BV. All Rights Reserved.