Interface Service
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
WebApplicationService
Marker interface for Services. Services are generally either remote
applications utilizing CAS or applications that principals wish to gain
access to. In most cases this will be some form of web application.
- Since:
- 3.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerLogger instance.static final StringService attribute to keep track of the available cookies.static final StringService attribute to keep track of the request headers.static final StringService attribute to keep track of various HTTP request properties. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TgetAttributeAs(String name, Class<T> clazz) Gets attribute as requested type.Principal attributes.default <T> TgetFirstAttribute(String name, Class<T> clazz) Gets first attribute value with requested type.getId()Principal id.Return the original url provided (asserviceortargetServicerequest parameter).default StringGets shortened id.voidsetAttributes(Map<String, Object> attributes) Sets the attributes.default voidsetPrincipal(String principal) Sets the principal.
-
Field Details
-
SERVICE_ATTRIBUTE_HTTP_REQUEST
Service attribute to keep track of various HTTP request properties.- See Also:
-
SERVICE_ATTRIBUTE_COOKIES
Service attribute to keep track of the available cookies.- See Also:
-
SERVICE_ATTRIBUTE_HEADERS
Service attribute to keep track of the request headers.- See Also:
-
LOGGER
static final org.slf4j.Logger LOGGERLogger instance.
-
-
Method Details
-
setPrincipal
Sets the principal.- Parameters:
principal- the new principal
-
setAttributes
Sets the attributes.- Parameters:
attributes- the new attributes
-
getOriginalUrl
String getOriginalUrl()Return the original url provided (asserviceortargetServicerequest parameter). Used to reconstruct the redirect url.- Returns:
- the original url provided.
-
getId
String getId()Principal id.- Returns:
- the unique id for the Principal
-
getAttributes
Principal attributes.- Returns:
- the map of configured attributes for this principal
-
getAttributeAs
Gets attribute as requested type.- Type Parameters:
T- the type parameter- Parameters:
name- the nameclazz- the clazz- Returns:
- the attribute as
-
getFirstAttribute
Gets first attribute value with requested type.- Type Parameters:
T- the type parameter- Parameters:
name- the nameclazz- the clazz- Returns:
- the first attribute
-
getShortenedId
Gets shortened id.- Returns:
- the shortened id
- Throws:
Exception- the exception
-