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.OverviewDoc;
22 import org.apache.juddi.datatype.RegistryObject;
23
24 /***
25 * Holds service-instance specific information that is required to either
26 * understand the service implementation details relative to a specific
27 * tModelKey reference, or to provide further parameter and settings support.
28 * If present this element should not be empty.
29 *
30 * @author Steve Viens (sviens@apache.org)
31 */
32 public class InstanceDetails implements RegistryObject
33 {
34
35
36
37 Vector descVector;
38
39
40
41 OverviewDoc overviewDoc;
42
43
44
45
46
47
48
49
50 String instanceParms;
51
52 /***
53 * Construct a new empty instanceDetails object.
54 */
55 public InstanceDetails()
56 {
57 }
58
59 /***
60 * Adds the given description. If there was already a description with the
61 * same language-code as the new description, an exception will be thrown.
62 *
63 * @param desc The description to add.
64 * languagecode.
65 */
66 public void addDescription(Description desc)
67 {
68 if (this.descVector == null)
69 this.descVector = new Vector();
70 this.descVector.add(desc);
71 }
72
73 /***
74 * Sets the description list to the current one. Ignores any object in the
75 * collection that is not an "instanceof" the Description class.
76 *
77 * @param descs Collection of Description objects to set
78 */
79 public void setDescriptionVector(Vector descs)
80 {
81 this.descVector = descs;
82 }
83
84 /***
85 * Returns the descriptions.
86 *
87 * @return the descriptions.
88 */
89 public Vector getDescriptionVector()
90 {
91 return this.descVector;
92 }
93
94 /***
95 * Sets the overview document of this instanceDetails to the given overview
96 * document.
97 *
98 * @param doc The new overview document, or null if the instanceDetails
99 * doesn't have an overview document anymore.
100 */
101 public void setOverviewDoc(OverviewDoc doc)
102 {
103 this.overviewDoc = doc;
104 }
105
106 /***
107 * Returns the overview document of this instanceDetails.
108 *
109 * @return The overview document of this instanceDetails, or null if this
110 * instanceDetails doesn't have an overvieuw document.
111 */
112 public OverviewDoc getOverviewDoc()
113 {
114 return this.overviewDoc;
115 }
116
117 /***
118 * Sets the instance parameters of this instanceDetails to the given instance
119 * parameters.
120 *
121 * @param parms The new instance parameters, or null if this instanceDetails
122 * doesn't have instance parameters anymore.
123 */
124 public void setInstanceParms(String parms)
125 {
126 this.instanceParms = parms;
127 }
128
129 /***
130 * Sets the instance parameters of this instanceDetails to the given instance
131 * parameters.
132 *
133 * @param parms The new instance parameters, or null if this instanceDetails
134 * doesn't have instance parameters anymore.
135 */
136 public void setInstanceParms(InstanceParms parms)
137 {
138 if ((parms != null) && (parms.getValue() != null))
139 setInstanceParms(parms.getValue());
140 }
141
142 /***
143 * Returns the instance parameters of this instanceDetails as a String.
144 *
145 * @return An InstanceParms instance containing the value of the instance
146 * parameters of this instanceDetails, or null if this instanceDetails
147 * doesn't have instance parameters.
148 */
149 public InstanceParms getInstanceParms()
150 {
151 if (this.instanceParms != null)
152 return new InstanceParms(this.instanceParms);
153 else
154 return null;
155 }
156
157 /***
158 * Returns the instance parameters of this instanceDetails as a String.
159 *
160 * @return A String containing the text value of the instance parameters
161 * of this instanceDetails, or null if this instanceDetails doesn't have
162 * instance parameters.
163 */
164 public String getInstanceParmsString()
165 {
166 return this.instanceParms;
167 }
168 }