com.binaryfantasy.murq.source.io
Interface ISourceIO

All Known Implementing Classes:
XStreamSourceIO

public interface ISourceIO

Implementors translate IContent objects to and from streams in an ISource.

Author:
Bill Weiss
See Also:
ISource

Method Summary
 IContent get(SourceKey key)
          Returns the IContent object associated with the specified key, or null if none is found.
 MurqSource getMurqSource()
          Returns the MurqSource this instance is handling IO for.
 void init(MurqSource src)
          First call made after instantiation allowing for any setup that my be needed.
 void put(IContent content)
          Writes the provided content.
 boolean remove(SourceKey key)
          Returns true if the content associated with the specified key is removed, false if the key is not found.
 

Method Detail

init

void init(MurqSource src)
          throws IOException
First call made after instantiation allowing for any setup that my be needed.

Parameters:
src - the
Throws:
IOException - if there is a problem during initialization.
IllegalStateException - if called more than once.
IllegalArgumentException - if source is null.

getMurqSource

MurqSource getMurqSource()
Returns the MurqSource this instance is handling IO for.

Returns:
the MurqSource this instance is handling IO for.

put

void put(IContent content)
         throws IOException
Writes the provided content.

Parameters:
content - the content to be persisted.
Throws:
IOException - if an error is encountered during persistance.
IllegalStateException - if init has not been called yet.
IllegalArgumentException - if content is null.

get

IContent get(SourceKey key)
             throws IOException
Returns the IContent object associated with the specified key, or null if none is found.

Parameters:
key - the unique identifier associated with the content.
Returns:
the IContent object associated with the specified key, or null if none is found.
Throws:
IOException - if an error is encountered while retrieving the content.
IllegalStateException - if init has not been called yet.
IllegalArgumentException - if key is null.

remove

boolean remove(SourceKey key)
               throws IOException
Returns true if the content associated with the specified key is removed, false if the key is not found.

Parameters:
key - key for the content to be removed.
Returns:
true if the specified content is removed, false if the content is not found.
Throws:
IOException - if an error is encountered during removal.
IllegalStateException - if init has not been called yet.
IllegalArgumentException - if key is null.


Copyright (c) 2000-2006, BinaryFantasy.com