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.assertion;
17  
18  import org.apache.juddi.datatype.KeyedReference;
19  import org.apache.juddi.datatype.RegistryObject;
20  
21  /***
22   * Many businesses, like large enterprises or marketplaces, are not effectively
23   * represented by a single businessEntity, since their description and
24   * discovery are likely to be diverse. As a consequence, serveral BusinessEntity
25   * structures can be published, representing individual subsidiaries of a large
26   * enterprise or individual participants of a marketplace. Nevertheless, they
27   * still represent a more or less coupled community and would like to make
28   * some of their relationships visible in their UDDI registrations. Therefore
29   * two related businesses use the xx_pulisherAssertion messages, publishing
30   * assertiions of business relationships.
31   *
32   * @author Steve Viens (sviens@apache.org)
33   */
34  public class PublisherAssertion implements RegistryObject
35  {
36    String fromKeyValue;
37    String toKeyValue;
38    KeyedReference keyedReference;
39  
40    /***
41     * Construct a new initialized keyedReference instance.
42     */
43    public PublisherAssertion()
44    {
45    }
46  
47    /***
48     * Construct a new initialized keyedReference instance.
49     */
50    public PublisherAssertion(String fromKey,String toKey,KeyedReference keyedRef)
51    {
52      this.fromKeyValue = fromKey;
53      this.toKeyValue = toKey;
54      this.keyedReference = keyedRef;
55    }
56  
57    /***
58     * Sets the fromKey.
59     *
60     * @param fromKey The fromKey.
61     */
62    public void setFromKey(String fromKey)
63    {
64      this.fromKeyValue = fromKey;
65    }
66  
67    /***
68     * Returns the fromKey.
69     *
70     * @return The fromKey.
71     */
72    public String getFromKey()
73    {
74      return fromKeyValue;
75    }
76  
77    /***
78     * Sets the toKey.
79     *
80     * @param toKey The toKey.
81     */
82    public void setToKey(String toKey)
83    {
84      this.toKeyValue = toKey;
85    }
86  
87    /***
88     * Returns the toKey.
89     *
90     * @return The toKey.
91     */
92    public String getToKey()
93    {
94      return this.toKeyValue;
95    }
96  
97    /***
98     * Sets the KeyedReference.
99     *
100    * @param keyedRef The new KeyedReference instance or null.
101    */
102   public void setKeyedReference(KeyedReference keyedRef)
103   {
104     this.keyedReference = keyedRef;
105   }
106 
107   /***
108    * Returns the KeyedReference instance.
109    *
110    * @return The KeyedReference instance.
111    */
112   public KeyedReference getKeyedReference()
113   {
114     return this.keyedReference;
115   }
116 
117   /***
118    * Sets the reference to this assertion's tModel to the given reference.
119    *
120    * @param tModelKey The key of the tModel to reference.
121    */
122   public void setTModelKey(String tModelKey)
123   {
124     if (this.keyedReference == null)
125       this.keyedReference = new KeyedReference();
126     this.keyedReference.setTModelKey(tModelKey);
127   }
128 
129   /***
130    * Sets the name of this assertion's keyedReference.
131    *
132    * @param keyName The new name of this keyedReference
133    */
134   public void setKeyName(String keyName)
135   {
136     if (this.keyedReference == null)
137       this.keyedReference = new KeyedReference();
138     this.keyedReference.setKeyName(keyName);
139   }
140 
141   /***
142    * Sets the value of this assertion's keyedReference.
143    *
144    * @param keyValue The new value of this keyedReference
145    */
146   public void setKeyValue(String keyValue)
147   {
148     if (this.keyedReference == null)
149       this.keyedReference = new KeyedReference();
150     this.keyedReference.setKeyValue(keyValue);
151   }
152 }