Class ComPersistenceChannel.Abstract<C,D>
java.lang.Object
one.microstream.communication.types.ComPersistenceChannel.Abstract<C,D>
- All Implemented Interfaces:
WriteController
,ComPersistenceChannel<C,D>
,PersistenceChannel<D>
,PersistenceSource<D>
,PersistenceTarget<D>
,PersistenceWriteController
- Direct Known Subclasses:
ComPersistenceChannelBinary.Abstract
- Enclosing interface:
- ComPersistenceChannel<C,D>
public abstract static class ComPersistenceChannel.Abstract<C,D> extends Object implements ComPersistenceChannel<C,D>
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.communication.types.ComPersistenceChannel
ComPersistenceChannel.Abstract<C,D>
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceWriteController
PersistenceWriteController.Disabled, PersistenceWriteController.Enabled, PersistenceWriteController.Wrapper
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
closeChannel()
abstract void
closeSource()
Take actions to deactivate/close/destroy the source because it won't be read again.abstract void
closeTarget()
Take actions to deactivate/close/destroy the target because it won't be written to again.protected C
getConnection()
protected abstract XGettingCollection<? extends D>
internalRead(C connection)
protected abstract void
internalWrite(C channel, D data)
void
prepareChannel()
abstract void
prepareSource()
Prepare to read from this source.abstract void
prepareTarget()
Prepare to write to this target.XGettingCollection<? extends D>
read()
A general, unspecific read, e.g.XGettingCollection<? extends D>
readByObjectIds(PersistenceIdSet[] objectIds)
void
write(D data)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface one.microstream.persistence.types.PersistenceWriteController
isStoringEnabled, validateIsStoringEnabled
Methods inherited from interface one.microstream.afs.types.WriteController
isWritable, validateIsWritable
-
Constructor Details
-
Method Details
-
getConnection
-
internalRead
protected abstract XGettingCollection<? extends D> internalRead(C connection) throws PersistenceExceptionTransfer- Throws:
PersistenceExceptionTransfer
-
internalWrite
- Throws:
PersistenceExceptionTransfer
-
read
Description copied from interface:PersistenceSource
A general, unspecific read, e.g. to initially read data in general from the attached data source.Examples:
- simply ALL data from a plain file.
- only root nodes (and all recursively referenced nodes) of a graph-based database.
- nothing at all if not applicable, resulting in
null
being returned.
- Specified by:
read
in interfacePersistenceSource<C>
- Returns:
- data segments containing general data if applicable, otherwise
null
. - Throws:
PersistenceExceptionTransfer
-
write
- Specified by:
write
in interfacePersistenceTarget<C>
- Throws:
PersistenceExceptionTransfer
-
prepareChannel
public void prepareChannel()- Specified by:
prepareChannel
in interfacePersistenceChannel<C>
-
closeChannel
public void closeChannel()- Specified by:
closeChannel
in interfacePersistenceChannel<C>
-
prepareSource
public abstract void prepareSource()Description copied from interface:PersistenceSource
Prepare to read from this source. E.g. open a defined file.- Specified by:
prepareSource
in interfacePersistenceSource<C>
-
prepareTarget
public abstract void prepareTarget()Description copied from interface:PersistenceTarget
Prepare to write to this target. E.g. open a defined file.- Specified by:
prepareTarget
in interfacePersistenceTarget<C>
-
closeSource
public abstract void closeSource()Description copied from interface:PersistenceSource
Take actions to deactivate/close/destroy the source because it won't be read again.- Specified by:
closeSource
in interfacePersistenceSource<C>
-
closeTarget
public abstract void closeTarget()Description copied from interface:PersistenceTarget
Take actions to deactivate/close/destroy the target because it won't be written to again.- Specified by:
closeTarget
in interfacePersistenceTarget<C>
-
readByObjectIds
public XGettingCollection<? extends D> readByObjectIds(PersistenceIdSet[] objectIds) throws PersistenceExceptionTransfer- Specified by:
readByObjectIds
in interfacePersistenceSource<C>
- Throws:
PersistenceExceptionTransfer
-