View Javadoc

1   /*
2    * <cvs:source>$Source: /devel/astrogrid/community/common/src/java/org/astrogrid/community/common/policy/data/PolicyCredentials.java,v $</cvs:source>
3    * <cvs:author>$Author: dave $</cvs:author>
4    * <cvs:date>$Date: 2004/09/16 23:18:08 $</cvs:date>
5    * <cvs:version>$Revision: 1.4 $</cvs:version>
6    *
7    * <cvs:log>
8    *   $Log: PolicyCredentials.java,v $
9    *   Revision 1.4  2004/09/16 23:18:08  dave
10   *   Replaced debug logging in Community.
11   *   Added stream close() to FileStore.
12   *
13   *   Revision 1.3.82.1  2004/09/16 09:58:48  dave
14   *   Replaced debug with commons logging ....
15   *
16   *   Revision 1.3  2004/06/18 13:45:20  dave
17   *   Merged development branch, dave-dev-200406081614, into HEAD
18   *
19   *   Revision 1.2.70.1  2004/06/17 13:38:58  dave
20   *   Tidied up old CVS log entries
21   *
22   * </cvs:log>
23   *
24   */
25  package org.astrogrid.community.common.policy.data ;
26  
27  public class PolicyCredentials
28      {
29      /***
30       * Status code for valid credentials.
31       *
32       */
33      public static final int STATUS_VALID = 0xFF ;
34  
35      /***
36       * Status code for credentials unchecked.
37       *
38       */
39      public static final int STATUS_NOT_KNOWN = 0x00 ;
40  
41      /***
42       * Status code for credentials invalid.
43       *
44       */
45      public static final int STATUS_NOT_VALID = 0x01 ;
46  
47      /***
48       * Public constructor.
49       *
50       */
51      public PolicyCredentials()
52          {
53          this(null, null) ;
54          }
55  
56      /***
57       * Public constructor.
58       *
59       */
60      public PolicyCredentials(String account, String group)
61          {
62          this.group   = group   ;
63          this.account = account ;
64          this.status  = STATUS_NOT_KNOWN ;
65          }
66  
67      /***
68       * Our Account ident.
69       *
70       */
71      private String account ;
72  
73      /***
74       * Access to our Account ident.
75       *
76       */
77      public String getAccount()
78          {
79          return this.account ;
80          }
81  
82      /***
83       * Access to our Account ident.
84       *
85       */
86      public void setAccount(String value)
87          {
88          this.account = value ;
89          }
90  
91      /***
92       * Our Group ident.
93       *
94       */
95      private String group ;
96  
97      /***
98       * Access to our Group ident.
99       *
100      */
101     public String getGroup()
102         {
103         return this.group ;
104         }
105 
106     /***
107      * Access to our Group ident.
108      *
109      */
110     public void setGroup(String value)
111         {
112         this.group = value ;
113         }
114 
115     /***
116      * The status value.
117      *
118      */
119     private int status ;
120 
121     /***
122      * Access to the status.
123      *
124      */
125     public int getStatus()
126         {
127         return this.status ;
128         }
129 
130     /***
131      * Access to the status.
132      *
133      */
134     public void setStatus(int value)
135         {
136         this.status = value ;
137         }
138 
139     /***
140      * Access to the status.
141      *
142      */
143     public boolean isValid()
144         {
145         return (STATUS_VALID == this.status) ;
146         }
147 
148     /***
149      * The status reason, explains why.
150      *
151      */
152     private String reason ;
153 
154     /***
155      * Access to the reason.
156      *
157      */
158     public String getReason()
159         {
160         return this.reason ;
161         }
162 
163     /***
164      * Access to the reason.
165      *
166      */
167     public void setReason(String value)
168         {
169         this.reason = value ;
170         }
171     }