com.softwareag.centrasite.appl.framework.persistence
Class RegistryAccessor

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.persistence.RegistryAccessor

public class RegistryAccessor
extends java.lang.Object

The class containing the main logic for working with JAXR Registry.


Constructor Summary
RegistryAccessor(QueryContext pContext)
          Creates a new instance with the given context.
 
Method Summary
 void addSlot(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String pSlot, java.util.Collection<java.lang.String> pValue)
          Adds new slot value.
 javax.xml.registry.infomodel.Association createAssociation(javax.xml.registry.infomodel.RegistryObject sourceObject, javax.xml.registry.infomodel.RegistryObject targetObject, javax.xml.registry.infomodel.Concept associationType)
          Utility method for creating an instance of Association.
 javax.xml.registry.infomodel.Association createAssociationByKey(javax.xml.registry.infomodel.RegistryObject sourceObject, javax.xml.registry.infomodel.RegistryObject targetObject, java.lang.String conceptKey)
          Utility method for creating an instance of Association.
 javax.xml.registry.infomodel.Association createAssociationByType(javax.xml.registry.infomodel.RegistryObject sourceObject, javax.xml.registry.infomodel.RegistryObject targetObject, java.lang.String associationType)
          Utility method for creating an instance of Association.
 javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject ro, javax.xml.registry.infomodel.Concept concept)
          Utility method for creating an instance of Classification.
 javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject pObject, java.lang.String key)
          Utility method for creating an instance of Classification.
 javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String classificationScheme, java.lang.String conceptPath)
          Utility method for creating an instance of Classification.
 javax.xml.registry.infomodel.ExternalLink createExternalLink(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String uri, java.lang.String description)
          Utility method for creating an instance of ExternalLink.
 void delete(java.util.Collection<javax.xml.registry.infomodel.Key> keys)
          Deletes RegistryObjects by a given Collection of keys.
 void delete(javax.xml.registry.infomodel.Key key)
          Removes the object with the given key from the registry.
 void delete(java.lang.String id)
          Removes the object with the given key from the registry.
 void deleteObjects(java.util.Collection<java.lang.String> ids)
          Deletes RegistryObjects by a given Collection of ids.
 javax.xml.registry.infomodel.Concept findAssociationTypeConcept(java.lang.String associationType)
          Retrieves the Concept for the given association type.
 javax.xml.registry.infomodel.Classification findClassificationByConcept(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String scheme, java.lang.String conceptPath)
          Retrieves a Classification by given concept path
 java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String scheme, java.lang.String conceptPath)
          Retrieves a Classification by given concept path
 javax.xml.registry.infomodel.ClassificationScheme findClassificationSchemeByName(java.lang.String name)
          Retrieves ClassificationScheme by name.
 javax.xml.registry.infomodel.Concept findConceptByPath(java.lang.String fullPath)
          Retrieves a Concept by full path.
 javax.xml.registry.infomodel.Concept findConceptByPath(java.lang.String classificationScheme, java.lang.String path)
          Retrieves a Concept by ClasssificationScheme name and path.
 javax.xml.registry.infomodel.Concept findObjectTypeConcept(java.lang.String objectType)
          Retrieves the Concept for the given object type.
 java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeKey(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String associationTypeKey)
          Returns all associations with the given source object and the given association type.
 java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeKeyAndTargetType(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String associationTypeKey, java.lang.String objectType)
          Returns all associations with the given source object, the given association type, and the given object type.
 java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsByTarget(java.lang.String targetId)
           
 java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsByTypeAndTarget(javax.xml.registry.infomodel.Concept assocType, java.lang.String objectType, java.lang.String targetId)
           
 java.lang.String getCheckpointName(javax.xml.registry.infomodel.RegistryObject ro)
           
 java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject ro, java.util.Collection<javax.xml.registry.infomodel.Concept> concepts)
          Retrieves all classifications with a concept which belongs to the given collection.
 java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject pRo, java.lang.String scheme, java.lang.String parentConceptPath)
          Returns the collection of instances, which refer to the given concept.
 QueryContext getContext()
          Returns the context.
 javax.xml.registry.infomodel.Classification getEnumClassification(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String key)
          Retrieves a classification with a concept which belongs to a given parent.
 javax.xml.registry.infomodel.Classification getEnumClassification(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String scheme, java.lang.String parentConceptPath)
          Retrieves a classification with a concept which belongs to a given parent.
 java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro, javax.xml.registry.infomodel.Concept parentConcept)
          Retrieves all classifications with a concept which belongs to a given parent.
 java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String key)
          Retrieves all classifications with a concept which belongs to a given parent.
 java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro, java.lang.String scheme, java.lang.String parentConceptPath)
          Retrieves all classifications with a concept which belongs to a given parent.
 javax.xml.registry.infomodel.RegistryObject getRegistryObject(Key pKey)
          Returns the registry object with the given Key.
 javax.xml.registry.infomodel.RegistryObject getRegistryObject(javax.xml.registry.infomodel.Key pKey)
          Returns the registry object with the given Key.
 javax.xml.registry.infomodel.RegistryObject getRegistryObject(java.lang.String pID)
          Returns the registry object with the given ID.
 java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getRegistryObjects(java.lang.String objectType)
          Returns all registry objects from the given object type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryAccessor

public RegistryAccessor(QueryContext pContext)
Creates a new instance with the given context.

Method Detail

addSlot

public void addSlot(javax.xml.registry.infomodel.RegistryObject pRo,
                    java.lang.String pSlot,
                    java.util.Collection<java.lang.String> pValue)
             throws javax.xml.registry.JAXRException
Adds new slot value. First removes the old slot and if the given values are not null and not empty adds the new value.

Throws:
javax.xml.registry.JAXRException

createClassification

public javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject pObject,
                                                                        java.lang.String key)
                                                                 throws javax.xml.registry.JAXRException
Utility method for creating an instance of Classification. The instance is attached to the given object.

Parameters:
pObject - the registry object to be classified.
key - the key of the concept to be used for creating the classification.
Throws:
javax.xml.registry.JAXRException

createClassification

public javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject ro,
                                                                        java.lang.String classificationScheme,
                                                                        java.lang.String conceptPath)
                                                                 throws javax.xml.registry.JAXRException
Utility method for creating an instance of Classification. The instance is attached to the given object.

Throws:
javax.xml.registry.JAXRException

createClassification

public javax.xml.registry.infomodel.Classification createClassification(javax.xml.registry.infomodel.RegistryObject ro,
                                                                        javax.xml.registry.infomodel.Concept concept)
                                                                 throws javax.xml.registry.JAXRException
Utility method for creating an instance of Classification. The instance is attached to the given object.

Throws:
javax.xml.registry.JAXRException

createAssociationByKey

public javax.xml.registry.infomodel.Association createAssociationByKey(javax.xml.registry.infomodel.RegistryObject sourceObject,
                                                                       javax.xml.registry.infomodel.RegistryObject targetObject,
                                                                       java.lang.String conceptKey)
                                                                throws javax.xml.registry.JAXRException
Utility method for creating an instance of Association. The instance is attached to the given source object.

Parameters:
sourceObject - the registry object that will serve as source for the association.
targetObject - the registry object that will serve as target for the association.
conceptKey - the key of the concept representing the association type.
Throws:
javax.xml.registry.JAXRException

createAssociationByType

public javax.xml.registry.infomodel.Association createAssociationByType(javax.xml.registry.infomodel.RegistryObject sourceObject,
                                                                        javax.xml.registry.infomodel.RegistryObject targetObject,
                                                                        java.lang.String associationType)
                                                                 throws javax.xml.registry.JAXRException
Utility method for creating an instance of Association. The instance is attached to the given source object.

Parameters:
sourceObject - the registry object that will serve as source for the association.
targetObject - the registry object that will serve as target for the association.
associationType - the key of the concept representing the association type.
Throws:
javax.xml.registry.JAXRException

createAssociation

public javax.xml.registry.infomodel.Association createAssociation(javax.xml.registry.infomodel.RegistryObject sourceObject,
                                                                  javax.xml.registry.infomodel.RegistryObject targetObject,
                                                                  javax.xml.registry.infomodel.Concept associationType)
                                                           throws javax.xml.registry.JAXRException
Utility method for creating an instance of Association. The instance is attached to the given source object.

Parameters:
sourceObject - the registry object that will serve as source for the association.
targetObject - the registry object that will serve as target for the association.
associationType - the concept representing the association type.
Throws:
javax.xml.registry.JAXRException

createExternalLink

public javax.xml.registry.infomodel.ExternalLink createExternalLink(javax.xml.registry.infomodel.RegistryObject ro,
                                                                    java.lang.String uri,
                                                                    java.lang.String description)
                                                             throws javax.xml.registry.JAXRException
Utility method for creating an instance of ExternalLink. The instance is attached to the given registry object.

Parameters:
ro - the registry object that will contain the external link.
uri - the URI for the external link.
description - the description foro the external link.
Throws:
javax.xml.registry.JAXRException

delete

public void delete(java.lang.String id)
            throws javax.xml.registry.JAXRException
Removes the object with the given key from the registry.

Throws:
javax.xml.registry.JAXRException

delete

public void delete(javax.xml.registry.infomodel.Key key)
            throws javax.xml.registry.JAXRException
Removes the object with the given key from the registry.

Parameters:
key - the Key of the RegistryObject to be deleted.
Throws:
javax.xml.registry.JAXRException

delete

public void delete(java.util.Collection<javax.xml.registry.infomodel.Key> keys)
            throws javax.xml.registry.JAXRException
Deletes RegistryObjects by a given Collection of keys.

Parameters:
keys - a Collection of Key objects.
Throws:
javax.xml.registry.JAXRException

deleteObjects

public void deleteObjects(java.util.Collection<java.lang.String> ids)
                   throws javax.xml.registry.JAXRException
Deletes RegistryObjects by a given Collection of ids.

Parameters:
ids - a Collection of String objects representing ids.
Throws:
javax.xml.registry.JAXRException

getContext

public QueryContext getContext()
Returns the context.


getRegistryObject

public javax.xml.registry.infomodel.RegistryObject getRegistryObject(Key pKey)
                                                              throws javax.xml.registry.JAXRException
Returns the registry object with the given Key.

Throws:
javax.xml.registry.JAXRException

getRegistryObject

public javax.xml.registry.infomodel.RegistryObject getRegistryObject(javax.xml.registry.infomodel.Key pKey)
                                                              throws javax.xml.registry.JAXRException
Returns the registry object with the given Key.

Throws:
javax.xml.registry.JAXRException

getRegistryObjects

public java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getRegistryObjects(java.lang.String objectType)
                                                                                     throws javax.xml.registry.JAXRException
Returns all registry objects from the given object type.

Throws:
javax.xml.registry.JAXRException

getRegistryObject

public javax.xml.registry.infomodel.RegistryObject getRegistryObject(java.lang.String pID)
                                                              throws javax.xml.registry.JAXRException
Returns the registry object with the given ID.

Throws:
javax.xml.registry.JAXRException

getAssociationsBySourceAndTypeKeyAndTargetType

public java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeKeyAndTargetType(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                                                     java.lang.String associationTypeKey,
                                                                                                                     java.lang.String objectType)
                                                                                                              throws javax.xml.registry.JAXRException
Returns all associations with the given source object, the given association type, and the given object type.

Throws:
javax.xml.registry.JAXRException

getAssociationsBySourceAndTypeKey

public java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsBySourceAndTypeKey(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                                        java.lang.String associationTypeKey)
                                                                                                 throws javax.xml.registry.JAXRException
Returns all associations with the given source object and the given association type.

Throws:
javax.xml.registry.JAXRException

getAssociationsByTypeAndTarget

public java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsByTypeAndTarget(javax.xml.registry.infomodel.Concept assocType,
                                                                                                     java.lang.String objectType,
                                                                                                     java.lang.String targetId)
                                                                                              throws javax.xml.registry.JAXRException
Parameters:
assocType - associationType to look for
objectType - type of the object that should be source of the association
targetId - Id of the target of the association
Returns:
list of associations of the given assocType-Type and for which the source object is of the given objectType-Type
Throws:
javax.xml.registry.JAXRException

getAssociationsByTarget

public java.util.Collection<javax.xml.registry.infomodel.Association> getAssociationsByTarget(java.lang.String targetId)
                                                                                       throws javax.xml.registry.JAXRException
Parameters:
targetId - Id of the target of the association
Returns:
list of associations of the given assocType-Type and for which the source object is of the given objectType-Type
Throws:
javax.xml.registry.JAXRException

getClassifications

public java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject pRo,
                                                                                            java.lang.String scheme,
                                                                                            java.lang.String parentConceptPath)
                                                                                     throws javax.xml.registry.JAXRException
Returns the collection of instances, which refer to the given concept.

Throws:
javax.xml.registry.JAXRException

getEnumClassification

public javax.xml.registry.infomodel.Classification getEnumClassification(javax.xml.registry.infomodel.RegistryObject ro,
                                                                         java.lang.String scheme,
                                                                         java.lang.String parentConceptPath)
                                                                  throws javax.xml.registry.JAXRException
Retrieves a classification with a concept which belongs to a given parent.

Parameters:
ro -
scheme -
parentConceptPath -
Returns:
Classification
Throws:
javax.xml.registry.JAXRException

getEnumClassification

public javax.xml.registry.infomodel.Classification getEnumClassification(javax.xml.registry.infomodel.RegistryObject ro,
                                                                         java.lang.String key)
                                                                  throws javax.xml.registry.JAXRException
Retrieves a classification with a concept which belongs to a given parent.

Parameters:
ro -
key -
Returns:
Classification
Throws:
javax.xml.registry.JAXRException

getEnumClassifications

public java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                java.lang.String scheme,
                                                                                                java.lang.String parentConceptPath)
                                                                                         throws javax.xml.registry.JAXRException
Retrieves all classifications with a concept which belongs to a given parent.

Parameters:
ro -
scheme -
parentConceptPath -
Returns:
Collection
Throws:
javax.xml.registry.JAXRException

getEnumClassifications

public java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                java.lang.String key)
                                                                                         throws javax.xml.registry.JAXRException
Retrieves all classifications with a concept which belongs to a given parent.

Parameters:
ro -
Returns:
Collection
Throws:
javax.xml.registry.JAXRException

getEnumClassifications

public java.util.Collection<javax.xml.registry.infomodel.Classification> getEnumClassifications(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                javax.xml.registry.infomodel.Concept parentConcept)
                                                                                         throws javax.xml.registry.JAXRException
Retrieves all classifications with a concept which belongs to a given parent.

Parameters:
ro -
parentConcept -
Returns:
Collection
Throws:
javax.xml.registry.JAXRException

getClassifications

public java.util.Collection<javax.xml.registry.infomodel.Classification> getClassifications(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                            java.util.Collection<javax.xml.registry.infomodel.Concept> concepts)
                                                                                     throws javax.xml.registry.JAXRException
Retrieves all classifications with a concept which belongs to the given collection.

Parameters:
ro -
concepts -
Returns:
Collection
Throws:
javax.xml.registry.JAXRException

findClassificationByConcept

public javax.xml.registry.infomodel.Classification findClassificationByConcept(javax.xml.registry.infomodel.RegistryObject ro,
                                                                               java.lang.String scheme,
                                                                               java.lang.String conceptPath)
                                                                        throws javax.xml.registry.JAXRException
Retrieves a Classification by given concept path

Throws:
javax.xml.registry.JAXRException

findClassificationsByConcept

public java.util.Collection<javax.xml.registry.infomodel.Classification> findClassificationsByConcept(javax.xml.registry.infomodel.RegistryObject ro,
                                                                                                      java.lang.String scheme,
                                                                                                      java.lang.String conceptPath)
                                                                                               throws javax.xml.registry.JAXRException
Retrieves a Classification by given concept path

Throws:
javax.xml.registry.JAXRException

findConceptByPath

public javax.xml.registry.infomodel.Concept findConceptByPath(java.lang.String classificationScheme,
                                                              java.lang.String path)
                                                       throws javax.xml.registry.JAXRException
Retrieves a Concept by ClasssificationScheme name and path.

Throws:
javax.xml.registry.JAXRException

findConceptByPath

public javax.xml.registry.infomodel.Concept findConceptByPath(java.lang.String fullPath)
                                                       throws javax.xml.registry.JAXRException
Retrieves a Concept by full path.

Parameters:
fullPath -
Throws:
javax.xml.registry.JAXRException

findObjectTypeConcept

public javax.xml.registry.infomodel.Concept findObjectTypeConcept(java.lang.String objectType)
                                                           throws javax.xml.registry.JAXRException
Retrieves the Concept for the given object type.

Throws:
javax.xml.registry.JAXRException

findAssociationTypeConcept

public javax.xml.registry.infomodel.Concept findAssociationTypeConcept(java.lang.String associationType)
                                                                throws javax.xml.registry.JAXRException
Retrieves the Concept for the given association type.

Throws:
javax.xml.registry.JAXRException

findClassificationSchemeByName

public javax.xml.registry.infomodel.ClassificationScheme findClassificationSchemeByName(java.lang.String name)
                                                                                 throws javax.xml.registry.JAXRException
Retrieves ClassificationScheme by name.

Throws:
javax.xml.registry.JAXRException

getCheckpointName

public java.lang.String getCheckpointName(javax.xml.registry.infomodel.RegistryObject ro)
                                   throws CSAppFrameworkException
Parameters:
ro -
Returns:
string
Throws:
CSAppFrameworkException