Class ConsistencyChecker

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.transformation.ConsistencyChecker
All Implemented Interfaces:
Component, LogEnabled, Serviceable

Consistency checker component. Checks the state of the links extracted as outgoing references for a content.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • checkConsistency

      public ConsistencyChecker.CHECK checkConsistency(String referenceType, String referenceValue, String contentId, String dataPath, boolean shortTest)
      Check the consistency of a reference
      Parameters:
      referenceType - The type of the reference to test (can be 'attachment', 'explorer', 'metadata', '__external', etc...)
      referenceValue - The value of the reference to test
      contentId - The id of the content containing the reference
      dataPath - The path of the data containing the reference
      shortTest - true to make a short test, that means that long tests will return UNKNOWN immediately. If false, you will always have a SUCCESS or a FAILURE.
      Returns:
      CHECK enum value
    • getLabel

      public I18nizableText getLabel(String referenceType, String referenceValue, String contentId, String dataPath)
      Get the label of a reference.
      Parameters:
      referenceType - The type of the reference to test (can be 'attachment', 'explorer', 'metadata', '__external', etc...)
      referenceValue - The value of the reference to test
      contentId - The id of the content containing the reference
      dataPath - The path of the data containing the reference
      Returns:
      the element label.
    • _checkHTTPLink

      protected ConsistencyChecker.CHECK _checkHTTPLink(String linkValue, boolean shortTest)
      Test an http link
      Parameters:
      linkValue - The http url to test
      shortTest - true to make a short test (with short timeout)
      Returns:
      The state. UNKNOWN if test cannot be done fully