org.opennms.netmgt.provision
Class BasePolicy<T>

java.lang.Object
  extended by org.opennms.netmgt.provision.BasePolicy<T>
Direct Known Subclasses:
MatchingIpInterfacePolicy, MatchingSnmpInterfacePolicy, NodeCategorySettingPolicy

public abstract class BasePolicy<T>
extends Object

Abstract BasePolicy class.

Version:
$Id: $
Author:
ranger

Nested Class Summary
static class BasePolicy.Match
           
 
Constructor Summary
BasePolicy()
           
 
Method Summary
abstract  T act(T iface)
          act
 T apply(T iface)
          apply
protected  LinkedHashMap<String,String> getCriteria()
          getCriteria
protected  String getCriteria(String key)
          getCriteria
protected  BasePolicy.Match getMatch()
          getMatch
 String getMatchBehavior()
          getMatchBehavior
protected  boolean match(String s, String matcher)
          match
protected  boolean matches(T iface)
          matches
protected  String putCriteria(String key, String expression)
          putCriteria
protected  void setMatch(BasePolicy.Match match)
          setMatch
 void setMatchBehavior(String matchBehavior)
          setMatchBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePolicy

public BasePolicy()
Method Detail

match

protected boolean match(String s,
                        String matcher)

match

Type Parameters:
T - a T object.
Parameters:
s - a String object.
matcher - a String object.
Returns:
a boolean.

getMatchBehavior

public String getMatchBehavior()

getMatchBehavior

Returns:
a String object.

setMatchBehavior

public void setMatchBehavior(String matchBehavior)

setMatchBehavior

Parameters:
matchBehavior - a String object.

setMatch

protected void setMatch(BasePolicy.Match match)

setMatch

Parameters:
match - the match to set

getMatch

protected BasePolicy.Match getMatch()

getMatch

Returns:
the match

getCriteria

protected String getCriteria(String key)

getCriteria

Parameters:
key - a String object.
Returns:
a String object.

putCriteria

protected String putCriteria(String key,
                             String expression)

putCriteria

Parameters:
key - a String object.
expression - a String object.
Returns:
a String object.

getCriteria

protected LinkedHashMap<String,String> getCriteria()

getCriteria

Returns:
the criteria

matches

protected boolean matches(T iface)

matches

Parameters:
iface - a T object.
Returns:
a boolean.

act

public abstract T act(T iface)

act

Parameters:
iface - a T object.
Returns:
a T object.

apply

public T apply(T iface)

apply

Parameters:
iface - a T object.
Returns:
a T object.


Copyright © 2011. All Rights Reserved.