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.profile; 18 19 import org.apache.jetspeed.om.security.JetspeedUser; 20 import org.apache.jetspeed.om.security.Role; 21 import org.apache.jetspeed.om.security.Group; 22 23 import java.io.Serializable; 24 /*** 25 * Interface definition for a Profile Locator. 26 * Locators are used by the profiler to describe the parameters used to locate 27 * a resource in the persistent configuration store. 28 * 29 * 30 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a> 31 * @version $Id: ProfileLocator.java,v 1.10 2004/02/23 03:05:01 jford Exp $ 32 */ 33 34 public interface ProfileLocator extends Serializable, Cloneable 35 { 36 /* 37 * populates this profile locator from a given path in the format: 38 * 39 * user/<name>/media-type/<mediaType>/language/<language> 40 * /country/<country>/<page>/page 41 * 42 * group/ "" 43 * role/ "" 44 * 45 * @param path The formatted profiler path string. 46 */ 47 public void createFromPath(String path); 48 49 /* 50 * Gets the unique profile locator id, which is a combination of the params 51 * This ID must follow the one of the 4 sequences below: 52 * 53 * <username>/<mediaType>/<language>/<country>/<page> 54 * <group>/<mediaType>/<language>/<country>/<page> 55 * <role>/<mediaType>/<language>/<country>/<page> 56 * 57 * @return The profile locator id 58 */ 59 public String getId(); 60 61 /* 62 * Gets the unique profile locator path, which is a combination of the params 63 * This Path must follow the one of the 4 sequences below: 64 * 65 * user/<name>/media-type/<mediaType>/language/<language> 66 * /country/<country>/<page>/page 67 * 68 * group/ "" 69 * role/ "" 70 * 71 * @return The profile locator path 72 */ 73 public String getPath(); 74 75 /* 76 * Gets the resource name parameter for this profile. 77 * 78 * @return The resource name parameter for this profile. 79 */ 80 String getName(); 81 82 /* 83 * Sets the resource name parameter for this profile. 84 * 85 * @param name The resource name parameter for this profile. 86 */ 87 void setName(String name); 88 89 /* 90 * Gets the media type parameter for this profile. 91 * Media types are values such as html, wml, xml ... 92 * 93 * @return The media type parameter for this profile. 94 */ 95 public String getMediaType(); 96 97 /* 98 * Sets the media type parameter for this profile. 99 * Media types are values such as html, wml, xml ... 100 * 101 * @param mediaType The media type parameter for this profile. 102 */ 103 public void setMediaType(String mediaType); 104 105 /* 106 * Gets the language parameter for this profile. 107 * Language values are ISO-639 standard language abbreviations 108 * en, fr, de, ... 109 * 110 * @return The language parameter for this profile. 111 */ 112 public String getLanguage(); 113 114 /* 115 * Sets the language parameter for this profile. 116 * Language values are ISO-639 standard language abbreviations 117 * en, fr, de, ... 118 * 119 * @param language The language parameter for this profile. 120 */ 121 public void setLanguage(String language); 122 123 /* 124 * Gets the country code parameter for this profile. 125 * Country code values are ISO-3166 standard country code abbreviations. 126 * GB, US, FR, CA, DE, ... 127 * 128 * @return The country code parameter for this profile. 129 */ 130 public String getCountry(); 131 132 /* 133 * Sets the country code parameter for this profile. 134 * Country code values are ISO-3166 standard country code abbreviations. 135 * GB, US, FR, CA, DE, ... 136 * 137 * @param country The country code parameter for this profile. 138 */ 139 public void setCountry(String country); 140 141 /* 142 * Gets the user parameter for this profile. 143 * 144 * @return The user parameter for this profile. 145 */ 146 public JetspeedUser getUser(); 147 148 public String getUserName(); 149 150 /* 151 * Sets the user parameter for this profile. 152 * 153 * @param user The user parameter for this profile. 154 */ 155 public void setUser(JetspeedUser user); 156 157 /* 158 * Gets the anonymous user flag for this profile. 159 * 160 * @return True if this profile is anonymous. 161 */ 162 public boolean getAnonymous(); 163 164 /* 165 * Sets the user parameter as the anonymous user 166 * 167 * @param anonymous True indicates this is an anonymous user. 168 */ 169 public void setAnonymous(boolean anonymous); 170 171 /* 172 * Gets the role parameter for this profile. 173 * 174 * @return The role parameter for this profile. 175 */ 176 public Role getRole(); 177 178 public String getRoleName(); 179 180 181 /* 182 * Sets the role parameter for this profile. 183 * 184 * @param role The role parameter for this profile. 185 */ 186 public void setRole( Role role ); 187 188 public void setRoleByName(String roleName); 189 190 /* 191 * Gets the group parameter for this profile. 192 * 193 * @return The group parameter for this profile. 194 */ 195 public Group getGroup(); 196 197 public String getGroupName(); 198 199 /* 200 * Sets the group parameter for this profile. 201 * 202 * @param group The group parameter for this profile. 203 */ 204 public void setGroup( Group group ); 205 206 public void setGroupByName( String groupName ); 207 208 /*** 209 * @see Object#clone 210 * @return an instance copy of this object 211 */ 212 public Object clone() throws java.lang.CloneNotSupportedException; 213 214 }