01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: * Gets the name of the principal in this principal/rule/locator pair association.
33: * The principal name identifies the uniqueness of the relationship.
34: * It is used for keyed lookups to find the rule associated with this principal.
35: *
36: * @return The name of the principal in this association.
37: */
38: String getPrincipalName();
39:
40: /**
41: * Sets the name of the principal in this principal/rule/locator pair association.
42: * The principal name identifies the uniqueness of the relationship.
43: * It is used for keyed lookups to find the rule associated with this principal.
44: *
45: * @param name The name of the principal in this association.
46: */
47: void setPrincipalName(String name);
48:
49: /**
50: * Gets the name of the locator in this principal/rule/locator pair association.
51: * The principal + locator name identifies the uniqueness of the relationship.
52: * It is used for keyed lookups to find the rule associated with this principal
53: * for a given locator
54: *
55: * @return The name of the locator in this association.
56: */
57: String getLocatorName();
58:
59: /**
60: * Sets the name of the locator in this principal/locator/rule pair association.
61: * The principal name + locator name identifies the uniqueness of the relationship.
62: * It is used for keyed lookups to find the rule associated with this principal
63: * for a given locator
64: *
65: * @param name The name of the locator in this association.
66: */
67: void setLocatorName(String name);
68:
69: /**
70: * Gets the profiling rule associated with the principal name
71: *
72: * @return The profiling rule associated with the principal name
73: */
74: ProfilingRule getProfilingRule();
75:
76: /**
77: * Sets the profiling rule associated with the principal name
78: *
79: * @param rule The profiling rule associated with the principal name
80: */
81: void setProfilingRule(ProfilingRule rule);
82:
83: }
|