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

com.adaptrex.core.rest.RestService Maven / Gradle / Ivy

There is a newer version: 1.0-Alpha3
Show newest version
package com.adaptrex.core.rest;

import javax.ws.rs.core.UriInfo;

public class RestService {

	public RestStore getStore(String className, UriInfo uriInfo) {
		return new RestStore(className, uriInfo, null);
	}
	
	public RestStore getStore(String className, UriInfo uriInfo, String factoryName) {
		return new RestStore(className, uriInfo, factoryName);
	}
	
	public RestModel getModel(String className, Object id, UriInfo uriInfo) {
		return new RestModel(className, id, uriInfo, null);
	}
	
	public RestModel getModel(String className, Object id, UriInfo uriInfo, String factoryName) {
		return new RestModel(className, id, uriInfo, factoryName);
	}
	
	public RestModel createModel(String className, RequestBody modelData, UriInfo uriInfo) {
		return createModel(className, modelData, uriInfo, null);
	}
	
	public RestModel createModel(String className, RequestBody modelData, UriInfo uriInfo, String factoryName) {
		return new RestModel(className, modelData.getData(), uriInfo, factoryName);
	}
	
	public RestModel updateModel(String className, Object id, RequestBody modelData, UriInfo uriInfo) {
		return updateModel(className, id, modelData, uriInfo, null);
	}
	
	public RestModel updateModel(String className, Object id, RequestBody modelData, UriInfo uriInfo, String factoryName) {
		RestModel model = new RestModel(className, id, uriInfo, factoryName);
		return model.updateEntity(modelData);		
	}	

	
	public RestModel deleteModel(String className, Object id) {
		return deleteModel(className, id, null);
	}
	
	public RestModel deleteModel(String className, Object id, String factoryName) {
		RestModel model = new RestModel(className, id, null, factoryName);
		return model.deleteEntity();
	}	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy