View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.profiler.rules;
18  
19  import java.io.Serializable;
20  
21  /***
22   * PrincipalRule is a paired association from principal to rule.
23   * This pair is unique in that there can only be a one entry for a principal which maps to a rule.
24   * This association is used by the profiler to determine which profiling rule to apply for a principal.
25   * If a rule is not found, there should be a default system wide rule.
26   *
27   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
28   * @version $Id: PrincipalRule.java 516448 2007-03-09 16:25:47Z ate $
29   */
30  public interface PrincipalRule extends Serializable
31  {
32      /***
33       * Gets the name of the principal in this principal/rule/locator pair association.
34       * The principal name identifies the uniqueness of the relationship.
35       * It is used for keyed lookups to find the rule associated with this principal. 
36       *  
37       * @return The name of the principal in this association.
38       */    
39      String getPrincipalName();
40  
41      /***
42       * Sets the name of the principal in this principal/rule/locator pair association.
43       * The principal name identifies the uniqueness of the relationship.
44       * It is used for keyed lookups to find the rule associated with this principal. 
45       *  
46       * @param name The name of the principal in this association.
47       */        
48      void setPrincipalName(String name);
49  
50      /***
51       * Gets the name of the locator in this principal/rule/locator pair association.
52       * The principal + locator name identifies the uniqueness of the relationship.
53       * It is used for keyed lookups to find the rule associated with this principal  
54       * for a given locator 
55       *  
56       * @return The name of the locator in this association.
57       */    
58      String getLocatorName();
59  
60      /***
61       * Sets the name of the locator in this principal/locator/rule pair association.
62       * The principal name + locator name identifies the uniqueness of the relationship.
63       * It is used for keyed lookups to find the rule associated with this principal
64       * for a given locator 
65       *  
66       * @param name The name of the locator in this association.
67       */        
68      void setLocatorName(String name);
69      
70          
71      /***
72       * Gets the profiling rule associated with the principal name 
73       * 
74       * @return The profiling rule associated with the principal name
75       */
76      ProfilingRule getProfilingRule();
77  
78      /***
79       * Sets the profiling rule associated with the principal name 
80       * 
81       * @param rule The profiling rule associated with the principal name
82       */
83      void setProfilingRule(ProfilingRule rule);
84      
85  }