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

rapture.common.client.HttpFieldsApi 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.FieldsApi;
import rapture.common.api.ScriptFieldsApi;
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.RaptureField;
import rapture.common.RaptureFolderInfo;

import rapture.common.shared.fields.ListFieldsByUriPrefixPayload;

import rapture.common.shared.fields.GetFieldPayload;

import rapture.common.shared.fields.PutFieldPayload;

import rapture.common.shared.fields.FieldExistsPayload;

import rapture.common.shared.fields.DeleteFieldPayload;

import rapture.common.shared.fields.GetDocumentFieldsPayload;

import rapture.common.shared.fields.PutDocumentAndGetDocumentFieldsPayload;


@SuppressWarnings("all")
public class HttpFieldsApi extends BaseHttpApi implements FieldsApi, ScriptFieldsApi {
        private static final Logger log = Logger.getLogger(HttpFieldsApi.class);

	public HttpFieldsApi(HttpLoginApi login) {
		super(login, "fields");
	}
		
	    private static final class ListFieldsByUriPrefixTypeReference extends TypeReference> {
	    }    
	    @Override
	    public Map listFieldsByUriPrefix(CallingContext context, String authority, int depth) {
	        ListFieldsByUriPrefixPayload requestObj = new ListFieldsByUriPrefixPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setAuthority(authority);
	        requestObj.setDepth(depth);
	        return doRequest(requestObj, "LISTFIELDSBYURIPREFIX", new ListFieldsByUriPrefixTypeReference());    }

	    private static final class GetFieldTypeReference extends TypeReference {
	    }    
	    @Override
	    public RaptureField getField(CallingContext context, String fieldUri) {
	        GetFieldPayload requestObj = new GetFieldPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setFieldUri(fieldUri);
	        return doRequest(requestObj, "GETFIELD", new GetFieldTypeReference());    }

	    
	    @Override
	    public void putField(CallingContext context, RaptureField field) {
	        PutFieldPayload requestObj = new PutFieldPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setField(field);
	        doRequest(requestObj, "PUTFIELD", null);    }

	    private static final class FieldExistsTypeReference extends TypeReference {
	    }    
	    @Override
	    public Boolean fieldExists(CallingContext context, String fieldUri) {
	        FieldExistsPayload requestObj = new FieldExistsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setFieldUri(fieldUri);
	        return doRequest(requestObj, "FIELDEXISTS", new FieldExistsTypeReference());    }

	    
	    @Override
	    public void deleteField(CallingContext context, String fieldUri) {
	        DeleteFieldPayload requestObj = new DeleteFieldPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setFieldUri(fieldUri);
	        doRequest(requestObj, "DELETEFIELD", null);    }

	    private static final class GetDocumentFieldsTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getDocumentFields(CallingContext context, String docURI, List fields) {
	        GetDocumentFieldsPayload requestObj = new GetDocumentFieldsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDocURI(docURI);
	        requestObj.setFields(fields);
	        return doRequest(requestObj, "GETDOCUMENTFIELDS", new GetDocumentFieldsTypeReference());    }

	    private static final class PutDocumentAndGetDocumentFieldsTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List putDocumentAndGetDocumentFields(CallingContext context, String docURI, String content, List fields) {
	        PutDocumentAndGetDocumentFieldsPayload requestObj = new PutDocumentAndGetDocumentFieldsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setDocURI(docURI);
	        requestObj.setContent(content);
	        requestObj.setFields(fields);
	        return doRequest(requestObj, "PUTDOCUMENTANDGETDOCUMENTFIELDS", new PutDocumentAndGetDocumentFieldsTypeReference());    }

	
	    @Override
	    public Map listFieldsByUriPrefix(String authority, int depth) {
	        return listFieldsByUriPrefix(null,authority,depth);    }

	    @Override
	    public RaptureField getField(String fieldUri) {
	        return getField(null,fieldUri);    }

	    @Override
	    public void putField(RaptureField field) {
	        putField(null,field);    }

	    @Override
	    public Boolean fieldExists(String fieldUri) {
	        return fieldExists(null,fieldUri);    }

	    @Override
	    public void deleteField(String fieldUri) {
	        deleteField(null,fieldUri);    }

	    @Override
	    public List getDocumentFields(String docURI, List fields) {
	        return getDocumentFields(null,docURI,fields);    }

	    @Override
	    public List putDocumentAndGetDocumentFields(String docURI, String content, List fields) {
	        return putDocumentAndGetDocumentFields(null,docURI,content,fields);    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy