Package com.sun.xacml

Examples of com.sun.xacml.Policy


   public void registerPolicy(String contextID, InputStream stream)
   {
      try
     
         Element elm = DOMUtils.parse(stream);
         Policy policy = Policy.getInstance(elm);
         this.contextIdToPolicy.put(contextID, policy);
      }
      catch(Exception e)
      {
         log.debug("Error in registering xacml policy:",e);
View Full Code Here


   public void registerPolicy(String contextID, InputStream stream)
   {
      try
     
         Element elm = DOMUtils.parse(stream);
         Policy policy = Policy.getInstance(elm);
         this.contextIdToPolicy.put(contextID, policy);
      }
      catch(Exception e)
      {
         log.debug("Error in registering xacml policy:",e);
View Full Code Here

      WebXACMLUtil util = new WebXACMLUtil();
      try
      {
         RequestCtx requestCtx = util.createXACMLRequest(request,callerRoles);
         String contextID = PolicyContext.getContextID();
         Policy policy = (Policy)policyRegistration.getPolicy(contextID,null);
         if(policy == null)
            throw new IllegalStateException("Missing xacml policy for contextid:"+contextID);
         result = JBossXACMLUtil.checkXACMLAuthorization(requestCtx,policy);
      }
      catch(Exception e)
View Full Code Here

      try
      {
         RequestCtx requestCtx = util.createXACMLRequest(this.ejbName,
               this.ejbMethod.getName(),this.principal, callerRoles);
        
         Policy policy = (Policy)policyRegistration.getPolicy(policyContextID,null);
         if(policy == null)
         {
            if(trace)
               log.trace("Policy obtained is null for contextID:"+policyContextID);
            throw new IllegalStateException("Missing xacml policy for contextid:"+policyContextID);
View Full Code Here

   public void registerPolicy(String contextID, InputStream stream)
   {
      try
     
         Element elm = DOMUtils.parse(stream);
         Policy policy = Policy.getInstance(elm);
         this.contextIdToPolicy.put(contextID, policy);
      }
      catch(Exception e)
      {
         log.debug("Error in registering xacml policy:",e);
View Full Code Here

  {
    final Target emptyTarget = createEmptyTarget();
    final RuleCombiningAlgorithm alg = new OrderedPermitOverridesRuleAlg();
    final Rule denyEverythingRule = createDefaultRule("DenyAll");
    final List<Rule> rules = Collections.singletonList(denyEverythingRule);
    return new Policy(URI.create(policyID), alg, DEFAULT_DESCRIPTION, emptyTarget, rules);
  }
View Full Code Here

    final String tagName = rootElement.getTagName();
   
    //sunxacml does not do namespaces, so this part is commented out for now
    if(/*XACMLConstants.XACML_POLICY_NAMESPACE.equals(namespace) && */XACMLConstants.POLICY_ELEMENT_LOCAL_NAME.equals(tagName))
    {
      Policy policy;
      try
      {
        policy = Policy.getInstance(rootElement);
      }
      catch(final ParsingException pe)
View Full Code Here

    final RuleCombiningAlgorithm algorithm = (RuleCombiningAlgorithm)getCombiningAlgorithm();
    final List<Rule> rawRules = new ArrayList<Rule>(rules.size());
    for(final RuleNode rule : rules)
      rawRules.add(rule.createRule());
    final URI useId = (id == null) ? getId() : id;
    return new Policy(useId, algorithm, getDescription(), target, rawRules);
  }
View Full Code Here

  private void newPolicy()
  {
    if(contextNode instanceof PolicySetNode || contextNode instanceof RootNode)
    {
      final PolicyElementContainer node =((PolicyElementContainer)contextNode);
      final Policy p = XACMLEditor.createDefaultPolicy(node);
      node.add(p);
    }
  }
View Full Code Here

      WebXACMLUtil util = new WebXACMLUtil();
      try
      {
         RequestCtx requestCtx = util.createXACMLRequest(request,am, am.getUserRoles(userP));
         String contextID = PolicyContext.getContextID();
         Policy policy = (Policy)policyRegistration.getPolicy(contextID,null);
         if(policy == null)
            throw new IllegalStateException("Missing xacml policy for contextid:"+contextID);
         result = JBossXACMLUtil.checkXACMLAuthorization(requestCtx,policy);
      }
      catch(Exception e)
View Full Code Here

TOP

Related Classes of com.sun.xacml.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.