hudson.plugins.jobConfigHistory
Interface HistoryDao

All Known Implementing Classes:
FileHistoryDao

public interface HistoryDao

Operations for historization of config files.

Author:
Mirko Friedenhagen

Method Summary
 void copyHistoryAndDelete(String oldName, String newName)
          Copies the history files of a restored project from the old location (_deleted_) to a directory with the new name and deletes the old entries.
 void copyNodeHistoryAndDelete(String oldName, String newName)
          Copies the history files of a restored node from the old location (_deleted_) to a directory with the new name and deletes the old entries.
 hudson.XmlFile getOldRevision(hudson.model.AbstractItem item, String identifier)
          Returns one old configuration of item.
 hudson.XmlFile getOldRevision(File configFile, String identifier)
          Returns one old configuration of file.
 hudson.XmlFile getOldRevision(hudson.model.Node node, String identifier)
          Returns one old configuration of node.
 hudson.XmlFile getOldRevision(String configFileName, String identifier)
          Returns one old configuration of file.
 hudson.XmlFile getOldRevision(hudson.XmlFile xmlFile, String identifier)
          Returns one old configuration of xmlFile.
 SortedMap<String,HistoryDescr> getRevisions(File configFile)
          Returns a sorted map of all revisions for this configFile.
 SortedMap<String,HistoryDescr> getRevisions(hudson.model.Node node)
          Returns a sorted map of all revisions for this node.
 SortedMap<String,HistoryDescr> getRevisions(hudson.XmlFile xmlFile)
          Returns a sorted map of all revisions for this xmlFile.
 boolean hasOldRevision(hudson.model.AbstractItem item, String identifier)
          Returns whether the revision exists.
 boolean hasOldRevision(File configFile, String identifier)
          Returns whether the revision exists.
 boolean hasOldRevision(hudson.model.Node node, String identifier)
          Returns whether the revision exists.
 boolean hasOldRevision(hudson.XmlFile xmlFile, String identifier)
          Returns whether the revision exists.
 boolean isCreatedEntry(File historyDir)
          Checks whether the respective history entry is a 'Created' entry.
 void purgeOldEntries(File itemHistoryRoot, int maxEntries)
          Purges old entries for the given history root to maxEntries.
 void saveItem(hudson.model.AbstractItem item)
          Saves the current configuration of an item.
 void saveItem(hudson.XmlFile file)
          Saves a copy of an xml file.
 void saveNode(hudson.model.Node node)
          Saves the current configuration of an node.
 

Method Detail

saveItem

void saveItem(hudson.model.AbstractItem item)
Saves the current configuration of an item.

Parameters:
item - project

saveNode

void saveNode(hudson.model.Node node)
Saves the current configuration of an node.

Parameters:
node - node

saveItem

void saveItem(hudson.XmlFile file)
Saves a copy of an xml file.

Parameters:
file - xmlFile

getRevisions

SortedMap<String,HistoryDescr> getRevisions(hudson.XmlFile xmlFile)
Returns a sorted map of all revisions for this xmlFile. The key is an identifier which may be used in getOldRevision(hudson.model.AbstractItem, java.lang.String)

Parameters:
xmlFile - file
Returns:
old revisions mapped to the identifier.

getRevisions

SortedMap<String,HistoryDescr> getRevisions(File configFile)
Returns a sorted map of all revisions for this configFile. The key is an identifier which may be used in getOldRevision(hudson.model.AbstractItem, java.lang.String)

Parameters:
configFile - file
Returns:
old revisions mapped to the identifier.

getRevisions

SortedMap<String,HistoryDescr> getRevisions(hudson.model.Node node)
Returns a sorted map of all revisions for this node. The key is an identifier which may be used in getOldRevision(hudson.model.Node, java.lang.String)

Parameters:
node - node
Returns:
old revisions mapped to the identifier.

getOldRevision

hudson.XmlFile getOldRevision(hudson.model.AbstractItem item,
                              String identifier)
Returns one old configuration of item.

Parameters:
item - project
identifier - timestamp or hash
Returns:
old configuration.

getOldRevision

hudson.XmlFile getOldRevision(hudson.model.Node node,
                              String identifier)
Returns one old configuration of node.

Parameters:
node - node
identifier - timestamp or hash
Returns:
old configuration.

getOldRevision

hudson.XmlFile getOldRevision(hudson.XmlFile xmlFile,
                              String identifier)
Returns one old configuration of xmlFile.

Parameters:
xmlFile - file
identifier - timestamp or hash
Returns:
old configuration.

getOldRevision

hudson.XmlFile getOldRevision(File configFile,
                              String identifier)
Returns one old configuration of file.

Parameters:
configFile - file
identifier - timestamp or hash
Returns:
old configuration.

getOldRevision

hudson.XmlFile getOldRevision(String configFileName,
                              String identifier)
Returns one old configuration of file.

Parameters:
configFileName - file
identifier - timestamp or hash
Returns:
old configuration.

hasOldRevision

boolean hasOldRevision(hudson.model.AbstractItem item,
                       String identifier)
Returns whether the revision exists.

Parameters:
item - project
identifier - timestamp or hash
Returns:
old configuration.

hasOldRevision

boolean hasOldRevision(hudson.model.Node node,
                       String identifier)
Returns whether the revision exists.

Parameters:
node - node
identifier - timestamp or hash
Returns:
old configuration.

hasOldRevision

boolean hasOldRevision(hudson.XmlFile xmlFile,
                       String identifier)
Returns whether the revision exists.

Parameters:
xmlFile - file
identifier - timestamp or hash
Returns:
old configuration.

hasOldRevision

boolean hasOldRevision(File configFile,
                       String identifier)
Returns whether the revision exists.

Parameters:
configFile - file
identifier - timestamp or hash
Returns:
old configuration.

purgeOldEntries

void purgeOldEntries(File itemHistoryRoot,
                     int maxEntries)
Purges old entries for the given history root to maxEntries.

Parameters:
itemHistoryRoot - directory to inspect.
maxEntries - maximum number of entries.

isCreatedEntry

boolean isCreatedEntry(File historyDir)
Checks whether the respective history entry is a 'Created' entry.

Parameters:
historyDir - The directory, e.g. 2013-01-18_17-33-51
Returns:
True if the directory contains a 'Created' entry.

copyHistoryAndDelete

void copyHistoryAndDelete(String oldName,
                          String newName)
Copies the history files of a restored project from the old location (_deleted_) to a directory with the new name and deletes the old entries.

Parameters:
oldName - The old name of the project (containing "_deleted_")
newName - The new name of the project

copyNodeHistoryAndDelete

void copyNodeHistoryAndDelete(String oldName,
                              String newName)
Copies the history files of a restored node from the old location (_deleted_) to a directory with the new name and deletes the old entries.

Parameters:
oldName - The old name of the node (containing "_deleted_")
newName - The new name of the node


Copyright © 2004–2014. All rights reserved.