com.jscape.inet.mft.security

## Class IPAccessRule

- java.lang.Object
- - com.jscape.inet.mft.security.IPAccessRule

- All Implemented Interfaces:
    java.io.Serializable

      public class IPAccessRule
      extends java.lang.Object
      implements java.io.Serializable

  IP access rule. Contains information about allowed or denied IP's.
  Author:
    Alex
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IPAccessRule()` Creates a new rule instance.
    `IPAccessRule(IPAccessRule that)`
    `IPAccessRule(com.jscape.inet.mft.MaskIPAccessVerifier.IPMask mask, java.lang.Long expirationDate)` Creates a new rule instance.
    `IPAccessRule(java.lang.String mask, java.lang.String reason, boolean allowed)` Creates a new rule instance.
    `IPAccessRule(java.lang.String mask, java.lang.String reason, boolean allowed, java.lang.Long expirationDate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `commonAccess()`
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.String` | `getAddressMask()` Returns IP address mask.
    `java.lang.Long` | `getExpirationDate()`
    `java.lang.String` | `getReason()` Return rule reason.
    `int` | `hashCode()`
    `boolean` | `isAllowed()` Returns rule allowed flag.
    `boolean` | `matches(java.net.InetAddress address)` Checks if specified address matches to the current rule.
    `void` | `setAddressMask(java.lang.String mask)` Sets IP address mask.
    `void` | `setAllowed(boolean value)` Sets rule allowed flag.
    `void` | `setExpirationDate(java.lang.Long value)`
    `void` | `setReason(java.lang.String value)` Sets rule reason.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### IPAccessRule

          public IPAccessRule(com.jscape.inet.mft.MaskIPAccessVerifier.IPMask mask,
                              java.lang.Long expirationDate)

      Creates a new rule instance.
      Parameters:
        `mask` - the base mask

    - #### IPAccessRule

          public IPAccessRule(java.lang.String mask,
                              java.lang.String reason,
                              boolean allowed,
                              java.lang.Long expirationDate)

    - #### IPAccessRule

          public IPAccessRule(java.lang.String mask,
                              java.lang.String reason,
                              boolean allowed)

      Creates a new rule instance.
      Parameters:
        `mask` - the IP address mask
        `reason` - the rule reason
        `allowed` - if `true` IP will be marked as allowed

    - #### IPAccessRule

          public IPAccessRule()

      Creates a new rule instance.

    - #### IPAccessRule

          public IPAccessRule(IPAccessRule that)

  - ### Method Detail

    - #### getAddressMask

          public java.lang.String getAddressMask()

      Returns IP address mask.
      Returns:
        IP address mask

    - #### setAddressMask

          public void setAddressMask(java.lang.String mask)

      Sets IP address mask.
      Parameters:
        `mask` - the IP address mask

    - #### getReason

          public java.lang.String getReason()

      Return rule reason.

    - #### setReason

          public void setReason(java.lang.String value)

      Sets rule reason.
      Parameters:
        `value` - the rule reason

    - #### isAllowed

          public boolean isAllowed()

      Returns rule allowed flag.
      Returns:
        IP address mask

    - #### setAllowed

          public void setAllowed(boolean value)

      Sets rule allowed flag.
      Parameters:
        `value` - if `true` the current rule will be marked as allowed.

    - #### getExpirationDate

          public java.lang.Long getExpirationDate()

    - #### setExpirationDate

          public void setExpirationDate(java.lang.Long value)

    - #### matches

          public boolean matches(java.net.InetAddress address)

      Checks if specified address matches to the current rule.
      Parameters:
        `address` - the address to check
      Returns:
        `true` if the specified address matches the current rule; `false` otherwise

    - #### commonAccess

          public boolean commonAccess()

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2009-2022. Redwood Software Inc. All rights reserved.