001: /**
002: * ========================================
003: * JFreeReport : a free Java report library
004: * ========================================
005: *
006: * Project Info: http://reporting.pentaho.org/
007: *
008: * (C) Copyright 2000-2007, by Object Refinery Limited, Pentaho Corporation and Contributors.
009: *
010: * This library is free software; you can redistribute it and/or modify it under the terms
011: * of the GNU Lesser General Public License as published by the Free Software Foundation;
012: * either version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: * See the GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License along with this
019: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020: * Boston, MA 02111-1307, USA.
021: *
022: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023: * in the United States and other countries.]
024: *
025: * ------------
026: * $Id: FlowController.java 3048 2007-07-28 18:02:42Z tmorgner $
027: * ------------
028: * (C) Copyright 2000-2005, by Object Refinery Limited.
029: * (C) Copyright 2005-2007, by Pentaho Corporation.
030: */package org.jfree.report.flow;
031:
032: import org.jfree.report.DataSourceException;
033: import org.jfree.report.ReportDataFactoryException;
034: import org.jfree.report.data.ExpressionSlot;
035: import org.jfree.report.data.GlobalMasterRow;
036: import org.jfree.report.data.PrecomputedValueRegistry;
037:
038: /**
039: * A flow-controller is an immutable object. Whenever an method, that may change
040: * the internal state of the controller, is invoked, a new instance of the
041: * controller is returned.
042: *
043: * @author Thomas Morgner
044: */
045: public interface FlowController {
046: public FlowController performOperation(
047: FlowControlOperation operation) throws DataSourceException;
048:
049: public GlobalMasterRow getMasterRow();
050:
051: public ReportContext getReportContext();
052:
053: public String getExportDescriptor();
054:
055: public boolean isAdvanceRequested();
056:
057: public FlowController performQuery(final String query)
058: throws ReportDataFactoryException, DataSourceException;
059:
060: public FlowController performSubReportQuery(final String query,
061: final ParameterMapping[] inputParameters,
062: final ParameterMapping[] outputParameters)
063: throws ReportDataFactoryException, DataSourceException;
064:
065: /**
066: * Activates expressions that compute running values. This does not activate
067: * precomputed expressions.
068: *
069: * @param expressions
070: * @return
071: * @throws DataSourceException
072: */
073: public FlowController activateExpressions(
074: final ExpressionSlot[] expressions)
075: throws DataSourceException;
076:
077: /**
078: * Returns the current expression slots of all currently active expressions.
079: * (Maybe we should limit the access to the name and value of the expression
080: * instead?)
081: *
082: * @return
083: * @throws DataSourceException
084: */
085: public ExpressionSlot[] getActiveExpressions()
086: throws DataSourceException;
087:
088: public FlowController deactivateExpressions()
089: throws DataSourceException;
090:
091: public ReportJob getReportJob();
092:
093: public FlowController performReturnFromQuery()
094: throws DataSourceException;
095:
096: public FlowController createPrecomputeInstance()
097: throws DataSourceException;
098:
099: public PrecomputedValueRegistry getPrecomputedValueRegistry();
100: }
|