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

io.searchbox.cluster.NodesShutdown Maven / Gradle / Ivy

There is a newer version: 6.3.1
Show newest version
package io.searchbox.cluster;

import io.searchbox.action.AbstractMultiINodeActionBuilder;
import io.searchbox.action.GenericResultAbstractAction;

/**
 * @author Dogukan Sonmez
 * @author cihat keser
 */
public class NodesShutdown extends GenericResultAbstractAction {

    protected NodesShutdown(Builder builder) {
        super(builder);
        setURI(buildURI());
    }

    @Override
    protected String buildURI() {
        return super.buildURI() + "/_nodes/" +
                nodes +
                "/_shutdown";
    }

    @Override
    public String getRestMethodName() {
        return "POST";
    }

    @Override
    public String getPathToResult() {
        return "nodes";
    }

    public static class Builder extends AbstractMultiINodeActionBuilder {

        /**
         * By default, the shutdown will be executed after a 1 second delay (1s).
         * The delay can be customized by setting the delay parameter in a time value format.
         *
         * @param value e.g.: "1s" -> 1 second, "10m" -> 10 minutes
         */
        public Builder delay(String value) {
            return setParameter("delay", value);
        }

        @Override
        public NodesShutdown build() {
            return new NodesShutdown(this);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy