Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SubjectRepository |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport | |
3 | * (http://www.vbs.admin.ch) | |
4 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
5 | * All rights reserved. | |
6 | * | |
7 | * Licensed under the Open Permis License which accompanies this distribution, | |
8 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
9 | */ | |
10 | package org.openpermis.repository; | |
11 | ||
12 | import java.net.URI; | |
13 | ||
14 | import org.openpermis.Subject; | |
15 | ||
16 | /** | |
17 | * Fetches the roles that are associated with users. | |
18 | * @since 0.1.0 | |
19 | */ | |
20 | public interface SubjectRepository { | |
21 | ||
22 | //---- Methods | |
23 | ||
24 | /** | |
25 | * Returns a subject whose identity matches the one specified. | |
26 | * @param identity a {@link URI} that identifies a subject. | |
27 | * @return a {@link Subject} associating a person with her assigned roles. The returned | |
28 | * subject is never <code>null</code>, but will have no assigned roles for unknown identities. | |
29 | * @throws SubjectRepositoryException when the repository fails to retrieve the roles | |
30 | * for the specified identity. | |
31 | * @since 0.3.0 | |
32 | */ | |
33 | public Subject retrieveSubject (URI identity) | |
34 | throws SubjectRepositoryException; | |
35 | ||
36 | } |