Package com.cloud.bridge.service.exception

Examples of com.cloud.bridge.service.exception.NoSuchObjectException


    int maxKeys = request.getMaxKeys();
    if(maxKeys <= 0) maxKeys = 1000;
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket sbucket = bucketDao.getByName(bucketName);
    if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   
    PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
    S3PolicyContext context = new S3PolicyContext( action, bucketName );
    context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
    context.setEvalParam( ConditionKeys.Prefix, prefix );
View Full Code Here


      S3AccessControlPolicy policy = new S3AccessControlPolicy();    
      SBucketDao bucketDao = new SBucketDao();
      String bucketName = request.getBucketName();
      SBucket sbucket = bucketDao.getByName( bucketName );
      if (sbucket == null)
        throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
     
      S3CanonicalUser owner = new S3CanonicalUser();
      owner.setID(sbucket.getOwnerCanonicalId());
      owner.setDisplayName("");
      policy.setOwner(owner);
View Full Code Here

    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName(bucketName);
    if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   

    // -> is the caller allowed to write the object?
    //  -> the allocObjectItem checks for the bucket policy PutObject permissions
    Tuple<SObject, SObjectItem> tupleObjectItem = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess());
View Full Code Here

    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName(bucketName);
    if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   
    // -> is the caller allowed to write the object? 
    //  -> the allocObjectItem checks for the bucket policy PutObject permissions
    Tuple<SObject, SObjectItem> tupleObjectItem = allocObjectItem(bucket, key, meta, acl, null);
    Tuple<SHost, String> tupleBucketHost = getBucketStorageHost(bucket);
View Full Code Here

      S3AccessControlPolicy policy = new S3AccessControlPolicy()
      SBucketDao bucketDao = new SBucketDao();
      String bucketName = request.getBucketName();
      SBucket sbucket = bucketDao.getByName( bucketName );
      if (sbucket == null)
        throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
     
      SObjectDao sobjectDao = new SObjectDao();
      String nameKey = request.getKey();
      SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey );
      if (sobject == null)
        throw new NoSuchObjectException("Object " + request.getKey() + " does not exist");
       
    String deletionMark = sobject.getDeletionMark();
    if (null != deletionMark) {
      policy.setResultCode(404);
      policy.setResultDescription("Object " + request.getKey() + " has been deleted (1)");
View Full Code Here

  public void setCertificateId( String cloudAccessKey, String certId )
        throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
      UserCredentials user = getByAccessKey( cloudAccessKey );
      PreparedStatement statement = null;

      if (null == user) throw new NoSuchObjectException( "Cloud API Access Key [" + cloudAccessKey + "] is unknown" );
     
        openConnection()
        try {
        statement = conn.prepareStatement ( "UPDATE usercredentials SET CertUniqueId=? WHERE AccessKey=?" );
          statement.setString( 1, certId );
View Full Code Here

    int maxKeys = request.getMaxKeys();
    if(maxKeys <= 0) maxKeys = 1000;
   
    //
    SBucketVO sbucket = bucketDao.getByName(bucketName);
    if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");

    PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
    S3PolicyContext context = new S3PolicyContext( action, bucketName );
    context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
    context.setEvalParam( ConditionKeys.Prefix, prefix );
View Full Code Here

    {
      S3AccessControlPolicy policy = new S3AccessControlPolicy();    
      String bucketName = request.getBucketName();
      SBucketVO sbucket = bucketDao.getByName( bucketName );
      if (sbucket == null)
        throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
     
      S3CanonicalUser owner = new S3CanonicalUser();
      owner.setID(sbucket.getOwnerCanonicalId());
      owner.setDisplayName("");
      policy.setOwner(owner);
View Full Code Here

    long contentLength = request.getContentLength();
    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketVO bucket = bucketDao.getByName(bucketName);
    if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   

    // Is the caller allowed to write the object?
    // The allocObjectItem checks for the bucket policy PutObject permissions
    OrderedPair<SObjectVO, SObjectItemVO> object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess());
View Full Code Here

    long contentLength = request.getContentLength();
    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketVO bucket = bucketDao.getByName(bucketName);
    if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   
    // Is the caller allowed to write the object? 
    // The allocObjectItem checks for the bucket policy PutObject permissions
    OrderedPair<SObjectVO, SObjectItemVO> object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, null);
    OrderedPair<SHostVO, String> host_storagelocation_pair = getBucketStorageHost(bucket);
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.exception.NoSuchObjectException

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.