/** * Update the last access date and time of this token. This means that the * expiration time starts again (if any). */ void updateLastAccess () { m_aLastAccessDT = PDTFactory.getCurrentLocalDateTime (); }
/** * @param aSubject * The auth subject that was authenticated. May be <code>null</code> if * authentication failed. */ public AuthIdentification (@Nullable final IAuthSubject aSubject) { m_aAuthSubject = aSubject; m_aIdentificationDT = PDTFactory.getCurrentLocalDateTime (); }
public boolean isExpired () { if (!m_bExpired && isExpirationPossible ()) { // Only if expiration is defined if (Duration.between (m_aLastAccessDT, PDTFactory.getCurrentLocalDateTime ()) .getSeconds () > m_nExpirationSeconds) m_bExpired = true; } return m_bExpired; }
public AuditItem (@Nullable final String sUserID, @Nonnull final EAuditActionType eType, @Nonnull final ESuccess eSuccess, @Nonnull final String sAction) { this (PDTFactory.getCurrentLocalDateTime (), StringHelper.hasText (sUserID) ? sUserID : CUserID.USER_ID_GUEST, eType, eSuccess, sAction); }
/** * @return <code>true</code> if this message can be resend now. */ public boolean isTimeToSend () { return m_aEarliestResendDT.compareTo (PDTFactory.getCurrentLocalDateTime ()) <= 0; } }
@Nonnull public static RequestFieldDate createLocalDateTimeNow (@Nonnull @Nonempty final String sFieldName, @Nonnull final Locale aDisplayLocale) { return new RequestFieldDate (sFieldName, PDTFactory.getCurrentLocalDateTime (), aDisplayLocale); }
public AS4MessageState (@Nonnull final ESOAPVersion eSOAPVersion, @Nonnull final AS4ResourceManager aResMgr) { m_aReceiptDT = PDTFactory.getCurrentLocalDateTime (); m_eSOAPVersion = ValueEnforcer.notNull (eSOAPVersion, "SOAPVersion"); m_aResMgr = ValueEnforcer.notNull (aResMgr, "ResMgr"); }
@Nonnull public static SystemMigrationResult createFailure (@Nonnull @Nonempty final String sMigrationID, @Nonnull final String sErrorMsg) { return new SystemMigrationResult (sMigrationID, PDTFactory.getCurrentLocalDateTime (), false, sErrorMsg); } }
protected boolean isTimeToSend (@Nonnull final File aCurrentFile) { try { final StringTokenizer aFileTokens = new StringTokenizer (aCurrentFile.getName (), ".", false); final LocalDateTime aTimestamp = AS2DateHelper.parseDate (FILENAME_DATE_FORMAT, aFileTokens.nextToken ()); return aTimestamp.isBefore (PDTFactory.getCurrentLocalDateTime ()); } catch (final Exception ex) { return true; } }
public WebSiteResourceBundleSerialized (@Nonnull @Nonempty final String sBundleID, @Nonnull final WebSiteResourceBundle aBundle, final boolean bRegular) { this (sBundleID, aBundle, PDTFactory.getCurrentLocalDateTime ()); // Always serialize new bundles _ensureSerialized (bRegular); }
@Nonnull public static SystemMigrationResult createSuccess (@Nonnull @Nonempty final String sMigrationID) { return new SystemMigrationResult (sMigrationID, PDTFactory.getCurrentLocalDateTime (), true, null); }
AS4DuplicateItem (@Nonnull final LocalDateTime aDT, @Nonnull @Nonempty final String sMessageID, @Nullable final String sProfileID, @Nullable final String sPModeID) { m_aDT = ValueEnforcer.notNull (aDT, "DT"); m_sMessageID = ValueEnforcer.notEmpty (sMessageID, "MessageID"); m_sProfileID = sProfileID; m_sPModeID = sPModeID; }
public IndexerWorkItem (@Nonnull final IParticipantIdentifier aParticpantID, @Nonnull final EIndexerWorkItemType eType, @Nonnull @Nonempty final String sOwnerID, @Nonnull @Nonempty final String sRequestingHost) { this (GlobalIDFactory.getNewPersistentStringID (), PDTFactory.getCurrentLocalDateTime (), aParticpantID, eType, sOwnerID, sRequestingHost); }
public LongRunningJobData (@Nonnull @Nonempty final String sJobID, @Nonnull final IMultilingualText aJobDescription, @Nullable final String sStartingUserID) { m_sID = ValueEnforcer.notEmpty (sJobID, "JobID"); m_aJobDescription = ValueEnforcer.notNull (aJobDescription, "JobDescription"); m_aStartDateTime = PDTFactory.getCurrentLocalDateTime (); m_sStartingUserID = sStartingUserID; }
void onJobEnd (@Nonnull final ESuccess eExecSucess, @Nonnull final LongRunningJobResult aResult) { ValueEnforcer.notNull (eExecSucess, "ExecSuccess"); ValueEnforcer.notNull (aResult, "Result"); if (isEnded ()) throw new IllegalStateException ("Job was already ended"); // Save the date m_aEndDateTime = PDTFactory.getCurrentLocalDateTime (); m_eExecSuccess = eExecSucess; // Build the main results m_aResult = aResult; if (m_aResult == null) throw new IllegalStateException ("Failed to create job results object!"); }
/** * @return <code>true</code> if this item is to be expired, because the * retry-time has been exceeded, <code>false</code> otherwise. */ default boolean isExpired () { return getMaxRetryDT ().isBefore (PDTFactory.getCurrentLocalDateTime ()); }
/** * Increment the number of retries and update the previous and the next retry * datetime. */ public void incRetryCount () { m_nRetries++; m_aPreviousRetryDT = PDTFactory.getCurrentLocalDateTime (); m_aNextRetryDT = m_aPreviousRetryDT.plusMinutes (PDServerConfiguration.getReIndexRetryMinutes ()); }
public ResendItem (@Nonnull @Nonempty final String sResendAction, @Nonnegative final int nRetries, @Nonnull final IMessage aMsg, @Nonnegative final long nResendDelayMS) { m_sResendAction = ValueEnforcer.notEmpty (sResendAction, "ResendAction"); m_nRetries = ValueEnforcer.isGE0 (nRetries, "Retries"); m_aMsg = ValueEnforcer.notNull (aMsg, "Message"); ValueEnforcer.isGE0 (nResendDelayMS, "ResendDelayMS"); m_aEarliestResendDT = PDTFactory.getCurrentLocalDateTime ().plus (nResendDelayMS, ChronoUnit.MILLIS); }
@Override protected void onExecute (@Nonnull final JobDataMap aJobDataMap, @Nonnull final IJobExecutionContext aContext) throws JobExecutionException { final long nMins = aJobDataMap.getAsLong (KEY_MINUTES); final LocalDateTime aOldDT = PDTFactory.getCurrentLocalDateTime ().minusMinutes (nMins); final ICommonsList <String> aEvicted = MetaAS4Manager.getIncomingDuplicateMgr ().evictAllItemsBefore (aOldDT); if (aEvicted.isNotEmpty ()) LOGGER.info ("Evicted " + aEvicted.size () + " incoming duplicate message IDs"); }
public ReIndexWorkItem (@Nonnull final IIndexerWorkItem aWorkItem) { // The next retry happens from now in the configured number of minutes this (aWorkItem, aWorkItem.getCreationDateTime ().plusHours (PDServerConfiguration.getReIndexMaxRetryHours ()), 0, (LocalDateTime) null, PDTFactory.getCurrentLocalDateTime ().plusMinutes (PDServerConfiguration.getReIndexRetryMinutes ())); }