@Override public String toString() { final String underlying = this.projectName + "." + this.flowName + " (" + this.projectId + ")" + " to be run at (starting) " + new DateTime( this.firstSchedTime).toDateTimeISO(); if (this.period == null && this.cronExpression == null) { return underlying + " non-recurring"; } else if (this.cronExpression != null) { return underlying + " with CronExpression {" + this.cronExpression + "}"; } else { return underlying + " with precurring period of " + createPeriodString(this.period); } }
private static int calculateBcdFromSubscription(final SubscriptionBase subscription, final InternalTenantContext internalTenantContext) { final DateTime date = subscription.getDateOfFirstRecurringNonZeroCharge(); final int bcdLocal = internalTenantContext.toLocalDate(date).getDayOfMonth(); log.debug("Calculated BCD: subscriptionId='{}', subscriptionStartDate='{}', bcd='{}'", subscription.getId(), date.toDateTimeISO(), bcdLocal); return bcdLocal; } }
public String toString() { return execId + " " + jobName + " to be checked at " + checkTime.toDateTimeISO(); }
public String getOrigin() { return origin == null ? null : origin.toDateTimeISO().toString(); }
@JsonValue private String getIntervalAsString() { return String.format(DRUID_INTERVAL_FORMAT, startTime.toDateTimeISO(), endTime.toDateTimeISO()); } }
public String getOrigin() { return origin == null ? null : origin.toDateTimeISO().toString(); } }
private String formatDate(final DateTime dateTime) { return dateTime.toDateTimeISO().toString(); }
DateTime dt = new DateTime(cal); System.out.println(dt.toDateTimeISO());
@Override public String toString() { final String underlying = this.projectName + "." + this.flowName + " (" + this.projectId + ")" + " to be run at (starting) " + new DateTime( this.firstSchedTime).toDateTimeISO(); if (this.period == null && this.cronExpression == null) { return underlying + " non-recurring"; } else if (this.cronExpression != null) { return underlying + " with CronExpression {" + this.cronExpression + "}"; } else { return underlying + " with precurring period of " + createPeriodString(this.period); } }
public String toString() { return projectName + "." + flowName + " (" + projectId + ")" + " to be run at (starting) " + new DateTime(firstSchedTime).toDateTimeISO() + " with recurring period of " + (period == null ? "non-recurring" : createPeriodString(period)); }
public String toString() { return projectName + "." + flowName + " (" + projectId + ")" + " to be run at (starting) " + new DateTime(firstSchedTime).toDateTimeISO() + " with recurring period of " + (period == null ? "non-recurring" : createPeriodString(period)); }
/** * {@inheritDoc} * <em><strong>N.B.</strong></em>: this implementation does <em>not</em> set an identifier on the returned * {@code DcsEvent}. It only will set the event type, and the current date time. * * @param eventType the returned event will carry this type * @return a new event, with the time set to the current date time, and event type set to {@code eventType} */ @Override public DcsEvent newEvent(String eventType) { DcsEvent e = new DcsEvent(); e.setDate(DateTime.now().toDateTimeISO().toString()); e.setEventType(eventType); return e; }
/** * Builds a JobRow with values for every field defined in {@link DefaultJobField}. * * @param request The request that is triggering this job * @param requestContext The context of the request triggering this job * * @return A JobRow with all the metadata for the job under construction */ @Override public JobRow buildJobRow(UriInfo request, ContainerRequestContext requestContext) { Map<JobField, String> jobMetadata = new LinkedHashMap<>(DefaultJobField.values().length); String userId = userIdExtractor.apply(requestContext.getSecurityContext()); jobMetadata.put(DefaultJobField.QUERY, request.getRequestUri().toString()); jobMetadata.put(DefaultJobField.STATUS, DefaultJobStatus.PENDING.getName()); String isoDateCreated = new DateTime(timestampGenerator.instant().toEpochMilli()).toDateTimeISO().toString(); jobMetadata.put(DefaultJobField.DATE_CREATED, isoDateCreated); jobMetadata.put(DefaultJobField.DATE_UPDATED, isoDateCreated); jobMetadata.put(DefaultJobField.USER_ID, userId); jobMetadata.put(DefaultJobField.JOB_TICKET, idGenerator.apply(jobMetadata)); return new JobRow(DefaultJobField.JOB_TICKET, jobMetadata); } }
/** * {@inheritDoc} * <em><strong>N.B.</strong></em>: this implementation does <em>not</em> set an identifier on the returned * {@code DcsEvent}. It only will set the event type, and the current date time. * * @param eventType the returned event will carry this type * @return a new event, with the time set to the current date time, and event type set to {@code eventType} */ @Override public DcsEvent newEvent(String eventType) { DcsEvent e = new DcsEvent(); e.setDate(DateTime.now().toDateTimeISO().toString()); e.setEventType(eventType); return e; }
/** * Returns a copy of the specified JobRow with the specified field set to the specified value. * The returned JobRow also has the DATE_UPDATED field set to the start of the current day. * * @param row The row to use as a prototype for the new row * @param field The field to update * @param value The value to assign to the field * * @return A JobRow that is identical to the specified row, except with the specified field set to the specified * value, and the DATE_UPDATED field set to the current instant according to timestampGenerator */ private JobRow updateField(JobRow row, JobField field, String value) { return row .withFieldValue(field, value) .withFieldValue( DATE_UPDATED, new DateTime(timestampGenerator.instant().toEpochMilli()).toDateTimeISO().toString() ); } }
private static int calculateBcdFromSubscription(final SubscriptionBase subscription, final InternalTenantContext internalTenantContext) { final DateTime date = subscription.getDateOfFirstRecurringNonZeroCharge(); final int bcdLocal = internalTenantContext.toLocalDate(date).getDayOfMonth(); log.debug("Calculated BCD: subscriptionId='{}', subscriptionStartDate='{}', bcd='{}'", subscription.getId(), date.toDateTimeISO(), bcdLocal); return bcdLocal; } }
credential.setId(assertion.getID()); credential.setIssuer(assertion.getIssuer()); credential.setIssuedOn(ZonedDateTime.parse(assertion.getIssueInstant().toDateTimeISO().toString())); val conditions = assertion.getConditions(); if (conditions != null) { credential.setNotBefore(ZonedDateTime.parse(conditions.getNotBefore().toDateTimeISO().toString())); credential.setNotOnOrAfter(ZonedDateTime.parse(conditions.getNotOnOrAfter().toDateTimeISO().toString())); if (!conditions.getAudienceRestrictionConditions().isEmpty()) { credential.setAudience(conditions.getAudienceRestrictionConditions().get(0).getAudiences().get(0).getUri());
final int bcdLocal = date.toDateTime(account.getTimeZone()).getDayOfMonth(); log.info("Calculated BCD: subscription id {}, subscription start {}, timezone {}, bcd UTC {}, bcd local {}", subscription.getId(), date.toDateTimeISO(), account.getTimeZone(), bcdUTC, bcdLocal);
@Test(groups = "fast") public void testJson() throws Exception { final String changeType = UUID.randomUUID().toString(); final DateTime changeDate = clock.getUTCNow(); final String changedBy = UUID.randomUUID().toString(); final String reasonCode = UUID.randomUUID().toString(); final String comments = UUID.randomUUID().toString(); final String userToken = UUID.randomUUID().toString(); final AuditLogJson auditLogJson = new AuditLogJson(changeType, changeDate, changedBy, reasonCode, comments, userToken); Assert.assertEquals(auditLogJson.getChangeType(), changeType); Assert.assertEquals(auditLogJson.getChangeDate(), changeDate); Assert.assertEquals(auditLogJson.getChangedBy(), changedBy); Assert.assertEquals(auditLogJson.getReasonCode(), reasonCode); Assert.assertEquals(auditLogJson.getComments(), comments); Assert.assertEquals(auditLogJson.getUserToken(), userToken); final String asJson = mapper.writeValueAsString(auditLogJson); Assert.assertEquals(asJson, "{\"changeType\":\"" + auditLogJson.getChangeType() + "\"," + "\"changeDate\":\"" + auditLogJson.getChangeDate().toDateTimeISO().toString() + "\"," + "\"changedBy\":\"" + auditLogJson.getChangedBy() + "\"," + "\"reasonCode\":\"" + auditLogJson.getReasonCode() + "\"," + "\"comments\":\"" + auditLogJson.getComments() + "\"," + "\"userToken\":\"" + auditLogJson.getUserToken() + "\"}"); final AuditLogJson fromJson = mapper.readValue(asJson, AuditLogJson.class); Assert.assertEquals(fromJson, auditLogJson); }