DecisionResource.java revision 8af80418ba1ec431c8027fa9668e5678658d3611
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms of the Common
* Development and Distribution License (the License). You may not use
* this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL Header Notice in each
* file and include the License file at opensso/legal/CDDLv1.0.txt. If
* applicable, add the following below the CDDL Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: DecisionResource.java,v 1.3 2009/12/15 00:44:19 veiming Exp $
*/
/**
* Exposes the entitlement decision REST resource.
*
* @author Paul C. Bryan <pbryan@sun.com>
* @author Ravi Hingarajiya <ravi.hingarajiya@sun.com>
*/
@Path("/1/entitlement")
public class DecisionResource extends ResourceBase {
private enum Permission {
}
throws EntitlementException {
}
/**
* Returns entitlement decision of a given user.
*
* @param realm Realm name.
* @param action Action to be evaluated.
* @param resource Resource to be evaluated.
* @param application Application name.
* @param environment environment parameters.
* @return entitlement decision of a given user. Either "deny" or "allow".
*/
@GET
@Path("/decision")
public String getDecision(
) {
}
try {
throw new EntitlementException(422);
}
env));
} catch (EntitlementException e) {
} catch (RestException e) {
}
}
/**
* Returns the entitlements of a given subject.
*
* @param realm Realm Name.
* @param resources resources to be evaluated
* @param application application name.
* @param environment environment parameters.
* @return entitlement of a given subject (in JSON string).
*/
@GET
@Produces("application/json")
@Path("/decisions")
public String getDecisions(
) {
try {
}
throw new EntitlementException(424);
}
if (entitlements != null) {
for (Entitlement e : entitlements) {
e.getAttributes());
}
}
}
} catch (JSONException e) {
} catch (RestException e) {
} catch (EntitlementException e) {
}
}
/**
* Returns the entitlement of a given subject.
*
* @param realm Realm Name.
* @param resource resource to be evaluated
* @param application application name.
* @param environment environment parameters.
* @return entitlement of a given subject (in JSON string).
*/
@GET
@Produces("application/json")
@Path("/entitlement")
public String getEntitlement(
) {
}
try {
} catch (JSONException e) {
} catch (RestException e) {
} catch (EntitlementException e) {
}
}
/**
* Returns the entitlements of a given subject.
*
* @param realm Realm Name.
* @param resource resource to be evaluated
* @param application application name.
* @param environment environment parameters.
* @return entitlements of a given subject (in JSON string).
*/
@GET
@Produces("application/json")
@Path("/entitlements")
public String getEntitlements(
) {
}
try {
for (Entitlement e : entitlements) {
}
} catch (JSONException e) {
} catch (RestException e) {
} catch (EntitlementException e) {
}
}
private String permission(boolean b) {
}
throws EntitlementException {
}
throws EntitlementException {
throw new EntitlementException(421);
}
}
throws EntitlementException {
throw new EntitlementException(420);
}
}
}