org.jets3t.service.multi
Class StorageServiceEventAdaptor
java.lang.Object
org.jets3t.service.multi.StorageServiceEventAdaptor
- All Implemented Interfaces:
- StorageServiceEventListener
- Direct Known Subclasses:
- S3ServiceEventAdaptor
public class StorageServiceEventAdaptor
- extends Object
- implements StorageServiceEventListener
Simple implementation of StorageServiceEventListener to listen for events produced by
ThreadedStorageService.
By default this adaptor does nothing but store the first Error event it comes across, if any,
and make it available through getErrorThrown().
The behaviour of this class can be specialised by over-riding the appropriate
event methods, though always be sure to call the super
version of these methods if you are relying on the default error-trapping functions of this
class.
- Author:
- James Murty
StorageServiceEventAdaptor
public StorageServiceEventAdaptor()
event
public void event(ListObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(CreateObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(CopyObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(CreateBucketsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(DeleteObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(GetObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(GetObjectHeadsEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(LookupACLEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(UpdateACLEvent event)
- Specified by:
event in interface StorageServiceEventListener
event
public void event(DownloadObjectsEvent event)
- Specified by:
event in interface StorageServiceEventListener
wasErrorThrown
public boolean wasErrorThrown()
- Returns:
- true if an event has resulted in an exception.
getErrorThrown
public Throwable getErrorThrown()
- Returns:
- the first error thrown by an event, or null if no error has been thrown.
throwErrorIfPresent
public void throwErrorIfPresent()
throws Exception
- Throws:
Exception - throws first error thrown by an event, or does nothing if no error occurred.