public interface DirectDataSource
setupTransactionOutput(OutputTransactionContext).
setupAttemptOutput(OutputAttemptContext).
openOutput(OutputAttemptContext, DataDefinition, String, String, Counter).
commitAttemptOutput(OutputAttemptContext).
cleanupAttemptOutput(OutputAttemptContext).
commitTransactionOutput(OutputTransactionContext).
cleanupTransactionOutput(OutputTransactionContext).
AbstractDirectDataSource| Modifier and Type | Method and Description |
|---|---|
void |
cleanupAttemptOutput(OutputAttemptContext context)
Cleanup output on the attempt.
|
void |
cleanupTransactionOutput(OutputTransactionContext context)
Cleanup output on the transaction.
|
void |
commitAttemptOutput(OutputAttemptContext context)
Commits output on the attempt.
|
void |
commitTransactionOutput(OutputTransactionContext context)
Commits output on the transaction.
|
boolean |
delete(String basePath,
ResourcePattern resourcePattern,
boolean recursive,
Counter counter)
Deletes resources.
|
<T> List<DirectInputFragment> |
findInputFragments(DataDefinition<T> definition,
String basePath,
ResourcePattern resourcePattern)
Collects input fragments about target resources.
|
default <T> Optional<T> |
findProperty(Class<T> propertyType)
Returns the property of this data source.
|
List<ResourceInfo> |
list(String basePath,
ResourcePattern resourcePattern,
Counter counter)
List resources.
|
<T> ModelInput<T> |
openInput(DataDefinition<T> definition,
DirectInputFragment fragment,
Counter counter)
Opens a fragment for input.
|
<T> ModelOutput<T> |
openOutput(OutputAttemptContext context,
DataDefinition<T> definition,
String basePath,
String resourcePath,
Counter counter)
Opens a resource for output.
|
String |
path(String basePath)
Returns a textually representation of the target path.
|
String |
path(String basePath,
ResourcePattern resourcePattern)
Returns a textually representation of the target path pattern.
|
void |
setupAttemptOutput(OutputAttemptContext context)
Prepares output area for the attempt.
|
void |
setupTransactionOutput(OutputTransactionContext context)
Prepares output area for the transaction.
|
String path(String basePath)
basePath - base path of target resourcesIllegalArgumentException - if some parameters were nullString path(String basePath, ResourcePattern resourcePattern)
basePath - base path of target resourcesresourcePattern - search pattern of target resources from basePathIllegalArgumentException - if some parameters were null<T> List<DirectInputFragment> findInputFragments(DataDefinition<T> definition, String basePath, ResourcePattern resourcePattern) throws IOException, InterruptedException
T - target data typedefinition - the data definitionbasePath - base path of target resourcesresourcePattern - search pattern of target resources from basePathIOException - if failed to find resources by I/O errorInterruptedException - if interrupted while finding fragmentsIllegalArgumentException - if some parameters were null<T> ModelInput<T> openInput(DataDefinition<T> definition, DirectInputFragment fragment, Counter counter) throws IOException, InterruptedException
T - target data typedefinition - the data definitionfragment - target fragmentcounter - counter objectModelInput to obtain contents in the fragmentIOException - if failed to open the fragment by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were null<T> ModelOutput<T> openOutput(OutputAttemptContext context, DataDefinition<T> definition, String basePath, String resourcePath, Counter counter) throws IOException, InterruptedException
T - target data typecontext - current output attempt contextdefinition - the data definitionbasePath - base path of target resourceresourcePath - target resource path from basePathcounter - counter objectModelOutput to put contents to the resourceIOException - if failed to open the resource by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullList<ResourceInfo> list(String basePath, ResourcePattern resourcePattern, Counter counter) throws IOException, InterruptedException
basePath - base path of target resourcesresourcePattern - search pattern of target resources from basePathcounter - the resource counterIOException - if failed to list resources by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullboolean delete(String basePath, ResourcePattern resourcePattern, boolean recursive, Counter counter) throws IOException, InterruptedException
basePath - base path of target resourcesresourcePattern - search pattern of target resources from basePathrecursive - also deletes containers and thier components recursively
(only if this datasource supports containers)counter - the resource countertrue if successfully deleted, otherwise falseIOException - if failed to delete resources by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid setupAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context - current attempt contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid commitAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context - current attempt contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid cleanupAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context - current attempt contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid setupTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context - current transaction contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid commitTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context - current transaction contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullvoid cleanupTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context - current transaction contextIOException - if failed by I/O errorInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.