Interface Service

All Superinterfaces:
Serializable
All Known Subinterfaces:
WebApplicationService

public interface Service extends Serializable
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 Details

    • SERVICE_ATTRIBUTE_HTTP_REQUEST

      static final String SERVICE_ATTRIBUTE_HTTP_REQUEST
      Service attribute to keep track of various HTTP request properties.
      See Also:
    • SERVICE_ATTRIBUTE_COOKIES

      static final String SERVICE_ATTRIBUTE_COOKIES
      Service attribute to keep track of the available cookies.
      See Also:
    • SERVICE_ATTRIBUTE_HEADERS

      static final String SERVICE_ATTRIBUTE_HEADERS
      Service attribute to keep track of the request headers.
      See Also:
    • LOGGER

      static final org.slf4j.Logger LOGGER
      Logger instance.
  • Method Details

    • setPrincipal

      default void setPrincipal(String principal)
      Sets the principal.
      Parameters:
      principal - the new principal
    • setAttributes

      void setAttributes(Map<String,Object> attributes)
      Sets the attributes.
      Parameters:
      attributes - the new attributes
    • getOriginalUrl

      String getOriginalUrl()
      Return the original url provided (as service or targetService request 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

      default Map<String,Object> getAttributes()
      Principal attributes.
      Returns:
      the map of configured attributes for this principal
    • getAttributeAs

      default <T> T getAttributeAs(String name, Class<T> clazz)
      Gets attribute as requested type.
      Type Parameters:
      T - the type parameter
      Parameters:
      name - the name
      clazz - the clazz
      Returns:
      the attribute as
    • getFirstAttribute

      default <T> T getFirstAttribute(String name, Class<T> clazz)
      Gets first attribute value with requested type.
      Type Parameters:
      T - the type parameter
      Parameters:
      name - the name
      clazz - the clazz
      Returns:
      the first attribute
    • getShortenedId

      default String getShortenedId() throws Exception
      Gets shortened id.
      Returns:
      the shortened id
      Throws:
      Exception - the exception