if (node == null) { return null; } else { return new MoriaTicket(ticketId, (MoriaTicketType) node.get(TICKET_TYPE_ATTRIBUTE), (String) node .get(PRINCIPAL_ATTRIBUTE), (Long) node.get(TTL_ATTRIBUTE)); }
return null;
    MoriaTicket getTicketFromStore(final MoriaTicketType ticketType, final String ticketId) {        /* Validate parameters. */        if (ticketType == null) {            throw new IllegalArgumentException("ticketType cannot be null.");        }        if (ticketId == null || ticketId.equals("")) {            throw new IllegalArgumentException("ticketId must be a non-empty string.");        }        /* The name of the node to be retrived. */        Fqn fqn = new Fqn(new Object[] {ticketType, ticketId});        /* The object to hold the node that will be retrived from the store. */        Node node;        try {            node = store.get(fqn);        } catch (LockingException e) {            messageLogger.logCritical("LockingException thrown by store. Rethrowing as RuntimeException.", e);            throw new RuntimeException(e);        } catch (TimeoutException e) {            messageLogger.logCritical("TimeoutException thrown by store. Rethrowing as RuntimeException.", e);            throw new RuntimeException(e);        }        if (node == null) {            return null;        } else {            return new MoriaTicket(ticketId, (MoriaTicketType) node.get(TICKET_TYPE_ATTRIBUTE), (String) node                    .get(PRINCIPAL_ATTRIBUTE), (Long) node.get(TTL_ATTRIBUTE));        }    }