Package com.espertech.esper.epl.expression

Examples of com.espertech.esper.epl.expression.ExprTimePeriod


            throws ViewParameterException
    {
        StreamTypeService streamTypeService = new StreamTypeServiceImpl(statementContext.getEngineURI(), false);
        ExprTimePeriodEvalDeltaConst timeDelta;
        if (expression instanceof ExprTimePeriod) {
            ExprTimePeriod validated = (ExprTimePeriod) ViewFactorySupport.validateExpr(viewName, statementContext, expression, streamTypeService, expressionNumber);
            timeDelta = validated.constEvaluator(new ExprEvaluatorContextStatement(statementContext));
        }
        else {
            Object result = ViewFactorySupport.validateAndEvaluateExpr(viewName, statementContext, expression, streamTypeService, expressionNumber);
            if (!(result instanceof Number)) {
                throw new ViewParameterException(expectedMessage);
View Full Code Here


        this.convertor = convertor;
    }

    protected long computeMilliseconds(MatchedEventMap beginState, PatternAgentInstanceContext context) {
        if (millisecondsExpr instanceof ExprTimePeriod) {
            ExprTimePeriod timePeriod = (ExprTimePeriod) millisecondsExpr;
            return timePeriod.nonconstEvaluator().deltaMillisecondsUseEngineTime(convertor.convert(beginState), context.getAgentInstanceContext());
        }
        else {
            Object millisecondVal = PatternExpressionUtil.evaluate("Timer-Within-Or-Max-Count guard", beginState, millisecondsExpr, convertor, context.getAgentInstanceContext());
            if (null == millisecondVal) {
                throw new EPException("Timer-within-or-max first parameter evaluated to a null-value");
View Full Code Here

                throw new ASTWalkException("Invalid use of 'now' with initiated-by stream, this combination is not supported");
            }
            return new ContextDetailConditionFilter(filterSpecRaw, asName);
        }
        else if (parent.getType() == EsperEPL2Ast.AFTER) {
            ExprTimePeriod timePeriod = (ExprTimePeriod) astExprNodeMap.remove(parent.getChild(0));
            return new ContextDetailConditionTimePeriod(timePeriod, immediate);
        }
        else {
            throw new IllegalStateException("Unrecognized child type " + parent.getType());
        }
View Full Code Here

            if (child.getType() == EsperEPL2Ast.YEAR_PART)
            {
                nodes[0] = astExprNodeMap.remove(child.getChild(0));
            }
        }
        ExprTimePeriod timeNode = new ExprTimePeriodImpl(nodes[0] != null, nodes[1]!= null, nodes[2]!= null, nodes[3]!= null, nodes[4]!= null, nodes[5]!= null, nodes[6]!= null, nodes[7]!= null);
        if (nodes[0] != null) timeNode.addChildNode(nodes[0]);
        if (nodes[1] != null) timeNode.addChildNode(nodes[1]);
        if (nodes[2] != null) timeNode.addChildNode(nodes[2]);
        if (nodes[3] != null) timeNode.addChildNode(nodes[3]);
        if (nodes[4] != null) timeNode.addChildNode(nodes[4]);
        if (nodes[5] != null) timeNode.addChildNode(nodes[5]);
        if (nodes[6] != null) timeNode.addChildNode(nodes[6]);
        if (nodes[7] != null) timeNode.addChildNode(nodes[7]);
        return timeNode;
    }
View Full Code Here

        if (outputLimitSpec != null) {
            ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
            ExprValidationContext validationContext = new ExprValidationContext(new StreamTypeServiceImpl(statementContext.getEngineURI(), false), statementContext.getMethodResolutionService(), null, statementContext.getTimeProvider(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor());
            if (outputLimitSpec.getAfterTimePeriodExpr() != null) {
                ExprTimePeriod timePeriodExpr = (ExprTimePeriod) ExprNodeUtility.getValidatedSubtree(outputLimitSpec.getAfterTimePeriodExpr(), validationContext);
                outputLimitSpec.setAfterTimePeriodExpr(timePeriodExpr);
            }
            if (outputLimitSpec.getTimePeriodExpr() != null) {
                ExprTimePeriod timePeriodExpr = (ExprTimePeriod) ExprNodeUtility.getValidatedSubtree(outputLimitSpec.getTimePeriodExpr(), validationContext);
                outputLimitSpec.setTimePeriodExpr(timePeriodExpr);
            }
        }

        OutputProcessViewFactory outputProcessViewFactory;
View Full Code Here

        if (outputLimitSpec != null) {
            ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
            ExprValidationContext validationContext = new ExprValidationContext(new StreamTypeServiceImpl(statementContext.getEngineURI(), false), statementContext.getMethodResolutionService(), null, statementContext.getTimeProvider(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor());
            if (outputLimitSpec.getAfterTimePeriodExpr() != null) {
                ExprTimePeriod timePeriodExpr = (ExprTimePeriod) ExprNodeUtility.getValidatedSubtree(outputLimitSpec.getAfterTimePeriodExpr(), validationContext);
                outputLimitSpec.setAfterTimePeriodExpr(timePeriodExpr);
            }
            if (outputLimitSpec.getTimePeriodExpr() != null) {
                ExprTimePeriod timePeriodExpr = (ExprTimePeriod) ExprNodeUtility.getValidatedSubtree(outputLimitSpec.getTimePeriodExpr(), validationContext);
                outputLimitSpec.setTimePeriodExpr(timePeriodExpr);
            }
        }

        OutputProcessViewFactory outputProcessViewFactory;
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.expression.ExprTimePeriod

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.