org.jenkinsci.plugins.periodicbackup
Class Location

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by org.jenkinsci.plugins.periodicbackup.Location
All Implemented Interfaces:
hudson.model.Describable<Location>, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem
Direct Known Subclasses:
LocalDirectory

public abstract class Location
extends hudson.model.AbstractModelObject
implements hudson.model.Describable<Location>

Location determines where to store backup files and is responsible for accessing the backup files once stored


Field Summary
 boolean enabled
           
 
Constructor Summary
Location(boolean enabled)
           
 
Method Summary
static hudson.DescriptorExtensionList<Location,LocationDescriptor> all()
          This will allow to retrieve the list of plugins at runtime
abstract  void deleteBackupFiles(BackupObject backupObject)
          This method deletes all files related to given BackupObject
abstract  java.lang.Iterable<BackupObject> getAvailableBackups()
          This method returns Iterable of BackupObject(s) in this location
 LocationDescriptor getDescriptor()
           
 java.lang.String getSearchUrl()
           
abstract  java.lang.Iterable<java.io.File> retrieveBackupFromLocation(BackupObject backup, java.io.File tempDir)
          Retrieves backup archive files from this location
abstract  void storeBackupInLocation(java.lang.Iterable<java.io.File> archives, java.io.File backupObjectFile)
          This method puts archived backup file(s) in location
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.model.ModelObject
getDisplayName
 

Field Detail

enabled

public final boolean enabled
Constructor Detail

Location

public Location(boolean enabled)
Method Detail

getAvailableBackups

public abstract java.lang.Iterable<BackupObject> getAvailableBackups()
This method returns Iterable of BackupObject(s) in this location

Returns:
BackupObject(s) in location

storeBackupInLocation

public abstract void storeBackupInLocation(java.lang.Iterable<java.io.File> archives,
                                           java.io.File backupObjectFile)
                                    throws java.io.IOException
This method puts archived backup file(s) in location

Parameters:
archives - archive file(s)
backupObjectFile - File with serialized backupObject
Throws:
java.io.IOException - IO error

retrieveBackupFromLocation

public abstract java.lang.Iterable<java.io.File> retrieveBackupFromLocation(BackupObject backup,
                                                                            java.io.File tempDir)
                                                                     throws java.io.IOException,
                                                                            org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Retrieves backup archive files from this location

Parameters:
backup - BackupObject related to the backup
tempDir - temporary directory to store archived backup file(s)
Returns:
Iterable of backup archive(s) in temporary location
Throws:
java.io.IOException - if anything goes wrong with IO
PeriodicBackupException - if anything else goes wrong

deleteBackupFiles

public abstract void deleteBackupFiles(BackupObject backupObject)
This method deletes all files related to given BackupObject

Parameters:
backupObject - the backupObject of the backup we want to delete

all

public static hudson.DescriptorExtensionList<Location,LocationDescriptor> all()
This will allow to retrieve the list of plugins at runtime

Returns:
Collection of FileManager Descriptors

getDescriptor

public LocationDescriptor getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<Location>

getSearchUrl

public java.lang.String getSearchUrl()
Specified by:
getSearchUrl in interface hudson.search.SearchItem


Copyright © 2004-2013. All Rights Reserved.