org.opennms.netmgt.config
Class PeerFactory

java.lang.Object
  extended by org.opennms.netmgt.config.PeerFactory
Direct Known Subclasses:
NSClientPeerFactory, SnmpPeerFactory

public class PeerFactory
extends Object

Convenience superclass for NSClientPeerFactory and SnmpPeerFactory, with common code used in both

Author:
Mathew Brozowski, Craig Miskell

Constructor Summary
PeerFactory()
           
 
Method Summary
static int countChar(char charIn, String stingIn)
           
static boolean matchNumericListOrRange(String value, String patterns)
          Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or ports
static boolean matchRange(String value, String pattern)
          Helper method in support of matchNumericListOrRange
protected static long toLong(InetAddress addr)
          Converts the internet address to a long value so that it can be compared using simple opertions.
static boolean verifyIpMatch(String hostAddress, String ipMatch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerFactory

public PeerFactory()
Method Detail

toLong

protected static long toLong(InetAddress addr)
Converts the internet address to a long value so that it can be compared using simple opertions. The address is converted in network byte order (big endin) and allows for comparisions like <, >, <=, >=, ==, and !=.

Parameters:
addr - The address to convert to a long
Returns:
The address as a long value.

verifyIpMatch

public static boolean verifyIpMatch(String hostAddress,
                                    String ipMatch)

matchNumericListOrRange

public static boolean matchNumericListOrRange(String value,
                                              String patterns)
Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or ports

Parameters:
value -
patterns -
Returns:

matchRange

public static boolean matchRange(String value,
                                 String pattern)
Helper method in support of matchNumericListOrRange

Parameters:
value -
pattern -
Returns:

countChar

public static int countChar(char charIn,
                            String stingIn)


Copyright ? 2008. All Rights Reserved.