1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.openpermis.policy.bean.basic; |
11 | |
|
12 | |
import java.net.URI; |
13 | |
import java.util.Set; |
14 | |
|
15 | |
import org.openpermis.Subject; |
16 | |
import org.openpermis.basic.TimePeriod; |
17 | |
import org.openpermis.policy.Role; |
18 | |
import org.openpermis.policy.TimeStamp; |
19 | |
import org.openpermis.policy.bean.AuthorityBean; |
20 | |
import org.openpermis.policy.bean.SerialNumber; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
public class BasicAuthority |
28 | |
extends BasicPartBean |
29 | |
implements AuthorityBean |
30 | |
{ |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
private static final long serialVersionUID = 299722778399378194L; |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
protected BasicAuthority (SerialNumber serialNumber, URI identity) { |
48 | 262 | super(AuthorityBean.class, serialNumber); |
49 | 262 | setIdentity(identity); |
50 | 262 | } |
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
public Set<Role> getAssignedRoles (TimeStamp timeStamp, Set<Role> roles) { |
58 | 0 | throw new IllegalStateException("Authority cannot be used as subject in access decisions"); |
59 | |
} |
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
public Set<Subject> getIssuersOf (Role roleRef) { |
65 | 0 | throw new IllegalStateException("Authority cannot be asked for issuers."); |
66 | |
} |
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
public TimePeriod getValidityOf (Role role, Subject issuer) { |
72 | 0 | throw new IllegalStateException("Authority cannot be asked for validity."); |
73 | |
} |
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
@Override |
81 | |
protected boolean comparablePart (BasicPart entity) { |
82 | 62 | return entity instanceof AuthorityBean; |
83 | |
} |
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
@Override |
89 | |
protected String getSimpleClassName () { |
90 | 0 | return AuthorityBean.class.getSimpleName(); |
91 | |
} |
92 | |
|
93 | |
} |