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

rapture.common.client.HttpPipelineApi Maven / Gradle / Ivy

/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2011-2016 Incapture Technologies LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file is autogenerated and any changes will be overwritten.
 */

package rapture.common.client;

import java.util.List;
import java.util.Map;
import rapture.common.api.PipelineApi;
import rapture.common.api.ScriptPipelineApi;
import rapture.common.CallingContext;
import rapture.common.model.GeneralResponse;
import rapture.common.model.BasePayload;
import rapture.common.exception.RaptureException;
import rapture.common.impl.jackson.JacksonUtil;

import com.fasterxml.jackson.core.type.TypeReference;

import org.apache.log4j.Logger;

import rapture.common.RapturePipelineTask;
import rapture.common.CategoryQueueBindings;
import rapture.common.PipelineTaskStatus;
import rapture.common.model.RaptureExchange;
import rapture.common.TableQuery;

import rapture.common.shared.pipeline.RemoveServerCategoryPayload;

import rapture.common.shared.pipeline.GetServerCategoriesPayload;

import rapture.common.shared.pipeline.GetBoundExchangesPayload;

import rapture.common.shared.pipeline.DeregisterPipelineExchangePayload;

import rapture.common.shared.pipeline.GetExchangesPayload;

import rapture.common.shared.pipeline.GetExchangePayload;

import rapture.common.shared.pipeline.PublishMessageToCategoryPayload;

import rapture.common.shared.pipeline.BroadcastMessageToCategoryPayload;

import rapture.common.shared.pipeline.BroadcastMessageToAllPayload;

import rapture.common.shared.pipeline.GetStatusPayload;

import rapture.common.shared.pipeline.QueryTasksPayload;

import rapture.common.shared.pipeline.QueryTasksOldPayload;

import rapture.common.shared.pipeline.GetLatestTaskEpochPayload;

import rapture.common.shared.pipeline.DrainPipelinePayload;

import rapture.common.shared.pipeline.RegisterExchangeDomainPayload;

import rapture.common.shared.pipeline.DeregisterExchangeDomainPayload;

import rapture.common.shared.pipeline.GetExchangeDomainsPayload;

import rapture.common.shared.pipeline.SetupStandardCategoryPayload;

import rapture.common.shared.pipeline.MakeRPCPayload;

import rapture.common.shared.pipeline.CreateTopicExchangePayload;

import rapture.common.shared.pipeline.PublishTopicMessagePayload;


@SuppressWarnings("all")
public class HttpPipelineApi extends BaseHttpApi implements PipelineApi, ScriptPipelineApi {
        private static final Logger log = Logger.getLogger(HttpPipelineApi.class);

	public HttpPipelineApi(HttpLoginApi login) {
		super(login, "pipeline");
	}
		
	    
	    @Override
	    public void removeServerCategory(CallingContext context, String category) {
	        RemoveServerCategoryPayload requestObj = new RemoveServerCategoryPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setCategory(category);
	        doRequest(requestObj, "REMOVESERVERCATEGORY", null);    }

	    private static final class GetServerCategoriesTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getServerCategories(CallingContext context) {
	        GetServerCategoriesPayload requestObj = new GetServerCategoriesPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        return doRequest(requestObj, "GETSERVERCATEGORIES", new GetServerCategoriesTypeReference());    }

	    private static final class GetBoundExchangesTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getBoundExchanges(CallingContext context, String category) {
	        GetBoundExchangesPayload requestObj = new GetBoundExchangesPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setCategory(category);
	        return doRequest(requestObj, "GETBOUNDEXCHANGES", new GetBoundExchangesTypeReference());    }

	    
	    @Override
	    public void deregisterPipelineExchange(CallingContext context, String name) {
	        DeregisterPipelineExchangePayload requestObj = new DeregisterPipelineExchangePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setName(name);
	        doRequest(requestObj, "DEREGISTERPIPELINEEXCHANGE", null);    }

	    private static final class GetExchangesTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getExchanges(CallingContext context) {
	        GetExchangesPayload requestObj = new GetExchangesPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        return doRequest(requestObj, "GETEXCHANGES", new GetExchangesTypeReference());    }

	    private static final class GetExchangeTypeReference extends TypeReference {
	    }    
	    @Override
	    public RaptureExchange getExchange(CallingContext context, String name) {
	        GetExchangePayload requestObj = new GetExchangePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setName(name);
	        return doRequest(requestObj, "GETEXCHANGE", new GetExchangeTypeReference());    }

	    
	    @Override
	    public void publishMessageToCategory(CallingContext context, RapturePipelineTask task) {
	        PublishMessageToCategoryPayload requestObj = new PublishMessageToCategoryPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setTask(task);
	        doRequest(requestObj, "PUBLISHMESSAGETOCATEGORY", null);    }

	    
	    @Override
	    public void broadcastMessageToCategory(CallingContext context, RapturePipelineTask task) {
	        BroadcastMessageToCategoryPayload requestObj = new BroadcastMessageToCategoryPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setTask(task);
	        doRequest(requestObj, "BROADCASTMESSAGETOCATEGORY", null);    }

	    
	    @Override
	    public void broadcastMessageToAll(CallingContext context, RapturePipelineTask task) {
	        BroadcastMessageToAllPayload requestObj = new BroadcastMessageToAllPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setTask(task);
	        doRequest(requestObj, "BROADCASTMESSAGETOALL", null);    }

	    private static final class GetStatusTypeReference extends TypeReference {
	    }    
	    @Override
	    public PipelineTaskStatus getStatus(CallingContext context, String taskId) {
	        GetStatusPayload requestObj = new GetStatusPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setTaskId(taskId);
	        return doRequest(requestObj, "GETSTATUS", new GetStatusTypeReference());    }

	    private static final class QueryTasksTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List queryTasks(CallingContext context, String query) {
	        QueryTasksPayload requestObj = new QueryTasksPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setQuery(query);
	        return doRequest(requestObj, "QUERYTASKS", new QueryTasksTypeReference());    }

	    private static final class QueryTasksOldTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List queryTasksOld(CallingContext context, TableQuery query) {
	        QueryTasksOldPayload requestObj = new QueryTasksOldPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setQuery(query);
	        return doRequest(requestObj, "QUERYTASKSOLD", new QueryTasksOldTypeReference());    }

	    private static final class GetLatestTaskEpochTypeReference extends TypeReference {
	    }    
	    @Override
	    public Long getLatestTaskEpoch(CallingContext context) {
	        GetLatestTaskEpochPayload requestObj = new GetLatestTaskEpochPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        return doRequest(requestObj, "GETLATESTTASKEPOCH", new GetLatestTaskEpochTypeReference());    }

	    
	    @Override
	    public void drainPipeline(CallingContext context, String exchange) {
	        DrainPipelinePayload requestObj = new DrainPipelinePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setExchange(exchange);
	        doRequest(requestObj, "DRAINPIPELINE", null);    }

	    
	    @Override
	    public void registerExchangeDomain(CallingContext context, String domainURI, String config) {
	        RegisterExchangeDomainPayload requestObj = new RegisterExchangeDomainPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDomainURI(domainURI);
	        requestObj.setConfig(config);
	        doRequest(requestObj, "REGISTEREXCHANGEDOMAIN", null);    }

	    
	    @Override
	    public void deregisterExchangeDomain(CallingContext context, String domainURI) {
	        DeregisterExchangeDomainPayload requestObj = new DeregisterExchangeDomainPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDomainURI(domainURI);
	        doRequest(requestObj, "DEREGISTEREXCHANGEDOMAIN", null);    }

	    private static final class GetExchangeDomainsTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getExchangeDomains(CallingContext context) {
	        GetExchangeDomainsPayload requestObj = new GetExchangeDomainsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        return doRequest(requestObj, "GETEXCHANGEDOMAINS", new GetExchangeDomainsTypeReference());    }

	    
	    @Override
	    public void setupStandardCategory(CallingContext context, String category) {
	        SetupStandardCategoryPayload requestObj = new SetupStandardCategoryPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setCategory(category);
	        doRequest(requestObj, "SETUPSTANDARDCATEGORY", null);    }

	    private static final class MakeRPCTypeReference extends TypeReference> {
	    }    
	    @Override
	    public Map makeRPC(CallingContext context, String queueName, String fnName, Map params, Long timeoutInSeconds) {
	        MakeRPCPayload requestObj = new MakeRPCPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setQueueName(queueName);
	        requestObj.setFnName(fnName);
	        requestObj.setParams(params);
	        requestObj.setTimeoutInSeconds(timeoutInSeconds);
	        return doRequest(requestObj, "MAKERPC", new MakeRPCTypeReference());    }

	    
	    @Override
	    public void createTopicExchange(CallingContext context, String domain, String exchange) {
	        CreateTopicExchangePayload requestObj = new CreateTopicExchangePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDomain(domain);
	        requestObj.setExchange(exchange);
	        doRequest(requestObj, "CREATETOPICEXCHANGE", null);    }

	    
	    @Override
	    public void publishTopicMessage(CallingContext context, String domain, String exchange, String topic, String message) {
	        PublishTopicMessagePayload requestObj = new PublishTopicMessagePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDomain(domain);
	        requestObj.setExchange(exchange);
	        requestObj.setTopic(topic);
	        requestObj.setMessage(message);
	        doRequest(requestObj, "PUBLISHTOPICMESSAGE", null);    }

	
	    @Override
	    public void removeServerCategory(String category) {
	        removeServerCategory(null,category);    }

	    @Override
	    public List getServerCategories() {
	        return getServerCategories(null);    }

	    @Override
	    public List getBoundExchanges(String category) {
	        return getBoundExchanges(null,category);    }

	    @Override
	    public void deregisterPipelineExchange(String name) {
	        deregisterPipelineExchange(null,name);    }

	    @Override
	    public List getExchanges() {
	        return getExchanges(null);    }

	    @Override
	    public RaptureExchange getExchange(String name) {
	        return getExchange(null,name);    }

	    @Override
	    public void publishMessageToCategory(RapturePipelineTask task) {
	        publishMessageToCategory(null,task);    }

	    @Override
	    public void broadcastMessageToCategory(RapturePipelineTask task) {
	        broadcastMessageToCategory(null,task);    }

	    @Override
	    public void broadcastMessageToAll(RapturePipelineTask task) {
	        broadcastMessageToAll(null,task);    }

	    @Override
	    public PipelineTaskStatus getStatus(String taskId) {
	        return getStatus(null,taskId);    }

	    @Override
	    public List queryTasks(String query) {
	        return queryTasks(null,query);    }

	    @Override
	    public List queryTasksOld(TableQuery query) {
	        return queryTasksOld(null,query);    }

	    @Override
	    public Long getLatestTaskEpoch() {
	        return getLatestTaskEpoch(null);    }

	    @Override
	    public void drainPipeline(String exchange) {
	        drainPipeline(null,exchange);    }

	    @Override
	    public void registerExchangeDomain(String domainURI, String config) {
	        registerExchangeDomain(null,domainURI,config);    }

	    @Override
	    public void deregisterExchangeDomain(String domainURI) {
	        deregisterExchangeDomain(null,domainURI);    }

	    @Override
	    public List getExchangeDomains() {
	        return getExchangeDomains(null);    }

	    @Override
	    public void setupStandardCategory(String category) {
	        setupStandardCategory(null,category);    }

	    @Override
	    public Map makeRPC(String queueName, String fnName, Map params, Long timeoutInSeconds) {
	        return makeRPC(null,queueName,fnName,params,timeoutInSeconds);    }

	    @Override
	    public void createTopicExchange(String domain, String exchange) {
	        createTopicExchange(null,domain,exchange);    }

	    @Override
	    public void publishTopicMessage(String domain, String exchange, String topic, String message) {
	        publishTopicMessage(null,domain,exchange,topic,message);    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy