cbr.service
Class LocalStoreDelegate

java.lang.Object
  extended bycbr.service.LocalStoreDelegate
All Implemented Interfaces:
StoreDelegate

public class LocalStoreDelegate
extends Object
implements StoreDelegate

This delegate handles thumbnails on behalf of the PicsStore. It cuts thumbnails out of the picture entries when entries are inserted into an index, and pastes them back in when entries are retrieved. Additionally, a delegate can be instructed to delete thumbnails e. g. when entries are deleted from an index.

Version:
"$Id: LocalStoreDelegate.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Field Summary
private  PicsSource pics_
          The PicsSource from which thumbnails are retrieved.
 
Constructor Summary
LocalStoreDelegate(PicsSource pics)
          Creates an instance that assumes that thumbnails are already available locally.
 
Method Summary
 void cut(PictureEntry entry)
          Deletes the thumbnail from the given entry.
 void delete(PictureEntry entry)
          Does nothing.
 void paste(PictureEntry entry)
          Retrieves the thumbnail with the name found in the given entry from the PicsSource of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pics_

private PicsSource pics_
The PicsSource from which thumbnails are retrieved.

Constructor Detail

LocalStoreDelegate

public LocalStoreDelegate(PicsSource pics)
Creates an instance that assumes that thumbnails are already available locally. Thumbnails are simply erased from picture entries. They are restored later by calling the given PicsSource.

Parameters:
pics - The PicsSource from which the thumbnails are retrieved.
Method Detail

cut

public void cut(PictureEntry entry)
         throws IOException
Deletes the thumbnail from the given entry. The thumbnail is recreated later by means of a PicsSource.

Specified by:
cut in interface StoreDelegate
Parameters:
entry - The entry from which the thumbnail is removed and stored away.
Throws:
IOException - if an I/O error occurs.

paste

public void paste(PictureEntry entry)
           throws IOException
Retrieves the thumbnail with the name found in the given entry from the PicsSource of this instance.

Specified by:
paste in interface StoreDelegate
Parameters:
entry - The picture entry whose thumbnail shall be restored.
Throws:
IOException - if an I/O error occurs.

delete

public void delete(PictureEntry entry)
Does nothing.

Specified by:
delete in interface StoreDelegate
Parameters:
entry - The picture entry whose thumbnail shall be deleted.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.