KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > request > GetBindingDetail


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 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.apache.juddi.datatype.request;
17
18 import java.util.Vector JavaDoc;
19
20 import org.apache.juddi.datatype.BindingKey;
21 import org.apache.juddi.datatype.RegistryObject;
22
23 /**
24  * "Used to get full bindingTemplate information suitable for make one
25  * or more service requests. Returns a bindingDetail message."
26  *
27  * @author Steve Viens (sviens@apache.org)
28  */

29 public class GetBindingDetail implements RegistryObject,Inquiry
30 {
31   String JavaDoc generic;
32   Vector JavaDoc bindingKeyVector;
33
34   /**
35    * Construct a new empty get_bindingDetail request
36    */

37   public GetBindingDetail()
38   {
39   }
40
41   /**
42    *
43    * @param genericValue
44    */

45   public void setGeneric(String JavaDoc genericValue)
46   {
47     this.generic = genericValue;
48   }
49
50   /**
51    *
52    * @return String UDDI request's generic value.
53    */

54   public String JavaDoc getGeneric()
55   {
56     return this.generic;
57   }
58
59   /**
60    * Add a reference to a bindingTemplate to this search. All the details for the
61    * referenced bindingTemplate will be searched.
62    *
63    * @param key The bindingkey of the referenced bindingTemplate.
64    */

65   public void addBindingKey(BindingKey key)
66   {
67     if ((key != null) && (key.getValue() != null))
68       addBindingKey(key.getValue());
69   }
70
71   /**
72    * Adds a BindingKey to the collection of binding keys used by this query.
73    *
74    * @param key A BindingKey
75    */

76   public void addBindingKey(String JavaDoc key)
77   {
78     if (bindingKeyVector == null)
79       bindingKeyVector = new Vector JavaDoc();
80     bindingKeyVector.add(key);
81   }
82
83   /**
84    * Add a collection of bindingTemplate references to this search. All the details for the
85    * given referenced bindingTemplates will be searched.
86    *
87    * @param keys The collection of bindingkeys.
88    */

89   public void setBindingKeyVector(Vector JavaDoc keys)
90   {
91     this.bindingKeyVector = keys;
92   }
93
94   /**
95    *
96    */

97   public Vector JavaDoc getBindingKeyVector()
98   {
99     return this.bindingKeyVector;
100   }
101
102   /**
103    *
104    */

105   public String JavaDoc toString()
106   {
107     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
108
109     if (this.bindingKeyVector != null)
110       for (int i=0; i<this.bindingKeyVector.size(); i++)
111         buffer.append(this.bindingKeyVector.elementAt(i));
112
113     return buffer.toString();
114   }
115 }
Popular Tags