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.String
getConstraintName()
Retrieve the technical name of this constraint.ControllerStatus
getControllerStatus()
Retrieve a failed ControllerStatus suitable to explain the required constraint relative to classified publication.java.lang.String
getIcon()
Retrieve the icon of this constraint.java.lang.String
getLabel(java.lang.String lang)
Retrieve the I18Ned label of this constraint.java.lang.String
getLogMessage()
Retrieve an english message explaining the constraint relative to classified publication.java.lang.String
getMessage(java.lang.String lang)
Retrieve the I18Ned message explaining the required constraint relative to classified publication.Plugin
getPlugin()
Retrieve the plugin in which this constraint was declared (if it is not a core feature)int
getStartLevel()
Retrieve the classification level starting which constraint must be enforced.boolean
mustBeCheckedFor(Publication pub)
Check if this constraint can be used for the specified publication.java.lang.String
toString()
-
-
-
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.required
orplugin.totp.required
.Must not be null.
- Throws:
java.lang.NullPointerException
- ifconstraintName
isnull
-
-
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:
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 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:
toString
in 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.
-
-