gov.nist.hl7.ws.repository
Interface RepositoryInterface


public interface RepositoryInterface

This service provides a mechanism to store and retrieve artifacts related to the HL7 V2 standard such as message profiles.

Author:
Robert Snelick

Method Summary
 java.lang.String bind(java.lang.String profileOID, java.lang.String resourceOID)
          This method binds a profile and a resource together.
 boolean bindAnotherResource(java.lang.String resourceOID, java.lang.String handleOID)
          This method binds an additional resource to a known handle OID.
 boolean bindWithOID(java.lang.String profileOID, java.lang.String resourceOID, java.lang.String handleOID)
          This method binds a profile and a resource together to a known handle OID.
 java.lang.String[] getBindings(java.lang.String handleOID)
          Use this method to retrieve a set of OIDs that are bound to a handle OID.
 java.lang.String getLastExceptionMessage()
          Get the message of the last exception caught.
 java.lang.String getProfile(java.lang.String oid)
           
 java.lang.String getResource(java.lang.String oid)
           
 java.lang.String loadProfile(java.lang.String xmlProfile)
          Load a profile into the repository.
 boolean loadProfileWithOID(java.lang.String xmlProfile, java.lang.String oid)
          Load a profile (xmlProfile) into the repository and associated an object identifier (OID) with it.
 java.lang.String loadResource(java.lang.String xmlResource)
          Load a resource into the repository.
 boolean loadResourceWithOID(java.lang.String xmlResource, java.lang.String oid)
          Load a resource (xmlResource) into the repository and associated an object identifier (OID) with it.
 boolean queryRepository(java.lang.String oid)
           
 java.lang.String[] queryRepositoryForHandles()
          Use this method to get a list of the handles in the repository.
 java.lang.String[] queryRepositoryForProfiles()
           
 java.lang.String[] queryRepositoryForResources()
           
 

Method Detail

bind

java.lang.String bind(java.lang.String profileOID,
                      java.lang.String resourceOID)
                      throws java.lang.Exception
This method binds a profile and a resource together. It returns a new handle OID that represents a "package" that consists of a profile and a resource.

Parameters:
profileOID - an OID referencing a profile
resourceOID - an OID referencing a resource
Returns:
an OID referencing a handle to the artifacts that were successfully bound; return null otherwise.
Throws:
java.lang.Exception

bindWithOID

boolean bindWithOID(java.lang.String profileOID,
                    java.lang.String resourceOID,
                    java.lang.String handleOID)
                    throws java.lang.Exception
This method binds a profile and a resource together to a known handle OID.

Parameters:
profileOID - an OID referencing a profile
resourceOID - an OID referencing a resource
handleOID - an OID referencing a package of a profile and resource(s)
Returns:
true if the artifacts were successfully bound; false otherwise.
Throws:
java.lang.Exception

bindAnotherResource

boolean bindAnotherResource(java.lang.String resourceOID,
                            java.lang.String handleOID)
                            throws java.lang.Exception
This method binds an additional resource to a known handle OID. This method is used in cases where multiple resources are bound to a given profile.

Parameters:
resourceOID - an OID referencing the resource to bind
handleOID - an OID referencing a package of a profile and resource(s)
Returns:
true if the resource was successfully bound; return false otherwise.
Throws:
java.lang.Exception

getBindings

java.lang.String[] getBindings(java.lang.String handleOID)
                               throws java.lang.Exception
Use this method to retrieve a set of OIDs that are bound to a handle OID. The method returns an array of strings. The first location in the String array is the OID for the profile. Subsequent OIDs represents resources. If the array is empty, the handle was not found.

Parameters:
handleOID - an object identifier referencing a handle to a profile and possible resources
Returns:
on success return an array of Strings in which the first location is the OID of the profile and subsequent OIDs reference resources; if the handle OID was not found, the array is empty.
Throws:
java.lang.Exception

loadProfile

java.lang.String loadProfile(java.lang.String xmlProfile)
                             throws java.lang.Exception
Load a profile into the repository. The repository associates an OID with the profile. The OID is returned on success.

Parameters:
xmlProfile - an HL7 version message profile. The profile is an XML document that follows the rules given in the HL7 version profile schema.

Returns:
on success an OID; on failure the empty string
Throws:
java.lang.Exception

loadProfileWithOID

boolean loadProfileWithOID(java.lang.String xmlProfile,
                           java.lang.String oid)
                           throws java.lang.Exception
Load a profile (xmlProfile) into the repository and associated an object identifier (OID) with it.

Parameters:
xmlProfile - an HL7 version message profile. The profile is an XML document that follows the rules given in the HL7 version profile schema.
oid - an object identifier referencing a profile

Returns:
true if the profile was successfully loaded using the OID; false otherwise.
Throws:
java.lang.Exception

getProfile

java.lang.String getProfile(java.lang.String oid)
                            throws java.lang.Exception
Parameters:
oid - an object identifier referencing a profile

Returns:
on success return an xmlProfile referenced by the OID; on failure return the empty string
Throws:
java.lang.Exception

loadResource

java.lang.String loadResource(java.lang.String xmlResource)
                              throws java.lang.Exception
Load a resource into the repository. The repository associates an OID with the resource. The OID is returned on success.

Parameters:
xmlResource - a resource that is represented as XML file

Returns:
on success an OID; on failure the empty string
Throws:
java.lang.Exception

loadResourceWithOID

boolean loadResourceWithOID(java.lang.String xmlResource,
                            java.lang.String oid)
                            throws java.lang.Exception
Load a resource (xmlResource) into the repository and associated an object identifier (OID) with it.

Parameters:
xmlResource - a resource that is represented as XML file

oid - an object identifier referencing a resource

Returns:
true if the resource was successfully loaded using the OID; false otherwise.
Throws:
java.lang.Exception

getResource

java.lang.String getResource(java.lang.String oid)
                             throws java.lang.Exception
Parameters:
oid - an object identifier referencing a resource

Returns:
on success return an xmlResource referenced by the OID; on failure return the empty string
Throws:
java.lang.Exception

queryRepository

boolean queryRepository(java.lang.String oid)
                        throws java.lang.Exception
Parameters:
oid - an object identifier referencing a profile
Returns:
true if the profile reference by the OID is in the repository; false otherwise.
Throws:
java.lang.Exception

queryRepositoryForProfiles

java.lang.String[] queryRepositoryForProfiles()
                                              throws java.lang.Exception
Returns:
an array of OIDs representing the profiles in the repository
Throws:
java.lang.Exception

queryRepositoryForResources

java.lang.String[] queryRepositoryForResources()
                                               throws java.lang.Exception
Returns:
an array of OIDs representing the resources in the repository
Throws:
java.lang.Exception

queryRepositoryForHandles

java.lang.String[] queryRepositoryForHandles()
                                             throws java.lang.Exception
Use this method to get a list of the handles in the repository. A handle is an OID that links a profile (OID) and a set of resources together as a single package (or handle).

Returns:
an array of OIDs representing the handles in the repository and for each handle return the bindings to that handle.
Throws:
java.lang.Exception

getLastExceptionMessage

java.lang.String getLastExceptionMessage()
                                         throws java.lang.Exception
Get the message of the last exception caught.

Returns:
a description of the last exception.
Throws:
java.lang.Exception