com.sun.ebxml.registry.persistence.rdb
Class RegistryObjectDAO

java.lang.Object
  |
  +--com.sun.ebxml.registry.persistence.rdb.RegistryObjectDAO
Direct Known Subclasses:
AssociationDAO, AuditableEventDAO, ClassificationDAO, ClassificationNodeDAO, ExternalIdentifierDAO, ExternalLinkDAO, OrganizationDAO, RegistryEntryDAO, ServiceBindingDAO, SpecificationLinkDAO, UserDAO

public class RegistryObjectDAO
extends java.lang.Object

Author:
Farrukh S. Najmi, Adrian Chong
See Also:
<{RegistryEntry}>

Constructor Summary
RegistryObjectDAO()
           
 
Method Summary
protected  java.lang.String checkAssociationReferences(java.sql.Connection conn, java.lang.String roId)
           
protected  java.lang.String checkClassificationReferences(java.sql.Connection conn, java.lang.String roId)
           
protected  void checkReferences(java.sql.Connection conn, java.lang.String roId)
           
 void delete(org.oasis.ebxml.registry.bindings.rim.User user, java.sql.Connection connection, java.util.ArrayList registryObjectIds)
          Does a bulk delete of a Collection of objects that match the type for this persister.
 void generateAuditbleEvent(java.sql.Connection conn, java.util.ArrayList ros, java.lang.String eventType, org.oasis.ebxml.registry.bindings.rim.User user)
          Generate AuditabEvent
 void generateAuditbleEvent(java.sql.Connection conn, org.oasis.ebxml.registry.bindings.rim.RegistryObjectType roType, java.lang.String eventType, org.oasis.ebxml.registry.bindings.rim.User user)
          Generate AuditabEvent
static java.util.ArrayList getByIds(java.sql.Connection conn, java.util.ArrayList ids, boolean getComposedObjects)
           
 java.util.ArrayList getLeafObjectList(java.sql.Connection conn, java.sql.ResultSet rs, org.oasis.ebxml.registry.bindings.query.ResponseOption responseOption, java.util.ArrayList objectRefs)
           
 java.lang.String getObjectType(java.sql.Connection conn, java.lang.String id, java.lang.String tableName)
          Get the objectType of a submitted object in persistence layer
static org.oasis.ebxml.registry.bindings.rim.User getOwner(java.sql.Connection connection, java.lang.String objectId)
          Get the User that is the owner for the object with specified objectId
 java.util.HashMap getOwnersMap(java.sql.Connection connection, java.util.ArrayList ids)
          Get a HashMap with registry object id as key and owner id as value
 java.lang.String getTableName()
           
static java.lang.String getTableNameStatic()
           
 void insert(org.oasis.ebxml.registry.bindings.rim.User user, java.sql.Connection connection, java.util.ArrayList registryObjects)
          Does a bulk insert of a Collection of objects that match the type for this persister.
 void loadObjectFromResultSet(java.sql.Connection conn, java.lang.Object obj, java.sql.ResultSet rs, org.oasis.ebxml.registry.bindings.query.ResponseOption responseOption, java.util.ArrayList objectRefs)
           
 boolean registryObjectExist(java.sql.Connection conn, java.lang.String id)
          Return true if the RegistryObject exist
 boolean registryObjectExist(java.sql.Connection conn, java.lang.String id, java.lang.String tableName)
          Check whether the object exists in the specified table.
 java.util.ArrayList registryObjectsExist(java.sql.Connection conn, java.util.ArrayList ids)
          Returns ArrayList of ids of non-existent RegistryObject.
 java.util.ArrayList registryObjectsExist(java.sql.Connection conn, java.util.ArrayList ids, java.lang.String tableName)
          Returns ArrayList of ids of non-existent RegistryObject.
 java.util.HashMap sortIdsByObjectType(java.sql.Connection connection, java.util.ArrayList registryObjectIds)
          Sort registryObjectIds by their objectType.
 void update(org.oasis.ebxml.registry.bindings.rim.User user, java.sql.Connection connection, java.util.ArrayList registryObjects)
          Does a bulk update of a Collection of objects that match the type for this persister.
protected  void update(org.oasis.ebxml.registry.bindings.rim.User user, java.sql.Connection conn, java.util.ArrayList ros, boolean checkExistence, boolean checkAuthorization)
          This should be overrided by subclass DAO.
protected  java.util.ArrayList updateExistingObjects(org.oasis.ebxml.registry.bindings.rim.User user, java.sql.Connection conn, java.util.ArrayList ros)
          It is to update exisitng Registry Objects when any existing objects can be found within SubmitObjectsRequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryObjectDAO

public RegistryObjectDAO()
Method Detail

getTableNameStatic

public static java.lang.String getTableNameStatic()

getTableName

public java.lang.String getTableName()

generateAuditbleEvent

public void generateAuditbleEvent(java.sql.Connection conn,
                                  org.oasis.ebxml.registry.bindings.rim.RegistryObjectType roType,
                                  java.lang.String eventType,
                                  org.oasis.ebxml.registry.bindings.rim.User user)
                           throws RegistryException
Generate AuditabEvent

RegistryException

generateAuditbleEvent

public void generateAuditbleEvent(java.sql.Connection conn,
                                  java.util.ArrayList ros,
                                  java.lang.String eventType,
                                  org.oasis.ebxml.registry.bindings.rim.User user)
                           throws RegistryException
Generate AuditabEvent

RegistryException

checkAssociationReferences

protected java.lang.String checkAssociationReferences(java.sql.Connection conn,
                                                      java.lang.String roId)
                                               throws RegistryException
RegistryException

checkClassificationReferences

protected java.lang.String checkClassificationReferences(java.sql.Connection conn,
                                                         java.lang.String roId)
                                                  throws RegistryException
RegistryException

checkReferences

protected void checkReferences(java.sql.Connection conn,
                               java.lang.String roId)
                        throws RegistryException
RegistryException

getObjectType

public java.lang.String getObjectType(java.sql.Connection conn,
                                      java.lang.String id,
                                      java.lang.String tableName)
                               throws RegistryException
Get the objectType of a submitted object in persistence layer

Returns:
null if the object does not exist or the objectType field is null
RegistryException

insert

public void insert(org.oasis.ebxml.registry.bindings.rim.User user,
                   java.sql.Connection connection,
                   java.util.ArrayList registryObjects)
            throws RegistryException
Does a bulk insert of a Collection of objects that match the type for this persister. It is for inserting the nested objects, i.e., Name, Description, Slot, Classification and ExternalIdentifier

RegistryException

update

public void update(org.oasis.ebxml.registry.bindings.rim.User user,
                   java.sql.Connection connection,
                   java.util.ArrayList registryObjects)
            throws RegistryException
Does a bulk update of a Collection of objects that match the type for this persister. It is for updating the nested objects (i.e. Name, Description, Slot, Classification and ExternalIdentifier. It will firstly delete all the nested objects of each objects in the ArrayList registryObjects, and then inserts the nested objects again.

RegistryException

sortIdsByObjectType

public java.util.HashMap sortIdsByObjectType(java.sql.Connection connection,
                                             java.util.ArrayList registryObjectIds)
                                      throws RegistryException
Sort registryObjectIds by their objectType.

Returns:
The HashMap storing the objectType String as keys and ArrayList of ids as values. For ExtrinsicObject, the objectType key is stored as "ExtrinsicObject" rather than the objectType of the repository items.
RegistryException

delete

public void delete(org.oasis.ebxml.registry.bindings.rim.User user,
                   java.sql.Connection connection,
                   java.util.ArrayList registryObjectIds)
            throws RegistryException
Does a bulk delete of a Collection of objects that match the type for this persister.

RegistryException

registryObjectExist

public boolean registryObjectExist(java.sql.Connection conn,
                                   java.lang.String id)
                            throws RegistryException
Return true if the RegistryObject exist

RegistryException

registryObjectExist

public boolean registryObjectExist(java.sql.Connection conn,
                                   java.lang.String id,
                                   java.lang.String tableName)
                            throws RegistryException
Check whether the object exists in the specified table.

RegistryException

registryObjectsExist

public java.util.ArrayList registryObjectsExist(java.sql.Connection conn,
                                                java.util.ArrayList ids)
                                         throws RegistryException
Returns ArrayList of ids of non-existent RegistryObject.

RegistryException

registryObjectsExist

public java.util.ArrayList registryObjectsExist(java.sql.Connection conn,
                                                java.util.ArrayList ids,
                                                java.lang.String tableName)
                                         throws RegistryException
Returns ArrayList of ids of non-existent RegistryObject.

RegistryException

updateExistingObjects

protected java.util.ArrayList updateExistingObjects(org.oasis.ebxml.registry.bindings.rim.User user,
                                                    java.sql.Connection conn,
                                                    java.util.ArrayList ros)
                                             throws RegistryException
It is to update exisitng Registry Objects when any existing objects can be found within SubmitObjectsRequest. It should be called by the method insert() of subclass DAO.

Returns:
ArrayList of RegistryObjects that are not existing
RegistryException

update

protected void update(org.oasis.ebxml.registry.bindings.rim.User user,
                      java.sql.Connection conn,
                      java.util.ArrayList ros,
                      boolean checkExistence,
                      boolean checkAuthorization)
               throws RegistryException
This should be overrided by subclass DAO. It is called by updateExistingObjects() methods.

RegistryException

getByIds

public static java.util.ArrayList getByIds(java.sql.Connection conn,
                                           java.util.ArrayList ids,
                                           boolean getComposedObjects)
                                    throws RegistryException
RegistryException

loadObjectFromResultSet

public void loadObjectFromResultSet(java.sql.Connection conn,
                                    java.lang.Object obj,
                                    java.sql.ResultSet rs,
                                    org.oasis.ebxml.registry.bindings.query.ResponseOption responseOption,
                                    java.util.ArrayList objectRefs)
                             throws RegistryException
RegistryException

getLeafObjectList

public java.util.ArrayList getLeafObjectList(java.sql.Connection conn,
                                             java.sql.ResultSet rs,
                                             org.oasis.ebxml.registry.bindings.query.ResponseOption responseOption,
                                             java.util.ArrayList objectRefs)
                                      throws RegistryException
RegistryException

getOwner

public static org.oasis.ebxml.registry.bindings.rim.User getOwner(java.sql.Connection connection,
                                                                  java.lang.String objectId)
                                                           throws RegistryException,
                                                                  java.sql.SQLException
Get the User that is the owner for the object with specified objectId

RegistryException
java.sql.SQLException

getOwnersMap

public java.util.HashMap getOwnersMap(java.sql.Connection connection,
                                      java.util.ArrayList ids)
                               throws RegistryException
Get a HashMap with registry object id as key and owner id as value

RegistryException


Copyright © 2001-2003 OASIS. All Rights Reserved.