Cisco Systems, Inc.

com.pcube.apps.engage.policy
Class RangeIdentifier

java.lang.Object
  extended by com.pcube.apps.engage.policy.RangeIdentifier
All Implemented Interfaces:
Formattable, java.io.Serializable, java.lang.Cloneable

public class RangeIdentifier
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, Formattable

RangeIdentifier defines IP and port ranges for the ignoreFilterRule. The IgnoreFilterRule has a RangeIdentifier for the flows source and for the flows destination, which define the ranges which the IgnoreFilterRule should apply to.

See Also:
Serialized Form

Constructor Summary
RangeIdentifier()
          RangeIdentifier Constructor.
RangeIdentifier(IPListItem ipFrom, IPListItem ipTo, PortListItem portFrom, PortListItem portTo, boolean inverseIps, boolean inversePorts)
          RangeIdentifier Constructor.
RangeIdentifier(long ipFrom, byte ipFromMask, long ipTo, byte ipToMask, long portFrom, int portFromTransport, long portTo, int portToTransport, boolean inverseIps, boolean inversePorts)
          RangeIdentifier Constructor.
RangeIdentifier(RangeIdentifier other)
          RangeIdentifier Copy Constructor.
 
Method Summary
 java.lang.Object clone()
          Producing an identical object to this object.
 void fromStream(java.io.BufferedReader in, Formatter f)
          Method fromStream
 IPListItem getIpFrom()
          Gets this RangeIdentifier's ip range's lower bound IPListItem.
 IPListItem getIpTo()
          Gets this RangeIdentifier's ip range's upper bound IPListItem.
 PortListItem getPortFrom()
          Gets this RangeIdentifier's port range's lower bound port.
 PortListItem getPortTo()
          Gets this RangeIdentifier's port range's upper bound port.
 boolean isInverseIPs()
          Checks if the ips to refer to are the ones in the range or the ones out of the range.
 boolean isInversePorts()
          Checks if the ports to refer to are the ones in the range or the ones out of the range.
 boolean isIPRange()
          Checks if this RangeIdentifier defines an ip range or just a single ip address.
 boolean isPortRange()
          Checks if this RangeIdentifier defines a port range or just a single port.
 void setInverseIPs(boolean newInverseIPs)
          Sets the flag which states if the ips to refer to are the ip range or its inverse values, that is,the ips which are not in the range.
 void setInversePorts(boolean newInversePorts)
          Sets the flag which states if the ports to refer to are the port range or its inverse values, that is,the ports which are not in the range.
 void setIpFrom(IPListItem newIpFrom)
          Sets this RangeIdentifier's ip range's lower bound IPListItem.
 void setIpFromIpAddress(long newIp)
          Sets this RangeIdentifier's ip range's lower bound ip.
 void setIpFromMask(byte newMask)
          Sets this RangeIdentifier's ip range's lower bound ip's mask.
 void setIpTo(IPListItem newIpTo)
          Sets this RangeIdentifier's ip range's upper bound IPListItem.
 void setIpToIpAddress(long newIp)
          Sets this RangeIdentifier's ip range's upper bound ip.
 void setIpToMask(byte newMask)
          Sets this RangeIdentifier's ip range's upper bound ip's mask.
 void setPortFrom(PortListItem newPortFrom)
          Sets this RangeIdentifier's port range's lower bound PortListItem.
 void setPortFromPortNumber(long newPort)
          Sets this RangeIdentifier's port range's lower bound port.
 void setPortFromTransportType(int transport)
          Sets this RangeIdentifier's port range's lower bound port's transport type.
 void setPortTo(PortListItem newPortTo)
          Sets this RangeIdentifier's port range's upper bound PortListItem.
 void setPortToPortNumber(long newPort)
          Sets this RangeIdentifier's port range's upper bound port.
 void setPortToTransportType(int transport)
          Sets this RangeIdentifier's port range's upper bound port's transport type.
 void toStream(java.io.PrintStream out, Formatter f)
          Method toStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeIdentifier

public RangeIdentifier()
RangeIdentifier Constructor.


RangeIdentifier

public RangeIdentifier(IPListItem ipFrom,
                       IPListItem ipTo,
                       PortListItem portFrom,
                       PortListItem portTo,
                       boolean inverseIps,
                       boolean inversePorts)
RangeIdentifier Constructor.

Parameters:
ipFrom - the ip range's lower bound IPListItem
ipTo - the ip range's upper bound IPListItem
portFrom - the port range's lower bound PortListItem
portTo - the port range's lower bound PortListItem
inverseIps - a flag stating that the inverse of the ip range is to be considered
inversePorts - a flag stating that the inverse of the port range is to be considered

RangeIdentifier

public RangeIdentifier(long ipFrom,
                       byte ipFromMask,
                       long ipTo,
                       byte ipToMask,
                       long portFrom,
                       int portFromTransport,
                       long portTo,
                       int portToTransport,
                       boolean inverseIps,
                       boolean inversePorts)
RangeIdentifier Constructor.

Parameters:
ipFrom - this RangeIdentifier's ip range's lower bound ip
ipFromMask - the mask to this RangeIdentifier's ip range lower bound
ipTo - this RangeIdentifier's ip range's upper bound ip
ipToMask - the mask to this RangeIdentifier's ip range upper bound
portFrom - this RangeIdentifier's port range's lower bound port
portFromTransport - the transport type to this RangeIdentifier's port range lower bound
portTo - this RangeIdentifier's port range's upper bound port
portToTransport - the transport type to this RangeIdentifier's port range upper bound
inverseIps - a flag stating that the inverse of the ip range is to be considered
inversePorts - a flag stating that the inverse of the port range is to be considered
See Also:
PortListItem.TRANSPORT_TYPE_TCP, PortListItem.TRANSPORT_TYPE_UDP, PortListItem.TRANSPORT_TYPE_BOTH

RangeIdentifier

public RangeIdentifier(RangeIdentifier other)
RangeIdentifier Copy Constructor.

Parameters:
other - the other RangeIdentifier that this RangeIdentifier takes the values from
Method Detail

clone

public java.lang.Object clone()
Producing an identical object to this object.

Overrides:
clone in class java.lang.Object
Returns:
a newly alocated object similar to this object.

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Description copied from interface: Formattable
Method fromStream

Specified by:
fromStream in interface Formattable
Throws:
ImportExportException
See Also:
Formattable.fromStream(java.io.BufferedReader, com.pcube.apps.engage.common.Formatter)

getIpFrom

public IPListItem getIpFrom()
Gets this RangeIdentifier's ip range's lower bound IPListItem.

Returns:
the IPListItem

getIpTo

public IPListItem getIpTo()
Gets this RangeIdentifier's ip range's upper bound IPListItem.

Returns:
the IPListItem

getPortFrom

public PortListItem getPortFrom()
Gets this RangeIdentifier's port range's lower bound port.

Returns:
this RangeIdentifier's port range's lower bound port

getPortTo

public PortListItem getPortTo()
Gets this RangeIdentifier's port range's upper bound port.

Returns:
this RangeIdentifier's port range's upper bound port

isInverseIPs

public boolean isInverseIPs()
Checks if the ips to refer to are the ones in the range or the ones out of the range.

Returns:
false for refering to the ips in the range, true for selecting the out of range ips

isInversePorts

public boolean isInversePorts()
Checks if the ports to refer to are the ones in the range or the ones out of the range.

Returns:
false for refering to the ports in the range, true for selecting the out of range ports

isIPRange

public boolean isIPRange()
Checks if this RangeIdentifier defines an ip range or just a single ip address.

Returns:
true if this RangeIdentifier has an ip range, false if it has a single ip address

isPortRange

public boolean isPortRange()
Checks if this RangeIdentifier defines a port range or just a single port.

Returns:
true if this RangeIdentifier has a port range, false if it has a single port

setInverseIPs

public void setInverseIPs(boolean newInverseIPs)
Sets the flag which states if the ips to refer to are the ip range or its inverse values, that is,the ips which are not in the range.

Parameters:
newInverseIPs - false for selecting the ip range, true for selecting the out of range ips

setInversePorts

public void setInversePorts(boolean newInversePorts)
Sets the flag which states if the ports to refer to are the port range or its inverse values, that is,the ports which are not in the range.

Parameters:
newInversePorts - false for selecting the port range, true for selecting the out of range ports

setIpFrom

public void setIpFrom(IPListItem newIpFrom)
Sets this RangeIdentifier's ip range's lower bound IPListItem.

Parameters:
newIpFrom - the new ip range lower bound IPListItem

setIpFromIpAddress

public void setIpFromIpAddress(long newIp)
                        throws DuplicateItemException
Sets this RangeIdentifier's ip range's lower bound ip.

Parameters:
newIp - the new ip value
Throws:
DuplicateItemException
java.lang.IllegalArgumentException - if the new ip is inconsistent with the IPListItem's mask

setIpFromMask

public void setIpFromMask(byte newMask)
                   throws DuplicateItemException
Sets this RangeIdentifier's ip range's lower bound ip's mask.

Parameters:
newMask - the new ip's mask
Throws:
DuplicateItemException
java.lang.IllegalArgumentException - if the new mask is inconsistent with the IPListItem's ip

setIpTo

public void setIpTo(IPListItem newIpTo)
Sets this RangeIdentifier's ip range's upper bound IPListItem.

Parameters:
newIpTo - the new ip range lower bound IPListItem

setIpToIpAddress

public void setIpToIpAddress(long newIp)
                      throws DuplicateItemException
Sets this RangeIdentifier's ip range's upper bound ip.

Parameters:
newIp - the new ip value
Throws:
DuplicateItemException
java.lang.IllegalArgumentException - if the new ip is inconsistent with the IPListItem's mask

setIpToMask

public void setIpToMask(byte newMask)
                 throws DuplicateItemException
Sets this RangeIdentifier's ip range's upper bound ip's mask.

Parameters:
newMask - the new ip's mask
Throws:
DuplicateItemException
java.lang.IllegalArgumentException - if the new mask is inconsistent with the IPListItem's ip

setPortFrom

public void setPortFrom(PortListItem newPortFrom)
Sets this RangeIdentifier's port range's lower bound PortListItem.

Parameters:
newPortFrom - the new port range lower bound PortListItem

setPortFromPortNumber

public void setPortFromPortNumber(long newPort)
Sets this RangeIdentifier's port range's lower bound port.

Parameters:
newPort - the new port value

setPortFromTransportType

public void setPortFromTransportType(int transport)
Sets this RangeIdentifier's port range's lower bound port's transport type.

Parameters:
transport - the new port's transport type
See Also:
PortListItem.TRANSPORT_TYPE_TCP, PortListItem.TRANSPORT_TYPE_UDP, PortListItem.TRANSPORT_TYPE_BOTH

setPortTo

public void setPortTo(PortListItem newPortTo)
Sets this RangeIdentifier's port range's upper bound PortListItem.

Parameters:
newPortTo - the new port range upper bound PortListItem

setPortToPortNumber

public void setPortToPortNumber(long newPort)
Sets this RangeIdentifier's port range's upper bound port.

Parameters:
newPort - the new port value

setPortToTransportType

public void setPortToTransportType(int transport)
Sets this RangeIdentifier's port range's upper bound port's transport type.

Parameters:
transport - the new port's transport type
See Also:
PortListItem.TRANSPORT_TYPE_TCP, PortListItem.TRANSPORT_TYPE_UDP, PortListItem.TRANSPORT_TYPE_BOTH

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Description copied from interface: Formattable
Method toStream

Specified by:
toStream in interface Formattable
See Also:
Formattable.toStream(java.io.PrintStream, com.pcube.apps.engage.common.Formatter)

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.