Package com.adaptris.aws.s3
Class S3BucketList
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.aws.s3.S3BucketList
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,DynamicPollingTemplate.TemplateProvider
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="List contents of an S3 bucket as part of a polling-trigger", since="3.9.2", tag="aws,s3,polling") public class S3BucketList extends ServiceImp implements DynamicPollingTemplate.TemplateProvider, ConnectedService
Query a S3 Location for a list of blobs stored there.Under the covers it re-uses
S3Service
with aListOperation
and does a full lifecycle on the underlying service each time it is triggered. This is intended for use as part of aDynamicPollingTemplate
; as a result keys are not intended to be resolved using the%message
expression language; they will, however, be passed as-is into the underlying service (which may still resolve them).In the adapter configuration file this class is aliased as s3-bucket-list which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description S3BucketList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
void
doService(AdaptrisMessage msg)
@NonNull java.lang.String
getBucket()
The S3 bucket to connect to.AdaptrisConnection
getConnection()
RemoteBlobFilter
getFilter()
Specify any additional filtering you wish to perform on the list.java.lang.Integer
getMaxKeys()
Specify max number of keys to be returned.BlobListRenderer
getOutputStyle()
java.lang.String
getPrefix()
The prefix to use when issuing the listOperationprotected void
initService()
void
prepare()
void
setBucket(@NonNull java.lang.String bucket)
The S3 bucket to connect to.void
setConnection(AdaptrisConnection connection)
void
setFilter(RemoteBlobFilter filter)
Specify any additional filtering you wish to perform on the list.void
setMaxKeys(java.lang.Integer maxKeys)
Specify max number of keys to be returned.void
setOutputStyle(BlobListRenderer outputStyle)
void
setPrefix(java.lang.String prefix)
The prefix to use when issuing the listOperationS3BucketList
withBucket(java.lang.String bucket)
S3BucketList
withConnection(AdaptrisConnection c)
S3BucketList
withFilter(RemoteBlobFilter f)
S3BucketList
withMaxKeys(java.lang.Integer maxKeys)
S3BucketList
withOutputStyle(BlobListRenderer outputStyle)
S3BucketList
withPrefix(java.lang.String key)
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
-
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Method Detail
-
prepare
public void prepare() throws CoreException
- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
- Specified by:
doService
in interfaceService
- Throws:
ServiceException
-
withConnection
public S3BucketList withConnection(AdaptrisConnection c)
-
withPrefix
public S3BucketList withPrefix(java.lang.String key)
-
withBucket
public S3BucketList withBucket(java.lang.String bucket)
-
withFilter
public S3BucketList withFilter(RemoteBlobFilter f)
-
withMaxKeys
public S3BucketList withMaxKeys(java.lang.Integer maxKeys)
-
withOutputStyle
public S3BucketList withOutputStyle(BlobListRenderer outputStyle)
-
setConnection
public void setConnection(AdaptrisConnection connection)
- Specified by:
setConnection
in interfaceConnectedService
-
getConnection
public AdaptrisConnection getConnection()
- Specified by:
getConnection
in interfaceConnectedService
-
setOutputStyle
public void setOutputStyle(BlobListRenderer outputStyle)
-
getOutputStyle
public BlobListRenderer getOutputStyle()
-
setBucket
public void setBucket(@NonNull @NonNull java.lang.String bucket)
The S3 bucket to connect to.
-
getBucket
@NonNull public @NonNull java.lang.String getBucket()
The S3 bucket to connect to.
-
setPrefix
public void setPrefix(java.lang.String prefix)
The prefix to use when issuing the listOperation
-
getPrefix
public java.lang.String getPrefix()
The prefix to use when issuing the listOperation
-
getFilter
public RemoteBlobFilter getFilter()
Specify any additional filtering you wish to perform on the list.
-
setFilter
public void setFilter(RemoteBlobFilter filter)
Specify any additional filtering you wish to perform on the list.
-
getMaxKeys
public java.lang.Integer getMaxKeys()
Specify max number of keys to be returned.
-
setMaxKeys
public void setMaxKeys(java.lang.Integer maxKeys)
Specify max number of keys to be returned.
-
-