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

io.searchbox.snapshot.CreateSnapshot Maven / Gradle / Ivy

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

/**
 * @author happyprg([email protected])
 */
public class CreateSnapshot extends AbstractSnapshotAction {

    protected CreateSnapshot(Builder builder) {
        super(builder);
        this.payload = builder.settings;
    }

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

    public static class Builder extends AbstractSnapshotAction.SingleSnapshotBuilder {
        private Object settings;

        public Builder(String repository, String snapshot) {
            super(repository, snapshot);
        }

        public Builder settings(Object settings) {
            this.settings = settings;
            return this;
        }

        public Builder waitForCompletion(boolean waitForCompletion) {
            return setParameter("wait_for_completion", waitForCompletion);
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy