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 null
String path(String basePath, ResourcePattern resourcePattern)
basePath
- base path of target resourcesresourcePattern
- search pattern of target resources from basePath
IllegalArgumentException
- 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 basePath
IOException
- 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 basePath
counter
- counter objectModelOutput
to put contents to the resourceIOException
- if failed to open the resource by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
List<ResourceInfo> list(String basePath, ResourcePattern resourcePattern, Counter counter) throws IOException, InterruptedException
basePath
- base path of target resourcesresourcePattern
- search pattern of target resources from basePath
counter
- the resource counterIOException
- if failed to list resources by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
boolean delete(String basePath, ResourcePattern resourcePattern, boolean recursive, Counter counter) throws IOException, InterruptedException
basePath
- base path of target resourcesresourcePattern
- search pattern of target resources from basePath
recursive
- also deletes containers and thier components recursively
(only if this datasource supports containers)counter
- the resource countertrue
if successfully deleted, otherwise false
IOException
- if failed to delete resources by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void setupAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context
- current attempt contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void commitAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context
- current attempt contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void cleanupAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException
context
- current attempt contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void setupTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context
- current transaction contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void commitTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context
- current transaction contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
void cleanupTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException
context
- current transaction contextIOException
- if failed by I/O errorInterruptedException
- if interruptedIllegalArgumentException
- if some parameters were null
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.