Class ClassifiedConstraint
- java.lang.Object
-
- com.jalios.jcms.security.classified.ClassifiedConstraint
-
public class ClassifiedConstraint extends java.lang.Object- Since:
- 10.0.8 / JCMS-10746
-
-
Constructor Summary
Constructors Constructor Description ClassifiedConstraint(java.lang.String constraintName)Create a new ClassifiedConstraint with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetConstraintName()Retrieve the technical name of this constraint.ControllerStatusgetControllerStatus()Retrieve a failed ControllerStatus suitable to explain the required constraint relative to classified publication.java.lang.StringgetIcon()Retrieve the icon of this constraint.java.lang.StringgetLabel(java.lang.String lang)Retrieve the I18Ned label of this constraint.java.lang.StringgetLogMessage()Retrieve an english message explaining the constraint relative to classified publication.java.lang.StringgetMessage(java.lang.String lang)Retrieve the I18Ned message explaining the required constraint relative to classified publication.PlugingetPlugin()Retrieve the plugin in which this constraint was declared (if it is not a core feature)intgetStartLevel()Retrieve the classification level starting which constraint must be enforced.booleanmustBeCheckedFor(Publication pub)Check if this constraint can be used for the specified publication.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ClassifiedConstraint
public ClassifiedConstraint(java.lang.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.requiredorplugin.totp.required.Must not be null.
- Throws:
java.lang.NullPointerException- ifconstraintNameisnull
-
-
Method Detail
-
getConstraintName
public java.lang.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:
trueif the constraint MUST be enforced for the specified publication.falseif 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 java.lang.String getLabel(java.lang.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 java.lang.String getMessage(java.lang.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 java.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getIcon
public java.lang.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.
-
-