1/*2 * Copyright 2001-2004 The Apache Software Foundation.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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */16package org.apache.juddi.datatype.binding;
1718import java.util.Vector;
1920import org.apache.juddi.datatype.Description;
21import org.apache.juddi.datatype.RegistryObject;
22import org.apache.juddi.datatype.TModelKey;
2324/***25 * A TModelInstanceInfo object represents the BindingTemplate instance26 * specific details for a single TModel by reference.<p>27 *28 * A set of these is held by the TModelInstanceDetails Map. When taken as a29 * group they form a technically descriptive fingerprint by virtue of the30 * unordered list of tModelKey references that they form. Each singular31 * TModelInstanceInfo refers to a single tModel, and its presence in a32 * bindingTemplate.tModelInstanceDetails implies that this containing web33 * service supports the tModel that is referenced.34 *35 * @author Steve Viens (sviens@apache.org)36 */37publicclassTModelInstanceInfo implements RegistryObject38 {
39// Required attribute. This is the unique key referenced that implies that40// the service being described has implementation details that are specified41// by the specifications associated with the tModel that is referenced.42 String tModelKey;
4344// Optional repeating element. This is one or more language qualified text45// descriptions that designate what role a TModel referenc plays in the46// overall service description.47 Vector descVector;
4849// Optional, can be used when tModel reference specific settings or other50// descriptive information are required to either describe a tModel specific51// component of a service description or support services that require52// additional technical data support (eg, via settings or other handshake53// support). If this element is supplied it should not be empty.54InstanceDetails instanceDetails;
5556/***57 * Constructs a new empty TModelInstanceDetails.58 */59publicTModelInstanceInfo()
60 {
61 }
6263/***64 * Constructs a new empty TModelInstanceDetails.65 */66publicTModelInstanceInfo(String key)
67 {
68this.tModelKey = key;
69 }
7071/***72 * Sets the tModel key of this tModelInstanceInfo to the given key.73 *74 * @param key The key of the tModel this tModelInstanceInfo is75 * referencing to.76 */77publicvoid setTModelKey(TModelKey key)
78 {
79if ((key != null) && (key.getValue() != null))
80this.tModelKey = key.getValue();
81 }
8283/***84 * Sets the tModel key of this tModelInstanceInfo to the given key.85 *86 * @param key The key of the tModel this tModelInstanceInfo is87 * referencing to.88 */89publicvoid setTModelKey(String key)
90 {
91this.tModelKey = key;
92 }
9394/***95 * Returns the tModel key of this tModelInstanceInfo.96 *97 * @return The tModel key of this tModelInstanceInfo.98 */99public String getTModelKey()
100 {
101returnthis.tModelKey;
102 }
103104/***105 * Add a Description to the collection of Descriptions.106 *107 * @param desc The Description to add.108 */109publicvoid addDescription(Description desc)
110 {
111if (this.descVector == null)
112this.descVector = new Vector();
113this.descVector.add(desc);
114 }
115116/***117 * Sets the Description intance to the one one passed in.118 *119 * @param descs Descriptions of Description objects to set120 */121publicvoid setDescriptionVector(Vector descs)
122 {
123this.descVector = descs;
124 }
125126/***127 * Returns the descriptions.128 *129 * @return the descriptions. If the aren't any descriptions, an empty130 * enumeration is returned.131 */132public Vector getDescriptionVector()
133 {
134returnthis.descVector;
135 }
136137/***138 * Sets the instanceDetails of this tModelInstanceInfo to the given139 * instanceDetails.140 *141 * @param details The instanceDetails of this tModelInstanceInfo, or null if142 * this tModelInstanceInfo doesn't have any instanceDetails.143 */144publicvoid setInstanceDetails(InstanceDetails details)
145 {
146this.instanceDetails = details;
147 }
148149/***150 * Returns the instanceDetails of this tModelInstanceInfo.151 *152 * @return The instanceDetails of this tModelInstanceInfo, or null if this153 * tModelInstanceInfo doesn't have an instanceDetails.154 */155publicInstanceDetails getInstanceDetails()
156 {
157returnthis.instanceDetails;
158 }
159 }