fedora.server.resourceIndex
Class DatabaseMethodInfoStore

java.lang.Object
  extended by fedora.server.resourceIndex.DatabaseMethodInfoStore
All Implemented Interfaces:
MethodInfoProvider, MethodInfoStore

public class DatabaseMethodInfoStore
extends java.lang.Object
implements MethodInfoStore

A MethodInfoStore that uses a database for storage.

 TABLE                 COLUMN        EXAMPLE VALUE
 --------------------  ------------  ----------------------
 riMethod              methodId      test:bdef1/methodName
                       bDefPid       test:bdef1
                       methodName    methodName

 riMethodPermutations  methodId      test:bdef1/methodName
                       permutation   methodName?arg1=val1

 riMethodImplBinding   methodImplId  test:bmech1/methodName
                       dsBindKey     KEY1
 
 riMethodImpl          methodImplId  test:bmech1/methodName
                       bMechPid      test:bmech1
                       methodId      test:bdef1/methodName

 riMethodMimeType      methodImplId  test:bmech1/methodName
                       mimeType      text/plain
 

Author:
cwilper@cs.cornell.edu

Constructor Summary
DatabaseMethodInfoStore(ConnectionPool pool, boolean storePermutations)
           
 
Method Summary
 void deleteBDefInfo(java.lang.String bDefPID)
          Delete method information about the given behavior definition.
 void deleteBMechInfo(java.lang.String bMechPID)
          Delete method information about the given behavior mechanism.
 java.util.Set<MethodInfo> getMethodInfo(java.lang.String bMechPID)
          Get the MethodInfo for each method of the given behavior mechanism.
 void putBDefInfo(BDefReader reader)
          Add or replace method information about the given behavior definition.
 void putBMechInfo(BMechReader reader)
          Add or replace method information about the given behavior mechanism.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseMethodInfoStore

public DatabaseMethodInfoStore(ConnectionPool pool,
                               boolean storePermutations)
Method Detail

putBDefInfo

public void putBDefInfo(BDefReader reader)
                 throws ResourceIndexException
Add or replace method information about the given behavior definition. A behavior definition defines a set of method names and the runtime parameters for each.

Specified by:
putBDefInfo in interface MethodInfoStore
Parameters:
reader - the behavior definition.
Throws:
ResourceIndexException - if any error occurs.

deleteBDefInfo

public void deleteBDefInfo(java.lang.String bDefPID)
                    throws ResourceIndexException
Delete method information about the given behavior definition.

Specified by:
deleteBDefInfo in interface MethodInfoStore
Parameters:
bDefPID - the pid of the behavior definition whose information should be deleted.
Throws:
ResourceIndexException - if any error occurs.

putBMechInfo

public void putBMechInfo(BMechReader reader)
                  throws ResourceIndexException
Add or replace method information about the given behavior mechanism. For each method it implements, a behavior mechanism defines a set of datastream binding keys and a set of possible return types.

Specified by:
putBMechInfo in interface MethodInfoStore
Parameters:
reader - the behavior mechanism.
Throws:
ResourceIndexException - if any error occurs.

deleteBMechInfo

public void deleteBMechInfo(java.lang.String bMechPID)
                     throws ResourceIndexException
Delete method information about the given behavior mechanism.

Specified by:
deleteBMechInfo in interface MethodInfoStore
Throws:
ResourceIndexException - if any error occurs.

getMethodInfo

public java.util.Set<MethodInfo> getMethodInfo(java.lang.String bMechPID)
                                        throws ResourceIndexException
Get the MethodInfo for each method of the given behavior mechanism.

Specified by:
getMethodInfo in interface MethodInfoProvider
Parameters:
bMechPID - the behavior mechanism pid.
Returns:
A set with one item for each implemented method.
Throws:
ResourceIndexException - if no such behavior mechanism exists or the information can't be read for any other reason.