Class ClassifiedConstraint

java.lang.Object
com.jalios.jcms.security.classified.ClassifiedConstraint

public class ClassifiedConstraint extends Object
Since:
10.0.8 / JCMS-10746
  • Constructor Details

    • ClassifiedConstraint

      public ClassifiedConstraint(String constraintName)
      Create a new ClassifiedConstraint with the specified name.
      Parameters:
      constraintName - the technical name of this constraint, as declared in properties prefixed with "classification.constraint.".

      Example values : core.reader-tracker.required or plugin.totp.required.

      Must not be null.

      Throws:
      NullPointerException - if constraintName is null
  • Method Details

    • getConstraintName

      public String getConstraintName()
      Retrieve the technical name of this constraint.
      Returns:
      the constraint's name, as declared in property prefixed with "classification.constraint.".
    • mustBeCheckedFor

      public boolean mustBeCheckedFor(Publication pub)
      Check if this constraint can be used for the specified publication.
      Parameters:
      pub - a publication, null accepted.
      Returns:
      true if the constraint MUST be enforced for the specified publication. false if constraint is not required, if classification is disabled, or if publication is null.
    • getStartLevel

      public int getStartLevel()
      Retrieve the classification level starting which constraint must be enforced.
      Returns:
      a classification level (inclusive)
    • getLabel

      public String getLabel(String lang)
      Retrieve the I18Ned label of this constraint.
      Parameters:
      lang - the ISO-639 code language to use to retrieve the label
      Returns:
      an I18Ned label such as "Reader tracking required"
    • getMessage

      public String getMessage(String lang)
      Retrieve the I18Ned message explaining the required constraint relative to classified publication.
      Parameters:
      lang - the ISO-639 code language to use to retrieve the message
      Returns:
      an I18Ned message such as "The 'Reader tracking required' must be honored for publication with a classification level greater than or equal to 'Confidential'."
    • getControllerStatus

      public ControllerStatus getControllerStatus()
      Retrieve a failed ControllerStatus suitable to explain the required constraint relative to classified publication.
      Returns:
      a ControllerStatus instance, never return null
    • getLogMessage

      public String getLogMessage()
      Retrieve an english message explaining the constraint relative to classified publication.
      Returns:
      an english message suitable for logging of behavior explanation, such as "The 'Reader tracking required' must be honored for publication with a classification level greater than or equal to 'Confidential'."
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIcon

      public String getIcon()
      Retrieve the icon of this constraint.
      Returns:
      an icon property name.
    • getPlugin

      public Plugin getPlugin()
      Retrieve the plugin in which this constraint was declared (if it is not a core feature)
      Returns:
      a Plugin instance, or null if it is a core feature.