Class ContextHelper
- java.lang.Object
-
- org.forgerock.openam.rest.resource.ContextHelper
-
public class ContextHelper extends Object
Helper class to get around the fact that some CREST Contexts are final and have package private constructors, i.e. UriRouterContext.- Since:
- 13.0.0
-
-
Constructor Summary
Constructors Constructor Description ContextHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRealm(org.forgerock.services.context.Context context)Gets the realm for the accessed resource.SubjectgetSubject(org.forgerock.services.context.Context context)Gets the subject for the user of the accessed resource.StringgetUserId(org.forgerock.services.context.Context context)Gets the username for the user of the accessed resource.StringgetUserUid(org.forgerock.services.context.Context context)Gets the universal id for the user of the accessed resource.StringgetUserUid(org.forgerock.services.context.Context context, String username)Gets the universal id for the given username.
-
-
-
Method Detail
-
getUserUid
public String getUserUid(org.forgerock.services.context.Context context)
Gets the universal id for the user of the accessed resource.- Parameters:
context- The context.- Returns:
- The resource users UID.
-
getUserUid
public String getUserUid(org.forgerock.services.context.Context context, String username)
Gets the universal id for the given username.- Parameters:
context- The context.username- The username.- Returns:
- The users UID.
-
getUserId
public String getUserId(org.forgerock.services.context.Context context)
Gets the username for the user of the accessed resource.- Parameters:
context- The context.- Returns:
- The resource users username.
-
getRealm
public String getRealm(org.forgerock.services.context.Context context)
Gets the realm for the accessed resource.- Parameters:
context- The context.- Returns:
- The resource realm.
-
getSubject
public Subject getSubject(org.forgerock.services.context.Context context)
Gets the subject for the user of the accessed resource.- Parameters:
context- the context- Returns:
- the subject attempting to access the resource
-
-