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.EbXMLObjectLibrary;
20  import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLRegistryPackage;
21  import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus;
22  import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryPackageType;
23  
24  import java.util.List;
25  import java.util.Map;
26  
27  /**
28   * Encapsulation for {@link RegistryPackageType}.
29   * @author Jens Riemschneider
30   */
31  public class EbXMLRegistryPackage30 extends EbXMLRegistryObject30<RegistryPackageType> implements EbXMLRegistryPackage, ExtraMetadataHolder {
32      /**
33       * Constructs a registry package by wrapping the given ebXML 3.0 object.
34       * @param registryPackage
35       *          the object to wrap.
36       * @param objectLibrary
37       *          the object library to use.
38       */
39      public EbXMLRegistryPackage30(RegistryPackageType registryPackage, EbXMLObjectLibrary objectLibrary) {
40          super(registryPackage, objectLibrary);
41      }
42  
43      @Override
44      public AvailabilityStatus getStatus() {
45          return AvailabilityStatus.valueOfOpcode(getInternal().getStatus());
46      }
47  
48      @Override
49      public void setStatus(AvailabilityStatus status) {
50          getInternal().setStatus(AvailabilityStatus.toQueryOpcode(status));
51      }
52  
53      @Override
54      public Map<String, List<String>> getExtraMetadata() {
55          return getInternal().getExtraMetadata();
56      }
57  
58      @Override
59      public void setExtraMetadata(Map<String, List<String>> map) {
60          getInternal().setExtraMetadata(map);
61      }
62  }