fedora.server.management
Class BasicPIDGenerator
java.lang.Object
fedora.server.Parameterized
fedora.server.Pluggable
fedora.server.Module
fedora.server.management.BasicPIDGenerator
- All Implemented Interfaces:
- Constants, PIDGenerator
public class BasicPIDGenerator
- extends Module
- implements PIDGenerator
A wrapper around the DBPIDGenerator class that casts it as a Module.
- Version:
- $Id: BasicPIDGenerator.java 5227 2006-11-25 18:48:50Z cwilper $
- Author:
- cwilper@cs.cornell.edu
| Fields inherited from interface fedora.common.Constants |
ACTION, BDEF, BMECH, DATASTREAM, DC, DISSEMINATOR, ENVIRONMENT, FEDORA, FEDORA_HOME, FEDORA_SYSTEM_DEF_PID, FEDORA_SYSTEM_DEF_URI, HTTP_REQUEST, MODEL, OBJECT, RDF, RECOVERY, RELS_EXT, RESOURCE, SUBJECT, TUCANA, VIEW, XSD |
|
Constructor Summary |
BasicPIDGenerator(java.util.Map moduleParameters,
Server server,
java.lang.String role)
Constructs a BasicPIDGenerator. |
|
Method Summary |
PID |
generatePID(java.lang.String namespaceID)
Generate a new pid that is guaranteed to be unique, within the
given namespace. |
PID |
getLastPID()
Get the last pid that was generated. |
void |
initModule()
Initializes the Module based on configuration parameters. |
void |
neverGeneratePID(java.lang.String pid)
Cause the given PID to never be generated by the PID generator. |
void |
postInitModule()
Get a reference to the ConnectionPoolManager so we can give the
instance constructor a ConnectionPool later in initializeIfNeeded(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicPIDGenerator
public BasicPIDGenerator(java.util.Map moduleParameters,
Server server,
java.lang.String role)
throws ModuleInitializationException
- Constructs a BasicPIDGenerator.
- Parameters:
moduleParameters - A pre-loaded Map of name-value pairs comprising
the intended configuration of this Module.server - The Server instance.role - The role this module fulfills, a java class name.
- Throws:
ModuleInitializationException - If initilization values are
invalid or initialization fails for some other reason.
initModule
public void initModule()
- Description copied from class:
Module
- Initializes the Module based on configuration parameters.
- Overrides:
initModule in class Module
postInitModule
public void postInitModule()
throws ModuleInitializationException
- Get a reference to the ConnectionPoolManager so we can give the
instance constructor a ConnectionPool later in initializeIfNeeded().
- Overrides:
postInitModule in class Module
- Throws:
ModuleInitializationException - If initialization values are
invalid or initialization fails for some other reason.
generatePID
public PID generatePID(java.lang.String namespaceID)
throws java.io.IOException
- Description copied from interface:
PIDGenerator
- Generate a new pid that is guaranteed to be unique, within the
given namespace.
- Specified by:
generatePID in interface PIDGenerator
- Returns:
- the PID
- Throws:
java.io.IOException
getLastPID
public PID getLastPID()
throws java.io.IOException
- Description copied from interface:
PIDGenerator
- Get the last pid that was generated.
- Specified by:
getLastPID in interface PIDGenerator
- Returns:
- the last PID that was generated
- Throws:
java.io.IOException
neverGeneratePID
public void neverGeneratePID(java.lang.String pid)
throws java.io.IOException
- Description copied from interface:
PIDGenerator
- Cause the given PID to never be generated by the PID generator.
- Specified by:
neverGeneratePID in interface PIDGenerator
- Throws:
java.io.IOException