org.exoplatform.services.jcr.aws.storage.value.s3
Class S3IOChannel

java.lang.Object
  extended by org.exoplatform.services.jcr.aws.storage.value.s3.S3IOChannel
All Implemented Interfaces:
ValueIOChannel
Direct Known Subclasses:
SimpleS3IOChannel

public abstract class S3IOChannel
extends java.lang.Object
implements ValueIOChannel


Field Summary
protected  java.lang.String awsAccessKey
          AWS access key id.
protected  java.lang.String awsSecretAccessKey
          AWS access secret key.
protected  java.lang.String bucket
          Bucket name.
protected  FileCleaner cleaner
           
protected static org.apache.commons.logging.Log log
           
protected  java.io.File s3SwapDirectory
           
protected  java.lang.String storageId
           
 
Constructor Summary
S3IOChannel(java.lang.String bucket, java.lang.String awsAccessKey, java.lang.String awsSecretAccessKey, java.io.File s3SwapDirectory, FileCleaner cleaner, java.lang.String storageId)
          New S3 channel
 
Method Summary
 void close()
           
 boolean delete(java.lang.String propertyId)
           
protected abstract  java.lang.String getFile(java.lang.String propertyId, int orderNumber)
          creates file name by propertyId and order number
protected abstract  java.lang.String[] getFiles(java.lang.String propertyId)
          creates file names list by propertyId
 java.lang.String getStorageId()
           
 ValueData read(java.lang.String propertyId, int orderNumber, int maxBufferSize)
           
 void write(java.lang.String propertyId, ValueData value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

bucket

protected final java.lang.String bucket
Bucket name. See amazon S3 wikipedia


awsAccessKey

protected final java.lang.String awsAccessKey
AWS access key id. See amazon S3 wikipedia


awsSecretAccessKey

protected final java.lang.String awsSecretAccessKey
AWS access secret key. See amazon S3 wikipedia


s3SwapDirectory

protected final java.io.File s3SwapDirectory

cleaner

protected final FileCleaner cleaner

storageId

protected final java.lang.String storageId
Constructor Detail

S3IOChannel

public S3IOChannel(java.lang.String bucket,
                   java.lang.String awsAccessKey,
                   java.lang.String awsSecretAccessKey,
                   java.io.File s3SwapDirectory,
                   FileCleaner cleaner,
                   java.lang.String storageId)
New S3 channel

Parameters:
bucket - the Bucket name
aws_access_key - the S3 access key
aws_secret_access_key - the S3 access secretkey
cleaner - file cleanre
Method Detail

delete

public boolean delete(java.lang.String propertyId)
               throws java.io.IOException
Specified by:
delete in interface ValueIOChannel
Throws:
java.io.IOException

close

public void close()
Specified by:
close in interface ValueIOChannel

read

public ValueData read(java.lang.String propertyId,
                      int orderNumber,
                      int maxBufferSize)
               throws java.io.IOException
Specified by:
read in interface ValueIOChannel
Throws:
java.io.IOException

write

public void write(java.lang.String propertyId,
                  ValueData value)
           throws java.io.IOException
Specified by:
write in interface ValueIOChannel
Throws:
java.io.IOException

getFile

protected abstract java.lang.String getFile(java.lang.String propertyId,
                                            int orderNumber)
creates file name by propertyId and order number

Parameters:
propertyId -
orderNumber -
Returns:
file name

getFiles

protected abstract java.lang.String[] getFiles(java.lang.String propertyId)
creates file names list by propertyId

Parameters:
propertyId -
Returns:
array of file names

getStorageId

public java.lang.String getStorageId()
Specified by:
getStorageId in interface ValueIOChannel


Copyright © 2012 eXo Platform SAS. All Rights Reserved.