axis_examplecompt_changesinfo-opsversion-2.00version-3.01version-3.02
Last change
on this file since e794984 was
8780cbec,
checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago
|
ABAC sources from Cobham
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | package edu.stanford.rt.credential; |
---|
2 | |
---|
3 | /** |
---|
4 | * @author Ninghui Li, Sandra Qiu<br> |
---|
5 | * |
---|
6 | * Implementation of <code>SimpleDelegation</code> element. |
---|
7 | * A <code>DelegationRole</code> has a required part <code>delegateTo</code> |
---|
8 | * and an optional part <code>control</code>. |
---|
9 | */ |
---|
10 | public class DelegationRole implements PrincipalExpression |
---|
11 | { |
---|
12 | /** |
---|
13 | * to whom to delegate the authority. |
---|
14 | */ |
---|
15 | private PrincipalExpression delegateTo; // required element. |
---|
16 | |
---|
17 | /** |
---|
18 | * depth of the allowed further delegation. |
---|
19 | */ |
---|
20 | private Role control; |
---|
21 | |
---|
22 | /** |
---|
23 | * Constructor for DelegationRole. |
---|
24 | */ |
---|
25 | public DelegationRole( |
---|
26 | PrincipalExpression delegateTo, |
---|
27 | Role control) |
---|
28 | { |
---|
29 | this.delegateTo = delegateTo; |
---|
30 | this.control = control; |
---|
31 | } |
---|
32 | |
---|
33 | /* (non-Javadoc) |
---|
34 | * @see edu.stanford.rt.credential.PrincipalExpression#toString(String) |
---|
35 | */ |
---|
36 | public String toString(String indent) |
---|
37 | { |
---|
38 | String thisIndent = indent + " "; |
---|
39 | StringBuffer sb = new StringBuffer(); |
---|
40 | sb.append(thisIndent).append("Delegation Role: \n"); |
---|
41 | sb.append(thisIndent + " ").append( |
---|
42 | delegateTo.toString()).append( |
---|
43 | "\n"); |
---|
44 | sb |
---|
45 | .append(thisIndent + " ") |
---|
46 | .append( |
---|
47 | (control == null) |
---|
48 | ? "" |
---|
49 | : control.toString(thisIndent + " ")) |
---|
50 | .append("\n"); |
---|
51 | return sb.toString(); |
---|
52 | } |
---|
53 | |
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.