Interface HistoryDao

All Known Implementing Classes:
FileHistoryDao, JobConfigHistoryStrategy

public interface HistoryDao
Operations for historization of config files.
Author:
Mirko Friedenhagen
  • Method Details

    • saveNode

      void saveNode(Node node)
      Saves the current configuration of a node.
      Parameters:
      node - node
    • saveItem

      void saveItem(XmlFile file)
      Saves a copy of a xml file.
      Parameters:
      file - xmlFile
    • getRevisions

      SortedMap<String,HistoryDescr> getRevisions(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(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.
    • getRevisionAmount

      int getRevisionAmount(XmlFile xmlFile)
      Parameters:
      xmlFile - the config's history xml file
      Returns:
      the amount of revision entries of a certain config.
    • getOldRevision

      XmlFile getOldRevision(AbstractItem item, String identifier)
      Returns one old configuration of item.
      Parameters:
      item - project
      identifier - timestamp or hash
      Returns:
      old configuration.
    • getOldRevision

      XmlFile getOldRevision(Node node, String identifier)
      Returns one old configuration of node.
      Parameters:
      node - node
      identifier - timestamp or hash
      Returns:
      old configuration.
    • getOldRevision

      XmlFile getOldRevision(XmlFile xmlFile, String identifier)
      Returns one old configuration of xmlFile.
      Parameters:
      xmlFile - file
      identifier - timestamp or hash
      Returns:
      old configuration.
    • getOldRevision

      XmlFile getOldRevision(String configFileName, String identifier)
      Returns one old configuration of file.
      Parameters:
      configFileName - file
      identifier - timestamp or hash
      Returns:
      old configuration.
    • deleteRevision

      void deleteRevision(AbstractItem item, String identifier)
      Permanently delete the given revision.
      Parameters:
      item - item
      identifier - timestamp or hash
    • deleteRevision

      void deleteRevision(Node node, String identifier)
    • deleteRevision

      void deleteRevision(File historyDir, String identifier)
    • revisionEqualsCurrent

      boolean revisionEqualsCurrent(AbstractItem project, String identifier1)
    • revisionEqualsCurrent

      boolean revisionEqualsCurrent(Node node, String identifier1)
    • hasOldRevision

      boolean hasOldRevision(Node node, String identifier)
      Returns whether the revision exists.
      Parameters:
      node - node
      identifier - timestamp or hash
      Returns:
      old configuration.
    • hasOldRevision

      boolean hasOldRevision(XmlFile xmlFile, String identifier)
      Returns whether the revision exists.
      Parameters:
      xmlFile - file
      identifier - timestamp or hash
      Returns:
      old configuration.
    • hasDuplicateHistory

      boolean hasDuplicateHistory(Node node)
      Determines whether the given node has already been recorded in the history.
      Parameters:
      node - the node to check for duplicate history.
      Returns:
      true if the node is a duplicate, false otherwise.