/** * Get the <code>Date</code> of the API method invocation. * @return The <code>Date</code> or <code>null</code> if not available. */ public Date getDate() { if (date == null) { if (getContext() != null) { date = context.now(); } } return date; }
/** * Get the <code>Date</code> of the API method invocation. * @return The <code>Date</code> or <code>null</code> if not available. */ public Date getDate() { if (date == null) { if (getContext() != null) { date = context.now(); } } return date; }
private String encipherPassword(Context context, String password) { String key = JournalHelper.formatDate(context.now()); return PasswordCipher.encipher(key, password); }
private String encipherPassword(Context context, String password) { String key = JournalHelper.formatDate(context.now()); return PasswordCipher.encipher(key, password); }
private final String ensureDate(Date date, Context context) throws AuthzOperationalException { if (date == null) { date = context.now(); } String dateAsString; try { dateAsString = dateAsString(date); } catch (Throwable t) { throw new AuthzOperationalException("couldn't make date a string", t); } return dateAsString; }
private final String ensureDate(Date date, Context context) throws AuthzOperationalException { if (date == null) { date = context.now(); } String dateAsString; try { dateAsString = dateAsString(date); } catch (Throwable t) { throw new AuthzOperationalException("couldn't make date a string", t); } return dateAsString; }
private void writeContextNow(Context context, XMLEventWriter writer) throws XMLStreamException { putStartTag(writer, QNAME_TAG_NOW); putCharacters(writer, JournalHelper.formatDate(context.now())); putEndTag(writer, QNAME_TAG_NOW); }
private void writeContextNow(Context context, XMLEventWriter writer) throws XMLStreamException { putStartTag(writer, QNAME_TAG_NOW); putCharacters(writer, JournalHelper.formatDate(context.now())); putEndTag(writer, QNAME_TAG_NOW); }
/** * A "copy constructor" that creates a writable context from one that might * be read-only. */ public JournalEntryContext(Context source) { password = source.getPassword(); noOp = source.getNoOp(); now = source.now(); for (Iterator<URI> keys = source.environmentAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(environmentAttributes, key, source .getEnvironmentValues(key)); } for (Iterator<String> keys = source.subjectAttributes(); keys.hasNext();) { String key = keys.next(); storeInMap(subjectAttributes, key, source.getSubjectValues(key)); } for (Iterator<URI> keys = source.actionAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(actionAttributes, key, source.getActionValues(key)); } for (Iterator<URI> keys = source.resourceAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(resourceAttributes, key, source.getResourceValues(key)); } }
/** * A "copy constructor" that creates a writable context from one that might * be read-only. */ public JournalEntryContext(Context source) { password = source.getPassword(); noOp = source.getNoOp(); now = source.now(); for (Iterator<URI> keys = source.environmentAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(environmentAttributes, key, source .getEnvironmentValues(key)); } for (Iterator<String> keys = source.subjectAttributes(); keys.hasNext();) { String key = keys.next(); storeInMap(subjectAttributes, key, source.getSubjectValues(key)); } for (Iterator<URI> keys = source.actionAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(actionAttributes, key, source.getActionValues(key)); } for (Iterator<URI> keys = source.resourceAttributes(); keys.hasNext();) { URI key = keys.next(); storeInMap(resourceAttributes, key, source.getResourceValues(key)); } }