本文整理了Java中org.joda.time.DateTime.isBeforeNow()
方法的一些代码示例,展示了DateTime.isBeforeNow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.isBeforeNow()
方法的具体详情如下:
包路径:org.joda.time.DateTime
类名称:DateTime
方法名:isBeforeNow
暂无
代码示例来源:origin: aws/aws-sdk-java
/**
* Determine whether the current state of the credentials warrant refreshing.
*/
private boolean credentialsNeedUpdating() {
return credentials == null || credentialExpirationTime.isBeforeNow();
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public boolean apply(DatasetVersion version) {
return ((TimestampedDatasetVersion) version).getDateTime().plus(TimeBasedRetentionPolicy.this.retention)
.isBeforeNow();
}
}));
代码示例来源:origin: apache/incubator-gobblin
@Override
public boolean shouldDeleteSnapshot(FileStatus snapshot, Trash trash) {
DateTime snapshotTime = Trash.TRASH_SNAPSHOT_NAME_FORMATTER.parseDateTime(snapshot.getPath().getName());
return snapshotTime.plusMinutes(this.retentionMinutes).isBeforeNow();
}
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public boolean apply(TimestampedDatasetVersion version) {
return version.getDateTime()
.plus(SelectBetweenTimeBasedPolicy.this.maxLookBackPeriod.or(new Period(DateTime.now().getMillis())))
.isAfterNow()
&& version.getDateTime().plus(SelectBetweenTimeBasedPolicy.this.minLookBackPeriod.or(new Period(0)))
.isBeforeNow();
}
};
代码示例来源:origin: apache/incubator-druid
if (earliestTaskStart.plus(ioConfig.getTaskDuration()).isBeforeNow()) {
log.info("Task group [%d] has run for [%s]", groupId, ioConfig.getTaskDuration());
futureGroupIds.add(groupId);
代码示例来源:origin: prestodb/presto
/**
* Enforce query max runtime/execution time limits
*/
private void enforceTimeLimits()
{
for (T query : queries.values()) {
if (query.isDone()) {
continue;
}
Duration queryMaxRunTime = getQueryMaxRunTime(query.getSession());
Duration queryMaxExecutionTime = getQueryMaxExecutionTime(query.getSession());
Optional<DateTime> executionStartTime = query.getExecutionStartTime();
DateTime createTime = query.getCreateTime();
if (executionStartTime.isPresent() && executionStartTime.get().plus(queryMaxExecutionTime.toMillis()).isBeforeNow()) {
query.fail(new PrestoException(EXCEEDED_TIME_LIMIT, "Query exceeded the maximum execution time limit of " + queryMaxExecutionTime));
}
if (createTime.plus(queryMaxRunTime.toMillis()).isBeforeNow()) {
query.fail(new PrestoException(EXCEEDED_TIME_LIMIT, "Query exceeded maximum time limit of " + queryMaxRunTime));
}
}
}
代码示例来源:origin: apache/incubator-druid
if (createdTask && firstRunTime.isBeforeNow()) {
代码示例来源:origin: apache/incubator-druid
if ((!foundSuccess && group.completionTimeout.isBeforeNow()) || entireTaskGroupFailed) {
if (entireTaskGroupFailed) {
log.warn("All tasks in group [%d] failed to publish, killing all tasks for these partitions", groupId);
代码示例来源:origin: stackoverflow.com
.withMillisOfSecond(0);
return (next.isBeforeNow())
? next.plusHours(24)
: next;
代码示例来源:origin: com.amazonaws/aws-java-sdk-core
/**
* Determine whether the current state of the credentials warrant refreshing.
*/
private boolean credentialsNeedUpdating() {
return credentials == null || credentialExpirationTime.isBeforeNow();
}
代码示例来源:origin: apache/cloudstack
public void validatePostUploadRequest(String signature, String metadata, String timeout, String hostname, long contentLength, String uuid)
throws InvalidParameterValueException {
// check none of the params are empty
if (StringUtils.isEmpty(signature) || StringUtils.isEmpty(metadata) || StringUtils.isEmpty(timeout)) {
updateStateMapWithError(uuid, "signature, metadata and expires are compulsory fields.");
throw new InvalidParameterValueException("signature, metadata and expires are compulsory fields.");
}
//check that contentLength exists and is greater than zero
if (contentLength <= 0) {
throw new InvalidParameterValueException("content length is not set in the request or has invalid value.");
}
//validate signature
String fullUrl = "https://" + hostname + "/upload/" + uuid;
String computedSignature = EncryptionUtil.generateSignature(metadata + fullUrl + timeout, getPostUploadPSK());
boolean isSignatureValid = computedSignature.equals(signature);
if (!isSignatureValid) {
updateStateMapWithError(uuid, "signature validation failed.");
throw new InvalidParameterValueException("signature validation failed.");
}
//validate timeout
DateTime timeoutDateTime = DateTime.parse(timeout, ISODateTimeFormat.dateTime());
if (timeoutDateTime.isBeforeNow()) {
updateStateMapWithError(uuid, "request not valid anymore.");
throw new InvalidParameterValueException("request not valid anymore.");
}
}
代码示例来源:origin: com.hp.autonomy.hod/java-hod-client
/**
* @return True if the token has expired; false otherwise
*/
public boolean hasExpired() {
return this.expiry.isBeforeNow();
}
代码示例来源:origin: ihaolin/antares
/**
* 日期a是否大于当前日期
* @param a 日期a
* @return 小于返回true,反之false
*/
public static Boolean isBeforeNow(Date a){
return new DateTime(a).isBeforeNow();
}
代码示例来源:origin: com.atlassian.plugins/base-hipchat-integration-plugin-api
@VisibleForTesting
boolean isExpired(Date tokenExpiryDate) {
return tokenExpiryDate == null ||
new DateTime(tokenExpiryDate).minusMillis((int) EXPIRE_TIME_BUFFER_MILLIS).isBeforeNow();
}
代码示例来源:origin: com.linkedin.gobblin/gobblin-data-management
@Override
public boolean apply(TimestampedDatasetVersion version) {
return version.getDateTime()
.plus(SelectBetweenTimeBasedPolicy.this.maxLookBackPeriod.or(new Period(DateTime.now().getMillis())))
.isAfterNow()
&& version.getDateTime().plus(SelectBetweenTimeBasedPolicy.this.minLookBackPeriod.or(new Period(0)))
.isBeforeNow();
}
};
代码示例来源:origin: org.motechproject/motech-scheduler
private String getJobActivity(JobKey jobKey) throws SchedulerException {
Trigger trigger = scheduler.getTriggersOfJob(jobKey).get(0);
DateTime startDateTime = new DateTime(trigger.getStartTime());
DateTime endDateTime = new DateTime(trigger.getEndTime());
if (startDateTime.isAfterNow()) {
return JobBasicInfo.ACTIVITY_NOTSTARTED;
} else if (endDateTime.isBeforeNow()) {
return JobBasicInfo.ACTIVITY_FINISHED;
} else {
return JobBasicInfo.ACTIVITY_ACTIVE;
}
}
代码示例来源:origin: com.nitorcreations/nflow-engine
public int insertWorkflowInstance(WorkflowInstance instance) {
int id;
if (sqlVariants.hasUpdateableCTE()) {
id = insertWorkflowInstanceWithCte(instance);
} else {
id = insertWorkflowInstanceWithTransaction(instance);
}
if (instance.nextActivation != null && instance.nextActivation.isBeforeNow()) {
workflowInstanceExecutor.wakeUpDispatcherIfNeeded();
}
return id;
}
代码示例来源:origin: org.kuali.kpme/kpme-tk-lm-impl
public boolean isOnCurrentPeriod() {
boolean isOnCurrentPeriod = false;
if (getCalendarEntry() != null) {
DateTime beginPeriodDateTime = getCalendarEntry().getBeginPeriodFullDateTime();
DateTime endPeriodDateTime = getCalendarEntry().getEndPeriodFullDateTime();
isOnCurrentPeriod = (beginPeriodDateTime.isEqualNow() || beginPeriodDateTime.isBeforeNow()) && endPeriodDateTime.isAfterNow();
}
return isOnCurrentPeriod;
}
代码示例来源:origin: FenixEdu/fenixedu-academic
public void setRealization(WrittenEvaluation writtenEvaluation) {
this.realizationPast = writtenEvaluation.getBeginningDateTime().isBeforeNow();
this.realization =
YearMonthDay.fromDateFields(writtenEvaluation.getBeginningDateTime().toDate()).toString()
+ " "
+ writtenEvaluation.getBeginningDateTime().getHourOfDay()
+ ":"
+ (writtenEvaluation.getBeginningDateTime().getMinuteOfHour() == 0 ? "00" : writtenEvaluation
.getBeginningDateTime().getMinuteOfHour());
}
代码示例来源:origin: FenixEdu/fenixedu-academic
public boolean isInEnrolmentPeriod() {
if (this.getEnrollmentBeginDayDate() == null || this.getEnrollmentBeginTimeDate() == null
|| this.getEnrollmentEndDayDate() == null || this.getEnrollmentEndTimeDate() == null) {
throw new DomainException("error.enrolmentPeriodNotDefined");
}
final DateTime enrolmentBeginDate = createDate(this.getEnrollmentBeginDayDate(), this.getEnrollmentBeginTimeDate());
final DateTime enrolmentEndDate = createDate(this.getEnrollmentEndDayDate(), this.getEnrollmentEndTimeDate());
return enrolmentBeginDate.isBeforeNow() && enrolmentEndDate.isAfterNow();
}
内容来源于网络,如有侵权,请联系作者删除!