1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.registry.base;
18
19 import org.apache.jetspeed.om.registry.*;
20
21 /***
22 * Bean like implementation of the Security interface suitable for
23 * Castor serialization.
24 *
25 * @see org.apache.jetspeed.om.registry.Security
26 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
27 * @version $Id: BaseSecurity.java,v 1.4 2004/02/23 03:08:26 jford Exp $
28 */
29 public class BaseSecurity implements Security,java.io.Serializable
30 {
31
32 private String role;
33
34 public BaseSecurity()
35 {}
36
37 public BaseSecurity(String role)
38 {
39 this.role = role;
40 }
41
42 /***
43 * Implements the equals operation so that 2 elements are equal if
44 * all their member values are equal.
45 */
46 public boolean equals(Object object)
47 {
48 if (object==null)
49 {
50 return false;
51 }
52
53 BaseSecurity obj = (BaseSecurity)object;
54
55 if (role!=null)
56 {
57 return role.equals(obj.getRole());
58 }
59 else
60 {
61 if (obj.getRole()!=null)
62 {
63 return false;
64 }
65 }
66
67 return true;
68 }
69
70 /*** @return the role name that is required for accessing this entry */
71 public String getRole()
72 {
73 return this.role;
74 }
75
76 /*** Sets the role name required for accessing this entry
77 * @param role the required role name
78 */
79 public void setRole( String role )
80 {
81 this.role = role;
82 }
83
84 }