Examples of Policy


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

Examples of com.sun.xml.internal.ws.policy.Policy

            throws WebServiceException {
        try {
            PolicyAssertion assertion = null;
            if (policyMap != null) {
                final PolicyMapKey key = PolicyMap.createWsdlEndpointScopeKey(serviceName, portName);
                final Policy policy = policyMap.getEndpointEffectivePolicy(key);
                if (policy != null) {
                    final Iterator<AssertionSet> assertionSets = policy.iterator();
                    if (assertionSets.hasNext()) {
                        final AssertionSet assertionSet = assertionSets.next();
                        final Iterator<PolicyAssertion> assertions = assertionSet.get(name).iterator();
                        if (assertions.hasNext()) {
                            assertion = assertions.next();
View Full Code Here

Examples of com.sun.xml.ws.policy.Policy

            return false;

        try {
            PolicyMapKey endpointKey = policyMap.createWsdlEndpointScopeKey(wsdlPort.getOwner().getName(),
                    wsdlPort.getName());
            Policy policy = policyMap.getEndpointEffectivePolicy(endpointKey);

            if ((policy != null) && policy.contains(SECURITY_POLICY_NAMESPACE_URI)) {
                return true;
            }

            for (WSDLBoundOperation wbo : wsdlPort.getBinding().getBindingOperations()) {
                PolicyMapKey operationKey = policyMap.createWsdlOperationScopeKey(wsdlPort.getOwner().getName(),
                        wsdlPort.getName(),
                        wbo.getName());
                policy = policyMap.getOperationEffectivePolicy(operationKey);
                if ((policy != null) && policy.contains(SECURITY_POLICY_NAMESPACE_URI))
                    return true;

                policy = policyMap.getInputMessageEffectivePolicy(operationKey);
                if ((policy != null) && policy.contains(SECURITY_POLICY_NAMESPACE_URI))
                    return true;

                policy = policyMap.getOutputMessageEffectivePolicy(operationKey);
                if ((policy != null) && policy.contains(SECURITY_POLICY_NAMESPACE_URI))
                    return true;

                policy = policyMap.getFaultMessageEffectivePolicy(operationKey);
                if ((policy != null) && policy.contains(SECURITY_POLICY_NAMESPACE_URI))
                    return true;
            }
        } catch (PolicyException e) {
            return false;
        }
View Full Code Here

Examples of com.sun.xml.ws.policy.impl.bindings.Policy

    /**
     * Create an instance of {@link Policy }
     *
     */
    public Policy createPolicy() {
        return new Policy();
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.definitions.Policy

    private void dumpCategory(Category category, StringBuffer buffer) {
        buffer.append("Category:\n");
        buffer.append("  name=" + category.getName() + "\n");
        Iterator policies = category.policies();
        while (policies.hasNext()) {
            Policy policy = (Policy) policies.next();
            dumpPolicy(policy, buffer);
        }
    }
View Full Code Here

Examples of com.volantis.mcs.policies.Policy

     * @exception RepositoryException if an error occurs
     */
    private void transferPolicy(PolicyType policyType, String name)
        throws RepositoryException {

        Policy policy;
        try {
          policy = srcPolicyAccessor.retrievePolicy(name);
        } catch (RepositoryException e) {
            // Try to report the name of the policy we couldn't read
            throw new RepositoryException(
View Full Code Here

Examples of eu.planets_project.pp.plato.model.Policy

        }

        if (data.isPolicy()) {
            Element policy = xmlRoot.addElement("policy");

            Policy p = (Policy)data;

            policy.addAttribute("name", p.getName());
            policy.addAttribute("value", p.getValue());
        } else {
            Element policyNode = xmlRoot.addElement("policyNode");

            policyNode.addAttribute("name", data.getName());
View Full Code Here

Examples of eu.scape_project.planning.model.Policy

    public PolicyNode createPolicyNode() {

        if (isLeaf()) {

            Policy p = new Policy();
            p.setValue(getTEXT());
            return p;

        } else {
            PolicyNode node = new PolicyNode();

            node.setName(getTEXT());

            for (Node n : children) {
                if (n.isLeaf()) {
                    Policy p = new Policy();
                    p.setValue(n.getTEXT());
                    //Policy p = (Policy)n.createPolicyNode();
                    p.setName(getTEXT());
                    return p;
                } else {
                    node.addChild(n.createPolicyNode());
                }
            }
View Full Code Here

Examples of github.priyatam.springrest.domain.Policy

            // shortcut exit - no further processing necessary
            return null;
        }

        // Load Policy
        Policy policy = persistenceHelper.loadPolicy(policyNum);
        if (policy == null) {
            logger.warn("No Policy found");
            return new ResponseEntity<Policy>(null, new HttpHeaders(), HttpStatus.NOT_FOUND);
        }
View Full Code Here

Examples of gov.nasa.arc.mct.policy.Policy

    }
  }
 
  @Test
  public void testExecute() {
    Policy policy = new PlotViewPolicy();
    PolicyContext context;
   
    ViewInfo plotViewInfo = new ViewInfo(PlotViewManifestation.class, "Plot", ViewType.OBJECT);
   
    // Plot views should be allowed for leaf component with a feed
    context = new PolicyContext();
    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
        plotViewInfo);
    context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
        leafWithAFeedComponent);   
    Assert.assertTrue(policy.execute(context).getStatus());

    // ...but not without a feed
    context = new PolicyContext();
    context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
        plotViewInfo);
    context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
        leafWithOutAFeedComponent);   
    Assert.assertFalse(policy.execute(context).getStatus());
   
    // Plot view policy should not reject non-plot, ever
    for (AbstractComponent ac : new AbstractComponent[] { leafWithAFeedComponent, leafWithOutAFeedComponent, nonLeafComponent} ) {
      for (ViewType vt : ViewType.values()) {
        ViewInfo someViewInfo = new ViewInfo(NonPlotView.class, "NonPlot", vt);
        context = new PolicyContext();
        context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(),
            someViewInfo);
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
            ac);   
        Assert.assertTrue(policy.execute(context).getStatus());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.