View Javadoc
1   /*
2    * Copyright 2009 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *     
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.ihe.xds.core.ebxml;
17  
18  
19  /**
20   * Serves as a factory for ebXML objects.
21   * <p>
22   * This factory is used to provide version independent creation of
23   * ebXML objects.
24   * @author Jens Riemschneider
25   */
26  public interface EbXMLFactory {
27      /**
28       * @return a new instance of an object library filled with object references used
29       *          for ebXML requests/responses.
30       */
31      EbXMLObjectLibrary createObjectLibrary();
32  
33      /**
34       * Creates a new classification.
35       * @param objectLibrary
36       *          the object library to use.
37       * @return the created object.
38       */
39      EbXMLClassification createClassification(EbXMLObjectLibrary objectLibrary);
40      
41      /**
42       * Creates a new extrinsic object and adds it to the object library.
43       * @param id
44       *          the id of the object within the object library.
45       * @param objectLibrary
46       *          the object library to use.
47       * @return the created object.
48       */
49      EbXMLExtrinsicObject createExtrinsic(String id, EbXMLObjectLibrary objectLibrary);
50  
51      /**
52       * Creates a new registry package and adds it to the object library.
53       * @param id
54       *          the id of the object within the object library.
55       * @param objectLibrary
56       *          the object library to use.
57       * @return the created object.
58       */
59      EbXMLRegistryPackage createRegistryPackage(String id, EbXMLObjectLibrary objectLibrary);
60  
61      /**
62       * Creates a new association.
63       * @param id
64       *          the id of the object within the object library.
65       * @param objectLibrary
66       *          the object library to use.
67       * @return the created object.
68       */
69      EbXMLAssociation createAssociation(String id, EbXMLObjectLibrary objectLibrary);
70      
71      /**
72       * Creates a new request to submit objects.
73       * @return the created object.
74       */
75      EbXMLSubmitObjectsRequest createSubmitObjectsRequest();
76      
77      /**
78       * Creates a new request to provide and register documents.
79       * @param library
80       *          the object library to use.
81       * @return the created object.
82       */
83      EbXMLProvideAndRegisterDocumentSetRequest createProvideAndRegisterDocumentSetRequest(EbXMLObjectLibrary library);
84  
85      /**
86       * Creates a new request to retrieve documents.
87       * @return the created object.
88       */
89      EbXMLNonconstructiveDocumentSetRequest createRetrieveDocumentSetRequest();
90  
91      /**
92       * Creates a new request to remove documents.
93       * @return the created object.
94       */
95      EbXMLNonconstructiveDocumentSetRequest createRemoveDocumentsRequest();
96  
97      /**
98       * Creates a new request to retrieve imaging documents.
99       * @return the created object.
100      */
101     EbXMLRetrieveImagingDocumentSetRequest createRetrieveImagingDocumentSetRequest();
102 
103     /**
104      * Creates a new request to query a registry.
105      * @return the created object.
106      */
107     EbXMLAdhocQueryRequest createAdhocQueryRequest();
108 
109     /**
110      * Creates a new response for a query request.
111      * @param objectLibrary
112      *          the object library to use.
113      * @param returnsObjectRefs
114      *          <code>true</code> if the response is meant to return object references instead
115      *          of the real objects. 
116      *          This parameter should be <code>true</code> to ensure that an object library
117      *          is not included in the query result contains ObjectRefs. Those ObjectRefs 
118      *          cannot be distinguished from the ObjectRefs of the object library and
119      *          therefore the object library would produce unwanted query results. 
120      * @return the created object.
121      */
122     EbXMLQueryResponse createAdhocQueryResponse(EbXMLObjectLibrary objectLibrary, boolean returnsObjectRefs);
123 
124     /**
125      * Creates a new response for a registry request.
126      * @return the created object.
127      */
128     EbXMLRegistryResponse createRegistryResponse();
129 
130     /**
131      * Creates a new response for a retrieve document request.
132      * @return the created object.
133      */
134     EbXMLRetrieveDocumentSetResponse createRetrieveDocumentSetResponse();
135 
136     /**
137      * Creates a new registry error object.
138      * @return the created object.
139      */
140     EbXMLRegistryError createRegistryError();
141 
142     /**
143      * Creates a new remove metadata request.
144      * @return the created object.
145      */
146     EbXMLRemoveMetadataRequest createRemoveMetadataRequest();
147 }