Interface CollectorMBean

All Superinterfaces:
SelfEmailingMBean

public interface CollectorMBean extends SelfEmailingMBean
A MBean interface that specifies the contract for how a plugin collects its targeted data during plugin execution. Most plugins can make use of AbstractPlugin.java default implementation of this MBean interface to collect the plugin data. Primarily used by the System Configuration Collector and JMX consoles through the Customer Support MBeans as a way to gather plugin data.

Supported API: true

Extendable: true
  • Method Details

    • collectData

      @MBeanOperationImpact(1) Map<String,Object> collectData(String srcPath, long callNumber, String pluginType, String pathTimeStamp)
      Collect the data and store it on the file system. Simplified version of other collectData methods that ignores date range and does not compress the collected data output. The result Map <String, Object> should have four key entries, one for each String, "success", "path", "message", "location". Each of these keys values must be another String that corresponds to the appropriate value for the key. The "success" keys value should be true or false and is the value that states whether the collection framework was successful in collecting the plugin data or not. The "path" keys value is generated by the collection framework and it denotes the last directory in the canonical path for which the plugin data is collected to for the particular server the plugin executed on. The "message" keys value is a String message that might accompany the plugin generated by the collection framework. This is likely a status message of why a plugin failed. The value null should be used if no message is to be reported. The "location" keys value is a String representing a partial path to where the collection framework collects the plugin data.

      Supported API: true
      Parameters:
      srcPath - The path to where the data is collected
      callNumber - The identifier to be used as the collection destination directory
      pluginType - The type of plugin being executed
      pathTimeStamp - A timestamp to use for uniqueness for this collection
      Returns:
      Map containing the collection result information.
    • collectData

      @MBeanOperationImpact(1) Map<String,Object> collectData(String srcPath, String topicIdentifier, String pluginType, String pathTimeStamp)
      Collect the data and store it on the file system. Simplified version of other collectData methods that ignores date range and does not compress the collected data output. The result Map <String, Object> should have four key entries, one for each String, "success", "path", "message", "location". Each of these keys values must be another String that corresponds to the appropriate value for the key. The "success" keys value should be true or false and is the value that states whether the collection framework was successful in collecting the plugin data or not. The "path" keys value is generated by the collection framework and it denotes the last directory in the canonical path for which the plugin data is collected to for the particular server the plugin executed on. The "message" keys value is a String message that might accompany the plugin generated by the collection framework. This is likely a status message of why a plugin failed. The value null should be used if no message is to be reported. The "location" keys value is a String representing a partial path to where the collection framework collects the plugin data.

      Supported API: true
      Parameters:
      srcPath - The path to where the data is collected
      topicIdentifier - The identifier to be used as the collection destination directory
      pluginType - The type of plugin
      pathTimeStamp - A timestamp to use for uniqueness for this collection
      Returns:
      Map containing the collection result information.
    • collectData

      @MBeanOperationImpact(1) Map<String,Object> collectData(String srcPath, long callNumber, long maxAgeInDays, long minAgeInDays, boolean isDateRangeUsed, String pluginType, String pathTimeStamp, boolean compressOutput)
      Collect the data and store it on the file system. The result Map <String, Object> should have four key entries, one for each String, "success", "path", "message", "location". Each of these keys values must be another String that corresponds to the appropriate value for the key. The "success" keys value should be true or false and is the value that states whether the collection framework was successful in collecting the plugin data or not. The "path" keys value is generated by the collection framework and it denotes the last directory in the canonical path for which the plugin data is collected to for the particular server the plugin executed on. The "message" keys value is a String message that might accompany the plugin generated by the collection framework. This is likely a status message of why a plugin failed. The value null should be used if no message is to be reported. The "location" keys value is a String representing a partial path to where the collection framework collects the plugin data.

      Supported API: true
      Parameters:
      srcPath - The path to where the data is collected
      callNumber - The identifier to be used as the collection destination directory
      maxAgeInDays - The maximum date as an integer to gather logs for. 0 represents today.
      minAgeInDays - The minimum date as an integer to gather logs for. 0 represents today.
      isDateRangeUsed - Whether the maxAgeInDays and minAgeInDays is used.
      pluginType - The type of plugin
      pathTimeStamp - A timestamp to use for uniqueness for this collection
      compressOutput - Should the output be compressed
      Returns:
      Map containing the collection result information.
    • collectData

      @MBeanOperationImpact(1) Map<String,Object> collectData(String srcPath, String topicIdentifier, long maxAgeInDays, long minAgeInDays, boolean isDateRangeUsed, String pluginType, String pathTimeStamp, boolean compressOutput)
      Collect the data and store it The result Map <String, Object> should have four key entries, one for each String, "success", "path", "message", "location". Each of these keys values must be another String that corresponds to the appropriate value for the key. The "success" keys value should be true or false and is the value that states whether the collection framework was successful in collecting the plugin data or not. The "path" keys value is generated by the collection framework and it denotes the last directory in the canonical path for which the plugin data is collected to for the particular server the plugin executed on. The "message" keys value is a String message that might accompany the plugin generated by the collection framework. This is likely a status message of why a plugin failed. The value null should be used if no message is to be reported. The "location" keys value is a String representing a partial path to where the collection framework collects the plugin data.

      Supported API: true
      Parameters:
      srcPath - The path to where the data is collected
      topicIdentifier - The identifier to be used as the collection destination directory
      maxAgeInDays - The maximum date as an integer to gather logs for. 0 represents today.
      minAgeInDays - The minimum date as an integer to gather logs for. 0 represents today.
      isDateRangeUsed - Whether the maxAgeInDays and minAgeInDays is used.
      pluginType - The type of plugin
      pathTimeStamp - A timestamp to use for uniqueness for this collection
      compressOutput - Should the output be compressed
      Returns:
      Map containing the collection result information.
    • getValidPluginTypes

      @MBeanOperationImpact(0) List<String> getValidPluginTypes()
      List of valid plugin types.

      Supported API: true
      Returns:
      A collection of valid plugin types.
    • sendFilesToSupport

      @MBeanOperationImpact(1) Map<String,Object> sendFilesToSupport(long callNumber, String dirIdentifier, String dirToSend, String sendComment)
      Send collected plugin data to PTC technical support. The result Map <String, Object> should have four key entries, one for each String, "success", "path", "message", "location". Each of these keys values must be another String that corresponds to the appropriate value for the key. The "success" keys value should be true or false and is the value that states whether the collection framework was successful in collecting the plugin data or not. The "path" keys value is generated by the collection framework and it denotes the last directory in the canonical path for which the plugin data is collected to for the particular server the plugin executed on. The "message" keys value is a String message that might accompany the plugin generated by the collection framework. This is likely a status message of why a plugin failed. The value null should be used if no message is to be reported. The "location" keys value is a String representing a partial path to where the collection framework collects the plugin data.
      Parameters:
      callNumber - Number of PTC technical support call this data is related to.
      dirIdentifier - The directory name of where the information to be sent resides
      sendComment - The comment that will be sent along with the file to PTC
      Returns:
      Map containing the collection result information.

      Supported API: true
    • deleteCollectedFiles

      @MBeanOperationImpact(1) boolean deleteCollectedFiles(String directoryPath)
      Deletes a all files in the given directory and sub-directories recursively.
      Parameters:
      directory -
      Returns:
      True if all the files were successfully deleted. False if any deletion fails.

      Supported API: true
    • getGatherDirectories

      @MBeanOperationImpact(0) Set<String> getGatherDirectories()
      Return a collection of names of the directories in the plugin collection location.
      Returns:
      A collection of the names of the directories under the gathered folder. This could return an empty set if no directories are found.

      Supported API: true
    • getDirectoryList

      @MBeanOperationImpact(0) Set<String> getDirectoryList(String topicId)
      Return a collection of names of the directories in the plugin collection location.
      Returns:
      A collection of the names of the directories under the gathered folder. This could return an empty set if no directories are found.@return a Set of the names of the directories under the topicID folder. Could be an empty set.

      Supported API: true
    • markDirectoryAsCanceled

      @MBeanOperationImpact(1) void markDirectoryAsCanceled(long callNumber, String pathTimeStamp)
      Change a directory name to be appended with "-canceled".
      Parameters:
      callNumber - The call number as a directory name used to build the canonical file path to the pathTimeStamp directory.
      pathTimeStamp - The timestamp as a directory to mark as canceled

      Supported API: true
    • markDirectoryAsCanceled

      @MBeanOperationImpact(1) void markDirectoryAsCanceled(String topicIdentifier, String pathTimeStamp)
      Change a directory name to be appended with "-canceled".
      Parameters:
      topicIdentifier - The topicIdentifier as a directory name used to build the canonical file path to the pathTimeStamp directory.
      pathTimeStamp - The timestamp as a directory to mark as canceled

      Supported API: true
    • deleteEmptyTopicDirectory

      @MBeanOperationImpact(1) boolean deleteEmptyTopicDirectory(String topicId)
      Delete a directory if it is empty
      Parameters:
      topicId - The directory name to delete.
      Returns:
      True if it was successful. Will return false if there were any files or if the directory could not be deleted.

      Supported API: true
    • copyLogDirectories

      @MBeanOperationImpact(1) Map<String,String> copyLogDirectories(String[] sourcePaths) throws Exception
      Copy files in string
      Parameters:
      All - the file names list which needs to be copied with full path
      Returns:
      Map<String, String> File path vs its content will be there in map
      Throws:
      Exception -

      Supported API: true