org.caleigo.core.service
Class TextFileDataService

java.lang.Object
  extended byorg.caleigo.core.AbstractDataService
      extended byorg.caleigo.core.service.MemoryDataService
          extended byorg.caleigo.core.service.TextFileDataService
All Implemented Interfaces:
IDataService, IDistributable, ISecureService, IService, java.io.Serializable

public class TextFileDataService
extends MemoryDataService

TextFileDataService provides a simple extension of the MemoryDataService that stores the data entities in text files in a database file-catalog. Note that the class is not suitable to store sensitive data. The class does not verify foreign keys and should only be used for temporary storage and/or for test or demonstration purposes.

Version:
1.00
Author:
Dennis Zikovic
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.caleigo.core.service.MemoryDataService
MemoryDataService.DataTransaction, MemoryDataService.DefaultSelectionHolder, MemoryDataService.ISelectionHolder
 
Nested classes inherited from class org.caleigo.core.AbstractDataService
AbstractDataService.AbstractDataTransaction
 
Field Summary
 
Fields inherited from class org.caleigo.core.service.MemoryDataService
mTableSelectionMap
 
Fields inherited from class org.caleigo.core.AbstractDataService
DEFAULT_TIMEOUT
 
Constructor Summary
TextFileDataService(IDataSourceDescriptor dataSourceDescriptor, java.lang.Object serviceIdentity, java.lang.String dbDirectoryPath)
           
TextFileDataService(IDataSourceDescriptor dataSourceDescriptor, java.lang.String dbDirectoryPath)
           
 
Method Summary
 java.io.File getDirectoryFile()
           
 int getFieldSeparator()
           
 int getRecordSeparator()
           
 int getStringDelimiter()
           
protected  ISelection loadTableSelection(IEntityDescriptor entityDescriptor)
          This method can be overriden to provide a simple persistent storage for the MemoryDataService.
 boolean ping()
          Should return true if the service is online and reponding to calls.
 void setFieldSeparator(int character)
           
 void setRecordSeparator(int character)
           
 void setStringDelimiter(int character)
           
protected  void storeTableSelection(ISelection dbSelection)
          This method can be overriden to provide a simple persistent storage for the MemoryDataService.
 
Methods inherited from class org.caleigo.core.service.MemoryDataService
backupTo, backupTo, copyDataSource, createSelectionHolder, executeDelete, executeInsert, executeLoad, executeQuery, executeUpdate, finalize, getTableSelection, isAutGenerateEnabled, isSyncronized, markTableAsChanged, newTransaction, restoreFrom, restoreFrom, restoreFromURL, restoreFromURL, setAutGenerateEnabled, setSyncronized, syncronize
 
Methods inherited from class org.caleigo.core.AbstractDataService
checkEntityAsDeletable, checkEntityAsStorable, delete, finalizeService, getCustomProxyService, getDataSourceDescriptor, getServiceIdentity, getServiceInterface, getServiceInterfaceClass, getServiceType, getTimeout, hasCustomProxyService, initializeService, isValidating, load, loadSelection, loadSelection, refresh, setEntityData, setTimeout, setValidating, store
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFileDataService

public TextFileDataService(IDataSourceDescriptor dataSourceDescriptor,
                           java.lang.String dbDirectoryPath)

TextFileDataService

public TextFileDataService(IDataSourceDescriptor dataSourceDescriptor,
                           java.lang.Object serviceIdentity,
                           java.lang.String dbDirectoryPath)
Method Detail

ping

public boolean ping()
Description copied from class: AbstractDataService
Should return true if the service is online and reponding to calls. Note that initializeService() must be called prior to this method.

Specified by:
ping in interface IService
Overrides:
ping in class MemoryDataService

loadTableSelection

protected ISelection loadTableSelection(IEntityDescriptor entityDescriptor)
Description copied from class: MemoryDataService
This method can be overriden to provide a simple persistent storage for the MemoryDataService. The method is called prior to any access of addressed table.

Overrides:
loadTableSelection in class MemoryDataService

storeTableSelection

protected void storeTableSelection(ISelection dbSelection)
Description copied from class: MemoryDataService
This method can be overriden to provide a simple persistent storage for the MemoryDataService. The method is called to store changes when neaded.

Overrides:
storeTableSelection in class MemoryDataService

getFieldSeparator

public int getFieldSeparator()

setFieldSeparator

public void setFieldSeparator(int character)

getRecordSeparator

public int getRecordSeparator()

setRecordSeparator

public void setRecordSeparator(int character)

getStringDelimiter

public int getStringDelimiter()

setStringDelimiter

public void setStringDelimiter(int character)

getDirectoryFile

public java.io.File getDirectoryFile()


Copyright © 2005 Caleigo. All Rights Reserved.