View Javadoc

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;
19  
20  import org.apache.juddi.datatype.RegistryObject;
21  import org.apache.juddi.datatype.UploadRegister;
22  import org.apache.juddi.datatype.tmodel.TModel;
23  
24  /***
25   * "Used to register or update complete information about a tModel."
26   *
27   * @author Steve Viens (sviens@apache.org)
28   */
29  public class SaveTModel implements RegistryObject,Publish
30  {
31    String generic;
32    AuthInfo authInfo;
33    Vector tModelVector;
34    Vector uploadRegisterVector;
35  
36    /***
37     *
38     */
39    public SaveTModel()
40    {
41    }
42  
43    /***
44     *
45     */
46    public SaveTModel(AuthInfo authInfo,TModel tModel)
47    {
48      setAuthInfo(authInfo);
49      addTModel(tModel);
50    }
51  
52    /***
53     *
54     */
55    public SaveTModel(AuthInfo authInfo,Vector tModels)
56    {
57      setAuthInfo(authInfo);
58      setTModelVector(tModels);
59    }
60  
61    /***
62     *
63     * @param genericValue
64     */
65    public void setGeneric(String genericValue)
66    {
67      this.generic = genericValue;
68    }
69  
70    /***
71     *
72     * @return String UDDI request's generic value.
73     */
74    public String getGeneric()
75    {
76      return this.generic;
77    }
78  
79    /***
80     * addTModel
81     */
82    public void addTModel(TModel tModel)
83    {
84      if (this.tModelVector == null)
85        this.tModelVector = new Vector();
86      this.tModelVector.add(tModel);
87    }
88  
89    /***
90     *
91     */
92    public void setTModelVector(Vector tModels)
93    {
94      this.tModelVector = tModels;
95    }
96  
97    /***
98     * getTModels
99     */
100   public Vector getTModelVector()
101   {
102     return this.tModelVector;
103   }
104 
105   /***
106    *
107    */
108   public void addUploadRegister(UploadRegister register)
109   {
110     if (this.uploadRegisterVector == null)
111       this.uploadRegisterVector = new Vector();
112     this.uploadRegisterVector.add(register);
113   }
114 
115   /***
116    *
117    */
118   public void setUploadRegisterVector(Vector registers)
119   {
120     this.uploadRegisterVector = registers;
121   }
122 
123   /***
124    *
125    */
126   public Vector getUploadRegisterVector()
127   {
128     return this.uploadRegisterVector;
129   }
130 
131   /***
132    *
133    */
134   public void setAuthInfo(AuthInfo authInfo)
135   {
136     if (authInfo == null)
137       throw new NullPointerException("The authentication info of a publish message cannot be null!");
138 
139     this.authInfo = authInfo;
140   }
141 
142   /***
143    *
144    */
145   public AuthInfo getAuthInfo()
146   {
147     return authInfo;
148   }
149 }