/** {@inheritDoc} */ @Override public void remove(@Nonnull @NotEmpty final String artifact) throws IOException { log.debug("Removing artifact entry: {}", artifact); if (artifact.length() > artifactStoreKeySize) { throw new IOException("Length of artifact (" + artifact.length() + ") exceeds storage capabilities"); } getStorageService().delete(STORAGE_CONTEXT, artifact); }
/** {@inheritDoc} */ public boolean clear(@Nonnull final ProfileRequestContext profileRequestContext) { try { final String key = lockoutKeyStrategy.apply(profileRequestContext); if (key != null) { log.debug("Clearing lockout state for '{}'", key); storageService.delete(getId(), key); return true; } else { log.warn("No lockout key returned for request"); } } catch (final IOException e) { log.error("Error deleting lockout entry", e); } return false; }
/** * Retrieves a ticket by ID from the storage service and then deletes it. * * @param id Ticket identifier. * @param <T> Type of ticket. * @param clazz Ticket class * * @return Deleted ticket or null if ticket not found. */ protected <T extends Ticket> T delete(final String id, final Class<T> clazz) { final T ticket = read(id, clazz); if (ticket == null) { return null; } try { final String context = context(clazz); log.debug("Attempting to delete {} from context {}", id, context); if (!storageService.delete(context, id)) { log.info("Failed deleting {} from context {}.", id, context); } final String sessionId = ticket.getSessionId(); log.debug("Attempting to delete {} from context {}", id, sessionId); if (!storageService.delete(sessionId, id)) { log.info("Failed deleting {} from context {}.", id, sessionId); } } catch (final IOException e) { throw new RuntimeException("Error deleting ticket " + id, e); } return ticket; }
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final ProfileInterceptorContext interceptorContext) { final String context = getStorageContext(); final String key = getStorageKey(); log.debug("{} Attempting to delete consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key); try { final boolean success = getStorageService().delete(context, key); if (success) { log.debug("{} Deleted consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key); } else { log.debug("{} No consent storage record found with context '{}' and key '{}'", getLogPrefix(), context, key); } removeKeyFromStorageIndex(key); } catch (final IOException e) { log.error("{} Unable to delete consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key, e); if (!maskStorageErrors) { ActionSupport.buildEvent(profileRequestContext, EventIds.IO_ERROR); } } }
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final ProfileInterceptorContext interceptorContext) { final String context = getStorageContext(); final String key = getStorageKey(); log.debug("{} Attempting to delete consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key); try { final boolean success = getStorageService().delete(context, key); if (success) { log.debug("{} Deleted consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key); } else { log.debug("{} No consent storage record found with context '{}' and key '{}'", getLogPrefix(), context, key); } removeKeyFromStorageIndex(key); } catch (final IOException e) { log.error("{} Unable to delete consent storage record with context '{}' and key '{}'", getLogPrefix(), context, key, e); if (!maskStorageErrors) { ActionSupport.buildEvent(profileRequestContext, EventIds.IO_ERROR); } } }
boolean success = getStorageService().delete(getStorageContext(), keyToDelete);
if (storageService.delete(context, key)) { response.setStatus(HttpServletResponse.SC_NO_CONTENT); } else {
final boolean success = getStorageService().delete(getStorageContext(), keyToDelete);
try { sessionManager.getStorageService().delete(getId(), result.getAuthenticationFlowId()); } catch (final IOException e) { log.error("Exception removing AuthenticationResult record for session {} and flow {}", getId(),
try { sessionManager.getStorageService().delete(getId(), getSPSessionStorageKey(spSession.getId())); } catch (final IOException e) { log.error("Exception removing SPSession record for IdP session {} and service {}", getId(),