/** * 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 (); }
/** * Return a timestamp string that contains the elapsed time period. * * @param time * the starting time of the period * @return the timestamp string */ protected String timestamp (final long time) { // Current time followed by elapsed time as (hh:mm:ss). final LocalDateTime aLDT = PDTFactory.getCurrentLocalDateTime (); final LocalDateTime aOld = PDTFactory.createLocalDateTime (time); return aLDT.toLocalTime ().toString () + " (" + Duration.between (aOld, aLDT).toString () + ")"; } }
@Nonnull public static RequestFieldDate createLocalDateNow (@Nonnull @Nonempty final String sFieldName, @Nonnull final Locale aDisplayLocale) { return new RequestFieldDate (sFieldName, PDTFactory.getCurrentLocalDate (), aDisplayLocale); }
final LocalDateTime aNow = PDTFactory.getCurrentLocalDateTime (); final ISMLInfo aSMLInfo = aSettings.getSMLInfo (); aStatusData.add ("status.datetime", PDTWebDateHelper.getAsStringXSD (PDTFactory.getCurrentZonedDateTimeUTC ())); aStatusData.add ("version.smp", CSMPServer.getVersionNumber ()); aStatusData.add ("smp.certificate.subject", aX509Cert.getSubjectX500Principal ().getName ()); final LocalDateTime aNotAfter = PDTFactory.createLocalDateTime (aX509Cert.getNotAfter ()); final boolean bIsExpired = aNow.isAfter (aNotAfter); aStatusData.add ("smp.certificate.expired", bIsExpired);
@Nonnull public LocalDateTime getBuildDateTime () { return PDTFactory.createLocalDateTime (getAsLong ("build.datetime.millis", 0)); }
PDTToString.getAsString (PDTFactory.createLocalDateTime (aEntry.getNotAfter ()), aDisplayLocale) + ".")); (LocalDate) null, aDisplayLocale); aDTP.setMinDate (PDTFactory.getCurrentLocalDate ().plusDays (1)); aForm.addFormGroup (new BootstrapFormGroup ().setLabel ("Certificate migration date") .setCtrl (aDTP)
final LocalDate aNow = PDTFactory.getCurrentLocalDate (); final String sMigrationDate = aWPEC.params ().getAsString (FIELD_PM_MIGRATION_DATE); final LocalDate aMigrationDate = PDTFromString.getLocalDateFromString (sMigrationDate, aDisplayLocale); final LocalDate aNotBefore = PDTFactory.createLocalDate (aMigrationPublicKey.getNotBefore ()); final LocalDate aNotAfter = PDTFactory.createLocalDate (aMigrationPublicKey.getNotAfter ()); aCaller.prepareChangeCertificate (sMigrationPublicKey, aMigrationDate); final LocalDate aNotBefore = PDTFactory.createLocalDate (aMigrationPublicKey.getNotBefore ()); final LocalDate aNotAfter = PDTFactory.createLocalDate (aMigrationPublicKey.getNotAfter ());
@Nonnull public static String getFormattedDateNow (@Nonnull final String sFormat) { // Must use "ZonedDateTime" because time zone is part of many formats return formatDate (sFormat, PDTFactory.getCurrentZonedDateTime ()); }
@Nullable public static LocalDate getCellValueLocalDate (@Nullable final Cell aCell) { final Date aDate = getCellValueJavaDate (aCell); return aDate == null ? null : PDTFactory.createLocalDate (aDate); }
final LocalDateTime aNow = PDTFactory.getCurrentLocalDateTime (); final ISMLInfo aSMLInfo = aSettings.getSMLInfo (); aStatusData.add ("status.datetime", PDTWebDateHelper.getAsStringXSD (PDTFactory.getCurrentZonedDateTimeUTC ())); aStatusData.add ("version.smp", CSMPServer.getVersionNumber ()); aStatusData.add ("smp.certificate.subject", aX509Cert.getSubjectX500Principal ().getName ()); final LocalDateTime aNotAfter = PDTFactory.createLocalDateTime (aX509Cert.getNotAfter ()); final boolean bIsExpired = aNow.isAfter (aNotAfter); aStatusData.add ("smp.certificate.expired", bIsExpired);
@Nullable public static LocalDateTime getCellValueLocalDateTime (@Nullable final Cell aCell) { final Date aDate = getCellValueJavaDate (aCell); return aDate == null ? null : PDTFactory.createLocalDateTime (aDate); }
@Nonnull public static RequestFieldDate createDateTimeNow (@Nonnull @Nonempty final String sFieldName, @Nonnull final Locale aDisplayLocale) { return new RequestFieldDate (sFieldName, PDTFactory.getCurrentZonedDateTime (), aDisplayLocale); } }
@Nonnull private static IHCNode _getCertificateDisplay (@Nullable final String sCert, @Nonnull final Locale aDisplayLocale) { X509Certificate aEndpointCert = null; try { aEndpointCert = CertificateHelper.convertStringToCertficate (sCert); } catch (final Exception ex) { // Ignore } if (aEndpointCert == null) { final int nDisplayLen = 20; final String sCertPart = (sCert.length () > nDisplayLen ? sCert.substring (0, 20) + "..." : sCert); return new HCDiv ().addChild ("Invalid certificate" + (sCert.length () > nDisplayLen ? " starting with: " : ": ")) .addChild (new HCCode ().addChild (sCertPart)); } final HCNodeList ret = new HCNodeList (); ret.addChild (new HCDiv ().addChild ("Issuer: " + aEndpointCert.getIssuerDN ().toString ())); ret.addChild (new HCDiv ().addChild ("Subject: " + aEndpointCert.getSubjectDN ().toString ())); final LocalDate aNotBefore = PDTFactory.createLocalDate (aEndpointCert.getNotBefore ()); ret.addChild (new HCDiv ().addChild ("Not before: " + PDTToString.getAsString (aNotBefore, aDisplayLocale))); final LocalDate aNotAfter = PDTFactory.createLocalDate (aEndpointCert.getNotAfter ()); ret.addChild (new HCDiv ().addChild ("Not after: " + PDTToString.getAsString (aNotAfter, aDisplayLocale))); return ret; }
/** * @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 (); }
final LocalDateTime aCreationDT = PDTFactory.createLocalDateTime (aWebScope.getSession ().getCreationTime ()); final LocalDateTime aLastAccessDT = PDTFactory.createLocalDateTime (aWebScope.getSession () .getLastAccessedTime ()); aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel (EText.MSG_SCOPE_SESSION_AGE.getDisplayText (aDisplayLocale)) .setCtrl (Duration.between (aCreationDT, PDTFactory.getCurrentLocalDateTime ()) .toString ())); aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel (EText.MSG_SCOPE_SESSION_TIMEOUT.getDisplayText (aDisplayLocale))
@Nonnull final Locale aDisplayLocale) final LocalDateTime aNotBefore = PDTFactory.createLocalDateTime (aX509Cert.getNotBefore ()); final LocalDateTime aNotAfter = PDTFactory.createLocalDateTime (aX509Cert.getNotAfter ()); final PublicKey aPublicKey = aX509Cert.getPublicKey ();
@Nullable public String get () { // No base dir -> in memory only if (StringHelper.hasNoText (m_sBaseDir)) return null; return m_sBaseDir + getRelativeAuditFilename (PDTFactory.getCurrentLocalDate ()); } }
/** * Build the filename for re-sending. The filename consists of the date and * time when the document is to be re-send. * * @return The filename and never <code>null</code>. * @throws InvalidParameterException * Only theoretically */ @Nonnull protected String getFilename () throws InvalidParameterException { final long nResendDelayMS = getResendDelayMS (); return AS2DateHelper.formatDate (FILENAME_DATE_FORMAT, PDTFactory.getCurrentZonedDateTime ().plus (nResendDelayMS, ChronoUnit.MILLIS)); }
@Nonnull private static IHCNode _getCertificateDisplay (@Nullable final String sCert, @Nonnull final Locale aDisplayLocale) { X509Certificate aEndpointCert = null; try { aEndpointCert = CertificateHelper.convertStringToCertficate (sCert); } catch (final Exception ex) { // Ignore } if (aEndpointCert == null) { final int nDisplayLen = 20; final String sCertPart = (sCert.length () > nDisplayLen ? sCert.substring (0, 20) + "..." : sCert); return new HCDiv ().addChild ("Invalid certificate" + (sCert.length () > nDisplayLen ? " starting with: " : ": ")) .addChild (new HCCode ().addChild (sCertPart)); } final HCNodeList ret = new HCNodeList (); ret.addChild (new HCDiv ().addChild ("Issuer: " + aEndpointCert.getIssuerDN ().toString ())); ret.addChild (new HCDiv ().addChild ("Subject: " + aEndpointCert.getSubjectDN ().toString ())); final LocalDate aNotBefore = PDTFactory.createLocalDate (aEndpointCert.getNotBefore ()); ret.addChild (new HCDiv ().addChild ("Not before: " + PDTToString.getAsString (aNotBefore, aDisplayLocale))); final LocalDate aNotAfter = PDTFactory.createLocalDate (aEndpointCert.getNotAfter ()); ret.addChild (new HCDiv ().addChild ("Not after: " + PDTToString.getAsString (aNotAfter, aDisplayLocale))); return ret; }
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); }