Class DoRevocationCacheOperation
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.authn.revocation.impl.DoRevocationCacheOperation
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that implements a JSON REST API for the
RevocationCache interface.
The API supports GET, PUT/POST, and DELETE at the moment, using jsonapi.org conventions.
- GET
- Return a revocation record.
- PUT/POST
- Insert or update a revocation record.
- DELETE
- Delete revocation record.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlow variable indicating ID of cache bean to access.private StringRevocation Cache ID.private StringRevocation context to operate on.static final StringFlow variable indicating ID of account context.private StringRevocation key to operate on.static final StringFlow variable indicating ID of account key.private org.slf4j.LoggerClass logger.private com.fasterxml.jackson.databind.ObjectMapperJSON object mapper.private RevocationCacheRevocationCacheto operate on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddoDelete()Delete a revocation record.protected voiddoExecute(ProfileRequestContext profileRequestContext) private voiddoGet()Get a revocation record.protected voidprivate voiddoPost()Insert a revocation record.protected booleandoPreExecute(ProfileRequestContext profileRequestContext) private StringNull safe getter.private StringNull safe getter.private StringgetKey()Null safe getter.private RevocationCacheNull safe getter.private voidOutput an error object.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper) Set the JSONObjectMapperto use for serialization.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
CACHE_ID
Flow variable indicating ID of cache bean to access.- See Also:
-
CONTEXT
Flow variable indicating ID of account context.- See Also:
-
KEY
Flow variable indicating ID of account key.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
objectMapper
JSON object mapper. -
cacheId
Revocation Cache ID. -
context
Revocation context to operate on. -
key
Revocation key to operate on. -
revocationCache
RevocationCacheto operate on.
-
-
Constructor Details
-
DoRevocationCacheOperation
public DoRevocationCacheOperation()
-
-
Method Details
-
setObjectMapper
public void setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper mapper) Set the JSONObjectMapperto use for serialization.- Parameters:
mapper- object mapper
-
getRevocationCache
Null safe getter.- Returns:
- Returns the revocationCache.
-
getCacheId
Null safe getter.- Returns:
- Returns the cacheId.
-
getKey
Null safe getter.- Returns:
- Returns the key.
-
getContext
Null safe getter.- Returns:
- Returns the context.
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
doGet
Get a revocation record.- Throws:
IOException- if an I/O error occurs
-
doPost
Insert a revocation record.- Throws:
IOException- if an I/O error occurs
-
doDelete
Delete a revocation record.- Throws:
IOException- if an I/O error occurs
-
sendError
private void sendError(int status, @Nonnull @NotEmpty String title, @Nonnull @NotEmpty String detail) throws IOException Output an error object.- Parameters:
status- HTTP statustitle- fixed error descriptiondetail- human-readable error description- Throws:
IOException- if unable to output the error
-