com.adaptrex.core.rest.RestService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adaptrex-core Show documentation
Show all versions of adaptrex-core Show documentation
The Core Adaptrex Framework
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();
}
}