KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > om > common > impl > SecurityRoleRefImpl


1 /*
2  * Copyright 2003,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
18  */

19
20
21 package org.apache.pluto.portalImpl.om.common.impl;
22
23 import java.util.Collection JavaDoc;
24 import java.util.Locale JavaDoc;
25
26 import org.apache.pluto.om.common.Description;
27 import org.apache.pluto.om.common.DescriptionSet;
28 import org.apache.pluto.om.common.SecurityRoleRef;
29 import org.apache.pluto.util.StringUtils;
30
31 public class SecurityRoleRefImpl implements SecurityRoleRef, java.io.Serializable JavaDoc
32 {
33
34     private String JavaDoc roleName;
35     private String JavaDoc roleLink;
36     private DescriptionSet descriptions;
37
38     public SecurityRoleRefImpl()
39     {
40         descriptions = new org.apache.pluto.portalImpl.om.common.impl.DescriptionSetImpl();
41     }
42
43     // SecurityRoleRef implementation.
44

45     public String JavaDoc getRoleName()
46     {
47         return roleName;
48     }
49
50     public String JavaDoc getRoleLink()
51     {
52         return roleLink;
53     }
54
55     /* (non-Javadoc)
56      * @see org.apache.pluto.om.common.SecurityRoleRef#getDescription(Locale)
57      */

58     public Description getDescription(Locale JavaDoc locale)
59     {
60         return descriptions.get(locale);
61     }
62
63
64     public void setRoleName(String JavaDoc roleName)
65     {
66         this.roleName = roleName;
67     }
68
69     // additional methods.
70

71     public void setRoleLink(String JavaDoc roleLink)
72     {
73         this.roleLink = roleLink;
74     }
75
76     public DescriptionSet getDescriptionSet()
77     {
78         return descriptions;
79     }
80
81     public void setDescriptionSet(DescriptionSet descriptions)
82     {
83         this.descriptions = descriptions;
84     }
85
86     public String JavaDoc toString()
87     {
88         return toString(0);
89     }
90
91     public String JavaDoc toString(int indent)
92     {
93         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc(50);
94         StringUtils.newLine(buffer,indent);
95         buffer.append(getClass().toString());
96         buffer.append(": role-name='");
97         buffer.append(roleName);
98         buffer.append("', role-link='");
99         buffer.append(roleLink);
100         buffer.append("'");
101         StringUtils.newLine(buffer,indent);
102         buffer.append(((DescriptionSetImpl)descriptions).toString(indent));
103         return buffer.toString();
104     }
105
106     public Collection JavaDoc getCastorDescriptions()
107     {
108         return(DescriptionSetImpl)descriptions;
109     }
110
111     public void setCastorDescriptions(DescriptionSet castorDescriptions)
112     {
113         this.descriptions = castorDescriptions;
114     }
115
116
117 }
118
Popular Tags