Class Context
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.server.endpoints.Context
-
public class Context extends Object
a context object that may be optionally added to the request. If a null instance is used on the {@link ResourceEndpoint#handleRequest(...)} methods the API will instantiate an instance by itself which will then be used- Since:
- 19.06.2021
- Author:
- Pascal Knueppel
-
-
Constructor Summary
Constructors Constructor Description Context(Authorization authorization)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationgetAuthorization()the authorization information of the current requestOptional<String>getCrossResourceReferenceUrl(String id, String resourceName)creates a cross-reference url to another resource.StringgetResourceReferenceUrl(String id)creates a direct reference url to the current resource.
-
-
-
Constructor Detail
-
Context
public Context(Authorization authorization)
-
-
Method Detail
-
getResourceReferenceUrl
public String getResourceReferenceUrl(String id)
creates a direct reference url to the current resource.
e.g. if called on theResourceHandlerimplementation for UsersgetResourceReferenceUrl("123456") => http://localhost:8080/scim/v2/Users/123456- Parameters:
id- the id of the resource. The id is not checked if a resource with this id does exist or not- Returns:
- the fully qualified url to the specific resource with the given id
-
getCrossResourceReferenceUrl
public Optional<String> getCrossResourceReferenceUrl(String id, String resourceName)
creates a cross-reference url to another resource.
e.g. if called on theResourceHandlerimplementation for Groups to create a reference to a user member of the groupgetExternalResourceReferenceUrl("123456", "User") => http://localhost:8080/scim/v2/Users/123456- Parameters:
id- the id of the resource. The id is not checked if a resource with this id does exist or not- Returns:
- the fully qualified url to the specific resource with the given id or an empty if no resource with the given name was registered
-
getAuthorization
public Authorization getAuthorization()
the authorization information of the current request
-
-