Interface SubjectReference
-
public interface SubjectReference
Represents a reference to a given subject.SubjectReferences should be used when a subject needs to be represented, but the backing Subject is not needed.
SubjectReferences are unique to a given PermissionService, and will not resolve to the correct service if the provider changes.
Note that implementations of this interface should be capable of resolving the reference to a real subject.
Instances can be obtained using
PermissionService.newSubjectReference(String, String)
,SubjectCollection.newSubjectReference(String)
orSubject.asSubjectReference()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
collectionIdentifier()
Gets the identifier of the collection containing the subject being referenced.java.util.concurrent.CompletableFuture<? extends Subject>
resolve()
Resolves and returns the Subject being referenced.java.lang.String
subjectIdentifier()
Gets the identifier of the subject.
-
-
-
Method Detail
-
collectionIdentifier
java.lang.String collectionIdentifier()
Gets the identifier of the collection containing the subject being referenced.- Returns:
- The identifier of the collection holding this subject
-
subjectIdentifier
java.lang.String subjectIdentifier()
Gets the identifier of the subject.- Returns:
- The subject identifier
-
resolve
java.util.concurrent.CompletableFuture<? extends Subject> resolve()
Resolves and returns the Subject being referenced.The returned future will complete exceptionally if the subject collection with the given identifier cannot be loaded.
- Returns:
- The subject being referenced by this instance.
-
-