Class CompliancePolicy

java.lang.Object
org.netxms.client.assess.CompliancePolicy

public class CompliancePolicy extends Object
Compliance policy: definition (JSON document), state, assignments and number of findings by effective state.
  • Constructor Details

    • CompliancePolicy

      public CompliancePolicy(String definition)
      Create new policy from definition. Policy ID is taken from the definition; server validates definition when policy is saved.
      Parameters:
      definition - policy definition (JSON document)
    • CompliancePolicy

      public CompliancePolicy(NXCPMessage msg, long baseId)
      Create policy from NXCP message.
      Parameters:
      msg - NXCP message
      baseId - base field ID
  • Method Details

    • fillMessage

      public void fillMessage(NXCPMessage msg)
      Fill NXCP message with policy data.
      Parameters:
      msg - NXCP message
    • getId

      public String getId()
      Returns:
      policy ID
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if policy is enabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Parameters:
      enabled - true if policy is enabled
    • getDefinition

      public String getDefinition()
      Returns:
      policy definition (JSON document)
    • setDefinition

      public void setDefinition(String definition)
      Set policy definition. Policy ID is updated from the definition.
      Parameters:
      definition - policy definition (JSON document)
    • getRevision

      public int getRevision()
      Returns:
      policy revision from definition (0 if definition has no valid revision)
    • getTitle

      public String getTitle()
      Returns:
      policy title from definition
    • getDescription

      public String getDescription()
      Returns:
      policy description from definition
    • getRemediation

      public String getRemediation()
      Returns:
      remediation advice from definition
    • getSeverity

      public Severity getSeverity()
      Returns:
      policy severity from definition (UNKNOWN if definition has no valid severity)
    • getAssignments

      public List<PolicyAssignment> getAssignments()
      Returns:
      assignments of this policy
    • getFindingCount

      public int getFindingCount()
      Returns:
      number of findings (objects in scope of the policy)
    • getCompliantCount

      public int getCompliantCount()
      Returns:
      number of compliant objects
    • getViolationCount

      public int getViolationCount()
      Returns:
      number of objects violating the policy
    • getNotAssessableCount

      public int getNotAssessableCount()
      Returns:
      number of objects that cannot be assessed
    • getSuppressedCount

      public int getSuppressedCount()
      Returns:
      number of objects with suppressed finding
    • getCoverage

      public double getCoverage()
      Get coverage: part of objects in scope of the policy that could be assessed (are either compliant or violating the policy). Objects with suppressed finding are not counted.
      Returns:
      coverage (0 to 1) or -1 if there are no objects to calculate it from
    • getCompliance

      public double getCompliance()
      Get compliance: part of assessed objects that are compliant. Objects that cannot be assessed and objects with suppressed finding are not counted, so compliance has to be read together with coverage.
      Returns:
      compliance (0 to 1) or -1 if there are no assessed objects