Search in sources :

Example 1 with Status

use of org.openkilda.model.Status in project open-kilda by telstra.

the class FlowService method getAllStatus.

/**
 * Gets the all status list.
 *
 * @return the all status list
 */
public Set<String> getAllStatus() {
    LinkStoreConfigDto linkStoreConfigDto = storeService.getLinkStoreConfig();
    boolean isLinkStoreConfig = linkStoreConfigDto.getUrls().isEmpty();
    Status status = Status.INSTANCE;
    if (!isLinkStoreConfig) {
        if (CollectionUtil.isEmpty(status.getStatuses())) {
            status.setStatuses(new HashSet<String>(flowStoreService.getAllStatus()));
        }
    } else {
        LOGGER.info("Link store is not configured. ");
    }
    return status.getStatuses() != null ? status.getStatuses() : new HashSet<String>();
}
Also used : Status(org.openkilda.model.Status) FlowStatus(org.openkilda.integration.model.FlowStatus) LinkStoreConfigDto(org.openkilda.store.model.LinkStoreConfigDto)

Example 2 with Status

use of org.openkilda.model.Status in project open-kilda by telstra.

the class FlowController method getAllStatusWithCron.

/**
 * Get statuses exists in the system with cron.
 */
@Scheduled(fixedDelayString = "${status.cron.time}")
public void getAllStatusWithCron() {
    LOGGER.info("Get all status cron. ");
    Status statuses = Status.INSTANCE;
    statuses.setStatuses(flowService.getAllStatus());
}
Also used : Status(org.openkilda.model.Status) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) HttpStatus(org.springframework.http.HttpStatus) FlowStatus(org.openkilda.integration.model.FlowStatus) Scheduled(org.springframework.scheduling.annotation.Scheduled)

Aggregations

FlowStatus (org.openkilda.integration.model.FlowStatus)2 Status (org.openkilda.model.Status)2 LinkStoreConfigDto (org.openkilda.store.model.LinkStoreConfigDto)1 HttpStatus (org.springframework.http.HttpStatus)1 Scheduled (org.springframework.scheduling.annotation.Scheduled)1 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)1