Package com.cloud.bridge.service.core.s3

Examples of com.cloud.bridge.service.core.s3.S3BucketPolicy


        request.setAttribute(S3Constants.PLAIN_POST_SIGNATURE, signatureString);

        // -> authenticated calls
        try {
            // S3AuthParams params = extractRequestHeaders( request );
            S3AuthParams params = new S3AuthParams();
            HeaderParam headerParam1 = new HeaderParam("accessKey", accessKeyString);
            params.addHeader(headerParam1);
            HeaderParam headerParam2 = new HeaderParam("secretKey", signatureString);
            params.addHeader(headerParam2);
            authenticateRequest( request, params );
        }
        catch (Exception e)
        { logger.warn("Authentication details insufficient"); }
View Full Code Here


     *         even if it is set at null.
     */
    public OrderedPair<S3BucketPolicy,Integer> getBucketPolicy(String bucketName) {

        if (policyMap.containsKey( bucketName )) {
            S3BucketPolicy policy = policyMap.get( bucketName );
            return new OrderedPair<S3BucketPolicy,Integer>( policy, 0 );
        }
        else return new OrderedPair<S3BucketPolicy,Integer>( null, -1 );           // For case (1) where the map has no entry for bucketName
    }
View Full Code Here

        Transaction txn = Transaction.open(Transaction.AWSAPI_DB);
        // [B] Place the policy into the database over writting an existing policy
        try {
            // -> first make sure that the policy is valid by parsing it
            PolicyParser parser = new PolicyParser();
            S3BucketPolicy sbp = parser.parse( policy, bucketName );
            bPolicyDao.deletePolicy(bucketName);

            if (null != policy && !policy.isEmpty()) {
                BucketPolicyVO bpolicy = new BucketPolicyVO(bucketName, client, policy);
                bpolicy = bPolicyDao.persist(bpolicy);
View Full Code Here

  };         

 
  public S3BucketPolicy parse( String policy, String bucketName ) throws ParseException, PermissionDeniedException
 
    bucketPolicy = new S3BucketPolicy();
    bucketPolicy.setBucketName( bucketName );
      jparser.parse(policy, myHandler);
      return bucketPolicy;
  }
View Full Code Here

        TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.AWSAPI_DB);
        // [B] Place the policy into the database over writting an existing policy
        try {
            // -> first make sure that the policy is valid by parsing it
            PolicyParser parser = new PolicyParser();
            S3BucketPolicy sbp = parser.parse(policy, bucketName);
            bPolicyDao.deletePolicy(bucketName);

            if (null != policy && !policy.isEmpty()) {
                BucketPolicyVO bpolicy = new BucketPolicyVO(bucketName, client, policy);
                bpolicy = bPolicyDao.persist(bpolicy);
View Full Code Here

     *         even if it is set at null.
     */
    public OrderedPair<S3BucketPolicy, Integer> getBucketPolicy(String bucketName) {

        if (policyMap.containsKey(bucketName)) {
            S3BucketPolicy policy = policyMap.get(bucketName);
            return new OrderedPair<S3BucketPolicy, Integer>(policy, 0);
        } else
            return new OrderedPair<S3BucketPolicy, Integer>(null, -1);           // For case (1) where the map has no entry for bucketName
    }
View Full Code Here

            return true;
        }
    };

    public S3BucketPolicy parse(String policy, String bucketName) throws ParseException, PermissionDeniedException {
        bucketPolicy = new S3BucketPolicy();
        bucketPolicy.setBucketName(bucketName);
        jparser.parse(policy, myHandler);
        return bucketPolicy;
    }
View Full Code Here

   *         even if its set at null.
   */
  public Tuple<S3BucketPolicy,Integer> getBucketPolicy(String bucketName) {

    if (policyMap.containsKey( bucketName )) {
      S3BucketPolicy policy = policyMap.get( bucketName );
      return new Tuple<S3BucketPolicy,Integer>( policy, 0 );
    }
    else return new Tuple<S3BucketPolicy,Integer>( null, -1 );
  }
View Full Code Here

  };         

 
  public S3BucketPolicy parse( String policy, String bucketName ) throws ParseException, PermissionDeniedException
 
    bucketPolicy = new S3BucketPolicy();
    bucketPolicy.setBucketName( bucketName );
      jparser.parse(policy, myHandler);
      return bucketPolicy;
  }
View Full Code Here

     
      // [B] Place the policy into the database over writting an existing policy
      try {
        // -> first make sure that the policy is valid by parsing it
           PolicyParser parser = new PolicyParser();
        S3BucketPolicy sbp = parser.parse( policy, bucketName );

          policyDao.deletePolicy( bucketName );
          if (null != policy && !policy.isEmpty()) policyDao.addPolicy( bucketName, client, policy );
                 
        if (null != sbp) ServiceProvider.getInstance().setBucketPolicy( bucketName, sbp );
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.core.s3.S3BucketPolicy

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.