Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jharks.workflow.conditions;
 
Condition that checks if the current session proeprty matches the specifed value.

Author(s):
Michael J. Rizzo
Version:
1.0
public class SessionPropertyMatchCondition extends SessionPropertySetCondition {
    
    
The value to be matched against the property value.
    private String sessionPropertyValue;
    
    
    public boolean checkCondition(Object param) {
        if (.isDebugEnabled())
            .debug("SessionPropertyMatchCondition: Check condition: " +
                  "property name = " + getSessionPropertyName());
            
      if (param instanceof SessionHistory) {
          SessionHistory rs = (SessionHistoryparam;
  
          if ( checkProperty(getSessionPropertyName(), rs) != null ) {
              Object property = rs.getProperty(getSessionPropertyName());
              
              if (property instanceof String) {
                if (.isDebugEnabled()) {
                  .debug("Session Property value = [" +  property + "]");
                  .debug("Configured value = [" 
                          + getSessionPropertyValue() + "]");
                }
              
                if (((Stringproperty).equalsIgnoreCase(
                      getSessionPropertyValue()))
                  return true;
              } else {
                if ( property.equals(getSessionPropertyValue()) )
                      return true;
              }
          }
      } else {
          throw new ClassCastException("Expecting SessionHistory Object.");
      }
        return false;
    } 
    
    
    
Returns the configured value of the session property value to check.

Returns:
the session property value that was configured.
    public String getSessionPropertyValue() {
        return ;
    }
    
    
Sets the session property value attribute to the specified value.

Parameters:
sessionPropertyValue The session property value to set.
    public void setSessionPropertyValue(String sessionPropertyValue) {
        this. = sessionPropertyValue;
    }
New to GrepCode? Check out our FAQ X