org.infinispan.loaders.s3.jclouds
Class JCloudsBucket

java.lang.Object
  extended by org.infinispan.loaders.s3.jclouds.JCloudsBucket
All Implemented Interfaces:
S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>

public class JCloudsBucket
extends Object
implements S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>

A JClouds implementation of S3Bucket.

Tuning and configuration parameters can be overridden by creating jclouds.properties and adding it to your classpath.

Since:
4.0
Author:
Adrian Cole

Constructor Summary
JCloudsBucket()
           
 
Method Summary
 void clear()
          removes all Infinispan buckets from the S3 bucket
 Bucket get(String key)
          
 String getName()
           
 void init(JCloudsConnection connection, org.jclouds.aws.s3.domain.S3Bucket bucket)
          Creates a connection to S3, and associates this object with an S3Bucket.
 void insert(Bucket b)
          Adds the Infinispan bucket into the S3 Bucket at location Bucket.getBucketName()
 Set<String> keySet()
          
 void remove(String key)
          Removes the Infinispan bucket from the S3 Bucket at location key
protected  void safeClose(InputStream stream)
           
 Set<Bucket> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCloudsBucket

public JCloudsBucket()
Method Detail

init

public void init(JCloudsConnection connection,
                 org.jclouds.aws.s3.domain.S3Bucket bucket)
Description copied from interface: S3Bucket
Creates a connection to S3, and associates this object with an S3Bucket.

Specified by:
init in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Parameters:
connection - - third-party connection to S3
bucket - - third-party representation of an S3 Bucket

getName

public String getName()
Specified by:
getName in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Returns:
name of the S3Bucket data will be stored in

get

public Bucket get(String key)
           throws S3ConnectionException

Specified by:
get in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Parameters:
key - - location in the S3Bucket where we can find the infinispan Bucket
Returns:
Infinispan bucket associated with the key
Throws:
S3ConnectionException

remove

public void remove(String key)
            throws S3ConnectionException
Removes the Infinispan bucket from the S3 Bucket at location key

Specified by:
remove in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Parameters:
key - what to remove from S3
Throws:
S3ConnectionException

keySet

public Set<String> keySet()
                   throws S3ConnectionException

Specified by:
keySet in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Returns:
names all infinispan buckets stored in this S3 Bucket
Throws:
S3ConnectionException

values

public Set<Bucket> values()
                   throws S3ConnectionException
Specified by:
values in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Returns:
all infinispan buckets stored in this S3 Bucket
Throws:
S3ConnectionException

clear

public void clear()
           throws S3ConnectionException
removes all Infinispan buckets from the S3 bucket

Specified by:
clear in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Throws:
S3ConnectionException

insert

public void insert(Bucket b)
            throws S3ConnectionException
Adds the Infinispan bucket into the S3 Bucket at location Bucket.getBucketName()

Specified by:
insert in interface S3Bucket<org.jclouds.aws.s3.domain.S3Bucket,JCloudsConnection>
Parameters:
b - what to persist into S3
Throws:
S3ConnectionException

safeClose

protected final void safeClose(InputStream stream)
                        throws S3ConnectionException
Throws:
S3ConnectionException

Google Analytics

Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.