org.fosstrak.llrp.client
Interface Repository

All Known Implementing Classes:
AbstractSQLRepository, DerbyRepository, MySQLRepository, PostgreSQLRepository

public interface Repository

This single access point for Reader Management module to access the message repository. The instance class will be initiated in ResourceCenter.

Version:
1.0
Author:
Haoning Zhang

Field Summary
static int RETRIEVE_ALL
          flag to set the retrieval of messages to all messages in the repo.
 
Method Summary
 void clearAdapter(java.lang.String adapter)
          clear all the items that belong to a given adapter.
 void clearAll()
          Clear all the items in repository.
 void clearReader(java.lang.String adapter, java.lang.String reader)
          clear all the items that belong to a given reader on a given adapter.
 void close()
          Closing the repository.
 int count(java.lang.String adaptor, java.lang.String reader)
          returns the number of messages in the repository to a given filter.
 LLRPMessageItem get(java.lang.String aMsgSysId)
          Get the LLRP Message Item from repository according to the unique Message ID.
 java.util.ArrayList<LLRPMessageItem> get(java.lang.String adaptorName, java.lang.String readerName, int num, boolean content)
          returns all the messages from the specified adaptor and the reader limited by num. if you set num to RETRIEVE_ALL all messages get returned.
 java.util.Map<java.lang.String,java.lang.String> getArgs()
           
 java.sql.Connection getDBConnection()
           
 ROAccessReportsRepository getROAccessRepository()
          The ROAccessReportsRepository is implemented via the strategy pattern.
 void initialize(java.util.Map<java.lang.String,java.lang.String> args)
          Initializer method for the repository.
 boolean isHealth()
           
 void put(LLRPMessageItem aMessage)
          Put the LLRP Message Item to the repository
 

Field Detail

RETRIEVE_ALL

static final int RETRIEVE_ALL
flag to set the retrieval of messages to all messages in the repo.

See Also:
Constant Field Values
Method Detail

initialize

void initialize(java.util.Map<java.lang.String,java.lang.String> args)
                throws LLRPRuntimeException
Initializer method for the repository. The method will be called directly after instantiation.

Parameters:
args - hash-map with the parameters.
Throws:
when - there is a problem with initialization (eg. missing param).
LLRPRuntimeException

getArgs

java.util.Map<java.lang.String,java.lang.String> getArgs()
Returns:
a hash map with the properties passed by the initializer.

close

void close()
Closing the repository.


isHealth

boolean isHealth()
Returns:
true if the repository is OK, false otherwise.

get

LLRPMessageItem get(java.lang.String aMsgSysId)
Get the LLRP Message Item from repository according to the unique Message ID.

Parameters:
aMsgSysId - The unique message ID
Returns:
LLRP Message Wrapper Item

put

void put(LLRPMessageItem aMessage)
Put the LLRP Message Item to the repository

Parameters:
aMessage - LLRP Message Wrapper Item

get

java.util.ArrayList<LLRPMessageItem> get(java.lang.String adaptorName,
                                         java.lang.String readerName,
                                         int num,
                                         boolean content)
returns all the messages from the specified adaptor and the reader limited by num. if you set num to RETRIEVE_ALL all messages get returned. if you set readerName to null, all the messages of all the readers with adaptor adaptorName will be returned.

Parameters:
adaptorName - the name of the adaptor.
readerName - the name of the reader.
num - how many messages to retrieve.
content - if true retrieve the message content, false no content.
Returns:
a list of messages.

count

int count(java.lang.String adaptor,
          java.lang.String reader)
returns the number of messages in the repository to a given filter.

Parameters:
adaptor - the name of the adaptor to filter. if null all the messages in the repository get return.
reader - the name of the reader to filter. if null all the messages of the given adaptor will be returned.
Returns:
the number of messages in the repository.

clearAll

void clearAll()
Clear all the items in repository.


clearAdapter

void clearAdapter(java.lang.String adapter)
clear all the items that belong to a given adapter.

Parameters:
adapter - the name of the adapter to clear.

clearReader

void clearReader(java.lang.String adapter,
                 java.lang.String reader)
clear all the items that belong to a given reader on a given adapter.

Parameters:
adapter - the name of the adapter where the reader belongs to.
reader - the name of the reader to clear.

getDBConnection

java.sql.Connection getDBConnection()
Returns:
a handle to the database connection. users of the repository are allowed to use the database for their own purposes.

getROAccessRepository

ROAccessReportsRepository getROAccessRepository()
The ROAccessReportsRepository is implemented via the strategy pattern. Depending on the type of the repository, you will get a different implementation of this handle at runtime. The respective implementation will setup the data-structures used to log RO_ACCESS_REPORTS and ease the access to the stored information.

Returns:
a handle to the RO_ACCESS_REPORTS repository. if the implementation of the repository does not implement this functionality, it shall return null.


Copyright © 2009. All Rights Reserved.