rapture.common.client.HttpEntitlementApi 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.EntitlementApi;
import rapture.common.api.ScriptEntitlementApi;
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.model.RaptureEntitlement;
import rapture.common.model.RaptureEntitlementGroup;
import rapture.common.shared.entitlement.GetEntitlementsPayload;
import rapture.common.shared.entitlement.GetEntitlementPayload;
import rapture.common.shared.entitlement.GetEntitlementByAddressPayload;
import rapture.common.shared.entitlement.GetEntitlementGroupPayload;
import rapture.common.shared.entitlement.GetEntitlementGroupByAddressPayload;
import rapture.common.shared.entitlement.GetEntitlementGroupsPayload;
import rapture.common.shared.entitlement.AddEntitlementPayload;
import rapture.common.shared.entitlement.AddGroupToEntitlementPayload;
import rapture.common.shared.entitlement.RemoveGroupFromEntitlementPayload;
import rapture.common.shared.entitlement.DeleteEntitlementPayload;
import rapture.common.shared.entitlement.DeleteEntitlementGroupPayload;
import rapture.common.shared.entitlement.AddEntitlementGroupPayload;
import rapture.common.shared.entitlement.AddUserToEntitlementGroupPayload;
import rapture.common.shared.entitlement.RemoveUserFromEntitlementGroupPayload;
import rapture.common.shared.entitlement.FindEntitlementsByUserPayload;
import rapture.common.shared.entitlement.FindEntitlementsByGroupPayload;
import rapture.common.shared.entitlement.FindEntitlementsBySelfPayload;
@SuppressWarnings("all")
public class HttpEntitlementApi extends BaseHttpApi implements EntitlementApi, ScriptEntitlementApi {
private static final Logger log = Logger.getLogger(HttpEntitlementApi.class);
public HttpEntitlementApi(HttpLoginApi login) {
super(login, "entitlement");
}
private static final class GetEntitlementsTypeReference extends TypeReference> {
}
@Override
public List getEntitlements(CallingContext context) {
GetEntitlementsPayload requestObj = new GetEntitlementsPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETENTITLEMENTS", new GetEntitlementsTypeReference()); }
private static final class GetEntitlementTypeReference extends TypeReference {
}
@Override
public RaptureEntitlement getEntitlement(CallingContext context, String entitlementName) {
GetEntitlementPayload requestObj = new GetEntitlementPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementName(entitlementName);
return doRequest(requestObj, "GETENTITLEMENT", new GetEntitlementTypeReference()); }
private static final class GetEntitlementByAddressTypeReference extends TypeReference {
}
@Override
public RaptureEntitlement getEntitlementByAddress(CallingContext context, String entitlementURI) {
GetEntitlementByAddressPayload requestObj = new GetEntitlementByAddressPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementURI(entitlementURI);
return doRequest(requestObj, "GETENTITLEMENTBYADDRESS", new GetEntitlementByAddressTypeReference()); }
private static final class GetEntitlementGroupTypeReference extends TypeReference {
}
@Override
public RaptureEntitlementGroup getEntitlementGroup(CallingContext context, String groupName) {
GetEntitlementGroupPayload requestObj = new GetEntitlementGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupName(groupName);
return doRequest(requestObj, "GETENTITLEMENTGROUP", new GetEntitlementGroupTypeReference()); }
private static final class GetEntitlementGroupByAddressTypeReference extends TypeReference {
}
@Override
public RaptureEntitlementGroup getEntitlementGroupByAddress(CallingContext context, String groupURI) {
GetEntitlementGroupByAddressPayload requestObj = new GetEntitlementGroupByAddressPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupURI(groupURI);
return doRequest(requestObj, "GETENTITLEMENTGROUPBYADDRESS", new GetEntitlementGroupByAddressTypeReference()); }
private static final class GetEntitlementGroupsTypeReference extends TypeReference> {
}
@Override
public List getEntitlementGroups(CallingContext context) {
GetEntitlementGroupsPayload requestObj = new GetEntitlementGroupsPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETENTITLEMENTGROUPS", new GetEntitlementGroupsTypeReference()); }
private static final class AddEntitlementTypeReference extends TypeReference {
}
@Override
public RaptureEntitlement addEntitlement(CallingContext context, String entitlementName, String initialGroup) {
AddEntitlementPayload requestObj = new AddEntitlementPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementName(entitlementName);
requestObj.setInitialGroup(initialGroup);
return doRequest(requestObj, "ADDENTITLEMENT", new AddEntitlementTypeReference()); }
private static final class AddGroupToEntitlementTypeReference extends TypeReference {
}
@Override
public RaptureEntitlement addGroupToEntitlement(CallingContext context, String entitlementName, String groupName) {
AddGroupToEntitlementPayload requestObj = new AddGroupToEntitlementPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementName(entitlementName);
requestObj.setGroupName(groupName);
return doRequest(requestObj, "ADDGROUPTOENTITLEMENT", new AddGroupToEntitlementTypeReference()); }
private static final class RemoveGroupFromEntitlementTypeReference extends TypeReference {
}
@Override
public RaptureEntitlement removeGroupFromEntitlement(CallingContext context, String entitlementName, String groupName) {
RemoveGroupFromEntitlementPayload requestObj = new RemoveGroupFromEntitlementPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementName(entitlementName);
requestObj.setGroupName(groupName);
return doRequest(requestObj, "REMOVEGROUPFROMENTITLEMENT", new RemoveGroupFromEntitlementTypeReference()); }
@Override
public void deleteEntitlement(CallingContext context, String entitlementName) {
DeleteEntitlementPayload requestObj = new DeleteEntitlementPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setEntitlementName(entitlementName);
doRequest(requestObj, "DELETEENTITLEMENT", null); }
@Override
public void deleteEntitlementGroup(CallingContext context, String groupName) {
DeleteEntitlementGroupPayload requestObj = new DeleteEntitlementGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupName(groupName);
doRequest(requestObj, "DELETEENTITLEMENTGROUP", null); }
private static final class AddEntitlementGroupTypeReference extends TypeReference {
}
@Override
public RaptureEntitlementGroup addEntitlementGroup(CallingContext context, String groupName) {
AddEntitlementGroupPayload requestObj = new AddEntitlementGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupName(groupName);
return doRequest(requestObj, "ADDENTITLEMENTGROUP", new AddEntitlementGroupTypeReference()); }
private static final class AddUserToEntitlementGroupTypeReference extends TypeReference {
}
@Override
public RaptureEntitlementGroup addUserToEntitlementGroup(CallingContext context, String groupName, String userName) {
AddUserToEntitlementGroupPayload requestObj = new AddUserToEntitlementGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupName(groupName);
requestObj.setUserName(userName);
return doRequest(requestObj, "ADDUSERTOENTITLEMENTGROUP", new AddUserToEntitlementGroupTypeReference()); }
private static final class RemoveUserFromEntitlementGroupTypeReference extends TypeReference {
}
@Override
public RaptureEntitlementGroup removeUserFromEntitlementGroup(CallingContext context, String groupName, String userName) {
RemoveUserFromEntitlementGroupPayload requestObj = new RemoveUserFromEntitlementGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupName(groupName);
requestObj.setUserName(userName);
return doRequest(requestObj, "REMOVEUSERFROMENTITLEMENTGROUP", new RemoveUserFromEntitlementGroupTypeReference()); }
private static final class FindEntitlementsByUserTypeReference extends TypeReference> {
}
@Override
public List findEntitlementsByUser(CallingContext context, String username) {
FindEntitlementsByUserPayload requestObj = new FindEntitlementsByUserPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setUsername(username);
return doRequest(requestObj, "FINDENTITLEMENTSBYUSER", new FindEntitlementsByUserTypeReference()); }
private static final class FindEntitlementsByGroupTypeReference extends TypeReference> {
}
@Override
public List findEntitlementsByGroup(CallingContext context, String groupname) {
FindEntitlementsByGroupPayload requestObj = new FindEntitlementsByGroupPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setGroupname(groupname);
return doRequest(requestObj, "FINDENTITLEMENTSBYGROUP", new FindEntitlementsByGroupTypeReference()); }
private static final class FindEntitlementsBySelfTypeReference extends TypeReference> {
}
@Override
public List findEntitlementsBySelf(CallingContext context) {
FindEntitlementsBySelfPayload requestObj = new FindEntitlementsBySelfPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "FINDENTITLEMENTSBYSELF", new FindEntitlementsBySelfTypeReference()); }
@Override
public List getEntitlements() {
return getEntitlements(null); }
@Override
public RaptureEntitlement getEntitlement(String entitlementName) {
return getEntitlement(null,entitlementName); }
@Override
public RaptureEntitlement getEntitlementByAddress(String entitlementURI) {
return getEntitlementByAddress(null,entitlementURI); }
@Override
public RaptureEntitlementGroup getEntitlementGroup(String groupName) {
return getEntitlementGroup(null,groupName); }
@Override
public RaptureEntitlementGroup getEntitlementGroupByAddress(String groupURI) {
return getEntitlementGroupByAddress(null,groupURI); }
@Override
public List getEntitlementGroups() {
return getEntitlementGroups(null); }
@Override
public RaptureEntitlement addEntitlement(String entitlementName, String initialGroup) {
return addEntitlement(null,entitlementName,initialGroup); }
@Override
public RaptureEntitlement addGroupToEntitlement(String entitlementName, String groupName) {
return addGroupToEntitlement(null,entitlementName,groupName); }
@Override
public RaptureEntitlement removeGroupFromEntitlement(String entitlementName, String groupName) {
return removeGroupFromEntitlement(null,entitlementName,groupName); }
@Override
public void deleteEntitlement(String entitlementName) {
deleteEntitlement(null,entitlementName); }
@Override
public void deleteEntitlementGroup(String groupName) {
deleteEntitlementGroup(null,groupName); }
@Override
public RaptureEntitlementGroup addEntitlementGroup(String groupName) {
return addEntitlementGroup(null,groupName); }
@Override
public RaptureEntitlementGroup addUserToEntitlementGroup(String groupName, String userName) {
return addUserToEntitlementGroup(null,groupName,userName); }
@Override
public RaptureEntitlementGroup removeUserFromEntitlementGroup(String groupName, String userName) {
return removeUserFromEntitlementGroup(null,groupName,userName); }
@Override
public List findEntitlementsByUser(String username) {
return findEntitlementsByUser(null,username); }
@Override
public List findEntitlementsByGroup(String groupname) {
return findEntitlementsByGroup(null,groupname); }
@Override
public List findEntitlementsBySelf() {
return findEntitlementsBySelf(null); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy