List of usage examples for java.time OffsetDateTime getDayOfWeek
public DayOfWeek getDayOfWeek()
From source file:Main.java
public static void main(String[] args) { OffsetDateTime o = OffsetDateTime.now(); DayOfWeek l = o.getDayOfWeek(); System.out.println(l);/*from w w w . j a v a 2s. c o m*/ }
From source file:com.epam.dlab.backendapi.service.impl.SchedulerJobServiceImpl.java
@Override public void executeStopResourceJob(boolean isAppliedForClusters) { OffsetDateTime currentDateTime = OffsetDateTime.now(); List<SchedulerJobData> jobsToStop = getSchedulerJobsForAction(STOPPED, currentDateTime, isAppliedForClusters);// w ww . ja va 2 s.c o m if (!jobsToStop.isEmpty()) { log.debug(isAppliedForClusters ? "Scheduler computational resource stop job is executing..." : "Scheduler exploratory stop job is executing..."); log.info(CURRENT_DATETIME_INFO, LocalTime.of(currentDateTime.toLocalTime().getHour(), currentDateTime.toLocalTime().getMinute()), currentDateTime.toLocalDate(), currentDateTime.getDayOfWeek()); log.info(isAppliedForClusters ? "Quantity of clusters for stopping: {}" : "Quantity of exploratories for stopping: {}", jobsToStop.size()); jobsToStop.forEach(job -> changeResourceStatusTo(STOPPED, job, isAppliedForClusters)); } }
From source file:com.epam.dlab.backendapi.service.impl.SchedulerJobServiceImpl.java
@Override public void executeStartResourceJob(boolean isAppliedForClusters) { OffsetDateTime currentDateTime = OffsetDateTime.now(); List<SchedulerJobData> jobsToStart = getSchedulerJobsForAction(UserInstanceStatus.RUNNING, currentDateTime, isAppliedForClusters);/* w ww .j av a 2 s .c om*/ if (!jobsToStart.isEmpty()) { log.debug(isAppliedForClusters ? "Scheduler computational resource start job is executing..." : "Scheduler exploratory start job is executing..."); log.info(CURRENT_DATETIME_INFO, LocalTime.of(currentDateTime.toLocalTime().getHour(), currentDateTime.toLocalTime().getMinute()), currentDateTime.toLocalDate(), currentDateTime.getDayOfWeek()); log.info(isAppliedForClusters ? "Quantity of clusters for starting: {}" : "Quantity of exploratories for starting: {}", jobsToStart.size()); jobsToStart .forEach(job -> changeResourceStatusTo(UserInstanceStatus.RUNNING, job, isAppliedForClusters)); } }
From source file:com.epam.dlab.backendapi.service.impl.SchedulerJobServiceImpl.java
@Override public void executeTerminateResourceJob(boolean isAppliedForClusters) { OffsetDateTime currentDateTime = OffsetDateTime.now(); List<SchedulerJobData> jobsToTerminate = getSchedulerJobsForAction(UserInstanceStatus.TERMINATED, currentDateTime, isAppliedForClusters); if (!jobsToTerminate.isEmpty()) { log.debug(isAppliedForClusters ? "Scheduler computational resource terminate job is executing..." : "Scheduler exploratory terminate job is executing..."); log.info(CURRENT_DATETIME_INFO,/* w w w.ja v a2s .c om*/ LocalTime.of(currentDateTime.toLocalTime().getHour(), currentDateTime.toLocalTime().getMinute()), currentDateTime.toLocalDate(), currentDateTime.getDayOfWeek()); log.info(isAppliedForClusters ? "Quantity of clusters for terminating: {}" : "Quantity of exploratories for terminating: {}", jobsToTerminate.size()); jobsToTerminate.forEach( job -> changeResourceStatusTo(UserInstanceStatus.TERMINATED, job, isAppliedForClusters)); } }