1package org.apache.archiva.redback.rbac;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */212223/**24 * TemplatedRole25 *26 * @author <a href="hisidro@exist.com">Henry Isidro</a>27 */28publicclassTemplatedRole29 {
30privateRole role;
3132private String templateNamePrefix;
3334private String delimiter;
3536publicTemplatedRole(Role role, String templateNamePrefix, String delimeter)
37 {
38this.role = role;
39this.templateNamePrefix = templateNamePrefix;
40this.delimiter = delimeter;
41 }
4243public String getResource()
44 {
45int index = role.getName().indexOf( getDelimiter() );
4647return role.getName().substring( index + 3);
48 }
4950publicRole getRole()
51 {
52return role;
53 }
5455publicvoid setRole( Role role )
56 {
57this.role = role;
58 }
5960public String getTemplateNamePrefix()
61 {
62return templateNamePrefix;
63 }
6465publicvoid setTemplateNamePrefix( String templateNamePrefix )
66 {
67this.templateNamePrefix = templateNamePrefix;
68 }
6970public String getDelimiter()
71 {
72return delimiter;
73 }
7475publicvoid setDelimiter( String delimiter )
76 {
77this.delimiter = delimiter;
78 }
7980public String getName()
81 {
82returnthis.role.getName();
83 }
8485publicvoid setName( String name )
86 {
87this.role.setName( name );
88 }
89 }