View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/community/common/src/java/org/astrogrid/community/common/policy/data/CommunityData.java,v $</cvs:source>
3    * <cvs:author>$Author: dave $</cvs:author>
4    * <cvs:date>$Date: 2004/06/18 13:45:20 $</cvs:date>
5    * <cvs:version>$Revision: 1.7 $</cvs:version>
6    *
7    * <cvs:log>
8    *   $Log: CommunityData.java,v $
9    *   Revision 1.7  2004/06/18 13:45:20  dave
10   *   Merged development branch, dave-dev-200406081614, into HEAD
11   *
12   *   Revision 1.6.38.1  2004/06/17 13:38:58  dave
13   *   Tidied up old CVS log entries
14   *
15   * </cvs:log>
16   *
17   */
18  package org.astrogrid.community.common.policy.data ;
19  
20  public class CommunityData
21      {
22      /***
23       * Public constructor.
24       *
25       */
26      public CommunityData()
27          {
28          this.ident = null ;
29          this.service = null ;
30          this.manager = null ;
31          this.description = null ;
32          }
33  
34      /***
35       * Public constructor.
36       *
37       */
38      public CommunityData(String ident)
39          {
40          this(ident, null) ;
41          }
42  
43      /***
44       * Public constructor.
45       *
46       */
47      public CommunityData(String ident, String description)
48          {
49          this.ident = ident ;
50          this.service = null ;
51          this.manager = null ;
52          this.description = description ;
53          }
54  
55      /***
56       * Our Community ident.
57       *
58       */
59      private String ident ;
60  
61      /***
62       * Access to our Community ident.
63       *
64       */
65      public String getIdent()
66          {
67          return this.ident ;
68          }
69  
70      /***
71       * Access to our Community ident.
72       *
73       */
74      public void setIdent(String value)
75          {
76          this.ident = value ;
77          }
78  
79      /***
80       * Our Community description.
81       *
82       */
83      private String description ;
84  
85      /***
86       * Access to our Community description.
87       *
88       */
89      public String getDescription()
90          {
91          return this.description ;
92          }
93  
94      /***
95       * Our service url.
96       *
97       */
98      private String service ;
99  
100     /***
101      * Access to our service url.
102      *
103      */
104     public String getServiceUrl()
105         {
106         return this.service ;
107         }
108 
109     /***
110      * Access to our Community url.
111      *
112      */
113     public void setServiceUrl(String value)
114         {
115         this.service = value ;
116         }
117 
118     /***
119      * Our manager url.
120      *
121      */
122     private String manager ;
123 
124     /***
125      * Access to our manager url.
126      *
127      */
128     public String getManagerUrl()
129         {
130         return this.manager ;
131         }
132 
133     /***
134      * Access to our Community url.
135      *
136      */
137     public void setManagerUrl(String value)
138         {
139         this.manager = value ;
140         }
141       
142       /***
143        * Our manager url.
144        *
145        */
146    private String authentication ;
147 
148     /***
149      * Access to our manager url.
150      *
151      */
152     public String getAuthenticationUrl()
153         {
154         return this.authentication ;
155         }
156 
157     /***
158      * Access to our Community url.
159      *
160      */
161     public void setAuthenticationUrl(String value)
162         {
163         this.authentication = value ;
164         }
165 
166     /***
167      * Access to our Community description.
168      *
169      */
170     public void setDescription(String value)
171         {
172         this.description = value ;
173         }
174 
175     /*
176      * Compare this with another CommunityData.
177      * All we want to check is the community ident.
178      *
179      */
180     public synchronized boolean equals(Object object)
181         {
182         //
183         // If the object is null.
184         if (null == object)
185             {
186             return false ;
187             }
188         //
189         // If the object is not null.
190         else {
191             //
192             // If the object is an CommunityData
193             if (object instanceof CommunityData)
194                 {
195                 CommunityData that = (CommunityData) object ;
196                 //
197                 // If our ident is null
198                 if (null == this.ident)
199                     {
200                     //
201                     // Check that ident is null.
202                     return (null == that.getIdent()) ;
203                     }
204                 //
205                 // If our ident is not null.
206                 else {
207                     //
208                     // Check that ident is the same.
209                     return (this.ident.equals(that.getIdent())) ;
210                     }
211                 }
212             //
213             // If that is not an CommunityData
214             else {
215                 return false ;
216                 }
217             }
218         }
219 
220     /***
221      * Generate a hash code for comparison tests.
222      * Just uses the ident.hashCode().
223      *
224      */
225     public synchronized int hashCode()
226         {
227         return (null != this.ident) ? this.ident.hashCode() : 0 ;
228         }
229 
230     }