public class MonitorUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_SEPARATOR |
static java.lang.String |
JAVA_VERSION |
static java.lang.String |
OS_ARCH |
static java.lang.String |
OS_NAME |
static java.lang.String |
OS_VERSION |
static int |
REPT_SKIP |
static int |
REPT_STATUS |
static int |
REPT_TIME |
static java.lang.String |
USER_NAME |
Constructor and Description |
---|
MonitorUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
checkDependencies(long currentTime,
java.util.List[] dependencies,
java.lang.String prefix)
It returns MonitorReport.NOSKIP if there is at least one group of
dependencies with status of NOSKIP.
|
static void |
clearDependencies(java.util.List[] dependencies)
It cleans up all the dependency objects.
|
static void |
clearMapArray(java.util.Map[] hmGroup) |
static boolean |
filter(java.lang.String text,
org.apache.oro.text.regex.Pattern[][] patterns,
org.apache.oro.text.regex.Perl5Matcher pm,
boolean def) |
static java.util.List[] |
getDependencies(java.util.List groupList) |
static java.util.List<java.util.Map> |
getGenericMapList(java.util.List list,
org.apache.oro.text.regex.Perl5Compiler pc,
Template template)
It returns a list of maps with each map contains three objects of
Pattern, TextSubstitution and Template.
|
static int[] |
getHeartbeat(int[] group)
It generates the heartbeat array from the input array.
|
static java.util.Map<java.lang.String,java.util.List> |
getIncludes(java.lang.String basename,
java.util.Map<java.lang.String,java.lang.Object> includeGroup,
java.util.Map props)
It returns a Map with the same keys of IncludeGroup and values of List
that contains Sets for names of the primary includes.
|
static java.lang.String |
getMappedName(java.lang.String name,
java.util.List<java.util.Map> mapList,
org.apache.oro.text.regex.Perl5Matcher pm)
Based on a list of generic name mapping rules, it trys to match the
given name with the pattern to select the substition.
|
static Template |
getMappedTemplate(java.lang.String name,
java.util.List<java.util.Map> mapList,
org.apache.oro.text.regex.Perl5Matcher pm)
Based on a list of generic name mapping rules, it trys to match the
given name with the pattern to select the template.
|
static MonitorAction |
getNewAction(java.util.Map props) |
static MonitorReport |
getNewReport(java.util.Map props) |
static org.apache.oro.text.regex.Pattern[][] |
getPatterns(java.lang.String name,
java.util.Map ph,
org.apache.oro.text.regex.Perl5Compiler pc) |
static org.apache.oro.text.regex.Pattern[][] |
getPatterns(java.lang.String name,
java.util.Map ph,
org.apache.oro.text.regex.Perl5Compiler pc,
Template template,
java.util.Map map) |
static java.util.Map |
getPrivateReport()
returns the private report of current thread from default container
|
static java.util.Map |
getReport(java.lang.String name)
returns the report map of the name from the default container
|
static int |
getReportMode(java.lang.String mode) |
static java.lang.String[] |
getSecondaryIncludes(java.lang.String[] primaryItems,
java.util.Map policyMap,
java.util.Map props)
Given the names of primary includes, the policy map for secondary
includes, and the master property map, it looks for all the names of
secondary includes required by those the primarily included objects.
|
static java.lang.String[] |
getSecondaryIncludes(java.lang.String[] primaryItems,
java.lang.String cfgDir,
java.util.Map policyMap)
Given the names of primary includes, the policy map for secondary
includes, and the name of the configration folder, it looks for names
of all the secondary includes, required by the given primary includes.
|
static MonitorReport |
getStaticDependency(java.util.Map props)
return a MonitorReport for static dependency
|
static void |
initReport(java.lang.String name,
long tm,
int status,
int skip)
initializes the report of the name in the default container
|
static void |
initReport(java.lang.String name,
java.lang.String[] keys,
java.util.Map report,
int mode)
initializes the report of the name in the default container
|
static java.util.Map<java.lang.String,java.lang.String> |
mergeSecondaryIncludes(java.lang.String listName,
java.util.Map policyMap,
java.util.Map group,
java.util.Map props)
It returns a Map with all names secondarily included in a given
list of the primary objects.
|
static Event |
runScript(java.lang.String program,
int timeout)
runs a script within the timeout and return an event.
|
static java.lang.String |
select(java.lang.Object obj)
use this with care since the dependency may not be defined.
|
static java.lang.String |
substitute(java.lang.String input,
Template template) |
static java.lang.String |
substitute(java.lang.String input,
Template template,
java.util.Map map) |
public static final int REPT_STATUS
public static final int REPT_SKIP
public static final int REPT_TIME
public static final java.lang.String OS_NAME
public static final java.lang.String OS_ARCH
public static final java.lang.String OS_VERSION
public static final java.lang.String FILE_SEPARATOR
public static final java.lang.String USER_NAME
public static final java.lang.String JAVA_VERSION
public static java.util.List[] getDependencies(java.util.List groupList)
public static MonitorReport getStaticDependency(java.util.Map props)
public static int checkDependencies(long currentTime, java.util.List[] dependencies, java.lang.String prefix)
public static void clearDependencies(java.util.List[] dependencies)
public static int getReportMode(java.lang.String mode)
public static MonitorReport getNewReport(java.util.Map props)
public static MonitorAction getNewAction(java.util.Map props)
public static Event runScript(java.lang.String program, int timeout)
public static java.lang.String substitute(java.lang.String input, Template template)
public static java.lang.String substitute(java.lang.String input, Template template, java.util.Map map)
public static org.apache.oro.text.regex.Pattern[][] getPatterns(java.lang.String name, java.util.Map ph, org.apache.oro.text.regex.Perl5Compiler pc) throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
public static org.apache.oro.text.regex.Pattern[][] getPatterns(java.lang.String name, java.util.Map ph, org.apache.oro.text.regex.Perl5Compiler pc, Template template, java.util.Map map) throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
public static boolean filter(java.lang.String text, org.apache.oro.text.regex.Pattern[][] patterns, org.apache.oro.text.regex.Perl5Matcher pm, boolean def)
public static void clearMapArray(java.util.Map[] hmGroup)
public static java.lang.String select(java.lang.Object obj)
public static java.util.Map<java.lang.String,java.util.List> getIncludes(java.lang.String basename, java.util.Map<java.lang.String,java.lang.Object> includeGroup, java.util.Map props)
public static java.lang.String[] getSecondaryIncludes(java.lang.String[] primaryItems, java.util.Map policyMap, java.util.Map props)
public static java.lang.String[] getSecondaryIncludes(java.lang.String[] primaryItems, java.lang.String cfgDir, java.util.Map policyMap)
public static java.util.Map<java.lang.String,java.lang.String> mergeSecondaryIncludes(java.lang.String listName, java.util.Map policyMap, java.util.Map group, java.util.Map props)
public static java.util.Map getPrivateReport()
public static java.util.Map getReport(java.lang.String name)
public static void initReport(java.lang.String name, long tm, int status, int skip)
public static void initReport(java.lang.String name, java.lang.String[] keys, java.util.Map report, int mode)
public static int[] getHeartbeat(int[] group)
public static java.util.List<java.util.Map> getGenericMapList(java.util.List list, org.apache.oro.text.regex.Perl5Compiler pc, Template template) throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
public static java.lang.String getMappedName(java.lang.String name, java.util.List<java.util.Map> mapList, org.apache.oro.text.regex.Perl5Matcher pm)
public static Template getMappedTemplate(java.lang.String name, java.util.List<java.util.Map> mapList, org.apache.oro.text.regex.Perl5Matcher pm)