org.jumpmind.symmetric.security.inet
Class Inet4AddressAuthorizerCompiler

java.lang.Object
  extended by org.jumpmind.symmetric.security.inet.AbstractInetAddressAuthorizerCompiler
      extended by org.jumpmind.symmetric.security.inet.Inet4AddressAuthorizerCompiler
All Implemented Interfaces:
IInetAddressAuthorizerCompiler

public class Inet4AddressAuthorizerCompiler
extends AbstractInetAddressAuthorizerCompiler

Filter compiler for IPv4 addresses.

Author:
dmichels2

Field Summary
static byte ANY
           
static java.lang.String BROADCAST_OCTET
           
static java.lang.String IPv4_OCTET_SEPARATOR
           
static int NUM_IPv4_OCTETS
           
static short SHORT_MASK
           
 
Fields inherited from class org.jumpmind.symmetric.security.inet.AbstractInetAddressAuthorizerCompiler
ANY_TOKEN, CIDR_TOKEN, RANGE_TOKEN
 
Constructor Summary
Inet4AddressAuthorizerCompiler()
           
 
Method Summary
protected  IRawInetAddressAuthorizer compileForIpVersion(java.lang.String filter)
          Compiles for IPv4 specific address filter strings.
static short[] convertAddressBytesToShort(byte[] bytes)
          Utility method to convert between the actual byte[] address representation and a short[] used to perform the address and range comparison.
static byte[] convertShortToAddressBytes(short[] shorts)
          Utility method to convert between the short[] used for comparison and a byte[] for actual address representation.
protected  java.lang.String getAddressSeparator()
           
protected  java.lang.String getBroadcastString()
           
protected  short getOctetFromString(java.lang.String octect)
          Mechanism to pull a short from the provided textual octet.
 
Methods inherited from class org.jumpmind.symmetric.security.inet.AbstractInetAddressAuthorizerCompiler
compile, replaceSymbols
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IPv4_OCTET_SEPARATOR

public static final java.lang.String IPv4_OCTET_SEPARATOR
See Also:
Constant Field Values

BROADCAST_OCTET

public static final java.lang.String BROADCAST_OCTET
See Also:
Constant Field Values

NUM_IPv4_OCTETS

public static final int NUM_IPv4_OCTETS
See Also:
Constant Field Values

SHORT_MASK

public static final short SHORT_MASK
See Also:
Constant Field Values

ANY

public static final byte ANY
See Also:
Constant Field Values
Constructor Detail

Inet4AddressAuthorizerCompiler

public Inet4AddressAuthorizerCompiler()
Method Detail

compileForIpVersion

protected IRawInetAddressAuthorizer compileForIpVersion(java.lang.String filter)
                                                 throws java.net.UnknownHostException
Compiles for IPv4 specific address filter strings.

Specified by:
compileForIpVersion in class AbstractInetAddressAuthorizerCompiler
Parameters:
filter -
Returns:
Throws:
java.net.UnknownHostException

getAddressSeparator

protected java.lang.String getAddressSeparator()
Specified by:
getAddressSeparator in class AbstractInetAddressAuthorizerCompiler
Returns:

getBroadcastString

protected java.lang.String getBroadcastString()
Specified by:
getBroadcastString in class AbstractInetAddressAuthorizerCompiler
Returns:

getOctetFromString

protected short getOctetFromString(java.lang.String octect)
Mechanism to pull a short from the provided textual octet. Use short values as we have to do comparisons and bytes are signed (and we'd have to add 254 prior to comparison, blah, blah, blah)

Parameters:
octect -
Returns:

convertAddressBytesToShort

public static short[] convertAddressBytesToShort(byte[] bytes)
Utility method to convert between the actual byte[] address representation and a short[] used to perform the address and range comparison.

Parameters:
bytes -
Returns:

convertShortToAddressBytes

public static byte[] convertShortToAddressBytes(short[] shorts)
Utility method to convert between the short[] used for comparison and a byte[] for actual address representation.

Parameters:
shorts -
Returns:


Copyright © 2007-2008. All Rights Reserved.