All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.actuate.application.maintenance.AppOfflineMaintenanceOperator Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.actuate.application.maintenance;

import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.RequestMethod;
import org.zodiac.core.event.context.AppOfflineEvent;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class AppOfflineMaintenanceOperator implements AppMaintenanceOperator, ApplicationEventPublisherAware {

    private ApplicationEventPublisher publisher;
    private final List supportedMethods;

    public AppOfflineMaintenanceOperator() {
        supportedMethods = Arrays.asList(RequestMethod.DELETE, RequestMethod.POST, RequestMethod.PUT);
    }

    @Override
    public String getOperatorName() {
        return "app-offline";
    }

    @Override
    public void process(Map params) {
        publisher.publishEvent(new AppOfflineEvent());
    }

    @Override
    public Object getStatus() {
        return null;
    }

    @Override
    public void setApplicationEventPublisher(@NonNull ApplicationEventPublisher applicationEventPublisher) {
        this.publisher = applicationEventPublisher;
    }

    @Override
    public List supportedMethods() {
        return supportedMethods;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy