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

com.ksc.epc.model.transform.RebootEpcRequestMarshaller Maven / Gradle / Ivy

package com.ksc.epc.model.transform;

import com.ksc.DefaultRequest;
import com.ksc.KscClientException;
import com.ksc.Request;
import com.ksc.http.HttpMethodName;
import com.ksc.epc.model.RebootEpcRequest;
import com.ksc.transform.Marshaller;
import com.ksc.util.StringUtils;

public class RebootEpcRequestMarshaller implements
        Marshaller, RebootEpcRequest> {

    @Override
    public Request marshall(RebootEpcRequest rebootEpcRequest) {
        if (rebootEpcRequest == null) {
            throw new KscClientException("Invalid argument passed to marshall(...)");
        }

        Request request = new DefaultRequest(
                rebootEpcRequest, "epc");
        request.addParameter("Action", "RebootEpc");
        String version = rebootEpcRequest.getVersion();
        if (org.apache.commons.lang.StringUtils.isBlank(version)) {
            version = "2015-11-01";
        }
        request.addParameter("Version", version);
        request.setHttpMethod(HttpMethodName.GET);

        if (!StringUtils.isNullOrEmpty(rebootEpcRequest.getHostId())) {
            request.addParameter("HostId", rebootEpcRequest.getHostId());
        }

        return request;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy