KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > om > security > BaseJetspeedRole


1 /*
2  * Copyright 2000-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
17 package org.apache.jetspeed.om.security;
18
19 /**
20  * A Jetspeed basic Role.
21  *
22  * @author <a HREF="mailto:taylor@apache.org">David Sean Taylor</a>
23  * @version $Id: BaseJetspeedRole.java,v 1.3 2004/02/23 03:14:12 jford Exp $
24  */

25 public class BaseJetspeedRole implements Role
26 {
27     protected String JavaDoc name;
28     protected String JavaDoc id = null;
29
30     protected boolean isNew = true;
31
32     public BaseJetspeedRole(String JavaDoc id)
33     {
34         this.id = id;
35         isNew = true;
36     }
37
38     public BaseJetspeedRole()
39     {
40         isNew = true;
41     }
42
43     /**
44      * Get the name of the Role
45      *
46      * @return the name of the role.
47      */

48     public String JavaDoc getName()
49     {
50         return name;
51     }
52  
53     /**
54      * Set the name of the Role
55      *
56      * @param roleName the name of the Role.
57      */

58     public void setName(String JavaDoc roleName)
59     {
60         name = roleName;
61     }
62
63     /**
64      * Get the id of the Role
65      *
66      * @return the id of the role.
67      */

68     public String JavaDoc getId()
69     {
70         return id;
71     }
72
73     /**
74      * Set the id of the Role
75      *
76      * @param id the new id for the role
77      */

78     public void setId(String JavaDoc id)
79     {
80         if (this.id == null)
81         {
82             this.id = id;
83         }
84     }
85
86     public boolean isNew()
87     {
88         return isNew;
89     }
90
91     void setNew(boolean isNew)
92     {
93         this.isNew = isNew;
94     }
95
96 }
97
98
99
Popular Tags