Package com.alu.e3.prov.restapi.model

Examples of com.alu.e3.prov.restapi.model.SSLKey


          LOG.debug("Remove bucket:" + bucketId + " on policy:", policyId);
        }

        dataManager.removeBucket(policyId, bucketId);

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here


        }

        com.alu.e3.data.model.sub.QuotaRLBucket authIdsDataModel = BeanConverterUtil.toDataModel(authIds);
        dataManager.addAuthsToBucket(policyId, bucketId, authIdsDataModel);

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here

        if(LOG.isDebugEnabled()) {
          LOG.debug("Remove auth:" + authId + " from policy:" + policyId + "/bucket:" + bucketId);
        }
        dataManager.removeAuthFromBucket(policyId, bucketId, authId);

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
View Full Code Here

        for (String authId : authIds.getAuthIds())
        {
          dataManager.removeAuthFromBucket(policyId, bucketId, authId);
        }

        return new PolicyResponse(PolicyResponse.SUCCESS);
      }
    };
  }
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 mSchema;
  }

  private static final com.alu.e3.prov.restapi.model.ResourceItem fromDataModel(com.alu.e3.data.model.sub.ResourceItem item) {

    ResourceItem wsItem = new ResourceItem();
    wsItem.setName(item.getName());
    wsItem.setGrammar(item.getGrammar());
    wsItem.setIsMain(item.isIsMain());   

    return wsItem;
  }
View Full Code Here

  }

  public static final SSLCert fromDataModel(Certificate cert){
    if(cert == null) throw new IllegalArgumentException("cert must not be null");

    SSLCert sslCert = new SSLCert();
    sslCert.setDisplayName(cert.getCertDetail().getName());
    sslCert.setContent(cert.getData());
    sslCert.setId(cert.getId());
    sslCert.setKeyId(cert.getCertDetail().getKeyId());

    return sslCert;
  }
View Full Code Here

  }

  public static final SSLKey fromDataModel(com.alu.e3.data.model.Key key) {
    if (key==null) return null; //throw new IllegalArgumentException("status must not be null");

    SSLKey ret = new SSLKey();

    ret.setActiveCertId(key.getActiveCertId());
    ret.setDisplayName(key.getKeyDetail().getName());
    // do NOT set SSLKey.content and SSLKey.keyPassphrase
    // key data should not be accessible through the provisioning api.
    ret.setId(key.getId());
    ret.setType(key.getKeyDetail().getType());

    return ret;
  }
View Full Code Here

 

  protected final Action newCreateKeyAction() {
    return new  Action("create") {
      protected Object doAction(Object... params) {
        SSLKey key = (SSLKey) params[0];
       
        if ((key.getId() == null) || (key.getId().equals(""))) {
          key.setId(UUID.randomUUID().toString());
        }
       
        if (key.getContent() == null || key.getContent().isEmpty()) {
          throw new IllegalArgumentException("Must include content when creating a key");
        }
        if(key.getDisplayName() == null || key.getDisplayName().isEmpty()) {
          throw new IllegalArgumentException("Must include a display name when creating a key");
        }
       
        if(LOG.isDebugEnabled())
          LOG.debug("Creating SSLKey ID:", key.getId());
       
        // Convert the provisioning object to the true model object
        com.alu.e3.data.model.Key modelKey = BeanConverterUtil.toDataModel(key);
        dataManager.addKey(modelKey);

        SSLKeyResponse response = new SSLKeyResponse(SSLKeyResponse.SUCCESS);
       
        response.setId(key.getId());
        return response;
      }
    };
  }
View Full Code Here

  }
 
  protected final Action newUpdateKeyAction() {
    return new  Action("update") {
      protected Object doAction(Object... params) {
        SSLKey key = (SSLKey) params[0];
        String id = (String) params[1];
       
        if(LOG.isDebugEnabled())
          LOG.debug("Updating SSLKey ID: {}", id);
       
        if(key.getId() == null || key.getId().isEmpty())
          key.setId(id);
        else if(key.getId().equals(id) == false)
          throw new InvalidParameterException("SSLKey ID mismatch");
       
        com.alu.e3.data.model.Key modelKey = BeanConverterUtil.toDataModel(key);
        dataManager.updateKey(modelKey);

        SSLKeyResponse response = new SSLKeyResponse(SSLKeyResponse.SUCCESS);
        response.setId(key.getId());
        return response;
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.alu.e3.prov.restapi.model.SSLKey

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.