Class PeriodicBackupLink
- java.lang.Object
-
- hudson.model.ManagementLink
-
- 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
Nested Classes Modifier and Type Class Description static class
PeriodicBackupLink.DescriptorImpl
Descriptor is only used for UI form bindings
-
Constructor Summary
Constructors Constructor Description PeriodicBackupLink()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 chosenstatic PeriodicBackupLink
get()
protected hudson.XmlFile
getConfigXml()
String
getCron()
int
getCycleDays()
int
getCycleQuantity()
String
getDescription()
PeriodicBackupLink.DescriptorImpl
getDescriptor()
String
getDisplayName()
Collection<FileManagerDescriptor>
getFileManagerDescriptors()
FileManager
getFileManagerPlugin()
String
getIconFileName()
Collection<LocationDescriptor>
getLocationDescriptors()
hudson.util.DescribableList<Location,LocationDescriptor>
getLocations()
String
getMessage()
String
getRootDirectory()
Collection<StorageDescriptor>
getStorageDescriptors()
hudson.util.DescribableList<Storage,StorageDescriptor>
getStorages()
String
getTempDirectory()
String
getUrlName()
boolean
isBackupNow()
protected void
load()
void
save()
void
setBackupNow(boolean backupNow)
void
setCron(String cron)
void
setCycleDays(int cycleDays)
void
setCycleQuantity(int cycleQuantity)
void
setFileManagerPlugin(FileManager fileManagerPlugin)
void
setMessage(String message)
void
setTempDirectory(String tempDirectory)
-
-
-
Constructor Detail
-
PeriodicBackupLink
public PeriodicBackupLink() throws IOException
- Throws:
IOException
-
-
Method Detail
-
getTempDirectory
public String getTempDirectory()
-
setTempDirectory
public void setTempDirectory(String tempDirectory)
-
getCron
public String getCron()
-
setCron
public void setCron(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 String getDisplayName()
- Specified by:
getDisplayName
in interfacehudson.model.Action
- Specified by:
getDisplayName
in interfacehudson.model.ModelObject
-
doBackup
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("1.4") public void doBackup(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws Exception
- Throws:
Exception
-
doRestore
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("1.4") public void doRestore(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter("backupHash") int backupHash) throws 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
- StaplerRequestrsp
- StaplerResponsebackupHash
- hash code of the selected BackupObject set to be restored- Throws:
IOException
- If an IO problem occursorg.jenkinsci.plugins.periodicbackup.PeriodicBackupException
- If other problem occurs
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfacehudson.model.Action
- Specified by:
getUrlName
in classhudson.model.ManagementLink
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfacehudson.model.Action
- Specified by:
getIconFileName
in classhudson.model.ManagementLink
-
getDescription
public String getDescription()
- Overrides:
getDescription
in classhudson.model.ManagementLink
-
load
protected void load() throws IOException
- Throws:
IOException
-
save
public void save() throws IOException
- Specified by:
save
in interfacehudson.model.Saveable
- Throws:
IOException
-
getConfigXml
protected hudson.XmlFile getConfigXml()
-
getRootDirectory
public String getRootDirectory()
-
doConfigSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("1.4") public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws javax.servlet.ServletException, IOException, ClassNotFoundException
- Throws:
javax.servlet.ServletException
IOException
ClassNotFoundException
-
getDescriptor
public PeriodicBackupLink.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfacehudson.model.Describable<PeriodicBackupLink>
-
getFileManagerDescriptors
public Collection<FileManagerDescriptor> getFileManagerDescriptors()
-
getStorageDescriptors
public Collection<StorageDescriptor> getStorageDescriptors()
-
getLocationDescriptors
public 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 String getMessage()
-
setMessage
public void setMessage(String message)
-
-