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.ebxml30;
17  
18  import org.openehealth.ipf.commons.ihe.xds.core.ExtraMetadataHolder;
19  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLExtrinsicObject;
20  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLObjectLibrary;
21  import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus;
22  import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ExtrinsicObjectType;
23  
24  import javax.activation.DataHandler;
25  import java.util.List;
26  import java.util.Map;
27  
28  /**
29   * Encapsulation of {@link ExtrinsicObjectType}.
30   * @author Jens Riemschneider
31   */
32  public class EbXMLExtrinsicObject30 extends EbXMLRegistryObject30<ExtrinsicObjectType> implements EbXMLExtrinsicObject, ExtraMetadataHolder {
33      /**
34       * Constructs an extrinsic object by wrapping an ebXML 3.0 object.
35       * @param extrinsic
36       *          the object to wrap.
37       * @param objectLibrary
38       *          the object library to use.
39       */
40      public EbXMLExtrinsicObject30(ExtrinsicObjectType extrinsic, EbXMLObjectLibrary objectLibrary) {
41          super(extrinsic, objectLibrary);
42      }
43      
44      @Override
45      public String getMimeType() {
46          return getInternal().getMimeType();
47      }
48  
49      @Override
50      public void setMimeType(String mimeType) {
51          getInternal().setMimeType(mimeType);
52      }
53  
54      @Override
55      public AvailabilityStatus getStatus() {
56          return AvailabilityStatus.valueOfOpcode(getInternal().getStatus());
57      }
58  
59      @Override
60      public void setStatus(AvailabilityStatus status) {
61          getInternal().setStatus(AvailabilityStatus.toQueryOpcode(status));
62      }
63  
64      @Override
65      public DataHandler getDataHandler() {
66          return getInternal().getDataHandler();
67      }
68  
69      @Override
70      public void setDataHandler(DataHandler dataHandler) {
71          getInternal().setDataHandler(dataHandler);
72      }
73  
74      @Override
75      public Map<String, List<String>> getExtraMetadata() {
76          return getInternal().getExtraMetadata();
77      }
78  
79      @Override
80      public void setExtraMetadata(Map<String, List<String>> map) {
81          getInternal().setExtraMetadata(map);
82      }
83  }