Package org.apache.wookie.proxy

Examples of org.apache.wookie.proxy.Policy


      //
      // Create access policies for each access request in the widget model
      //
      for(IAccessEntity accessEntity:model.getAccessList()){
        Policy policy = new Policy();
        policy.setOrigin(accessEntity.getOrigin());
        policy.setScope(widget.getGuid());
        policy.setDirective("DENY");
        if (grantAccessRequests){
          policy.setDirective("ALLOW");
          _logger.info("access policy granted for "+widget.getWidgetTitle("en")+" to access "+policy.getOrigin());
        }
        Policies.getInstance().addPolicy(policy);
      }
    } catch (ConfigurationException e) {
      _logger.error("problem with policies configuration", e);
View Full Code Here


    try {

      //
      // Obtain a policy from the resource identifier
      //
      Policy policy;
      policy = new Policy(resourceId);
      Policies.getInstance().removePolicy(policy);
      return true;
     
    } catch (PolicyFormatException e) {
View Full Code Here

      //
      // Create access policies for each access request in the widget model
      //
      for(IAccessEntity accessEntity:model.getAccessList()){
        Policy policy = new Policy();
        policy.setOrigin(accessEntity.getOrigin());
        policy.setScope(widget.getGuid());
        policy.setDirective("DENY");
        if (grantAccessRequests){
          policy.setDirective("ALLOW");
          _logger.info("access policy granted for "+widget.getWidgetTitle("en")+" to access "+policy.getOrigin());
        }
        Policies.getInstance().addPolicy(policy);
      }
    } catch (ConfigurationException e) {
      _logger.error("problem with policies configuration", e);
View Full Code Here

      //
      // Create access policies for each access request in the widget model
      //
      for(IAccess access:model.getAccessList()){
        Policy policy = new Policy();
        policy.setOrigin(access.getOrigin());
        policy.setScope(widget.getIdentifier());
        policy.setDirective("DENY");
        if (grantAccessRequests){
          policy.setDirective("ALLOW");
          _logger.info("access policy granted for "+widget.getLocalName("en")+" to access "+policy.getOrigin());
        }
        Policies.getInstance().addPolicy(policy);
      }
    } catch (ConfigurationException e) {
      _logger.error("problem with policies configuration", e);
View Full Code Here

public class PolicyTest {
 
 
  @Test
  public void createPolicy() throws PolicyFormatException{
    Policy policy = new Policy();
    policy.setScope("*");
    policy.setOrigin("*");
    policy.setDirective("ALLOW");
  }
View Full Code Here

    policy.setDirective("ALLOW");
  }

  @Test
  public void createPolicyFromString() throws PolicyFormatException{
    Policy policy = new Policy("* http://localhost ALLOW");
  }
View Full Code Here

    Policy policy = new Policy("* http://localhost ALLOW");
  }
 
  @Test(expected = PolicyFormatException.class)
  public void createPolicyFromInvalidString() throws PolicyFormatException{
    Policy policy = new Policy("http://localhost ALLOW");
  }
View Full Code Here

    Policy policy = new Policy("http://localhost ALLOW");
  }
 
  @Test
  public void policyToString() throws PolicyFormatException{
    Policy policy = new Policy("* http://localhost ALLOW");
    assertEquals("* http://localhost ALLOW",policy.toString());
  }
View Full Code Here

    assertEquals("* http://localhost ALLOW",policy.toString());
  }
 
  @Test(expected = PolicyFormatException.class)
  public void createPolicyFromInvalidUriString() throws PolicyFormatException{
    Policy policy = new Policy("* isnotauri! ALLOW");
  }
View Full Code Here

    Policy policy = new Policy("* isnotauri! ALLOW");
  }
 
  @Test(expected = PolicyFormatException.class)
  public void createPolicyFromInvalidUriString2() throws PolicyFormatException{
    Policy policy = new Policy("* nohost: ALLOW");
  }
View Full Code Here

TOP

Related Classes of org.apache.wookie.proxy.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.