Package com.alu.e3.data.model

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


  }

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

    Auth auth = new Auth()
    auth.setId            (authData.getId());
    auth.setStatus          (toDataModel(authData.getStatus()));
    auth.setTdrGenerationRule    (toDataModel(authData.getTdr()));
    auth.setApiContext           (authData.getApiContext());
    auth.setPolicyContext         (authData.getPolicyContext());
    auth.setHeaderTransformation    (BeanConverterUtil.<HeaderTransformation, com.alu.e3.prov.restapi.model.HeaderTransformation>toDataModels(authData.getHeaderTransformations()));

    for(Key prop : authData.getProperties()){
      auth.getProperties().put(prop.getName(), prop.getValue());
    }

    AuthDetail authDetail = new AuthDetail();
    auth.setAuthDetail        (authDetail);

    authDetail.setType        (toDataModel(authData.getType()));

    switch(authData.getType()) {
    case AUTHKEY:
      authDetail.setAuthKeyValue(authData.getAuthKeyAuth().getKeyValue());
      break;
    case BASIC:
      authDetail.setUsername(authData.getBasicAuth().getUsername());
      authDetail.setPassword(authData.getBasicAuth().getPassword());
      break;
    case IP_WHITE_LIST:
      authDetail.getWhiteListedIps().addAll(authData.getIpWhiteListAuth().getIp());
      break;
    case NO_AUTH:
      break;
    case OAUTH:
      authDetail.setClientId(authData.getOAuth().getClientId());
      authDetail.setClientSecret(authData.getOAuth().getClientSecret());
      break;
    case WSSE:
      authDetail.setUsername(authData.getWsseAuth().getUsername());
      auth.setWssePassword(authData.getWsseAuth().getPassword());
      break;
    default:
      throw new IllegalArgumentException("Unknown authType specified");
    }
View Full Code Here


    Map<String, String> props = new HashMap<String,String>();

    props.putAll(identity.getApi().getProperties());
    Iterator<CallDescriptor> it = identity.getCallDescriptors().iterator();
    while(it.hasNext()){
      CallDescriptor cd = it.next();
      Policy policy = cd.getPolicy();
      if(policy != null){
        props.putAll(policy.getProperties());
      }
    }
View Full Code Here

        processTdrGenerationRuleDynamic(api.getTdrGenerationRule(), exchange, properties, efType);

    // Next add all of the tdr values for the Policies
    Iterator<CallDescriptor> it = identity.getCallDescriptors().iterator();
    while(it.hasNext()){
      CallDescriptor cd = it.next();
      Policy policy = cd.getPolicy();
      if(policy != null){
        if(doStatic)
          processTdrGenerationRuleStatic(policy.getTdrGenerationRule(), exchange, properties);
        else
          processTdrGenerationRuleDynamic(policy.getTdrGenerationRule(), exchange, properties, efType);
View Full Code Here

    props.putAll(identity.getApi().getProperties());
    Iterator<CallDescriptor> it = identity.getCallDescriptors().iterator();
    while(it.hasNext()){
      CallDescriptor cd = it.next();
      Policy policy = cd.getPolicy();
      if(policy != null){
        props.putAll(policy.getProperties());
      }
    }

    if(identity.getAuth() != null)
      props.putAll(identity.getAuth().getProperties());
View Full Code Here

    // Next add all of the tdr values for the Policies
    Iterator<CallDescriptor> it = identity.getCallDescriptors().iterator();
    while(it.hasNext()){
      CallDescriptor cd = it.next();
      Policy policy = cd.getPolicy();
      if(policy != null){
        if(doStatic)
          processTdrGenerationRuleStatic(policy.getTdrGenerationRule(), exchange, properties);
        else
          processTdrGenerationRuleDynamic(policy.getTdrGenerationRule(), exchange, properties, efType);
      }
    }

    // Finally add the values from the Auth
    Auth auth = identity.getAuth();
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

TOP

Related Classes of com.alu.e3.data.model.ApiJar

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.