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

rapture.common.client.HttpIdGenApi 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.IdGenApi;
import rapture.common.api.ScriptIdGenApi;
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.RaptureIdGenConfig;

import rapture.common.shared.idgen.GetIdGenConfigsPayload;

import rapture.common.shared.idgen.GetIdGenConfigPayload;

import rapture.common.shared.idgen.CreateIdGenPayload;

import rapture.common.shared.idgen.IdGenExistsPayload;

import rapture.common.shared.idgen.DeleteIdGenPayload;

import rapture.common.shared.idgen.SetIdGenPayload;

import rapture.common.shared.idgen.NextPayload;

import rapture.common.shared.idgen.NextIdsPayload;

import rapture.common.shared.idgen.SetupDefaultIdGensPayload;


@SuppressWarnings("all")
public class HttpIdGenApi extends BaseHttpApi implements IdGenApi, ScriptIdGenApi {
        private static final Logger log = Logger.getLogger(HttpIdGenApi.class);

	public HttpIdGenApi(HttpLoginApi login) {
		super(login, "idgen");
	}
		
	    private static final class GetIdGenConfigsTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getIdGenConfigs(CallingContext context, String authority) {
	        GetIdGenConfigsPayload requestObj = new GetIdGenConfigsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setAuthority(authority);
	        return doRequest(requestObj, "GETIDGENCONFIGS", new GetIdGenConfigsTypeReference());    }

	    private static final class GetIdGenConfigTypeReference extends TypeReference {
	    }    
	    @Override
	    public RaptureIdGenConfig getIdGenConfig(CallingContext context, String idGenUri) {
	        GetIdGenConfigPayload requestObj = new GetIdGenConfigPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        return doRequest(requestObj, "GETIDGENCONFIG", new GetIdGenConfigTypeReference());    }

	    private static final class CreateIdGenTypeReference extends TypeReference {
	    }    
	    @Override
	    public RaptureIdGenConfig createIdGen(CallingContext context, String idGenUri, String config) {
	        CreateIdGenPayload requestObj = new CreateIdGenPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        requestObj.setConfig(config);
	        return doRequest(requestObj, "CREATEIDGEN", new CreateIdGenTypeReference());    }

	    private static final class IdGenExistsTypeReference extends TypeReference {
	    }    
	    @Override
	    public Boolean idGenExists(CallingContext context, String idGenUri) {
	        IdGenExistsPayload requestObj = new IdGenExistsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        return doRequest(requestObj, "IDGENEXISTS", new IdGenExistsTypeReference());    }

	    
	    @Override
	    public void deleteIdGen(CallingContext context, String idGenUri) {
	        DeleteIdGenPayload requestObj = new DeleteIdGenPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        doRequest(requestObj, "DELETEIDGEN", null);    }

	    
	    @Override
	    public void setIdGen(CallingContext context, String idGenUri, Long count) {
	        SetIdGenPayload requestObj = new SetIdGenPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        requestObj.setCount(count);
	        doRequest(requestObj, "SETIDGEN", null);    }

	    private static final class NextTypeReference extends TypeReference {
	    }    
	    @Override
	    public String next(CallingContext context, String idGenUri) {
	        NextPayload requestObj = new NextPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        return doRequest(requestObj, "NEXT", new NextTypeReference());    }

	    private static final class NextIdsTypeReference extends TypeReference {
	    }    
	    @Override
	    public String nextIds(CallingContext context, String idGenUri, Long num) {
	        NextIdsPayload requestObj = new NextIdsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setIdGenUri(idGenUri);
	        requestObj.setNum(num);
	        return doRequest(requestObj, "NEXTIDS", new NextIdsTypeReference());    }

	    
	    @Override
	    public void setupDefaultIdGens(CallingContext context, Boolean force) {
	        SetupDefaultIdGensPayload requestObj = new SetupDefaultIdGensPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setForce(force);
	        doRequest(requestObj, "SETUPDEFAULTIDGENS", null);    }

	
	    @Override
	    public List getIdGenConfigs(String authority) {
	        return getIdGenConfigs(null,authority);    }

	    @Override
	    public RaptureIdGenConfig getIdGenConfig(String idGenUri) {
	        return getIdGenConfig(null,idGenUri);    }

	    @Override
	    public RaptureIdGenConfig createIdGen(String idGenUri, String config) {
	        return createIdGen(null,idGenUri,config);    }

	    @Override
	    public Boolean idGenExists(String idGenUri) {
	        return idGenExists(null,idGenUri);    }

	    @Override
	    public void deleteIdGen(String idGenUri) {
	        deleteIdGen(null,idGenUri);    }

	    @Override
	    public void setIdGen(String idGenUri, Long count) {
	        setIdGen(null,idGenUri,count);    }

	    @Override
	    public String next(String idGenUri) {
	        return next(null,idGenUri);    }

	    @Override
	    public String nextIds(String idGenUri, Long num) {
	        return nextIds(null,idGenUri,num);    }

	    @Override
	    public void setupDefaultIdGens(Boolean force) {
	        setupDefaultIdGens(null,force);    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy