Package com.alu.e3.common

Examples of com.alu.e3.common.InvalidIDException


  @Override
  public Policy getPolicyById(String id, boolean getFullDetails) throws InvalidIDException {

    Policy policy = cachingTablePolicy.get(id);
    if (policy == null)
      throw new InvalidIDException("A Policy with that ID [" + id + "] doesn't exist");

    if (getFullDetails) {
      // It's not because List<Context> is transient on Policy
      // that it is not stored in hazelcast memory _locally_.
      // For sure, it will not be replicated
View Full Code Here


    Policy policy = getPolicyById(policyId);

    String authToken = cachingTableAuthIdToAuthToken.get(authId);
    if (authToken == null)
      throw new InvalidIDException("An Authorization with that ID [" + authId + "] doesn't exist");

    Auth auth = cachingTableAuth.get(authToken);
    if (auth == null)
      throw new InvalidIDException("An Authorization with that token doesn't exist");

    QuotaRLBucket pAuthIds = getBucketWithIdForPolicy(policy, bucketId);
    if(pAuthIds == null) {
      throw new InvalidIDException("A Bucket with that ID [" + bucketId + "] doesn't exist for this Policy [" + policyId + "]");
    }

    // Remove auth from the bucket
    pAuthIds.getAuthIds().remove(auth.getId());
    cachingTablePolicy.set(policy.getId(), policy);
View Full Code Here

    Policy policy = getPolicyById(policyId);

    QuotaRLBucket pAuthIds = getBucketWithIdForPolicy(policy, bucketId);
    if(pAuthIds == null) {
      throw new InvalidIDException("A Bucket with that ID [" + bucketId + "] doesn't exist for this Policy [" + policyId + "]");
    }

    // Iterating over Auth Ids in the bucket to remove policy from the auth
    for(String authId : pAuthIds.getAuthIds()) {
View Full Code Here

  @Override
  public Key getKeyById(String id, boolean getFullDetails) throws InvalidIDException {

    if( ! cachingTableKey.containsKey(id))
      throw new InvalidIDException("A Key with that ID [" + id + "] doesn't exist");

    Key key = cachingTableKey.get(id);

    if (getFullDetails)
      key.setKeyDetail(cachingTableKeyDetails.get(id));
View Full Code Here

  @Override
  public void updateKey(Key key) throws InvalidIDException {

    if( ! cachingTableKey.containsKey(key.getId()))
      throw new InvalidIDException("A Key with that ID [" + key.getId() + "] doesn't exist");

    if( key.getData() != null && !key.getData().isEmpty() )
      throw new IllegalArgumentException("Key data cannot be changed with an update");

    Key knownKey = getKeyById(key.getId(), true);
View Full Code Here

  @Override
  public void removeKey(String id) throws InvalidIDException {

    if( ! cachingTableKey.containsKey(id))
      throw new InvalidIDException("A Key with that ID [" + id + "] doesn't exist");

    ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(DataManager.class.getClassLoader());

    // Remove all certificates for this key
View Full Code Here

  }

  @Override
  public Certificate getCertById(String id, boolean getFullDetails) throws InvalidIDException {
    if(!cachingTableCertificate.containsKey(id))
      throw new InvalidIDException("A Certificate with that ID [" + id + "] doesn't exist");
    Certificate cert = cachingTableCertificate.get(id)

    if(getFullDetails)
      cert.setCertDetail(cachingTableCertificateDetails.get(id));
    else
View Full Code Here

  }

  @Override
  public void updateCert(Certificate cert) throws InvalidIDException {
    if( ! cachingTableCertificate.containsKey(cert.getId()))
      throw new InvalidIDException("A Certificate with that ID [" + cert.getId() + "] doesn't exist");

    if( cert.getData() != null && !cert.getData().isEmpty() )
      throw new IllegalArgumentException("Certificate data cannot be changed with an update");

View Full Code Here

  }

  @Override
  public void removeCert(String id) throws InvalidIDException {
    if( ! cachingTableCertificate.containsKey(id))
      throw new InvalidIDException("A Certificate with that ID [" + id + "] doesn't exist");

    // If the cert is active, disallow removal
    if( cachingTableKey.get(cachingTableCertificateDetails.get(id).getKeyId()).getActiveCertId().equals(id))
      throw new IllegalArgumentException("Cannot remove active certificate");
View Full Code Here

  }

  @Override
  public Certificate getCAById(String id) throws InvalidIDException {
    if(!cachingTableCA.containsKey(id))
      throw new InvalidIDException("A CA with that ID [" + id + "] doesn't exist");
    Certificate cert = cachingTableCA.get(id)
    cert.setCertDetail(cachingTableCADetails.get(id));

    return cert;
  }
View Full Code Here

TOP

Related Classes of com.alu.e3.common.InvalidIDException

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.