com.hp.ucmdb.api.discovery.types
Interface ParsingRule

All Superinterfaces:
java.io.Serializable

public interface ParsingRule
extends java.io.Serializable

A rule that is part of a software discovery process.


Nested Class Summary
static class ParsingRule.RuleType
          Rule types.
 
Method Summary
 java.lang.String getId()
          Returns the ID of this ParsingRule object.
 ParsingRule.RuleType getRuleType()
          Returns the type of this rule.
 ParsingRule ofType(ParsingRule.RuleType ruleType)
          Sets the type of this ParsingRule.
 void setRegularExpression(java.lang.String regExpStr)
          Sets a regular expression to this ParsingRule.
 void setRuleType(ParsingRule.RuleType ruleType)
          Sets the type of this ParsingRule.
 ParsingRule withRegularExpression(java.lang.String regExpStr)
          Sets the rule to be the specified regular expression.
 

Method Detail

getId

java.lang.String getId()
Returns the ID of this ParsingRule object. The ID must be unique in the scope of its SoftwareSignature.

Returns:
the ID of this ParsingRule object.

setRuleType

void setRuleType(ParsingRule.RuleType ruleType)
Sets the type of this ParsingRule. A call to this method overrides a previous call to it or to ofType(RuleType ruleType).

Parameters:
ruleType - the type of this rule.

ofType

ParsingRule ofType(ParsingRule.RuleType ruleType)
Sets the type of this ParsingRule. A call to this method overrides a previous call to it or to setRuleType(RuleType ruleType).

Parameters:
ruleType - the type of this rule
Returns:
this object with the change (for chaining)

getRuleType

ParsingRule.RuleType getRuleType()
Returns the type of this rule. The default value if not set by ofType or setRuleType is COMMAND_LINE.

Returns:
the type of this rule

setRegularExpression

void setRegularExpression(java.lang.String regExpStr)
Sets a regular expression to this ParsingRule. For example,
        setRuleType(ParsingRule.RuleType.PORT);
        setRegularExpression("80??");
        setRuleType(ParsingRule.RuleType.COMMAND_LINE);
        setRegularExpression(".+\\s+(\\s+)$");
        
A literal string can be passed instead of a regular expression is required. A call to this method overrides a previous call to it or to withRegularExpression(String regExpStr).

Parameters:
regExpStr - the regular expression which should be set.

withRegularExpression

ParsingRule withRegularExpression(java.lang.String regExpStr)
Sets the rule to be the specified regular expression. For example,
        setRuleType(ParsingRule.RuleType.PORT);
        ParsingRule myPRule = withRegularExpression("80??");
        setRuleType(ParsingRule.RuleType.COMMAND_LINE);
        setRegularExpression(".+\\s+(\\s+)$");
A literal string can be passed instead of a regular expression is required. A call to this method overrides a previous call to it or to setRegularExpression(String regExpStr).

Parameters:
regExpStr - the regular expression which should be set.
Returns:
this object with the change (for chaining).


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.