@Override public boolean deleteTicket(final String ticketId) { try { logger.debug("Removing ticket from registry for: {}", ticketId); return this.cache.remove(FQN_TICKET, ticketId) != null; } catch (final CacheException e) { logger.error(e.getMessage(), e); return false; } }
/** * {@inheritDoc} * Returns a proxied instance. * * @see org.jasig.cas.ticket.registry.TicketRegistry#getTicket(java.lang.String) */ @Override public Ticket getTicket(final String ticketId) { try { logger.debug("Retrieving ticket from registry for: {}", ticketId); return getProxiedTicketInstance(this.cache.get(FQN_TICKET, ticketId)); } catch (final CacheException e) { logger.error(e.getMessage(), e); return null; } }
@Override public void addTicket(final Ticket ticket) { try { logger.debug("Adding ticket to registry for: {}", ticket.getId()); this.cache.put(FQN_TICKET, ticket.getId(), ticket); } catch (final CacheException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } }
/** * Remove all objects from the Cache. Used on SLEE exit. * * @throws SystemException * */ public void cleanUpCache(String tcache) throws SystemException { try { if (!getTreeCache(tcache).exists(getRootFqn(tcache))) return; // TODO: test to make sure it does what it suppose to do getTreeCache(tcache).remove(getRootFqn(tcache)); /* * Node node = getTreeCache(tcache).get(getRootFqn(tcache)); * node.removeAllChildren(); */ } catch (CacheException ex) { logger .error( "Failed to clean SLEE cache. This could lead to unexpected behaviour! Recommendation: Restart SLEE VM!", ex); throw new SystemException("Failed to clean SLEE cache. " + ex.getMessage()); } }