zeus.ext
Class FlatFile

java.lang.Object
  extended byzeus.agents.PersistentStore
      extended byzeus.ext.FlatFile

public class FlatFile
extends PersistentStore


Field Summary
(package private)  java.lang.String fsep
           
protected  java.util.Hashtable ht
           
(package private)  java.lang.String NEWLINE
           
(package private)  java.lang.String NEWRECORD
           
(package private)  java.lang.String PREFIX
           
(package private)  java.lang.String RECORD_TAG
           
(package private)  java.lang.String ROOT
           
 
Fields inherited from class zeus.agents.PersistentStore
proxy
 
Constructor Summary
FlatFile()
           
 
Method Summary
 void beginSession(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Go to the beginning of a session identified by accessKey.
 void closeSession(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Close a session identified by accessKey.
 void countRecords(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Returns the number of records in a session identified by accessKey.
 void createSession(java.lang.String replyKey, java.lang.String agent, java.lang.String sessionType, java.lang.String sessionId, java.lang.String accessKey)
          Its purpose is to create a new session (i.e. a flat file or database table).
 void deleteSession(java.lang.String replyKey, java.lang.String agent, java.lang.String sessionType, java.lang.String sessionId)
          Given a session type, delete the session type with the name sessionId.
 void deleteSessionType(java.lang.String replyKey, java.lang.String agent, java.lang.String sessionType)
          Delete a session type with its associated sessions (i.e. tables).
 void endSession(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Go to the end of a session identified by accessKey.
 void getAgents(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Returns all known agents associated with a given session identified by accessKey.
 void getAllSessions(java.lang.String replyKey, java.lang.String agent, java.lang.String sessionType)
          Given a session type, list all sessions (tables) associated with that type.
private  int getCountUpTo(java.io.RandomAccessFile fp, long length)
           
 void nextRecord(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Returns the next record in a session identified by accessKey.
 void openSession(java.lang.String replyKey, java.lang.String agent, java.lang.String sessionType, java.lang.String sessionId, java.lang.String accessKey)
          Given a session type, open the session with name sessionId.
 void priorRecord(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey)
          Returns the previous record in a session identified by accessKey.
private  java.lang.String readRecord(java.io.RandomAccessFile fp)
           
 void saveRecord(java.lang.String replyKey, java.lang.String agent, java.lang.String accessKey, java.lang.String record)
          Save the record in a session identified by accessKey.
 
Methods inherited from class zeus.agents.PersistentStore
isAccessible, setAccess, setProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ht

protected java.util.Hashtable ht

fsep

java.lang.String fsep

ROOT

java.lang.String ROOT

NEWLINE

java.lang.String NEWLINE

NEWRECORD

java.lang.String NEWRECORD

RECORD_TAG

java.lang.String RECORD_TAG

PREFIX

java.lang.String PREFIX
Constructor Detail

FlatFile

public FlatFile()
Method Detail

createSession

public void createSession(java.lang.String replyKey,
                          java.lang.String agent,
                          java.lang.String sessionType,
                          java.lang.String sessionId,
                          java.lang.String accessKey)
Description copied from class: PersistentStore
Its purpose is to create a new session (i.e. a flat file or database table). Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.
If the session exists open it for appending and return done.
If the session doesn't exit create it for writing and return done.
If aforementioned operations fails return failure.

Specified by:
createSession in class PersistentStore

deleteSession

public void deleteSession(java.lang.String replyKey,
                          java.lang.String agent,
                          java.lang.String sessionType,
                          java.lang.String sessionId)
Description copied from class: PersistentStore
Given a session type, delete the session type with the name sessionId. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
deleteSession in class PersistentStore

countRecords

public void countRecords(java.lang.String replyKey,
                         java.lang.String agent,
                         java.lang.String accessKey)
Description copied from class: PersistentStore
Returns the number of records in a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
countRecords in class PersistentStore

getCountUpTo

private int getCountUpTo(java.io.RandomAccessFile fp,
                         long length)

getAllSessions

public void getAllSessions(java.lang.String replyKey,
                           java.lang.String agent,
                           java.lang.String sessionType)
Description copied from class: PersistentStore
Given a session type, list all sessions (tables) associated with that type. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
getAllSessions in class PersistentStore

deleteSessionType

public void deleteSessionType(java.lang.String replyKey,
                              java.lang.String agent,
                              java.lang.String sessionType)
Description copied from class: PersistentStore
Delete a session type with its associated sessions (i.e. tables). Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
deleteSessionType in class PersistentStore

openSession

public void openSession(java.lang.String replyKey,
                        java.lang.String agent,
                        java.lang.String sessionType,
                        java.lang.String sessionId,
                        java.lang.String accessKey)
Description copied from class: PersistentStore
Given a session type, open the session with name sessionId. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
openSession in class PersistentStore

saveRecord

public void saveRecord(java.lang.String replyKey,
                       java.lang.String agent,
                       java.lang.String accessKey,
                       java.lang.String record)
Description copied from class: PersistentStore
Save the record in a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
saveRecord in class PersistentStore

closeSession

public void closeSession(java.lang.String replyKey,
                         java.lang.String agent,
                         java.lang.String accessKey)
Description copied from class: PersistentStore
Close a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
closeSession in class PersistentStore

nextRecord

public void nextRecord(java.lang.String replyKey,
                       java.lang.String agent,
                       java.lang.String accessKey)
Description copied from class: PersistentStore
Returns the next record in a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
nextRecord in class PersistentStore

priorRecord

public void priorRecord(java.lang.String replyKey,
                        java.lang.String agent,
                        java.lang.String accessKey)
Description copied from class: PersistentStore
Returns the previous record in a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
priorRecord in class PersistentStore

beginSession

public void beginSession(java.lang.String replyKey,
                         java.lang.String agent,
                         java.lang.String accessKey)
Description copied from class: PersistentStore
Go to the beginning of a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
beginSession in class PersistentStore

endSession

public void endSession(java.lang.String replyKey,
                       java.lang.String agent,
                       java.lang.String accessKey)
Description copied from class: PersistentStore
Go to the end of a session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
endSession in class PersistentStore

getAgents

public void getAgents(java.lang.String replyKey,
                      java.lang.String agent,
                      java.lang.String accessKey)
Description copied from class: PersistentStore
Returns all known agents associated with a given session identified by accessKey. Returns done as the content of a Performative object if the operation succeeds else return reasons for failure to the specified agent with the replyKey as agent's conversation key.

Specified by:
getAgents in class PersistentStore

readRecord

private java.lang.String readRecord(java.io.RandomAccessFile fp)


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.