/**
* 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: PrivilegePolicyMapping.java,v 1.2 2009/11/12 18:37:40 veiming Exp $
*/
/**
*
* @author dennis
*/
public class PrivilegePolicyMapping {
"PrivilegePolicyMappingTestUser";
try {
"entered");
} catch (Exception e) {
+ "Exception STACKTRACE:"
+ e.getMessage());
}
throw e;
}
}
}
throw new Exception(
"PrivilegePolicyMapping.privilegeToPolicy: resource is incorrect");
}
throw new Exception(
"PrivilegePolicyMapping.privilegeToPolicy: action value is incorrect");
}
}
if (!(sbj instanceof PrivilegeSubject)) {
throw new Exception(
"PrivilegePolicyMapping.privilegeToPolicy: not instance of privilege subject");
}
}
throw new Exception(
"PrivilegePolicyMapping.privilegeToPolicy: number of condition is incorrect");
}
if (!(cond instanceof PrivilegeCondition)) {
throw new Exception(
"PrivilegePolicyMapping.privilegeToPolicy: not instance of privilege condition");
}
}
}
@Test
if (privileges.isEmpty()) {
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: cannot get privilege");
}
if (!(cond instanceof OrCondition)) {
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: condition is not AND condition");
}
if (!(ec instanceof PolicyCondition)) {
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: condition is not policy condition");
}
) {
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: condition values are not correct");
}
}
if (!(sbj instanceof PolicySubject)) {
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: subject is not privilege subject");
}
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: subject value is empty");
}
throw new Exception(
"PrivilegePolicyMapping.policyToPrivilege: subject value is incorrect");
}
}
{
}
{
}
}
return subject;
}
throws PolicyException {
return cond;
}
throws PolicyException {
return cond;
}
}