org.bibalex.daf.retrievalplugins
Class DriveRetrieval

java.lang.Object
  extended by org.bibalex.daf.retrievalplugins.DriveRetrieval
All Implemented Interfaces:
IRetrievalPlugin

public class DriveRetrieval
extends java.lang.Object
implements IRetrievalPlugin

Copyright (c) 2006-2007 by Bibliotheca Alexandrina This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. This class implements the IRetrievalPlugin interface in a way that it retrieves file from drive

Author:
Niveen.Nagy

Field Summary
private  java.io.File drive
           
private  boolean retrievalCancelled
           
 
Constructor Summary
DriveRetrieval()
           
 
Method Summary
 java.lang.String[] getMediaTypes()
          This method is called to get the available media types for this plugin, it retrievs them from the resource file
 java.lang.String getPlugInName()
          Gets the name of the Plug-In.
 boolean initialize()
          This method launches the dialog needed to choose the drive to retrieve from
 boolean retrieveJob(Job job, int version, java.lang.String mediaBarcode, BackupInfoDef backupInfo, RetrievalEventNotifier notifier)
          When implemented i a class it retrieves the job from the suitable media
private  void setDrive(java.io.File drive)
          sets the drive file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drive

private java.io.File drive

retrievalCancelled

private boolean retrievalCancelled
Constructor Detail

DriveRetrieval

public DriveRetrieval()
Method Detail

getPlugInName

public java.lang.String getPlugInName()
Description copied from interface: IRetrievalPlugin
Gets the name of the Plug-In.

Specified by:
getPlugInName in interface IRetrievalPlugin
Returns:
Name of the plugIn

initialize

public boolean initialize()
This method launches the dialog needed to choose the drive to retrieve from

Specified by:
initialize in interface IRetrievalPlugin
Returns:
True if the initialize is performed correctly, false otherwise

setDrive

private void setDrive(java.io.File drive)
sets the drive file

Parameters:
drive -

getMediaTypes

public java.lang.String[] getMediaTypes()
This method is called to get the available media types for this plugin, it retrievs them from the resource file

Returns:
array of string of available media types for this plugin

retrieveJob

public boolean retrieveJob(Job job,
                           int version,
                           java.lang.String mediaBarcode,
                           BackupInfoDef backupInfo,
                           RetrievalEventNotifier notifier)
When implemented i a class it retrieves the job from the suitable media

Specified by:
retrieveJob in interface IRetrievalPlugin
Parameters:
job - The Job object to retrieve for.
version - The version to retrieve.
mediaBarcode - The mediaBarcode, in this case it is empty string
backupInfo - The backupInfo, to know from the 'BackupAs' whether this is an old system or new system data retrieval.
notifier - This obfect is used to notify the observers for the GUI
Returns:
True if the retrieve sucsseeded otherwise false.