Package org.infinispan.loader.s3

Examples of org.infinispan.loader.s3.S3ConnectionException


                properties.put("jclouds.aws.accesskeyid", config.getAwsAccessKey());
            if (!properties.containsKey("jclouds.aws.secretaccesskey"))
                properties.put("jclouds.aws.secretaccesskey", config.getAwsSecretKey());
            this.s3Service = S3ConnectionFactory.getConnection(properties, new S3HttpNioConnectionPoolClientModule());
            if (this.s3Service == null) {
                throw new S3ConnectionException("Could not connect");
            }

        } catch (Exception ex) {
            throw convertToS3ConnectionException("Exception connecting to s3", ex);
        }
View Full Code Here


        }
    }

    S3ConnectionException convertToS3ConnectionException(String message, Exception caught) {
        return (caught instanceof S3ConnectionException) ? (S3ConnectionException) caught :
                new S3ConnectionException(message, caught);
    }
View Full Code Here

            for (String key : keySet()) {
                deletes.add(connection.getConnection().deleteObject(rootS3Bucket, key));
            }
            for (Future<Boolean> delete : deletes) {
                if (!delete.get())
                    throw new S3ConnectionException("could not delete entry");
            }
        } catch (Exception ex) {
            throw connection.convertToS3ConnectionException("Exception clearing store", ex);
        }
    }
View Full Code Here

     */
    public void insert(Bucket b) throws S3ConnectionException {
        try {
            if (b.getEntries().isEmpty()) {
                if (!connection.getConnection().deleteObject(rootS3Bucket, b.getBucketName()).get())
                    throw new S3ConnectionException(String.format("Could not delete object [%2s] in s3bucket [%1s] ", rootS3Bucket.getName(), b.getBucketName()));
            } else {
                S3Object s3Object = new S3Object();
                s3Object.setKey(b.getBucketName());
                s3Object.setContent(connection.marshaller.objectToByteBuffer(b));
                s3Object.setContentType("application/octet-string");
View Full Code Here

    protected final void safeClose(InputStream stream) throws S3ConnectionException {
        if (stream == null) return;
        try {
            stream.close();
        } catch (Exception e) {
            throw new S3ConnectionException("Problems closing input stream", e);
        }
    }
View Full Code Here

         Module loggingModule = org.infinispan.util.logging.LogFactory.IS_LOG4J_AVAILABLE ? new Log4JLoggingModule()
               : new JDKLoggingModule();
         this.context = S3ContextFactory.createContext(config.getAwsAccessKey(),config.getAwsSecretKey()).withModules(new HttpNioConnectionPoolClientModule(), loggingModule).build();
         this.s3Service = context.getConnection();
         if (this.s3Service == null) {
            throw new S3ConnectionException("Could not connect");
         }

      } catch (Exception ex) {
         throw convertToS3ConnectionException("Exception connecting to s3",
                                              ex);
View Full Code Here

   }

   S3ConnectionException convertToS3ConnectionException(String message,
                                                        Exception caught) {
      return (caught instanceof S3ConnectionException) ? (S3ConnectionException) caught
            : new S3ConnectionException(message, caught);
   }
View Full Code Here

               : new JDKLoggingModule();
         this.context = S3ContextFactory.createS3Context(properties,
                                                         new HttpNioConnectionPoolClientModule(), loggingModule);
         this.s3Service = context.getConnection();
         if (this.s3Service == null) {
            throw new S3ConnectionException("Could not connect");
         }

      } catch (Exception ex) {
         throw convertToS3ConnectionException("Exception connecting to s3",
                                              ex);
View Full Code Here

   }

   S3ConnectionException convertToS3ConnectionException(String message,
                                                        Exception caught) {
      return (caught instanceof S3ConnectionException) ? (S3ConnectionException) caught
            : new S3ConnectionException(message, caught);
   }
View Full Code Here

      if (stream == null)
         return;
      try {
         stream.close();
      } catch (Exception e) {
         throw new S3ConnectionException("Problems closing input stream", e);
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.loader.s3.S3ConnectionException

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.