org.jenkinsci.plugins.periodicbackup
Class PeriodicBackupLink

java.lang.Object
  extended by hudson.model.ManagementLink
      extended by org.jenkinsci.plugins.periodicbackup.PeriodicBackupLink
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Action, hudson.model.Describable<PeriodicBackupLink>, hudson.model.ModelObject, hudson.model.Saveable

@Extension
public class PeriodicBackupLink
extends hudson.model.ManagementLink
implements hudson.model.Describable<PeriodicBackupLink>, hudson.model.Saveable

Main class of the plugin This plugin is based on and inspired by the backup plugin developed by: Vincent Sellier, Manufacture Fran�aise des Pneumatiques Michelin, Romain Seguy and the PXE plugin developed by: Kohsuke Kawaguchi


Nested Class Summary
static class PeriodicBackupLink.DescriptorImpl
          Descriptor is only used for UI form bindings
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.ManagementLink
LIST
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
PeriodicBackupLink()
           
 
Method Summary
 void doBackup(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
           
 void doRestore(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, int backupHash)
          Performing restore when triggered form restore web page, backupHash of selected backup is passed to determine which backup in this location should be chosen
static PeriodicBackupLink get()
           
protected  hudson.XmlFile getConfigXml()
           
 java.lang.String getCron()
           
 int getCycleDays()
           
 int getCycleQuantity()
           
 java.lang.String getDescription()
           
 PeriodicBackupLink.DescriptorImpl getDescriptor()
           
 java.lang.String getDisplayName()
           
 java.util.Collection<FileManagerDescriptor> getFileManagerDescriptors()
           
 FileManager getFileManagerPlugin()
           
 java.lang.String getIconFileName()
           
 java.util.Collection<LocationDescriptor> getLocationDescriptors()
           
 hudson.util.DescribableList<Location,LocationDescriptor> getLocations()
           
 java.lang.String getMessage()
           
 java.lang.String getRootDirectory()
           
 java.util.Collection<StorageDescriptor> getStorageDescriptors()
           
 hudson.util.DescribableList<Storage,StorageDescriptor> getStorages()
           
 java.lang.String getTempDirectory()
           
 java.lang.String getUrlName()
           
 boolean isBackupNow()
           
protected  void load()
           
 void save()
           
 void setBackupNow(boolean backupNow)
           
 void setCron(java.lang.String cron)
           
 void setCycleDays(int cycleDays)
           
 void setCycleQuantity(int cycleQuantity)
           
 void setFileManagerPlugin(FileManager fileManagerPlugin)
           
 void setMessage(java.lang.String message)
           
 void setTempDirectory(java.lang.String tempDirectory)
           
 
Methods inherited from class hudson.model.ManagementLink
all
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeriodicBackupLink

public PeriodicBackupLink()
                   throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getTempDirectory

public java.lang.String getTempDirectory()

setTempDirectory

public void setTempDirectory(java.lang.String tempDirectory)

getCron

public java.lang.String getCron()

setCron

public void setCron(java.lang.String cron)

isBackupNow

public boolean isBackupNow()

setBackupNow

public void setBackupNow(boolean backupNow)

getCycleQuantity

public int getCycleQuantity()

setCycleQuantity

public void setCycleQuantity(int cycleQuantity)

getCycleDays

public int getCycleDays()

setCycleDays

public void setCycleDays(int cycleDays)

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

doBackup

public void doBackup(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp)
              throws java.lang.Exception
Throws:
java.lang.Exception

doRestore

public void doRestore(org.kohsuke.stapler.StaplerRequest req,
                      org.kohsuke.stapler.StaplerResponse rsp,
                      @QueryParameter(value="backupHash")
                      int backupHash)
               throws java.io.IOException,
                      org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Performing restore when triggered form restore web page, backupHash of selected backup is passed to determine which backup in this location should be chosen

Parameters:
req - StaplerRequest
rsp - StaplerResponse
backupHash - hash code of the selected BackupObject set to be restored
Throws:
java.io.IOException - If an IO problem occurs
PeriodicBackupException - If other problem occurs

getUrlName

public java.lang.String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action
Specified by:
getUrlName in class hudson.model.ManagementLink

getIconFileName

public java.lang.String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action
Specified by:
getIconFileName in class hudson.model.ManagementLink

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class hudson.model.ManagementLink

load

protected void load()
             throws java.io.IOException
Throws:
java.io.IOException

save

public void save()
          throws java.io.IOException
Specified by:
save in interface hudson.model.Saveable
Throws:
java.io.IOException

getConfigXml

protected hudson.XmlFile getConfigXml()

getRootDirectory

public java.lang.String getRootDirectory()

doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws javax.servlet.ServletException,
                           java.io.IOException,
                           java.lang.ClassNotFoundException
Throws:
javax.servlet.ServletException
java.io.IOException
java.lang.ClassNotFoundException

getDescriptor

public PeriodicBackupLink.DescriptorImpl getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<PeriodicBackupLink>

getFileManagerDescriptors

public java.util.Collection<FileManagerDescriptor> getFileManagerDescriptors()

getStorageDescriptors

public java.util.Collection<StorageDescriptor> getStorageDescriptors()

getLocationDescriptors

public java.util.Collection<LocationDescriptor> getLocationDescriptors()

getFileManagerPlugin

public FileManager getFileManagerPlugin()

setFileManagerPlugin

public void setFileManagerPlugin(FileManager fileManagerPlugin)

getStorages

public hudson.util.DescribableList<Storage,StorageDescriptor> getStorages()

getLocations

public hudson.util.DescribableList<Location,LocationDescriptor> getLocations()

get

public static PeriodicBackupLink get()

getMessage

public java.lang.String getMessage()

setMessage

public void setMessage(java.lang.String message)


Copyright © 2004-2013. All Rights Reserved.