com.binaryfantasy.murq.source.io
Class XStreamSourceIO

java.lang.Object
  extended by com.binaryfantasy.murq.source.io.XStreamSourceIO
All Implemented Interfaces:
ISourceIO

public final class XStreamSourceIO
extends Object
implements ISourceIO

Translates IContent objects to and from streams in an ISource using XStream.

Author:
Bill Weiss

Constructor Summary
XStreamSourceIO()
          Constructs a new XStreamSourceIO to handle IContent object translation using XStream encoding.
 
Method Summary
 void close()
           
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XStreamSourceIO

public XStreamSourceIO()
                throws IOException
Constructs a new XStreamSourceIO to handle IContent object translation using XStream encoding.

Throws:
IOException
Method Detail

getMurqSource

public MurqSource getMurqSource()
Description copied from interface: ISourceIO
Returns the MurqSource this instance is handling IO for.

Specified by:
getMurqSource in interface ISourceIO
Returns:
the MurqSource this instance is handling IO for.

init

public void init(MurqSource src)
          throws IOException
Description copied from interface: ISourceIO
First call made after instantiation allowing for any setup that my be needed.

Specified by:
init in interface ISourceIO
Parameters:
src - the
Throws:
IOException - if there is a problem during initialization.

close

public void close()
           throws IOException
Throws:
IOException

remove

public boolean remove(SourceKey key)
               throws IOException
Description copied from interface: ISourceIO
Returns true if the content associated with the specified key is removed, false if the key is not found.

Specified by:
remove in interface ISourceIO
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.

put

public void put(IContent content)
         throws IOException
Description copied from interface: ISourceIO
Writes the provided content.

Specified by:
put in interface ISourceIO
Parameters:
content - the content to be persisted.
Throws:
IOException - if an error is encountered during persistance.

get

public IContent get(SourceKey key)
             throws IOException
Description copied from interface: ISourceIO
Returns the IContent object associated with the specified key, or null if none is found.

Specified by:
get in interface ISourceIO
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.

toString

public String toString()
Overrides:
toString in class Object


Copyright (c) 2000-2006, BinaryFantasy.com