Package com.alu.e3.common.camel

Examples of com.alu.e3.common.camel.AuthReport


  private static final Data fromDataModelToData(Map<String, String> keys) {
    if (keys==null) throw new IllegalArgumentException("keys must not be null");
    Data d = new Data();
    for(Map.Entry<String, String> entry : keys.entrySet()) {
      Key k = new Key();
      k.setName  (entry.getKey());
      k.setValue  (entry.getValue());
      d.getKey().add(k);
    }
    return d;
  }
View Full Code Here


    return b;
  }

  private static OAuth fromDataModelToOAuth(AuthDetail authDetail) {
    if (authDetail==null) throw new IllegalArgumentException("authDetail must not be null");
    OAuth b = new OAuth();
    b.setClientId(authDetail.getClientId());
    b.setClientSecret(authDetail.getClientSecret());
    return b;
  }
View Full Code Here

  protected final Action newCreateAction() {
    return new Action() {

      @Override
      protected Object doAction(Object... params) {
        Policy policy = (Policy) params[0];

        if ((policy.getId() == null) || (policy.getId().equals("")))
        {
          // create the id
          policy.setId(UUID.randomUUID().toString());
        }

        /**
         * Some validation
         */
        for(Key key : policy.getProperties()){
          if(key.getName() == null || key.getName().isEmpty())
            throw new IllegalArgumentException("All properties must have a name");
        }

        if(LOG.isDebugEnabled()) {
          LOG.debug("Creating Policy:", policy.getId());
        }

        com.alu.e3.data.model.Policy policyDataModel = BeanConverterUtil.toDataModel(policy);
        dataManager.addPolicy(policyDataModel);

        PolicyResponse response = new PolicyResponse(PolicyResponse.SUCCESS);
        response.setId(policy.getId());

        return response;
      }
    };
  }
View Full Code Here

  protected final Action newUpdateAction() {
    return new Action() {

      @Override
      protected Object doAction(Object... params) {
        Policy policy = (Policy) params[0];
        String policyId = (String) params[1];

        /**
         * Some validation
         */
        for(Key key : policy.getProperties()){
          if(key.getName() == null || key.getName().isEmpty())
            throw new IllegalArgumentException("All properties must have a name");
        }

        if(LOG.isDebugEnabled()) {
          LOG.debug("Updating Policy:", policyId);
        }

        if(policy.getId() == null || policy.getId().equals(""))
          policy.setId(policyId);
        else if(policy.getId().equals(policyId) == false)
          throw new InvalidParameterException("Policy ID mismatch");

        com.alu.e3.data.model.Policy policyDataModel = BeanConverterUtil.toDataModel(policy);       
        dataManager.updatePolicy(policyDataModel);

View Full Code Here

        com.alu.e3.data.model.Policy policyDataModel = dataManager.getPolicyById(policyId);
        if(policyDataModel == null)
          throw new InvalidIDException("A Policy with that ID does not exist");

        Policy policy = BeanConverterUtil.fromDataModel(policyDataModel);

        PolicyResponse response = new PolicyResponse(PolicyResponse.SUCCESS);
        response.setPolicy(policy);

        return response;
View Full Code Here

    Authkey ak = new Authkey();
    ak.setKeyName    (apiDetail.getAuthKeyName());
    ak.setHeaderName  (apiDetail.getAuthHeaderName());

    ProvisionAuthentication p = new ProvisionAuthentication();
    p.setAuthKey    (ak);
    p.getAuths().addAll  (BeanConverterUtil.<AuthType, NBAuthType>fromDataModels(apiDetail.getEnabledAuthType()));

    return p;
  }
View Full Code Here

   
    return perfWatch;
  }
 
  public TdrStreamWriter(File dir) throws TransformerConfigurationException {
    this(new RotatableFileWriterProvider(dir, TDR_FILE_SIZE, TDR_FILE_AGE) {
      @Override
      protected String getFileName() {
        return "tdrs." + System.currentTimeMillis() + ".xml";   // TDR file name
      }
View Full Code Here

   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
    healthCheckFactory = new DummyHealthCheckFactory();
   
    setHealthCheckGateways(gatewayList);
    setHealthCheckGatewaysActive(gatewayActiveList);
    setHealthCheckSpeakers(activeSpeakerList);
   
View Full Code Here

  private void createTestResources(String[] gatewayList, String[] gatewayActiveList, String[] activeSpeakerList) {
    topologyWatcher = new TopologyWatcher();
   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
    healthCheckFactory = new DummyHealthCheckFactory();
   
    setHealthCheckGateways(gatewayList);
    setHealthCheckGatewaysActive(gatewayActiveList);
View Full Code Here

   
    return instance;
  }
 
  private void createTestResources(String[] gatewayList, String[] gatewayActiveList, String[] activeSpeakerList) {
    topologyWatcher = new TopologyWatcher();
   
    topologyWatcher.setPollingInterval(POLLING_INTERVAL);
   
    topologyClient = new DummyTopologyClient();
   
View Full Code Here

TOP

Related Classes of com.alu.e3.common.camel.AuthReport

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.