org.mycore.backend.hibernate
Class MCRHIBURNStore

java.lang.Object
  extended by org.mycore.backend.hibernate.MCRHIBURNStore
All Implemented Interfaces:
MCRURNStore

public class MCRHIBURNStore
extends Object
implements MCRURNStore

This class implements the MCRXMLInterface.


Field Summary
(package private) static Logger logger
           
 
Constructor Summary
MCRHIBURNStore()
          The constructor for the class MCRHIBURLStore.
 
Method Summary
 void assignURN(String urn, String id)
          Assigns the given urn to the given document ID
 void assignURN(String urn, String id, String path, String filename)
          Assigns the given urn to the given derivate ID
 void create(String urn, String id)
          The method create a new item in the datastore.
 void create(String urn, String id, String path, String filename)
          The method creates a new item in the datastore.
 void delete(String urn)
          The method remove a item for the URN from the datastore.
 void deleteByObjectID(String objID)
          The method remove a item for the URN from the datastore.
 boolean exist(String urn)
          This method check that the URN exist in this store.
 String getDocumentIDforURN(String urn)
          Retrieves the URN that is assigned to the given document ID
 String getURNforDocument(String id)
          Retrieves the URN that is assigned to the given document ID
 boolean hasURNAssigned(String id)
          Checks wether an object has an urn assigned or not
 boolean isAssigned(String urn)
          Returns true if the given urn is assigned to a document ID
 void removeURN(String urn)
          Removes the urn (and assigned document ID) from the persistent store
 void removeURNByObjectID(String objID)
          Removes the urn (and assigned document ID) from the persistent store by the given object id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static Logger logger
Constructor Detail

MCRHIBURNStore

public MCRHIBURNStore()
The constructor for the class MCRHIBURLStore.

Method Detail

create

public final void create(String urn,
                         String id)
                  throws MCRPersistenceException
The method create a new item in the datastore.

Parameters:
urn - a URN
id - the MCRObjectID as String
Throws:
MCRPersistenceException - the method arguments are not correct

create

public final void create(String urn,
                         String id,
                         String path,
                         String filename)
                  throws MCRPersistenceException
The method creates a new item in the datastore.

Parameters:
urn - a URN
id - the MCRObjectID as String
path - the path of the derivate in the IFS
Throws:
MCRPersistenceException - the method arguments are not correct

assignURN

public void assignURN(String urn,
                      String id)
Assigns the given urn to the given document ID

Specified by:
assignURN in interface MCRURNStore
Parameters:
urn - a URN
id - the MCRObjectID as String
Throws:
MCRPersistenceException - the method arguments are not correct

assignURN

public void assignURN(String urn,
                      String id,
                      String path,
                      String filename)
Assigns the given urn to the given derivate ID

Specified by:
assignURN in interface MCRURNStore
Parameters:
urn - a URN
id - the MCRObjectID as String
path - the path of the derivate
Throws:
MCRPersistenceException - the method arguments are not correct

delete

public final void delete(String urn)
                  throws MCRPersistenceException
The method remove a item for the URN from the datastore.

Parameters:
urn - a URN
Throws:
MCRPersistenceException - the method argument is not correct

deleteByObjectID

public final void deleteByObjectID(String objID)
                            throws MCRPersistenceException
The method remove a item for the URN from the datastore.

Parameters:
objID - an object id
Throws:
MCRPersistenceException - the method argument is not correct

removeURN

public void removeURN(String urn)
Removes the urn (and assigned document ID) from the persistent store

Specified by:
removeURN in interface MCRURNStore
Parameters:
urn - a URN
Throws:
MCRPersistenceException - the method argument is not correct

getURNforDocument

public final String getURNforDocument(String id)
                               throws MCRPersistenceException
Retrieves the URN that is assigned to the given document ID

Specified by:
getURNforDocument in interface MCRURNStore
Parameters:
id - the MCRObjectID as String
Returns:
the urn, or null if no urn is assigned to this ID
Throws:
MCRPersistenceException

removeURNByObjectID

public void removeURNByObjectID(String objID)
Removes the urn (and assigned document ID) from the persistent store by the given object id

Specified by:
removeURNByObjectID in interface MCRURNStore
Parameters:
urn - a URN
Throws:
MCRPersistenceException - the method argument is not correct

getDocumentIDforURN

public final String getDocumentIDforURN(String urn)
                                 throws MCRPersistenceException
Retrieves the URN that is assigned to the given document ID

Specified by:
getDocumentIDforURN in interface MCRURNStore
Parameters:
urn - the URN as String
Returns:
the document ID, or null if no urn is assigned to this ID
Throws:
MCRPersistenceException

hasURNAssigned

public final boolean hasURNAssigned(String id)
                             throws MCRPersistenceException
Checks wether an object has an urn assigned or not

Specified by:
hasURNAssigned in interface MCRURNStore
Parameters:
id - the MCRObjectID as String
Returns:
true if an urn is assigned to the given object, false otherwise
Throws:
MCRPersistenceException

exist

public final boolean exist(String urn)
This method check that the URN exist in this store.

Returns:
true if the URN exist, else return false

isAssigned

public boolean isAssigned(String urn)
Returns true if the given urn is assigned to a document ID

Specified by:
isAssigned in interface MCRURNStore
Parameters:
urn - a URN
Returns:
true if the URN exist, else return false