1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.juddi.datatype.binding;
17
18 import java.util.Vector;
19
20 import org.apache.juddi.datatype.Description;
21 import org.apache.juddi.datatype.RegistryObject;
22 import org.apache.juddi.datatype.TModelKey;
23
24 /***
25 * A TModelInstanceInfo object represents the BindingTemplate instance
26 * specific details for a single TModel by reference.<p>
27 *
28 * A set of these is held by the TModelInstanceDetails Map. When taken as a
29 * group they form a technically descriptive fingerprint by virtue of the
30 * unordered list of tModelKey references that they form. Each singular
31 * TModelInstanceInfo refers to a single tModel, and its presence in a
32 * bindingTemplate.tModelInstanceDetails implies that this containing web
33 * service supports the tModel that is referenced.
34 *
35 * @author Steve Viens (sviens@apache.org)
36 */
37 public class TModelInstanceInfo implements RegistryObject
38 {
39
40
41
42 String tModelKey;
43
44
45
46
47 Vector descVector;
48
49
50
51
52
53
54 InstanceDetails instanceDetails;
55
56 /***
57 * Constructs a new empty TModelInstanceDetails.
58 */
59 public TModelInstanceInfo()
60 {
61 }
62
63 /***
64 * Constructs a new empty TModelInstanceDetails.
65 */
66 public TModelInstanceInfo(String key)
67 {
68 this.tModelKey = key;
69 }
70
71 /***
72 * Sets the tModel key of this tModelInstanceInfo to the given key.
73 *
74 * @param key The key of the tModel this tModelInstanceInfo is
75 * referencing to.
76 */
77 public void setTModelKey(TModelKey key)
78 {
79 if ((key != null) && (key.getValue() != null))
80 this.tModelKey = key.getValue();
81 }
82
83 /***
84 * Sets the tModel key of this tModelInstanceInfo to the given key.
85 *
86 * @param key The key of the tModel this tModelInstanceInfo is
87 * referencing to.
88 */
89 public void setTModelKey(String key)
90 {
91 this.tModelKey = key;
92 }
93
94 /***
95 * Returns the tModel key of this tModelInstanceInfo.
96 *
97 * @return The tModel key of this tModelInstanceInfo.
98 */
99 public String getTModelKey()
100 {
101 return this.tModelKey;
102 }
103
104 /***
105 * Add a Description to the collection of Descriptions.
106 *
107 * @param desc The Description to add.
108 */
109 public void addDescription(Description desc)
110 {
111 if (this.descVector == null)
112 this.descVector = new Vector();
113 this.descVector.add(desc);
114 }
115
116 /***
117 * Sets the Description intance to the one one passed in.
118 *
119 * @param descs Descriptions of Description objects to set
120 */
121 public void setDescriptionVector(Vector descs)
122 {
123 this.descVector = descs;
124 }
125
126 /***
127 * Returns the descriptions.
128 *
129 * @return the descriptions. If the aren't any descriptions, an empty
130 * enumeration is returned.
131 */
132 public Vector getDescriptionVector()
133 {
134 return this.descVector;
135 }
136
137 /***
138 * Sets the instanceDetails of this tModelInstanceInfo to the given
139 * instanceDetails.
140 *
141 * @param details The instanceDetails of this tModelInstanceInfo, or null if
142 * this tModelInstanceInfo doesn't have any instanceDetails.
143 */
144 public void setInstanceDetails(InstanceDetails details)
145 {
146 this.instanceDetails = details;
147 }
148
149 /***
150 * Returns the instanceDetails of this tModelInstanceInfo.
151 *
152 * @return The instanceDetails of this tModelInstanceInfo, or null if this
153 * tModelInstanceInfo doesn't have an instanceDetails.
154 */
155 public InstanceDetails getInstanceDetails()
156 {
157 return this.instanceDetails;
158 }
159 }