Package com.ptc.customersupport.mbeans
Interface CollectorMBean
- All Superinterfaces:
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
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptioncollectData(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.collectData(String srcPath, long callNumber, String pluginType, String pathTimeStamp) Collect the data and store it on the file system.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".collectData(String srcPath, String topicIdentifier, String pluginType, String pathTimeStamp) Collect the data and store it on the file system.copyLogDirectories(String[] sourcePaths) Copy files in stringbooleandeleteCollectedFiles(String directoryPath) Deletes a all files in the given directory and sub-directories recursively.booleandeleteEmptyTopicDirectory(String topicId) Delete a directory if it is emptygetDirectoryList(String topicId) Return a collection of names of the directories in the plugin collection location.Return a collection of names of the directories in the plugin collection location.List of valid plugin types.voidmarkDirectoryAsCanceled(long callNumber, String pathTimeStamp) Change a directory name to be appended with "-canceled".voidmarkDirectoryAsCanceled(String topicIdentifier, String pathTimeStamp) Change a directory name to be appended with "-canceled".sendFilesToSupport(long callNumber, String dirIdentifier, String dirToSend, String sendComment) Send collected plugin data to PTC technical support.Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
-
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 collectedcallNumber- The identifier to be used as the collection destination directorypluginType- The type of plugin being executedpathTimeStamp- 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 collectedtopicIdentifier- The identifier to be used as the collection destination directorypluginType- The type of pluginpathTimeStamp- 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 collectedcallNumber- The identifier to be used as the collection destination directorymaxAgeInDays- 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 pluginpathTimeStamp- A timestamp to use for uniqueness for this collectioncompressOutput- 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 collectedtopicIdentifier- The identifier to be used as the collection destination directorymaxAgeInDays- 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 pluginpathTimeStamp- A timestamp to use for uniqueness for this collectioncompressOutput- Should the output be compressed- Returns:
- Map containing the collection result information.
-
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 residessendComment- The comment that will be sent along with the file to PTC- Returns:
- Map containing the collection result information.
Supported API: true
-
deleteCollectedFiles
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
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
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
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
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
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
-