public class FileHistoryDao extends Object implements HistoryDao, ItemListenerHistoryDao, OverviewHistoryDao, NodeListenerHistoryDao
JobConfigHistoryJobListener and
JobConfigHistorySaveableListener.| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
createNewItem(hudson.model.Item item)
Adds and saves the initial configuration of an item.
|
void |
createNewNode(hudson.model.Node node)
Adds and saves the initial configuration of a node.
|
void |
deleteItem(hudson.model.Item item)
Deletes the history of an item.
|
void |
deleteNode(hudson.model.Node node)
Deletes the history of an node.
|
File[] |
getDeletedJobs(String folderName)
Returns a list of deleted jobs with a history.
|
File[] |
getDeletedNodes(String folderName)
Returns a list of deleted nodes with a history.
|
SortedMap<String,HistoryDescr> |
getJobHistory(String jobName)
Returns a sorted map of all HistoryDescr for a given job.
|
File[] |
getJobs(String folderName)
Returns a list of jobs with a history.
|
SortedMap<String,HistoryDescr> |
getNodeHistory(String nodeName)
Returns a sorted map of all HistoryDescr for a given node.
|
File[] |
getNodes(String folderName)
Returns a list of nodes with a history.
|
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.
|
File[] |
getSystemConfigs()
Returns a list of all system configuration files with a history.
|
SortedMap<String,HistoryDescr> |
getSystemHistory(String name)
Returns a sorted map of all HistoryDescr for a given system configuration.
|
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 |
renameItem(hudson.model.Item item,
String oldName,
String newName)
Save and renames the item.
|
void |
renameNode(hudson.model.Node node,
String oldName,
String newName)
Save and renames the node.
|
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.
|
public void createNewItem(hudson.model.Item item)
ItemListenerHistoryDaocreateNewItem in interface ItemListenerHistoryDaoitem - projectpublic void saveItem(hudson.model.AbstractItem item)
HistoryDaosaveItem in interface HistoryDaoitem - projectpublic void saveItem(hudson.XmlFile file)
HistoryDaosaveItem in interface HistoryDaofile - xmlFilepublic void deleteItem(hudson.model.Item item)
ItemListenerHistoryDaodeleteItem in interface ItemListenerHistoryDaoitem - projectpublic void renameItem(hudson.model.Item item,
String oldName,
String newName)
ItemListenerHistoryDaorenameItem in interface ItemListenerHistoryDaoitem - projectoldName - old project namenewName - new namepublic SortedMap<String,HistoryDescr> getRevisions(hudson.XmlFile xmlFile)
HistoryDaoHistoryDao.getOldRevision(hudson.model.AbstractItem, java.lang.String)getRevisions in interface HistoryDaoxmlFile - filepublic SortedMap<String,HistoryDescr> getRevisions(File configFile)
HistoryDaoHistoryDao.getOldRevision(hudson.model.AbstractItem, java.lang.String)getRevisions in interface HistoryDaoconfigFile - filepublic hudson.XmlFile getOldRevision(hudson.model.AbstractItem item,
String identifier)
HistoryDaogetOldRevision in interface HistoryDaoitem - projectidentifier - timestamp or hashpublic hudson.XmlFile getOldRevision(hudson.XmlFile xmlFile,
String identifier)
HistoryDaogetOldRevision in interface HistoryDaoxmlFile - fileidentifier - timestamp or hashpublic hudson.XmlFile getOldRevision(File configFile, String identifier)
HistoryDaogetOldRevision in interface HistoryDaoconfigFile - fileidentifier - timestamp or hashpublic hudson.XmlFile getOldRevision(String configFileName, String identifier)
HistoryDaogetOldRevision in interface HistoryDaoconfigFileName - fileidentifier - timestamp or hashpublic boolean hasOldRevision(hudson.model.AbstractItem item,
String identifier)
HistoryDaohasOldRevision in interface HistoryDaoitem - projectidentifier - timestamp or hashpublic boolean hasOldRevision(hudson.XmlFile xmlFile,
String identifier)
HistoryDaohasOldRevision in interface HistoryDaoxmlFile - fileidentifier - timestamp or hashpublic boolean hasOldRevision(File configFile, String identifier)
HistoryDaohasOldRevision in interface HistoryDaoconfigFile - fileidentifier - timestamp or hashpublic void purgeOldEntries(File itemHistoryRoot, int maxEntries)
HistoryDaopurgeOldEntries in interface HistoryDaoitemHistoryRoot - directory to inspect.maxEntries - maximum number of entries.public boolean isCreatedEntry(File historyDir)
HistoryDaoisCreatedEntry in interface HistoryDaohistoryDir - The directory, e.g. 2013-01-18_17-33-51public File[] getDeletedJobs(String folderName)
OverviewHistoryDaogetDeletedJobs in interface OverviewHistoryDaofolderName - name of folder.public File[] getJobs(String folderName)
OverviewHistoryDaogetJobs in interface OverviewHistoryDaofolderName - name of folderpublic File[] getSystemConfigs()
OverviewHistoryDaogetSystemConfigs in interface OverviewHistoryDaopublic SortedMap<String,HistoryDescr> getJobHistory(String jobName)
OverviewHistoryDaogetJobHistory in interface OverviewHistoryDaojobName - of the jobpublic SortedMap<String,HistoryDescr> getSystemHistory(String name)
OverviewHistoryDaogetSystemHistory in interface OverviewHistoryDaoname - of the configurationpublic void copyHistoryAndDelete(String oldName, String newName)
HistoryDaocopyHistoryAndDelete in interface HistoryDaooldName - The old name of the project (containing "_deleted_")newName - The new name of the projectpublic void createNewNode(hudson.model.Node node)
NodeListenerHistoryDaocreateNewNode in interface NodeListenerHistoryDaonode - nodepublic void deleteNode(hudson.model.Node node)
NodeListenerHistoryDaodeleteNode in interface NodeListenerHistoryDaonode - nodepublic void renameNode(hudson.model.Node node,
String oldName,
String newName)
NodeListenerHistoryDaorenameNode in interface NodeListenerHistoryDaonode - nodeoldName - old node namenewName - new namepublic SortedMap<String,HistoryDescr> getRevisions(hudson.model.Node node)
HistoryDaoHistoryDao.getOldRevision(hudson.model.Node, java.lang.String)getRevisions in interface HistoryDaonode - nodepublic void copyNodeHistoryAndDelete(String oldName, String newName)
HistoryDaocopyNodeHistoryAndDelete in interface HistoryDaooldName - The old name of the node (containing "_deleted_")newName - The new name of the nodepublic void saveNode(hudson.model.Node node)
HistoryDaosaveNode in interface HistoryDaonode - nodepublic hudson.XmlFile getOldRevision(hudson.model.Node node,
String identifier)
HistoryDaogetOldRevision in interface HistoryDaonode - nodeidentifier - timestamp or hashpublic boolean hasOldRevision(hudson.model.Node node,
String identifier)
HistoryDaohasOldRevision in interface HistoryDaonode - nodeidentifier - timestamp or hashpublic File[] getDeletedNodes(String folderName)
OverviewHistoryDaogetDeletedNodes in interface OverviewHistoryDaofolderName - name of folder.public File[] getNodes(String folderName)
OverviewHistoryDaogetNodes in interface OverviewHistoryDaofolderName - name of folderpublic SortedMap<String,HistoryDescr> getNodeHistory(String nodeName)
OverviewHistoryDaogetNodeHistory in interface OverviewHistoryDaonodeName - of the nodeCopyright © 2004–2014. All rights reserved.