org.eclipse.ohf.ihe.xds.consumer
Class Consumer

java.lang.Object
  extended by org.eclipse.ohf.ihe.xds.consumer.Consumer

public class Consumer
extends java.lang.Object

IHE XDS Document Consumer implementation - (SEK) updated for EOHF Supports Transaction ITI-16: Query Registry, Transaction ITI-17: Retrieve Document and Transaction ITI-18: Registry Stored Query

Author:
Sarah Knoop
See Also:
IHE Technical Framework, Stored Query Supplement

Constructor Summary
Consumer(java.lang.String regURL)
          Constructor,
Consumer(java.lang.String regURL, boolean doAudit)
          Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors
Consumer(java.net.URI regURI)
          Constructor,
Consumer(java.net.URI regURI, boolean doAudit)
          Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors
 
Method Summary
 java.net.URI getRegURI()
           
 java.lang.String getRegURL()
           
 java.util.List invokeStoredQuery(StoredQuery q, boolean returnReferencesOnly, java.lang.String initiatingUser)
          Transaction ITI-18: Registry Stored Query
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes.
 boolean isDoAudit()
           
 java.util.List query(Query q, boolean returnReferencesOnly, java.lang.String initiatingUser)
          Transaction ITI-16: Query Registry
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes.
 java.util.List query(java.lang.String sqlQueryString, boolean returnReferencesOnly, java.lang.String initiatingUser)
          Transaction ITI-16: Query Registry
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes.
 java.io.InputStream retrieveDocument(java.lang.String uri, java.lang.String initiatingUser)
          Transaction ITI-17: Retrieve Document
Retrieve an input stream from which the document content can be read.
 void setDoAudit(boolean doAudit)
          Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors
 void setRegURI(java.net.URI regURI)
          Sets the the URI of the registy
 void setRegURL(java.lang.String regURL)
          Sets the string url to be the URI of the registy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Consumer

public Consumer(java.lang.String regURL,
                boolean doAudit)
Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors

Constructor,

Parameters:
regURL - the URL string for the registry to use for query requests
doAudit - whether to enable or disable auditing for the consumer actor

Consumer

public Consumer(java.lang.String regURL)
Constructor,

Parameters:
regURL - the URL string for the registry to use for query requests

Consumer

public Consumer(java.net.URI regURI,
                boolean doAudit)
Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors

Constructor,

Parameters:
regURI - the URI for the registry to use for query requests
doAudit - whether to enable or disable auditing for the consumer actor

Consumer

public Consumer(java.net.URI regURI)
Constructor,

Parameters:
regURI - the URI for the registry to use for query requests
Method Detail

isDoAudit

public boolean isDoAudit()
Returns:
Returns the doAudit.

setDoAudit

public void setDoAudit(boolean doAudit)
Deprecated. use AtnaAgentFactory.getAtnaAgent().setDoAudit(doAudit) to turn auditing on and off for all your actors

Parameters:
doAudit - the doAudit to set

getRegURL

public java.lang.String getRegURL()
Returns:
Returns the regURI as a url string

setRegURL

public void setRegURL(java.lang.String regURL)
Sets the string url to be the URI of the registy

Parameters:
regURL - The regURL to set.

getRegURI

public java.net.URI getRegURI()
Returns:
Returns the regURI

setRegURI

public void setRegURI(java.net.URI regURI)
Sets the the URI of the registy

Parameters:
regURL - The URI to set.

query

public java.util.List query(Query q,
                            boolean returnReferencesOnly,
                            java.lang.String initiatingUser)
                     throws java.lang.Exception
Transaction ITI-16: Query Registry
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes. This is the prefered version of the query method and should be used whenever possible.

Parameters:
q - fully populated Query object to be executed by the consumer Query
returnReferencesOnly - used to indicate the return type desired by the user. Set returnReferencesOnly = true if only references to document entries are desired. This option is desireable if the user is expecting many documents to satisfy the query, or if memory space is a concern. Set returnReferencesOnly = false if the complete document entry object is desired.
initiatingUser - entity issuing the query. Can only be null or empty string if auditing is disabled for the Consumer
Returns:
a List of returned data. If returnReferencesOnly = false the returned data will be a List populated with DocumentEntryTypes, containing all metadata for each document satisfying the criteria specified in the argument map. If the returnReferencesOnly = true the returned data will be a list of DocumentEntry.entryUUID string values that reference the DocumentEntries in the registry that satisfy the query. Returns null if no documents are found.
Throws:
java.lang.Exception

query

public java.util.List query(java.lang.String sqlQueryString,
                            boolean returnReferencesOnly,
                            java.lang.String initiatingUser)
                     throws java.lang.Exception
Transaction ITI-16: Query Registry
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes. This method should be used with extreem caution as the SQL query string is not validated in any way before being sent.

Parameters:
sqlQueryString - query to be executed by the Consumer
returnReferencesOnly - used to indicate the return type desired by the user. Set returnReferencesOnly = true if only references to document entries are desired. This option is desireable if the user is expecting many documents to satisfy the query, or if memory space is a concern. Set returnReferencesOnly = false if the complete document entry object is desired.
initiatingUser - entity issuing the query. Can only be null or empty string if auditing is disabled for the Consumer
Returns:
a List of returned data. If returnReferencesOnly = false the returned data will be a List populated with DocumentEntryTypes, containing all metadata for each document satisfying the criteria specified in the argument map. If the returnReferencesOnly = true the returned data will be a list of DocumentEntry.entryUUID string values that reference the DocumentEntries in the registry that satisfy the query. Returns null if no documents are found.
Throws:
java.lang.Exception

invokeStoredQuery

public java.util.List invokeStoredQuery(StoredQuery q,
                                        boolean returnReferencesOnly,
                                        java.lang.String initiatingUser)
                                 throws java.lang.Exception
Transaction ITI-18: Registry Stored Query
Query for and retrieve a list of docoment metadata or metadata references based on the input attributes. This is the prefered version of the query method and should be used whenever possible.

Parameters:
q - fully populated AdhocQueryType object to be executed by the consumer AdhocQueryType
returnReferencesOnly - used to indicate the return type desired by the user. Set returnReferencesOnly = true if only references to document entries are desired. This option is desireable if the user is expecting many documents to satisfy the query, or if memory space is a concern. Set returnReferencesOnly = false if the complete document entry object is desired.
initiatingUser - entity issuing the query. Can only be null or empty string if auditing is disabled for the Consumer
Returns:
a List of returned data. If returnReferencesOnly = false the returned data will be a List populated with DocumentEntryTypes, containing all metadata for each document satisfying the criteria specified in the argument map. If the returnReferencesOnly = true the returned data will be a list of DocumentEntry.entryUUID string values that reference the DocumentEntries in the registry that satisfy the query. Returns null if no documents are found.
Throws:
java.lang.Exception

retrieveDocument

public java.io.InputStream retrieveDocument(java.lang.String uri,
                                            java.lang.String initiatingUser)
                                     throws java.io.IOException,
                                            ATNAAuditClientException,
                                            java.security.GeneralSecurityException
Transaction ITI-17: Retrieve Document
Retrieve an input stream from which the document content can be read.

Parameters:
uri - The input value is the URI for the document, presumably returned from the getUri() function on an element returned from findDocuments.
initiatingUser - identity of the user initiating the export transaction. Used only for auditing.
Throws:
ATNAAuditClientException
java.security.GeneralSecurityException
java.io.IOException