psdi.common.condition

Class MaxCondition

  • All Implemented Interfaces:
    java.io.Serializable, FixedLoggerNames, FixedLoggers


    public class MaxCondition
    extends CachedObjectPointer
    implements FixedLoggers
    The object that represent a condition. It contains the information of condition number, expression, or classnames. This is the object that stored in the condition cache. It also evaluates.
    See Also:
    Serialized Form
    • Constructor Detail

      • MaxCondition

        public MaxCondition(java.lang.String num,
                            java.lang.String clsName,
                            java.lang.String value,
                            boolean isExp,
                            int tenantId,
                            long uniqueId)
        Constructor to create a expression condition.
        Parameters:
        num - condition number
        clsName - class name
        value - condition value
        exp - is expression
        tenantId - tenant id
        id - unique id
      • MaxCondition

        public MaxCondition(java.lang.String num,
                            java.lang.String exp,
                            int tenantId,
                            long uniqueId)
        Constructor to create a expression condition.
        Parameters:
        num - condition number
        exp - is expression
        tenantId - tenant id
        id - unique id
    • Method Detail

      • isExpression

        public boolean isExpression()
        Whether it is a expression condition.
        Returns:
      • getConditionNum

        public java.lang.String getConditionNum()
        Returns condition number. It returns null if it is a temporary condition without the number.
        Returns:
      • evaluate

        public boolean evaluate(MboRemote mbo)
                         throws MXException,
                                java.rmi.RemoteException,
                                java.rmi.RemoteException
        Evaluate the condition to true or false based on the mbo passed in. The evaluation is performed by the expression or custom condition object that is appropriate for the condition. If exception encountered, the exception will be logged as error but the evaluation will return false.
        Parameters:
        mbo -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • evaluate

        public boolean evaluate(MboRemote mbo,
                                boolean logExceptionOnly)
                         throws MXException,
                                java.rmi.RemoteException
        Evaluate the condition to true or false based on the mbo passed in. The evaluation is performed by the expression or custom condition object that is appropriate for the condition.
        Parameters:
        mbo -
        logExceptionOnly - True if exception will only be loged.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • toWhereClause

        public java.lang.String toWhereClause(MboSetRemote msr)
                                       throws MXException,
                                              java.rmi.RemoteException
        Convert the condition expression to a where clause. This method is called when the condition is used for the row security's "QUALIFIED" type. If the expression cannot be converted, an exception would be thrown.
        Returns:
        Throws:
        MXException
        RemoteExcption
        java.rmi.RemoteException
      • isAlwaysTrue

        public boolean isAlwaysTrue()
      • isAlwaysTrue

        public static boolean isAlwaysTrue(java.util.ArrayList conditions)
        Return true if one of the condition is always true.
        Parameters:
        conditions -
        Returns:
      • getClassName

        public java.lang.String getClassName()
        Used by UserProfileHierarchySet for Profile tab in Users app. This should be called after evaluating isExpression = False.
        Returns:
        class name
      • getExpression

        public java.lang.String getExpression()
        Used by UserProfileHierarchySet for Profile tab in Users app. This should be called after evaluating isExpression = True.
        Returns:
        strValue
      • isMboCachable

        public boolean isMboCachable()
      • setMboCachable

        public void setMboCachable(boolean cachable)
      • getTypedReference

        public MaxConditionBase getTypedReference()
        Get reference to actual info object
        Returns:
        actual info object
      • getTypedReferenceForSet

        public MaxConditionBase getTypedReferenceForSet()
        Get reference to actual info object for set
        Returns:
        actual info object