WsArtifacts.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 package org.apache.qpid.management.wsdm.capabilities;
22 
23 import org.w3c.dom.Document;
24 import org.w3c.dom.Element;
25 
26 /**
27  * Web Service Artifacts.
28  * Basically it acts as a container for all artifacts built when a new WS-Resource is created.
29  * With WS artifacts we mean :
30  
31  <ul>
32  *   <li>Capability class (which encapsulate the WS-DM capability concern)</li>
33  *   <li>WS Resource Metadata Descriptor (RMD)</li>
34  *   <li>Web Service Description (WSDL)</li>
35  </ul>
36  
37  @author Andrea Gazzarini
38  */
39 class WsArtifacts {
40 
41   private final Class<MBeanCapability>_capabilityClass;
42   private final Element[] _resourceMetadataDescriptor;
43   private final Document _wsdl; 
44 
45   /**
46    * Builds a new artifacts container with the given artifacts.
47    
48    @param capabilityClass the capability class.
49    @param resourceMetadataDescriptor the resource metadata descriptor.
50    @param wsdl the wsdl.
51    */
52   public WsArtifacts(
53       Class<MBeanCapability> capabilityClass,
54       Element[] resourceMetadataDescriptor, 
55       Document wsdl
56   {
57     this._capabilityClass = capabilityClass;
58     this._resourceMetadataDescriptor = resourceMetadataDescriptor;
59     this._wsdl = wsdl;
60   }
61 
62   /**
63    * Returns the capability class.
64    
65    @return the capability class.
66    */
67   Class<MBeanCapability> getCapabilityClass() 
68   {
69     return _capabilityClass;
70   }
71 
72   /**
73    * Returns the resource metadata descriptor.
74    * It is not a whole document but each property metadata is described in a 
75    * separated element so the returned object is an array of elements.
76    
77    @return the resource metadata descriptor.
78    */
79   Element[] getResourceMetadataDescriptor() 
80   {
81     return _resourceMetadataDescriptor;
82   }
83 
84   /**
85    * Returns the web service description.
86    
87    @return the web service description (WSDL).
88    */
89   Document getWsdl() 
90   {
91     return _wsdl;
92   }
93 }