Package org.jboss.security.xacml.sunxacml.attr

Examples of org.jboss.security.xacml.sunxacml.attr.TimeAttribute


        // check if any errors occured while resolving the inputs
        if (result != null)
            return result;

        // get the three time values
        TimeAttribute attr = (TimeAttribute)(argValues[0]);
        long middleTime = attr.getMilliseconds();
        long minTime = resolveTime(attr, (TimeAttribute)(argValues[1]));
        long maxTime = resolveTime(attr, (TimeAttribute)(argValues[2]));
       
        // first off, if the min and max are the same, then this can only
        // be true is the middle is also the same value
View Full Code Here


            break;
        }

        case ID_TIME_GREATER_THAN: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) > 0);

            break;
        }

        case ID_TIME_GREATER_THAN_OR_EQUAL: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) >= 0);

            break;
        }

        case ID_TIME_LESS_THAN: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) < 0);

            break;
        }

        case ID_TIME_LESS_THAN_OR_EQUAL: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) <= 0);

            break;
        }

        case ID_DATETIME_GREATER_THAN: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) > 0);

            break;
        }

        case ID_DATETIME_GREATER_THAN_OR_EQUAL: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) >= 0);

            break;
        }

        case ID_DATETIME_LESS_THAN: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) < 0);

            break;
        }

        case ID_DATETIME_LESS_THAN_OR_EQUAL: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) <= 0);

            break;
        }

        case ID_DATE_GREATER_THAN: {
View Full Code Here

        long millis = dateTimeHelper();

        if (useCachedEnvValues)
            return currentTime;
        else
            return new TimeAttribute(new Date(millis));
    }
View Full Code Here

            return millis;
        } else {
            // we're caching, so resolve all three values, making sure
            // to use clean copies of the date object since it may be
            // modified when creating the attributes
            currentTime = new TimeAttribute(time);
            currentDate = new DateAttribute(new Date(millis));
            currentDateTime = new DateTimeAttribute(new Date(millis));
        }
       
        return -1;
View Full Code Here

        long millis = dateTimeHelper();

        if (useCachedEnvValues)
            return currentTime;
        else
            return new TimeAttribute(new Date(millis));
    }
View Full Code Here

            return millis;
        } else {
            // we're caching, so resolve all three values, making sure
            // to use clean copies of the date object since it may be
            // modified when creating the attributes
            currentTime = new TimeAttribute(time);
            currentDate = new DateAttribute(new Date(millis));
            currentDateTime = new DateTimeAttribute(new Date(millis));
        }
       
        return -1;
View Full Code Here

*/
public class TimeAttributeUnitTestCase extends TestCase
{
   public void testTime() throws Exception
   {
      TimeAttribute end = TimeAttribute.getInstance("23:59:00-08:00");
      TimeAttribute now = TimeAttribute.getInstance("16:50:07.091000000-05:00");
     
      Date nowDate = now.getValue();
      Date endDate = end.getValue();
     
      assertTrue("4:50 PM CDT is before 11:59 PDT", nowDate.before(endDate));
     
      end = TimeAttribute.getInstance("01:59:00-08:00");
      now = TimeAttribute.getInstance("03:59:00-06:00");
     
      nowDate = now.getValue();
      endDate = end.getValue();
     
      assertFalse("03:59 central is not before 01:59 PDT", nowDate.before(endDate) );
     
      end = TimeAttribute.getInstance("03:59:00-08:00");
      now = TimeAttribute.getInstance("03:59:00-08:00");
     
      nowDate = now.getValue();
      endDate = end.getValue();
     
      assertFalse("03:59 PDT is not before 03:59 PDT", nowDate.before(endDate) );
   }
View Full Code Here

            break;
        }

        case ID_TIME_GREATER_THAN: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) > 0);

            break;
        }

        case ID_TIME_GREATER_THAN_OR_EQUAL: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) >= 0);

            break;
        }

        case ID_TIME_LESS_THAN: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) < 0);

            break;
        }

        case ID_TIME_LESS_THAN_OR_EQUAL: {
            TimeAttribute arg0 = (TimeAttribute)(argValues[0]);
            TimeAttribute arg1 = (TimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) <= 0);

            break;
        }

        case ID_DATETIME_GREATER_THAN: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) > 0);

            break;
        }

        case ID_DATETIME_GREATER_THAN_OR_EQUAL: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) >= 0);

            break;
        }

        case ID_DATETIME_LESS_THAN: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) < 0);

            break;
        }

        case ID_DATETIME_LESS_THAN_OR_EQUAL: {
            DateTimeAttribute arg0 = (DateTimeAttribute)(argValues[0]);
            DateTimeAttribute arg1 = (DateTimeAttribute)(argValues[1]);

            boolResult =
                (dateCompare(arg0.getValue(), arg0.getNanoseconds(),
                             arg1.getValue(), arg1.getNanoseconds()) <= 0);

            break;
        }

        case ID_DATE_GREATER_THAN: {
View Full Code Here

        // check if any errors occured while resolving the inputs
        if (result != null)
            return result;

        // get the three time values
        TimeAttribute attr = (TimeAttribute)(argValues[0]);
        long middleTime = attr.getMilliseconds();
        long minTime = resolveTime(attr, (TimeAttribute)(argValues[1]));
        long maxTime = resolveTime(attr, (TimeAttribute)(argValues[2]));
       
        // first off, if the min and max are the same, then this can only
        // be true is the middle is also the same value
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.attr.TimeAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.