Class IpRange

java.lang.Object
io.goobi.viewer.model.security.user.AbstractLicensee
io.goobi.viewer.model.security.user.IpRange
All Implemented Interfaces:
ILicensee, Serializable

@Entity public class IpRange extends AbstractLicensee implements Serializable
Represents an IP address range used for IP-based access control and licence assignment.
See Also:
  • Constructor Details

    • IpRange

      public IpRange()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • matchIp

      public boolean matchIp(String inIp)
      matchIp.
      Parameters:
      inIp - client IP address to test against this range
      Returns:
      true if the given IP address falls within the subnet mask of this IP range, false otherwise
    • canSatisfyAllAccessConditions

      public AccessPermission canSatisfyAllAccessConditions(Set<String> requiredAccessConditions, String privilegeName, String pi) throws PresentationException, IndexUnreachableException, DAOException
      canSatisfyAllAccessConditions.
      Parameters:
      requiredAccessConditions - set of access condition values that must all be satisfied
      privilegeName - privilege name to check against each access condition
      pi - persistent identifier of the record being accessed
      Returns:
      true if this IP range satisfies all given access conditions for the specified privilege, false otherwise
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      DAOException - if any.
    • getId

      public Long getId()
      Getter for the field id.
      Returns:
      the database identifier of this IP range
    • setId

      public void setId(Long id)
      Setter for the field id.
      Parameters:
      id - the database identifier to set
    • getName

      public String getName()
      getName.
      Specified by:
      getName in interface ILicensee
      Returns:
      the name of this licensee
    • setName

      public void setName(String name)
      Setter for the field name.
      Parameters:
      name - the display name of this IP range to set
    • getSubnetMask

      public String getSubnetMask()
      Getter for the field subnetMask.
      Returns:
      the CIDR subnet mask defining the IP range
    • setSubnetMask

      public void setSubnetMask(String subnetMask)
      Setter for the field subnetMask.
      Parameters:
      subnetMask - the CIDR subnet mask defining the IP range to set
    • getDescription

      public String getDescription()
      Getter for the field description.
      Returns:
      a human-readable description of this IP range
    • setDescription

      public void setDescription(String description)
      Setter for the field description.
      Parameters:
      description - a human-readable description of this IP range to set
    • getAccessType

      public License.AccessType getAccessType()
      Specified by:
      getAccessType in interface ILicensee
      Returns:
      AccessType corresponding to the licensee's class
    • main

      public static void main(String[] args)
      main.
      Parameters:
      args - command-line arguments (unused)
    • toString

      public String toString()
      Overrides:
      toString in class Object