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

com.aeontronix.enhancedmule.tools.runtime.ServerGroup Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha4
Show newest version
/*
 * Copyright (c) Aeontronix 2019
 */

package com.aeontronix.enhancedmule.tools.runtime;

import com.aeontronix.enhancedmule.tools.anypoint.Environment;
import com.aeontronix.enhancedmule.tools.util.HttpException;

import java.util.Map;

public class ServerGroup extends Server {
    public ServerGroup() {
    }

    public ServerGroup(Environment environment) {
        super(environment);
    }

    public ServerGroup(Environment environment, String id) {
        super(environment, id);
    }

    @Override
    public void delete() throws HttpException {
        httpHelper.anypointHttpDelete("/hybrid/api/v1/serverGroups/" + id, parent);
    }

    public void addServer(Server server) throws HttpException {
        addServer(server.getId());
    }

    public void addServer(String serverId) throws HttpException {
        Map request = jsonHelper.buildJsonMap().set("serverGroupId", id).set("serverId", serverId).toMap();
        httpHelper.anypointHttpPost("/hybrid/api/v1/serverGroups/" + id + "/servers/" + serverId, request, parent);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy