Package com.alu.e3.data.model

Examples of com.alu.e3.data.model.Policy


    Api api = new Api();
    api.setStatus(StatusType.ACTIVE);
    this.setApi(api);   
    if(isAlwaysHappy) {
      this.setAuth(new Auth());
      this.getCallDescriptors().add(new CallDescriptor(new Policy(), 1, 2));
    }
  }
View Full Code Here


    mockDataManager.setApi(api);
   
    // No policy found for the API
    // assertNull(dataAccess.isAllowed("api"));
   
    Policy policy = new Policy();
    mockDataManager.getCallDescriptors().add(new CallDescriptor(policy, 1, 2));
   
   
    AuthReport authReport = dataAccess.checkAllowed(api);
    AuthIdentity authIdentity = authReport.getAuthIdentity();
View Full Code Here

    // No policy found
    assertNull(dataAccess.checkAllowed(api, "authKey").getAuthIdentity());
    assertNull(dataAccess.checkAllowed(api, "username", "password").getAuthIdentity());
    assertNull(dataAccess.checkAllowed(api, new CanonicalizedIpAddress("127.0.0.1")).getAuthIdentity());
   
    Policy policy = new Policy();
    mockDataManager.getCallDescriptors().add(new CallDescriptor(policy, 1, 2));
   
    AuthIdentity authIdentity = dataAccess.checkAllowed(api, "authKey").getAuthIdentity();
    assertNotNull(authIdentity);   
    assertNotNull(authIdentity.getApi() == api); // compare memory reference
View Full Code Here

    exchange = new DefaultExchange(new DefaultCamelContext());
    processor = new PropertyExtractionProcessor();

    id = new AuthIdentity();
    api = new Api();
    policy1 = new Policy();
    auth = new Auth();
    CallDescriptor cd = new CallDescriptor(policy1, 0, 0);

    id.setApi(api);
    id.setAuth(auth);
View Full Code Here

  }

  private static final LoadBalancing toDataModel(com.alu.e3.prov.restapi.model.LoadBalancing loadBalancing) {
    if (loadBalancing==null) throw new IllegalArgumentException("loadBalancing must not be null");

    LoadBalancing lb = new LoadBalancing();
    lb.setLoadBalancingType(toDataModel(loadBalancing.getLoadBalancingType()));

    if(loadBalancing.getTargetHealthCheck() != null)
      lb.setTargetHealthCheck(toDataModel(loadBalancing.getTargetHealthCheck()));

    if(loadBalancing.getFailOver() != null)
      lb.setFailOver(toDataModel(loadBalancing.getFailOver()));

    return lb;
  }
View Full Code Here

  }

  public static final QuotaRLBucket toDataModel(com.alu.e3.prov.restapi.model.AuthIdsNoIdType authIds) {
    if (authIds==null) throw new IllegalArgumentException("authIds must not be null");

    QuotaRLBucket ids = new QuotaRLBucket();
    ids.getAuthIds().addAll(authIds.getAuthIds());
    ids.setId(authIds.getId());

    return ids;
  }
View Full Code Here

  private static final QuotaRLBucket toDataModel(com.alu.e3.prov.restapi.model.AuthIdsType authIds) {
    if (authIds==null) throw new IllegalArgumentException("authIds must not be null");
    if (authIds.getId()==null) throw new IllegalArgumentException("id must not be null");

    QuotaRLBucket ids = new QuotaRLBucket();
    ids.getAuthIds().addAll(authIds.getAuthIds());
    ids.setId(authIds.getId());

    return ids;
  }
View Full Code Here

    return t;
  }

  private static final SBAuthentication toDataModel(Authentication authentication) {
    if (authentication==null) return null; // throw new IllegalArgumentException("authentication must not be null");
    SBAuthentication s = new SBAuthentication();
    s.setType(authentication.getType());
    for (Key k : authentication.getData().getKey())
      s.getKeys().put(k.getName(), k.getValue());
    return s;
  }
View Full Code Here

  }

  private static final TargetHealthCheck toDataModel(com.alu.e3.prov.restapi.model.TargetHealthCheck targetHealthCheckType) {
    if (targetHealthCheckType==null) throw new IllegalArgumentException("targetHealthCheckType must not be null");

    TargetHealthCheck thc = new TargetHealthCheck();
    thc.setType(targetHealthCheckType.getType());

    return thc;
  }
View Full Code Here

    return apiContext;
  }

  private static final TargetHost toDataModel(com.alu.e3.prov.restapi.model.TargetHost targetHost) {
    if (targetHost==null) throw new IllegalArgumentException("targetHost must not be null");
    TargetHost t = new TargetHost();
    t.setUrl        (targetHost.getUrl());
    t.setSite        (targetHost.getSite());
    t.setAuthentication    (toDataModel(targetHost.getAuthentication()));
    if (targetHost.getConnectionParameters() != null)
      t.setConnectionParameters(toDataModel(targetHost.getConnectionParameters()));
   
    return t;
  }
View Full Code Here

TOP

Related Classes of com.alu.e3.data.model.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.