        HttpSession session = request.getSession();
        String username = (String) session.getAttribute("username");
        PrintWriter out = response.getWriter();
        String jsession = request.getJsessionid();

import servlet.HttpServlet;
import servlet.HttpServletRequest;
import servlet.HttpServletResponse;
import servlet.HttpSession;
import java.io.PrintWriter;

/**
 * @author WangZhiJun
 */
public class User extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {

if (jsession != null) {
            out.print("HTTP/1.1 200 OK\r\nSet-Cookie: JSESSIONID=" + jsession + "\r\n\r\n");
        } else {
            out.print("HTTP/1.1 200 OK\r\n\r\n");
        }
        out.print("");
        out.print("");
        out.print("welcome! " + username + "\r\n\r\n");
        out.print("sessionId:" + jsession);
        out.print("");
        out.print("");
        out.flush();
        out.close();
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }
}


if (jsession != null) {
            out.print("HTTP/1.1 200 OK\r\nSet-Cookie: JSESSIONID=" + jsession + "\r\n\r\n");
        } else {
            out.print("HTTP/1.1 200 OK\r\n\r\n");
        }
        out.print("<html>");
        out.print("<body>");
        out.print("welcome! " + username + "\r\n\r\n");
        out.print("sessionId:" + jsession);

import servlet.HttpServlet;
import servlet.HttpServletRequest;
import servlet.HttpServletResponse;
import servlet.HttpSession;
import java.io.PrintWriter;

/**
 * @author WangZhiJun
 */
public class User extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        String username = (String) session.getAttribute("username");
        PrintWriter out = response.getWriter();
        String jsession = request.getJsessionid();

out.print("");
        out.print("");
        out.flush();
        out.close();
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }
}


out.print("");
        out.print("");
        out.flush();
        out.close();
    }

import servlet.HttpServlet;
import servlet.HttpServletRequest;
import servlet.HttpServletResponse;
import servlet.HttpSession;
import java.io.PrintWriter;

/**
 * @author WangZhiJun
 */
public class User extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        String username = (String) session.getAttribute("username");
        PrintWriter out = response.getWriter();
        String jsession = request.getJsessionid();
        if (jsession != null) {
            out.print("HTTP/1.1 200 OK\r\nSet-Cookie: JSESSIONID=" + jsession + "\r\n\r\n");
        } else {
            out.print("HTTP/1.1 200 OK\r\n\r\n");
        }
        out.print("<html>");
        out.print("<body>");
        out.print("welcome! " + username + "\r\n\r\n");
        out.print("sessionId:" + jsession);

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }
}


import servlet.HttpServlet;
import servlet.HttpServletRequest;
import servlet.HttpServletResponse;
import servlet.HttpSession;
import java.io.PrintWriter;

/**
 * @author WangZhiJun
 */
public class User extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        String username = (String) session.getAttribute("username");
        PrintWriter out = response.getWriter();
        String jsession = request.getJsessionid();
        if (jsession != null) {
            out.print("HTTP/1.1 200 OK\r\nSet-Cookie: JSESSIONID=" + jsession + "\r\n\r\n");
        } else {
            out.print("HTTP/1.1 200 OK\r\n\r\n");
        }
        out.print("");
        out.print("");
        out.print("welcome! " + username + "\r\n\r\n");
        out.print("sessionId:" + jsession);
        out.print("");
        out.print("");
        out.flu

        out.close();
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }
}


if (jsession != null) {
            out.print("HTTP/1.1 200 OK\r\nSet-Cookie: JSESSIONID=" + jsession + "\r\n\r\n");
        } else {
            out.print("HTTP/1.1 200 OK\r\n\r\n");
        }

out.print("");
        out.print("");
        out.print("welcome! " + username + "\r\n\r\n");
        out.print("sessionId:" + jsession);
        out.print("");
        out.print("");
        out.flush();
        out.close();
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) {
        doPost(request, response);
    }
}


public Map<ResourceHost, ResourceHostCapacity> getAvailableResources()

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH

{
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();
        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }
        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


{
        return Collections.unmodifiableMap(availableResources);
    }

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources()

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();
        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }
        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


StringBuilder humanResult = new StringBuilder();

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources() {
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {

        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }
        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources() {
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();

        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources() {
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();
        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }


package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources() {
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return

    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();
        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }
            if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }
        }
        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


if (requestedCapacity.getCpu() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getCpu()) {
                humanResult.append(String.format("Requested CPU %.2f can not be provided on RH %s: available CPU is %.2f%n", requestedCapacity.getCpu(), resourceHost.getHostname(), availableCapacity.getCpu()));
                canFit = false;
            }

package io.subutai.common.peer;

import java.util.Collections;
import java.util.Map;
import com.google.common.base.Preconditions;
import io.subutai.common.settings.Common;
import io.subutai.common.util.CollectionUtil;
import io.subutai.common.util.UnitUtil;

public class FitCheckResult {

    public static final double ACCOMMODATION_OVERHEAD_FACTOR = 1.01;

    private final Map<ResourceHost, ResourceHostCapacity> availableResources;

    private final Map<ResourceHost, ResourceHostCapacity> requestedResources;

    private boolean canFit = true;

    private String description;

    public FitCheckResult(final Map<ResourceHost, ResourceHostCapacity> availableResources, final Map<ResourceHost, ResourceHostCapacity> requestedResources) {
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(availableResources));
        Preconditions.checkArgument(!CollectionUtil.isMapEmpty(requestedResources));
        this.availableResources = availableResources;
        this.requestedResources = requestedResources;
        parse();
    }

    // returns capacity available on RH
    public Map<ResourceHost, ResourceHostCapacity> getAvailableResources() {
        return Collections.unmodifiableMap(availableResources);
    }

    // returns resources requested on RH
    public Map<ResourceHost, ResourceHostCapacity> getRequestedResources() {
        return Collections.unmodifiableMap(requestedResources);
    }

    public boolean canFit() {
        if (!Common.CHECK_RH_LIMITS) {
            return true;
        }
        return canFit;
    }

    public String getDescription() {
        return description;
    }

    private void parse() {
        StringBuilder humanResult = new StringBuilder();
        for (Map.Entry<ResourceHost, ResourceHostCapacity> resourceEntry : requestedResources.entrySet()) {
            ResourceHost resourceHost = resourceEntry.getKey();
            ResourceHostCapacity requestedCapacity = resourceEntry.getValue();
            ResourceHostCapacity availableCapacity = availableResources.get(resourceHost);
            if (requestedCapacity.getRam() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getRam()) {
                humanResult.append(String.format("Requested RAM volume %.2fMB can not be provided on RH %s: available RAM volume is %" + ".2fMB%n", UnitUtil.convert(requestedCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getRam(), UnitUtil.Unit.B, UnitUtil.Unit.MB)));
                canFit = false;
            }
            if (requestedCapacity.getDisk() * FitCheckResult.ACCOMMODATION_OVERHEAD_FACTOR > availableCapacity.getDisk()) {
                humanResult.append(String.format("Requested DISK volume %.2fGB can not be provided on RH %s: available DISK volume is " + "%.2fGB%n", UnitUtil.convert(requestedCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB), resourceHost.getHostname(), UnitUtil.convert(availableCapacity.getDisk(), UnitUtil.Unit.B, UnitUtil.Unit.GB)));
                canFit = false;
            }

        }
        description = humanResult.length() > 0 ? humanResult.toString() : "The requested resources can be allocated";
    }
}


/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *
 *    All Rights Reserved. http://example.com
 */
package org.opengis.metadata.identification;

import static org.opengis.annotation.Obligation.CONDITIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
import java.util.ArrayList;
import java.util.List;
import org.opengis.annotation.UML;
import org.opengis.util.CodeList;

/**
 * High-level geographic data thematic classification to assist in the grouping and search of
 * available geographic data sets. Can be used to group keywords as well. Listed examples are not
 * exhaustive.
 *
 *
NOTE: It is understood there are overlaps between general categories and the user is
 * encouraged to select the one most appropriate.
 *
 * @version ISO 19115
 * @author Martin Desruisseaux (IRD)
 * @since GeoAPI 2.0
 */
@UML(identifier = "MD_TopicCategoryCode", specification = ISO_19115)
public final class TopicCategory extends CodeList<TopicCategory> {

    /**
     * Serial number for compatibility with different versions.
     */
    private static final long serialVersionUID = -4987523565852255081L;

    /**
     * List of all enumerations of this type. Must be declared before any enum declaration.
     */
    private static final List<TopicCategory> VALUES = new ArrayList<>(19);

    /**
     * Rearing of animals and/or cultivation of plants.
     *
     *
Examples: agriculture, irrigation, aquaculture, plantations, herding, pests and diseases
     * affecting crops and livestock.
     */
    @UML(identifier = "farming", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory FARMING = new TopicCategory("FARMING");

    /**
     * Flora and/or fauna in natural environment.
     *
     *
Examples: wildlife, vegetation, biological sciences, ecology, wilderness, sealife,
     * wetlands, habitat
     */
    @UML(identifier = "biota", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BIOTA = new TopicCategory("BIOTA");

    /**
     * Legal land descriptions.
     *
     *
Examples: political and administrative boundaries.
     */
    @UML(identifier = "boundaries", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BOUNDARIES = new TopicCategory("BOUNDARIES");

    /**
     * Processes and phenomena of the atmosphere.
     *
     *
Examples: cloud cover, weather, climate, atmospheric conditions, climate change,
     * precipitation.
     */
    @UML(identifier = "climatologyMeteorologyAtmosphere", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory CLIMATOLOGY_METEOROLOGY_ATMOSPHERE = new TopicCategory("CLIMATOLOGY_METEOROLOGY_ATMOSPHERE");

    /**
     * Economic activities, conditions and employment.
     *
     *
Examples: production, labour, revenue, commerce, industry, tourism and ecotourism,
     * forestry, fisheries, commercial or subsistence hunting, exploration and exploitation of
     * resources such as minerals, oil and gas.
     */
    @UML(identifier = "economy", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ECONOMY = new TopicCategory("ECONOMY");

    /**
     * Height above or below sea level.
     *
     *
Examples: altitude, bathymetry, digital elevation models, slope, derived products.
     */
    @UML(identifier = "elevation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ELEVATION = new TopicCategory("ELEVATION");

    /**
     * Environmental resources, protection and conservation.
     *
     *
Examples: environmental pollution, waste storage and treatment, environmental impact
     * assessment, monitoring environmental risk, nature reserves, landscape.
     */
    @UML(identifier = "environment", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ENVIRONMENT = new TopicCategory("ENVIRONMENT");

    /**
     * Information pertaining to earth sciences.
     *
     *
Examples: geophysical features and processes, geology, minerals, sciences dealing with the
     * composition, structure and origin of the earth's rocks, risks of earthquakes, volcanic
     * activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion.
     */
    @UML(identifier = "geoscientificInformation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory GEOSCIENTIFIC_INFORMATION = new TopicCategory("GEOSCIENTIFIC_INFORMATION");

    /**
     * Health, health services, human ecology, and safety.
     *
     *
Examples: disease and illness, factors affecting health, hygiene, substance abuse, mental
     * and physical health, health services.
     *
     * @since GeoAPI 2.1
     */
    @UML(identifier = "health", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory HEALTH = new TopicCategory("HEALTH");

    @UML(identifier = "imageryBaseMapsEarthCover", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory IMAGERY_BASE_MAPS_EARTH_COVER = new TopicCategory("IMAGERY_BASE_MAPS_EARTH_COVER");

    @UML(identifier = "intelligenceMilitary", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INTELLIGENCE_MILITARY = new TopicCategory("INTELLIGENCE_MILITARY");

    /**
     * Inland water features, drainage systems and their characteristics.
     *
     *
Examples: rivers and glaciers, salt lakes, water utilization plans, dams, currents,
     * floods, water quality, hydrographic charts.
     */
    @UML(identifier = "inlandWaters", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INLAND_WATERS = new TopicCategory("INLAND_WATERS");

    /**
     * Positional information and services.
     *
     *
Examples: addresses, geodetic networks, control points, postal zones and services, place
     * names.
     */
    @UML(identifier = "location", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory LOCATION = new TopicCategory("LOCATION");

    /**
     * Features and characteristics of salt water bodies (excluding inland waters).
     *
     *
Examples: tides, tidal waves, coastal information, reefs.
     */
    @UML(identifier = "oceans", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory OCEANS = new TopicCategory("OCEANS");

    /**
     * Information used for appropriate actions for future use of the land.
     *
     *
Examples: land use maps, zoning maps, cadastral surveys, land ownership.
     */
    @UML(identifier = "planningCadastre", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory PLANNING_CADASTRE = new TopicCategory("PLANNING_CADASTRE");

    /**
     * Characteristics of society and cultures.
     *
     *
Examples: settlements, anthropology, archaeology, education, traditional beliefs, manners
     * and customs, demographic data, recreational areas and activities, social impact assessments,
     * crime and justice, census information
     */
    @UML(identifier = "society", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory SOCIETY = new TopicCategory("SOCIETY");

    @UML(identifier = "structure", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory STRUCTURE = new TopicCategory("STRUCTURE");

    /**
     * Means and aids for conveying persons and/or goods.
     *
     *
Examples: roads, airports/airstrips, shipping routes, tunnels, nautical charts, vehicle or
     * vessel location, aeronautical charts, railways.
     */
    @UML(identifier = "transportation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory TRANSPORTATION = new TopicCategory("TRANSPORTATION");

    /**
     * Energy, water and waste systems and communications infrastructure and services.
     *
     *
Examples: hydroelectricity, geothermal, solar and nuclear sources of energy, water
     * purification and distribution, sewage collection and disposal, electricity and gas
     * distribution, data communication, telecommunication, radio, communication networks.
     */
    @UML(identifier = "utilitiesCommunication", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory UTILITIES_COMMUNICATION = new TopicCategory("UTILITIES_COMMUNICATION");

    /**
     * Constructs an enum with the given name. The new enum is automatically added to the list
     * returned by {@link #values}.
     *
     * @param name The enum name. This name must not be in use by an other enum of this type.
     */
    private TopicCategory(final String name) {
        super(name, VALUES);
    }

    /**
     * Returns the list of {@code TopicCategory}s.
     *
     * @return The list of codes declared in the current JVM.
     */

{
        synchronized (VALUES) {
            return VALUES.toArray(new TopicCategory[VALUES.size()]);
        }
    }

    /**
     * Returns the list of enumerations of the same kind than this enum.
     */
    @Override
    public TopicCategory[] family() {
        return values();
    }

    /**
     * Returns the topic category that matches the given string, or returns a new one if none match
     * it.
     *
     * @param code The name of the code to fetch or to create.
     * @return A code matching the given name.
     */
    public static TopicCategory valueOf(String code) {
        return valueOf(TopicCategory.class, code);
    }
}


{
        synchronized (VALUES) {
            return VALUES.toArray(new TopicCategory[VALUES.size()]);
        }
    }

/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *
 *    All Rights Reserved. http://example.com
 */
package org.opengis.metadata.identification;

import static org.opengis.annotation.Obligation.CONDITIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
import java.util.ArrayList;
import java.util.List;
import org.opengis.annotation.UML;
import org.opengis.util.CodeList;

/**
 * High-level geographic data thematic classification to assist in the grouping and search of
 * available geographic data sets. Can be used to group keywords as well. Listed examples are not
 * exhaustive.
 *
 *
NOTE: It is understood there are overlaps between general categories and the user is
 * encouraged to select the one most appropriate.
 *
 * @version ISO 19115
 * @author Martin Desruisseaux (IRD)
 * @since GeoAPI 2.0
 */
@UML(identifier = "MD_TopicCategoryCode", specification = ISO_19115)
public final class TopicCategory extends CodeList<TopicCategory> {

    /**
     * Serial number for compatibility with different versions.
     */
    private static final long serialVersionUID = -4987523565852255081L;

    /**
     * List of all enumerations of this type. Must be declared before any enum declaration.
     */
    private static final List<TopicCategory> VALUES = new ArrayList<>(19);

    /**
     * Rearing of animals and/or cultivation of plants.
     *
     *
Examples: agriculture, irrigation, aquaculture, plantations, herding, pests and diseases
     * affecting crops and livestock.
     */
    @UML(identifier = "farming", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory FARMING = new TopicCategory("FARMING");

    /**
     * Flora and/or fauna in natural environment.
     *
     *
Examples: wildlife, vegetation, biological sciences, ecology, wilderness, sealife,
     * wetlands, habitat
     */
    @UML(identifier = "biota", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BIOTA = new TopicCategory("BIOTA");

    /**
     * Legal land descriptions.
     *
     *
Examples: political and administrative boundaries.
     */
    @UML(identifier = "boundaries", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BOUNDARIES = new TopicCategory("BOUNDARIES");

    /**
     * Processes and phenomena of the atmosphere.
     *
     *
Examples: cloud cover, weather, climate, atmospheric conditions, climate change,
     * precipitation.
     */
    @UML(identifier = "climatologyMeteorologyAtmosphere", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory CLIMATOLOGY_METEOROLOGY_ATMOSPHERE = new TopicCategory("CLIMATOLOGY_METEOROLOGY_ATMOSPHERE");

    /**
     * Economic activities, conditions and employment.
     *
     *
Examples: production, labour, revenue, commerce, industry, tourism and ecotourism,
     * forestry, fisheries, commercial or subsistence hunting, exploration and exploitation of
     * resources such as minerals, oil and gas.
     */
    @UML(identifier = "economy", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ECONOMY = new TopicCategory("ECONOMY");

    /**
     * Height above or below sea level.
     *
     *
Examples: altitude, bathymetry, digital elevation models, slope, derived products.
     */
    @UML(identifier = "elevation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ELEVATION = new TopicCategory("ELEVATION");

    /**
     * Environmental resources, protection and conservation.
     *
     *
Examples: environmental pollution, waste storage and treatment, environmental impact
     * assessment, monitoring environmental risk, nature reserves, landscape.
     */
    @UML(identifier = "environment", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ENVIRONMENT = new TopicCategory("ENVIRONMENT");

    /**
     * Information pertaining to earth sciences.
     *
     *
Examples: geophysical features and processes, geology, minerals, sciences dealing with the
     * composition, structure and origin of the earth's rocks, risks of earthquakes, volcanic
     * activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion.
     */
    @UML(identifier = "geoscientificInformation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory GEOSCIENTIFIC_INFORMATION = new TopicCategory("GEOSCIENTIFIC_INFORMATION");

    /**
     * Health, health services, human ecology, and safety.
     *
     *
Examples: disease and illness, factors affecting health, hygiene, substance abuse, mental
     * and physical health, health services.
     *
     * @since GeoAPI 2.1
     */
    @UML(identifier = "health", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory HEALTH = new TopicCategory("HEALTH");

    @UML(identifier = "imageryBaseMapsEarthCover", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory IMAGERY_BASE_MAPS_EARTH_COVER = new TopicCategory("IMAGERY_BASE_MAPS_EARTH_COVER");

    @UML(identifier = "intelligenceMilitary", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INTELLIGENCE_MILITARY = new TopicCategory("INTELLIGENCE_MILITARY");

    /**
     * Inland water features, drainage systems and their characteristics.
     *
     *
Examples: rivers and glaciers, salt lakes, water utilization plans, dams, currents,
     * floods, water quality, hydrographic charts.
     */
    @UML(identifier = "inlandWaters", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INLAND_WATERS = new TopicCategory("INLAND_WATERS");

    /**
     * Positional information and services.
     *
     *
Examples: addresses, geodetic networks, control points, postal zones and services, place
     * names.
     */
    @UML(identifier = "location", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory LOCATION = new TopicCategory("LOCATION");

    /**
     * Features and characteristics of salt water bodies (excluding inland waters).
     *
     *
Examples: tides, tidal waves, coastal information, reefs.
     */
    @UML(identifier = "oceans", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory OCEANS = new TopicCategory("OCEANS");

    /**
     * Information used for appropriate actions for future use of the land.
     *
     *
Examples: land use maps, zoning maps, cadastral surveys, land ownership.
     */
    @UML(identifier = "planningCadastre", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory PLANNING_CADASTRE = new TopicCategory("PLANNING_CADASTRE");

    /**
     * Characteristics of society and cultures.
     *
     *
Examples: settlements, anthropology, archaeology, education, traditional beliefs, manners
     * and customs, demographic data, recreational areas and activities, social impact assessments,
     * crime and justice, census information
     */
    @UML(identifier = "society", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory SOCIETY = new TopicCategory("SOCIETY");

    @UML(identifier = "structure", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory STRUCTURE = new TopicCategory("STRUCTURE");

    /**
     * Means and aids for conveying persons and/or goods.
     *
     *
Examples: roads, airports/airstrips, shipping routes, tunnels, nautical charts, vehicle or
     * vessel location, aeronautical charts, railways.
     */
    @UML(identifier = "transportation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory TRANSPORTATION = new TopicCategory("TRANSPORTATION");

    /**
     * Energy, water and waste systems and communications infrastructure and services.
     *
     *
Examples: hydroelectricity, geothermal, solar and nuclear sources of energy, water
     * purification and distribution, sewage collection and disposal, electricity and gas
     * distribution, data communication, telecommunication, radio, communication networks.
     */
    @UML(identifier = "utilitiesCommunication", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory UTILITIES_COMMUNICATION = new TopicCategory("UTILITIES_COMMUNICATION");

    /**
     * Constructs an enum with the given name. The new enum is automatically added to the list
     * returned by {@link #values}.
     *
     * @param name The enum name. This name must not be in use by an other enum of this type.
     */
    private TopicCategory(final String name) {
        super(name, VALUES);
    }

    /**
     * Returns the list of {@code TopicCategory}s.
     *
     * @return The list of codes declared in the current JVM.
     */
    public static TopicCategory[] values()

    /**
     * Returns the list of enumerations of the same kind than this enum.
     */
    @Override
    public TopicCategory[] family() {
        return values();
    }

    /**
     * Returns the topic category that matches the given string, or returns a new one if none match
     * it.
     *
     * @param code The name of the code to fetch or to create.
     * @return A code matching the given name.
     */
    public static TopicCategory valueOf(String code) {
        return valueOf(TopicCategory.class, code);
    }
}


/*
 *    GeoTools - The Open Source Java GIS Toolkit
 *    http://geotools.org
 *
 *
 *    All Rights Reserved. http://example.com
 */
package org.opengis.metadata.identification;

import static org.opengis.annotation.Obligation.CONDITIONAL;
import static org.opengis.annotation.Specification.ISO_19115;
import java.util.ArrayList;
import java.util.List;
import org.opengis.annotation.UML;
import org.opengis.util.CodeList;

/**
 * High-level geographic data thematic classification to assist in the grouping and search of
 * available geographic data sets. Can be used to group keywords as well. Listed examples are not
 * exhaustive.
 *
 *
NOTE: It is understood there are overlaps between general categories and the user is
 * encouraged to select the one most appropriate.
 *
 * @version ISO 19115
 * @author Martin Desruisseaux (IRD)
 * @since GeoAPI 2.0
 */
@UML(identifier = "MD_TopicCategoryCode", specification = ISO_19115)
public final class TopicCategory extends CodeList<TopicCategory> {

    /**
     * Serial number for compatibility with different versions.
     */
    private static final long serialVersionUID = -4987523565852255081L;

    /**
     * List of all enumerations of this type. Must be declared before any enum declaration.
     */
    private static final List<TopicCategory> VALUES = new ArrayList<>(19);

    /**
     * Rearing of animals and/or cultivation of plants.
     *
     *
Examples: agriculture, irrigation, aquaculture, plantations, herding, pests and diseases
     * affecting crops and livestock.
     */
    @UML(identifier = "farming", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory FARMING = new TopicCategory("FARMING");

    /**
     * Flora and/or fauna in natural environment.
     *
     *
Examples: wildlife, vegetation, biological sciences, ecology, wilderness, sealife,
     * wetlands, habitat
     */
    @UML(identifier = "biota", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BIOTA = new TopicCategory("BIOTA");

    /**
     * Legal land descriptions.
     *
     *
Examples: political and administrative boundaries.
     */
    @UML(identifier = "boundaries", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory BOUNDARIES = new TopicCategory("BOUNDARIES");

    /**
     * Processes and phenomena of the atmosphere.
     *
     *
Examples: cloud cover, weather, climate, atmospheric conditions, climate change,
     * precipitation.
     */
    @UML(identifier = "climatologyMeteorologyAtmosphere", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory CLIMATOLOGY_METEOROLOGY_ATMOSPHERE = new TopicCategory("CLIMATOLOGY_METEOROLOGY_ATMOSPHERE");

    /**
     * Economic activities, conditions and employment.
     *
     *
Examples: production, labour, revenue, commerce, industry, tourism and ecotourism,
     * forestry, fisheries, commercial or subsistence hunting, exploration and exploitation of
     * resources such as minerals, oil and gas.
     */
    @UML(identifier = "economy", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ECONOMY = new TopicCategory("ECONOMY");

    /**
     * Height above or below sea level.
     *
     *
Examples: altitude, bathymetry, digital elevation models, slope, derived products.
     */
    @UML(identifier = "elevation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ELEVATION = new TopicCategory("ELEVATION");

    /**
     * Environmental resources, protection and conservation.
     *
     *
Examples: environmental pollution, waste storage and treatment, environmental impact
     * assessment, monitoring environmental risk, nature reserves, landscape.
     */
    @UML(identifier = "environment", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory ENVIRONMENT = new TopicCategory("ENVIRONMENT");

    /**
     * Information pertaining to earth sciences.
     *
     *
Examples: geophysical features and processes, geology, minerals, sciences dealing with the
     * composition, structure and origin of the earth's rocks, risks of earthquakes, volcanic
     * activity, landslides, gravity information, soils, permafrost, hydrogeology, erosion.
     */
    @UML(identifier = "geoscientificInformation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory GEOSCIENTIFIC_INFORMATION = new TopicCategory("GEOSCIENTIFIC_INFORMATION");

    /**
     * Health, health services, human ecology, and safety.
     *
     *
Examples: disease and illness, factors affecting health, hygiene, substance abuse, mental
     * and physical health, health services.
     *
     * @since GeoAPI 2.1
     */
    @UML(identifier = "health", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory HEALTH = new TopicCategory("HEALTH");

    @UML(identifier = "imageryBaseMapsEarthCover", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory IMAGERY_BASE_MAPS_EARTH_COVER = new TopicCategory("IMAGERY_BASE_MAPS_EARTH_COVER");

    @UML(identifier = "intelligenceMilitary", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INTELLIGENCE_MILITARY = new TopicCategory("INTELLIGENCE_MILITARY");

    /**
     * Inland water features, drainage systems and their characteristics.
     *
     *
Examples: rivers and glaciers, salt lakes, water utilization plans, dams, currents,
     * floods, water quality, hydrographic charts.
     */
    @UML(identifier = "inlandWaters", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory INLAND_WATERS = new TopicCategory("INLAND_WATERS");

    /**
     * Positional information and services.
     *
     *
Examples: addresses, geodetic networks, control points, postal zones and services, place
     * names.
     */
    @UML(identifier = "location", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory LOCATION = new TopicCategory("LOCATION");

    /**
     * Features and characteristics of salt water bodies (excluding inland waters).
     *
     *
Examples: tides, tidal waves, coastal information, reefs.
     */
    @UML(identifier = "oceans", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory OCEANS = new TopicCategory("OCEANS");

    /**
     * Information used for appropriate actions for future use of the land.
     *
     *
Examples: land use maps, zoning maps, cadastral surveys, land ownership.
     */
    @UML(identifier = "planningCadastre", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory PLANNING_CADASTRE = new TopicCategory("PLANNING_CADASTRE");

    /**
     * Characteristics of society and cultures.
     *
     *
Examples: settlements, anthropology, archaeology, education, traditional beliefs, manners
     * and customs, demographic data, recreational areas and activities, social impact assessments,
     * crime and justice, census information
     */
    @UML(identifier = "society", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory SOCIETY = new TopicCategory("SOCIETY");

    @UML(identifier = "structure", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory STRUCTURE = new TopicCategory("STRUCTURE");

    /**
     * Means and aids for conveying persons and/or goods.
     *
     *
Examples: roads, airports/airstrips, shipping routes, tunnels, nautical charts, vehicle or
     * vessel location, aeronautical charts, railways.
     */
    @UML(identifier = "transportation", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory TRANSPORTATION = new TopicCategory("TRANSPORTATION");

    /**
     * Energy, water and waste systems and communications infrastructure and services.
     *
     *
Examples: hydroelectricity, geothermal, solar and nuclear sources of energy, water
     * purification and distribution, sewage collection and disposal, electricity and gas
     * distribution, data communication, telecommunication, radio, communication networks.
     */
    @UML(identifier = "utilitiesCommunication", obligation = CONDITIONAL, specification = ISO_19115)
    public static final TopicCategory UTILITIES_COMMUNICATION = new TopicCategory("UTILITIES_COMMUNICATION");

    /**
     * Constructs an enum with the given name. The new enum is automatically added to the list
     * returned by {@link #values}.
     *
     * @param name The enum name. This name must not be in use by an other enum of this type.
     */
    private TopicCategory(final String name) {
        super(name, VALUES);
    }

    /**
     * Returns the list of {@code TopicCategory}s.
     *
     * @return The list of codes declared in the current JVM.
     */
    public static TopicCategory[] values() {
        synchronized (VALUES) {
            return VALUES.toArray(new TopicCategory[VALUES.size()]);
        }
    }

    /**
     * Returns the list of enumerations of the same kind than this enum.
     */
    @Override
    public TopicCategory[] family() {
        retu

    }

    /**
     * Returns the topic category that matches the given string, or returns a new one if none match
     * it.
     *
     * @param code The name of the code to fetch or to create.
     * @return A code matching the given name.
     */
    public static TopicCategory valueOf(String code) {
        return valueOf(TopicCategory.class, code);
    }
}


public static TopicCategory[] values() {
        synchronized (VALUES) {
            return VALUES.toArray(new TopicCategory[VALUES.size()]);
        }
    }


void onWritePossible() throws IOException;

package org.glassfish.jersey.jdk.connector.internal;

import java.io.IOException;

/**
 * Callback notification mechanism that signals to the developer it's possible
 * to write content without blocking.
 *

 * Based on Servlet 3.1
 */
interface WriteListener {

    /**
     * When an instance of the WriteListener is registered with a {@link BodyOutputStream},
     * this method will be invoked by the container the first time when it is possible
     * to write data. Subsequently the container will invoke this method if and only
     * if {@link BodyOutputStream#isReady()} method
     * has been called and has returned false.
     *
     * @throws IOException if an I/O related error has occurred during processing
     */

    /**
     * Invoked when an error occurs writing data using the non-blocking APIs.
     */
    void onError(final Throwable t);
}


private String toIndentedString(java.lang.Object o)

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */

{
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


{
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString()

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


        if (this == o) {
            return true;
        }

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {

        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }

        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7

        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */
    public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


public UpdateL7policyReq getL7policy() {
        return l7policy;
    }

package com.huaweicloud.sdk.elb.v2.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * This is a auto create Body Object
 */
public class UpdateL7policiesRequestBody {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "l7policy")
    private UpdateL7policyReq l7policy;

    public UpdateL7policiesRequestBody withL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
        return this;
    }

    public UpdateL7policiesRequestBody withL7policy(Consumer<UpdateL7policyReq> l7policySetter) {
        if (this.l7policy == null) {
            this.l7policy = new UpdateL7policyReq();
            l7policySetter.accept(this.l7policy);
        }
        return this;
    }

    /**
     * Get l7policy
     *
     * @return l7policy
     */

    public void setL7policy(UpdateL7policyReq l7policy) {
        this.l7policy = l7policy;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


if (o == null || getClass() != o.getClass()) {
            return false;
        }

        UpdateL7policiesRequestBody updateL7policiesRequestBody = (UpdateL7policiesRequestBody) o;
        return Objects.equals(this.l7policy, updateL7policiesRequestBody.l7policy);
    }

    @Override
    public int hashCode() {
        return Objects.hash(l7policy);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class UpdateL7policiesRequestBody {\n");
        sb.append("    l7policy: ").append(toIndentedString(l7policy)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


public void setCommissionRate(long commissionRate)

package com.binance.dex.api.client.domain.stake.sidechain;

import com.binance.dex.api.client.domain.stake.Description;

/**
 * @author Fitz.Lu
 */
public class EditSideChainValidator {

    private Description description;

    private String validatorAddress;

    private long commissionRate;

    private String sideChainId;

    private String sideFeeAddr;

    public EditSideChainValidator() {
    }

    public Description getDescription() {
        return description;
    }

    public void setDescription(Description description) {
        this.description = description;
    }

    public String getValidatorAddress() {
        return validatorAddress;
    }

    public void setValidatorAddress(String validatorAddress) {
        this.validatorAddress = validatorAddress;
    }

    public long getCommissionRate() {
        return commissionRate;
    }

{
        this.commissionRate = commissionRate;
    }

    public String getSideChainId() {
        return sideChainId;
    }

    public void setSideChainId(String sideChainId) {
        this.sideChainId = sideChainId;
    }

    public String getSideFeeAddr() {
        return sideFeeAddr;
    }

    public void setSideFeeAddr(String sideFeeAddr) {
        this.sideFeeAddr = sideFeeAddr;
    }

    @Override
    public String toString() {
        return "EditSideChainValidator{" + "description=" + description + "\n" + ", validatorAddress='" + validatorAddress + '\'' + "\n" + ", commissionRate=" + commissionRate + "\n" + ", sideChainId='" + sideChainId + '\'' + "\n" + ", sideFeeAddr='" + sideFeeAddr + '\'' + "\n" + '}';
    }
}


{
        return "EditSideChainValidator{" + "description=" + description + "\n" + ", validatorAddress='" + validatorAddress + '\'' + "\n" + ", commissionRate=" + commissionRate + "\n" + ", sideChainId='" + sideChainId + '\'' + "\n" + ", sideFeeAddr='" + sideFeeAddr + '\'' + "\n" + '}';
    }

package com.binance.dex.api.client.domain.stake.sidechain;

import com.binance.dex.api.client.domain.stake.Description;

/**
 * @author Fitz.Lu
 */
public class EditSideChainValidator {

    private Description description;

    private String validatorAddress;

    private long commissionRate;

    private String sideChainId;

    private String sideFeeAddr;

    public EditSideChainValidator() {
    }

    public Description getDescription() {
        return description;
    }

    public void setDescription(Description description) {
        this.description = description;
    }

    public String getValidatorAddress() {
        return validatorAddress;
    }

    public void setValidatorAddress(String validatorAddress) {
        this.validatorAddress = validatorAddress;
    }

    public long getCommissionRate() {
        return commissionRate;
    }

    public void setCommissionRate(long commissionRate) {
        this.commissionRate = commissionRate;
    }

    public String getSideChainId() {
        return sideChainId;
    }

    public void setSideChainId(String sideChainId) {
        this.sideChainId = sideChainId;
    }

    public String getSideFeeAddr() {
        return sideFeeAddr;
    }

    public void setSideFeeAddr(String sideFeeAddr) {
        this.sideFeeAddr = sideFeeAddr;
    }

    @Override
    public String toString()


package com.binance.dex.api.client.domain.stake.sidechain;

import com.binance.dex.api.client.domain.stake.Description;

/**
 * @author Fitz.Lu
 */
public class EditSideChainValidator {

    private Description description;

    private String validatorAddress;

    private long commissionRate;

    private String sideChainId;

    private String sideFeeAddr;

    public EditSideChainValidator() {
    }

    public Description getDescription() {
        return description;
    }

    public void setDescription(Description description) {
        this.description = description;
    }

    public String getValidatorAddress() {
        return validatorAddress;
    }

    public void setValidatorAddress(String validatorAddress) {
        this.validatorAddress = validatorAddress;
    }

    public long getCommissionRate() {
        return commissionRate;
    }

    public void setCommissionRate(long commissionRate) {
        this.commissionRate = commissionRate;
    }

    public String getSideChainId() {
        return sideChainId;
    }

    public void setSideChainId(String sideChainId) {
        this.sideChainId = sideChainId;
    }

    public String getSideFeeAddr() {
        return sideFeeAddr;
    }

    public void setSideFeeAddr(String sideFeeAddr) {
        this.sideFeeAddr = si

    }

    @Override
    public String toString() {
        return "EditSideChainValidator{" + "description=" + description + "\n" + ", validatorAddress='" + validatorAddress + '\'' + "\n" + ", commissionRate=" + commissionRate + "\n" + ", sideChainId='" + sideChainId + '\'' + "\n" + ", sideFeeAddr='" + sideFeeAddr + '\'' + "\n" + '}';
    }
}


package com.qiudaoyu.monitor.df;

import android.content.Context;
import com.qiudaoyu.monitor.Monitor;
import com.qiudaoyu.monitor.analysis.MasData;
import com.qiudaoyu.monitor.df.config.DFConfigManager;
import com.qiudaoyu.monitor.df.upload.MUploadService;
import com.qiudaoyu.monitor.log.MLog;
import com.qiudaoyu.monitor.log.mlog.MethodValueAopHandler;
import com.qiudaoyu.monitor.utils.AppUtils;
import com.qiudaoyu.monitor.utils.EmptyUtils;
import com.qiudaoyu.monitor.BuildConfig;
import org.json.JSONObject;
import java.util.Map;

public class MMonitor {

    public final static String TEST_URL = "10.1.27.50";

    public final static int TEST_PROT = 10000;

    private static MMonitor msInstance;

    private MUploadService.Info info;

    private MasData masData;

    private boolean debug;

    private MMonitor(MUploadService.Info info, boolean isDebug) {
        this.info = info;
        debug = isDebug;
        masData = MasData.getInstance();
        masData.setAppKey(info.appkey);
    }

    public static MMonitor getInstance() {
        if (msInstance == null) {
            throw new IllegalStateException("you should build MMonitor fisrt!!!");
        }
        return msInstance;
    }

    public MUploadService.Info getInfo() {
        return info;
    }

    /**
     * 发送自定义数据
     *
     * @param eventType
     * @param propety
     */
    public void trackBusUserEvent(String eventType, JSONObject propety) {
        if (msInstance == null) {
            throw new IllegalStateException("you should init monitor fisrt!!!");
        }
        if (EmptyUtils.isEmpty(eventType)) {
            throw new IllegalArgumentException("eventType can not be null or empty!!!");
        }
        if (propety == null) {
            propety = new JSONObject();
        }
        masData.trackBusUserEvent(eventType, propety);
    }

    /**
     * 发送自定义数据
     *
     * @param eventType
     * @param propety
     */
    public void trackBusUserEvent(String eventType, JSONObject propety, String parId) {
        if (msInstance == null) {
            throw new IllegalStateException("you should init monitor fisrt!!!");
        }
        if (EmptyUtils.isEmpty(eventType)) {
            throw new IllegalArgumentException("eventType can not be null or empty!!!");
        }
        if (propety == null) {
            propety = new JSONObject();
        }
        masData.trackBusUserEvent(eventType, propety, parId);
    }

    /**
     * 获取当前线程前置操作的Id
     */
    public String getParentId() {
        return masData.getParentId();
    }

    /**
     * @param cusParentId
     */
    public void setParentId(String cusParentId) {
        masData.setParentId(cusParentId);
    }

    /**
     * 传递entityId和userId
     *
     * @param entityId
     * @param userId
     */
    public void setUserId(final String entityId, final String userId) {
        masData.setUserId(entityId, userId);
    }

    /**
     * 设置每个时间都携带的业务数据
     *
     * @param properties
     */
    public void setDynamicProperties(Map<String, String> properties) {
        masData.setDynamicProperties(properties);
    }

    public void start() {
        MUploadService.getInstance().initialize(info);
        if (AppUtils.isMainProcess(info.context, info.pkgName)) {
            Monitor.start();
        }
    }

    public String getAppKey() {
        return info.appkey;
    }

    public void destroy() {
        if (masData != null) {
            masData.shutDown();
        }
        Monitor.shutDown();
        MUploadService.getInstance().shutDown();
        DFConfigManager.getInstance().shutDown();
    }

    public boolean isDebug() {
        return debug;
    }

    public void onLowMemory() {
    }

{
    }

    public static class Builder {

        private Context context;

        private String appkey;

        private String appSecret;

        private String pkgName;

        private String appVer;

        private String path;

        private short heartBeatInterval;

        private boolean isDebug;

        private MethodValueAopHandler handler;

        private boolean level;

        private String prefix;

        private MLog.LogInterface logInterface;

        private String url;

        private int port = -1;

        private int[] types;

        public static Builder newBuilder() {
            return new Builder();
        }

        public Builder isDebugEnalbe(boolean isDebug) {
            this.isDebug = isDebug;
            return this;
        }

        public Builder context(Context context) {
            this.context = context;
            return this;
        }

        public Builder appKey(String appkey, String appSecret) {
            this.appkey = appkey;
            this.appSecret = appSecret;
            return this;
        }

        public Builder appInfo(String pkgName, String appVer) {
            this.pkgName = pkgName;
            this.appVer = appVer;
            return this;
        }

        public Builder uploadService(String url, int port, String cachePath, short heartBeatInterval) {
            if (EmptyUtils.isEmpty(url)) {
                throw new IllegalArgumentException("url can't be null or empty");
            }
            if (port < 0 || port > 66000) {
                throw new IllegalArgumentException("port can't be " + port);
            }
            this.url = url;
            this.port = port;
            this.path = cachePath;
            this.heartBeatInterval = heartBeatInterval;
            return this;
        }

        public Builder mAopHandler(MethodValueAopHandler handler) {
            this.handler = handler;
            return this;
        }

        public Builder MLog(boolean level, String prefix, MLog.LogInterface logInterface) {
            this.level = level;
            this.logInterface = logInterface;
            this.prefix = prefix;
            return this;
        }

        public Builder install(int[] types) {
            this.types = types;
            return this;
        }

        public MMonitor build() {
            if (EmptyUtils.isEmpty(url)) {
                throw new IllegalArgumentException("url can't be null or empty");
            }
            if (port < -1 || port > 66000) {
                throw new IllegalArgumentException("port can't be " + port);
            }
            Monitor.Builder.newBuilder().context(context).isDebugEnalbe(isDebug).uploadService(MUploadService.getInstance()).configManager(DFConfigManager.getInstance()).MLog(level, prefix, logInterface).mAopHandler(handler).install(types).build();
            // 生成初始化数据
            MUploadService.Info info = new MUploadService.Info(context, MasData.getDeviceId(context), pkgName, appkey, appSecret, appVer, BuildConfig.SDK_VER, path, heartBeatInterval, url, port);
            msInstance = new MMonitor(info, isDebug);
            return msInstance;
        }
    }
}


{
            this.handler = handler;
            return this;
        }

package com.qiudaoyu.monitor.df;

import android.content.Context;
import com.qiudaoyu.monitor.Monitor;
import com.qiudaoyu.monitor.analysis.MasData;
import com.qiudaoyu.monitor.df.config.DFConfigManager;
import com.qiudaoyu.monitor.df.upload.MUploadService;
import com.qiudaoyu.monitor.log.MLog;
import com.qiudaoyu.monitor.log.mlog.MethodValueAopHandler;
import com.qiudaoyu.monitor.utils.AppUtils;
import com.qiudaoyu.monitor.utils.EmptyUtils;
import com.qiudaoyu.monitor.BuildConfig;
import org.json.JSONObject;
import java.util.Map;

public class MMonitor {

    public final static String TEST_URL = "10.1.27.50";

    public final static int TEST_PROT = 10000;

    private static MMonitor msInstance;

    private MUploadService.Info info;

    private MasData masData;

    private boolean debug;

    private MMonitor(MUploadService.Info info, boolean isDebug) {
        this.info = info;
        debug = isDebug;
        masData = MasData.getInstance();
        masData.setAppKey(info.appkey);
    }

    public static MMonitor getInstance() {
        if (msInstance == null) {
            throw new IllegalStateException("you should build MMonitor fisrt!!!");
        }
        return msInstance;
    }

    public MUploadService.Info getInfo() {
        return info;
    }

    /**
     * 发送自定义数据
     *
     * @param eventType
     * @param propety
     */
    public void trackBusUserEvent(String eventType, JSONObject propety) {
        if (msInstance == null) {
            throw new IllegalStateException("you should init monitor fisrt!!!");
        }
        if (EmptyUtils.isEmpty(eventType)) {
            throw new IllegalArgumentException("eventType can not be null or empty!!!");
        }
        if (propety == null) {
            propety = new JSONObject();
        }
        masData.trackBusUserEvent(eventType, propety);
    }

    /**
     * 发送自定义数据
     *
     * @param eventType
     * @param propety
     */
    public void trackBusUserEvent(String eventType, JSONObject propety, String parId) {
        if (msInstance == null) {
            throw new IllegalStateException("you should init monitor fisrt!!!");
        }
        if (EmptyUtils.isEmpty(eventType)) {
            throw new IllegalArgumentException("eventType can not be null or empty!!!");
        }
        if (propety == null) {
            propety = new JSONObject();
        }
        masData.trackBusUserEvent(eventType, propety, parId);
    }

    /**
     * 获取当前线程前置操作的Id
     */
    public String getParentId() {
        return masData.getParentId();
    }

    /**
     * @param cusParentId
     */
    public void setParentId(String cusParentId) {
        masData.setParentId(cusParentId);
    }

    /**
     * 传递entityId和userId
     *
     * @param entityId
     * @param userId
     */
    public void setUserId(final String entityId, final String userId) {
        masData.setUserId(entityId, userId);
    }

    /**
     * 设置每个时间都携带的业务数据
     *
     * @param properties
     */
    public void setDynamicProperties(Map<String, String> properties) {
        masData.setDynamicProperties(properties);
    }

    public void start() {
        MUploadService.getInstance().initialize(info);
        if (AppUtils.isMainProcess(info.context, info.pkgName)) {
            Monitor.start();
        }
    }

    public String getAppKey() {
        return info.appkey;
    }

    public void destroy() {
        if (masData != null) {
            masData.shutDown();
        }
        Monitor.shutDown();
        MUploadService.getInstance().shutDown();
        DFConfigManager.getInstance().shutDown();
    }

    public boolean isDebug() {
        return debug;
    }

    public void onLowMemory() {
    }

    public void onTrimMemory(int level) {
    }

    public static class Builder {

        private Context context;

        private String appkey;

        private String appSecret;

        private String pkgName;

        private String appVer;

        private String path;

        private short heartBeatInterval;

        private boolean isDebug;

        private MethodValueAopHandler handler;

        private boolean level;

        private String prefix;

        private MLog.LogInterface logInterface;

        private String url;

        private int port = -1;

        private int[] types;

        public static Builder newBuilder() {
            return new Builder();
        }

        public Builder isDebugEnalbe(boolean isDebug) {
            this.isDebug = isDebug;
            return this;
        }

        public Builder context(Context context) {
            this.context = context;
            return this;
        }

        public Builder appKey(String appkey, String appSecret) {
            this.appkey = appkey;
            this.appSecret = appSecret;
            return this;
        }

        public Builder appInfo(String pkgName, String appVer) {
            this.pkgName = pkgName;
            this.appVer = appVer;
            return this;
        }

        public Builder uploadService(String url, int port, String cachePath, short heartBeatInterval) {
            if (EmptyUtils.isEmpty(url)) {
                throw new IllegalArgumentException("url can't be null or empty");
            }
            if (port < 0 || port > 66000) {
                throw new IllegalArgumentException("port can't be " + port);
            }
            this.url = url;
            this.port = port;
            this.path = cachePath;
            this.heartBeatInterval = heartBeatInterval;
            return this;
        }

        public Builder mAopHandler(MethodValueAopHandler handler)

        public Builder MLog(boolean level, String prefix, MLog.LogInterface logInterface) {
            this.level = level;
            this.logInterface = logInterface;
            this.prefix = prefix;
            return this;
        }

        public Builder install(int[] types) {
            this.types = types;
            return this;
        }

        public MMonitor build() {
            if (EmptyUtils.isEmpty(url)) {
                throw new IllegalArgumentException("url can't be null or empty");
            }
            if (port < -1 || port > 66000) {
                throw new IllegalArgumentException("port can't be " + port);
            }
            Monitor.Builder.newBuilder().context(context).isDebugEnalbe(isDebug).uploadService(MUploadService.getInstance()).configManager(DFConfigManager.getInstance()).MLog(level, prefix, logInterface).mAopHandler(handler).install(types).build();
            // 生成初始化数据
            MUploadService.Info info = new MUploadService.Info(context, MasData.getDeviceId(context), pkgName, appkey, appSecret, appVer, BuildConfig.SDK_VER, path, heartBeatInterval, url, port);
            msInstance = new MMonitor(info, isDebug);
            return msInstance;
        }
    }
}