Class CSPViolations

java.lang.Object
org.deltava.beans.system.CSPViolations
All Implemented Interfaces:
Comparable<CSPViolations>

public class CSPViolations extends Object implements Comparable<CSPViolations>
A bean to store Content Security Policy violation data.
Since:
12.0
Version:
12.0
Author:
Luke
  • Constructor Details

    • CSPViolations

      public CSPViolations(Instant dt, String type)
      Creates the bean.
      Parameters:
      dt - the date
      type - policy violation type
  • Method Details

    • getDate

      public Instant getDate()
      Returns the violation date.
      Returns:
      the date
    • getType

      public String getType()
      Returns the CSP directive violated.
      Returns:
      the directive name
    • getCount

      public int getCount()
      Returns the number of violations
      Returns:
      the violation count
    • getHost

      public String getHost()
      Returns the offending host name.
      Returns:
      the host name
    • getURLs

      public Collection<String> getURLs()
      Returns the offending site URLs
      Returns:
      the URLs
    • addURL

      public void addURL(String url)
      Adds a site URL. THe protocol and host names will be stripped if present.
      Parameters:
      url - the URL
    • setHost

      public void setHost(String host)
      Updates the offending host name.
      Parameters:
      host - the host name
    • setCount

      public void setCount(int cnt)
      Updates the violation count.
      Parameters:
      cnt - the violation count
    • compareTo

      public int compareTo(CSPViolations cv2)
      Specified by:
      compareTo in interface Comparable<CSPViolations>