KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > response > BusinessInfo


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.response;
17
18 import java.util.Vector JavaDoc;
19
20 import org.apache.juddi.datatype.Description;
21 import org.apache.juddi.datatype.Name;
22 import org.apache.juddi.datatype.RegistryObject;
23
24 /**
25  * "Each businessInfo structure contains company name and optional description
26  * data, along with a collection element named serviceInfos that in turn can
27  * contain one or more serviceInfo structures" - UDDI Version 2.0 Data Structure
28  * Reference
29  *
30  * @author Steve Viens (sviens@apache.org)
31  */

32 public class BusinessInfo implements RegistryObject
33 {
34   String JavaDoc businessKey;
35   Vector JavaDoc nameVector;
36   Vector JavaDoc descVector;
37   ServiceInfos infos;
38
39   /**
40    * default constructor
41    */

42   public BusinessInfo()
43   {
44   }
45
46   /**
47    * copy constructor
48    */

49   public BusinessInfo(BusinessInfo bizInfo)
50   {
51     businessKey = bizInfo.getBusinessKey();
52     nameVector = bizInfo.getNameVector();
53     descVector = bizInfo.getDescriptionVector();
54     infos = bizInfo.getServiceInfos();
55   }
56
57   /**
58    *
59    */

60   public BusinessInfo(String JavaDoc key)
61   {
62     this.businessKey = key;
63   }
64
65   /**
66    *
67    */

68   public void setBusinessKey(String JavaDoc key)
69   {
70     this.businessKey = key;
71   }
72
73   /**
74    *
75    */

76   public String JavaDoc getBusinessKey()
77   {
78     return this.businessKey;
79   }
80
81   /**
82    *
83    */

84   public void addName(Name name)
85   {
86     if (this.nameVector == null)
87       this.nameVector = new Vector JavaDoc();
88     this.nameVector.add(name);
89   }
90
91   /**
92    *
93    */

94   public void setNameVector(Vector JavaDoc names)
95   {
96     this.nameVector = names;
97   }
98
99   /**
100    *
101    */

102   public Vector JavaDoc getNameVector()
103   {
104     return this.nameVector;
105   }
106
107   /**
108    *
109    */

110   public void addDescription(Description desc)
111   {
112     if (this.descVector == null)
113       this.descVector = new Vector JavaDoc();
114     this.descVector.add(desc);
115   }
116
117   /**
118    *
119    */

120   public void setDescriptionVector(Vector JavaDoc descriptions)
121   {
122     this.descVector = descriptions;
123   }
124
125   /**
126    *
127    */

128   public Vector JavaDoc getDescriptionVector()
129   {
130     return this.descVector;
131   }
132
133   /**
134    *
135    */

136   public void addServiceInfo(ServiceInfo info)
137   {
138     if (this.infos == null)
139       this.infos = new ServiceInfos();
140     this.infos.addServiceInfo(info);
141   }
142
143   /**
144    *
145    */

146   public void setServiceInfos(ServiceInfos infos)
147   {
148     this.infos = infos;
149   }
150
151   /**
152    *
153    */

154   public ServiceInfos getServiceInfos()
155   {
156     return this.infos;
157   }
158 }
Popular Tags