org.aludratest.service.separatedfile
Interface SeparatedFileInteraction

All Superinterfaces:
Action, Interaction
All Known Implementing Classes:
DefaultSeparatedFileAction

public interface SeparatedFileInteraction
extends Interaction

Interaction interface of the SeparatedFileService.

Author:
Volker Bergmann

Method Summary
 void closeReader(Object readerId)
          Closes the reader.
 void closeWriter(Object writerId)
          Closes the writer.
 Object createReader(String filePath, Class<? extends SeparatedFileBeanData> beanClass, char separator)
          Creates a reader for reading JavaBeans.
 Object createWriter(String filePath, boolean overwrite, Class<? extends SeparatedFileBeanData> beanClass, char separator, String header)
          Creates a writer for persisting SeparatedFileBeans or JavaBean data structures.
 void delete(String filePath)
          Deletes a file.
 String readHeader(Object readerId)
          Reads a header line from a separated file.
 SeparatedFileBeanData readRow(Object readerId)
          Reads a separated file row and provides it as Java object.
 void waitUntilExists(String elementType, String filePath)
          Polls the file system until a file at the given path is found or a timeout occurs.
 void waitUntilNotExists(String filePath)
          Polls the file system until no file is found at the given path.
 void writeRow(SeparatedFileBeanData bean, Object writerId)
          Writes an object as separated file row.
 
Methods inherited from interface org.aludratest.service.Action
createAttachments, createDebugAttachments, setSystemConnector
 

Method Detail

waitUntilExists

void waitUntilExists(String elementType,
                     String filePath)
Polls the file system until a file at the given path is found or a timeout occurs.

Parameters:
elementType -
filePath - the full path of the requested file

waitUntilNotExists

void waitUntilNotExists(String filePath)
Polls the file system until no file is found at the given path.

Parameters:
filePath -

delete

void delete(String filePath)
Deletes a file.

Parameters:
filePath - the path of the file to delete

createWriter

Object createWriter(String filePath,
                    boolean overwrite,
                    Class<? extends SeparatedFileBeanData> beanClass,
                    char separator,
                    String header)
Creates a writer for persisting SeparatedFileBeans or JavaBean data structures.

Parameters:
filePath - the path of the file to write
overwrite - flag that indicates whether pre-existing files may be overwritten
beanClass - the type of the bean Objects to write
separator - the separator character to use
header -
Returns:
the id of the created writer

writeRow

void writeRow(SeparatedFileBeanData bean,
              Object writerId)
Writes an object as separated file row.

Parameters:
bean - a SeparatedFileBean to write
writerId - the id of the writer

closeWriter

void closeWriter(Object writerId)
Closes the writer.

Parameters:
writerId - the id of the writer

createReader

Object createReader(String filePath,
                    Class<? extends SeparatedFileBeanData> beanClass,
                    char separator)
Creates a reader for reading JavaBeans.

Parameters:
filePath - the path of the file to read
beanClass - the type of the bean Objects to write
separator - the separator character to use
Returns:
the id of the created reader

readHeader

String readHeader(Object readerId)
Reads a header line from a separated file.

Parameters:
readerId -
Returns:
the content of the header

readRow

SeparatedFileBeanData readRow(Object readerId)
Reads a separated file row and provides it as Java object.

Parameters:
readerId - the id of the reader
Returns:
a SeparatedFileBean holding the content of the parsed separated file row

closeReader

void closeReader(Object readerId)
Closes the reader.

Parameters:
readerId - the id of the reader


Copyright © 2015 aludratest.org. All rights reserved.