Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.dataSource.common
Class QueryDataDirector

java.lang.Object
  |
  +--oracle.dss.dataSource.common.QueryDataDirector
All Implemented Interfaces:
DataDirector, java.io.Serializable
Direct Known Subclasses:
CubeQueryDataDirector, RelationalQueryDataDirector

public class QueryDataDirector
extends java.lang.Object
implements DataDirector, java.io.Serializable

QueryDataDirector Implementation of common DataDirector functions

See Also:
Serialized Form

Fields inherited from interface oracle.dss.util.DataDirector
COLUMN_EDGE, DATA_ELEMENT_EDGE, DRILL_REPLACE, DRILLSTATE_DRILLABLE, DRILLSTATE_IS_DRILLED, DRILLSTATE_NOT_DRILLABLE, GROUPSORT_END, GROUPSORT_MIDDLE, GROUPSORT_NONE, GROUPSORT_START, max_edge, NA_SUPPRESSION, NA_ZERO_SUPPRESSION, NO_SUPPRESSION, PAGE_EDGE, PIVOT_EDGES, PIVOT_MOVE_AFTER, PIVOT_MOVE_BEFORE, PIVOT_MOVE_TO, PIVOT_SWAP, ROW_EDGE, ZERO_SUPPRESSION

 

Method Summary
 void addDataDirectorListener(DataDirectorListener l)
          Registers a listener to the data source for changes.
 boolean cancel()
          Cancels the current long-running operation, if possible.
 boolean changeEdgeCurrentHPos(int edge, int[] hPos, int maxLayerSpecified)
          Changes the current slice of data on the given edge.
 boolean changeEdgeCurrentSlice(int edge, int slice)
          Changes the current slice of data on the given edge.
 boolean deleteMemberCalc(int edge, int layer, int slice)
          Deletes a calculated value at the specified edge, layer, and slice.
 boolean deleteValueCalc(int row, int column)
          Deletes a calculated value at the specified row and column.
 boolean drill(int edge, int layer, int[] slice, int flags)
          Drills in data, from multiple selected members.
 boolean drill(int edge, int layer, int slice, int flags)
          Drills in the data, from a single member.
 boolean drillOK(int edge, int layer, int[] slice, int flags)
          Indicates whether the drill operation from multiple selected members is legal.
 boolean drillOK(int edge, int layer, int slice, int flags)
          Indicates whether a drill operation from a single selected member is legal.
 DataMap getDataMap()
          Retrieves the list of types of data that can be retrieved or set for each location in the data cursor.
 MetadataMap getMetadataMap(int edge, int layer)
          Retrieves the list of available types of metadata.
 DataMap getSupportedDataMap()
          Return a Datamap containing all of the types the implementor can support.
 LayerMetadataMap getSupportedLayerMetadataMap()
          Return a LayerMetadataMap containing all of the types the implementor can support.
 MetadataMap getSupportedMetadataMap()
          Return a MetadataMap containing all of the types the implementor can support.
 boolean insertMemberCalc(int edge, int layer, int slice, int flags, java.lang.Object calc)
          Inserts a calculation at a specified edge, layer, and slice.
 boolean insertValueCalc(int row, int column, int flags, java.lang.Object calc)
          Inserts a calculation at a specified row and column.
 boolean isCancelable()
          Indicates whether this DataDirector implementor allows views to cancel an operation that takes a long time.
 boolean isOutline()
          Indicates whether the data is provided in outline form or inline form.
 boolean pivot(int fromEdge, int toEdge, int fromLayer, int toLayer, int flags)
          Pivots data.
 boolean pivotOK(int fromEdge, int toEdge, int fromLayer, int toLayer, int flags)
          Indicates whether the specified pivot operation is legal.
 boolean refresh()
          Refreshes data and fires a DataChangedEvent.
 void removeDataDirectorListener(DataDirectorListener l)
          Removes a listener from the data source.
 boolean reorder(int edge, int fromLayer, int toLayer, int flags)
          Reorder dimension members or edge items and updates data.
 boolean revalidate()
          Rebuilds a query, refreshes data, and fires a DataChangedEvent.
 void setDataMap(DataMap map, int sizeRow, int sizeColumn)
          Specifies the types of data to provide in a data cursor.
 void setManualUpdate()
          Batches DataDirector operations.
 void setMetadataMap(int edge, int layer, MetadataMap map, int size)
          Specifies the types of metadata to provide in an edge cursor or in a layer cursor.
 void setOutline(boolean outline)
          Specifies whether the data is provided in outline form.
 void update()
          Processes batched DataDirector operations.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

pivot

public boolean pivot(int fromEdge,
                     int toEdge,
                     int fromLayer,
                     int toLayer,
                     int flags)
              throws EdgeOutOfRangeException,
LayerOutOfRangeException,
DataDirectorException
Pivots data. Operations include:
Specified by:
pivot in interface DataDirector
Parameters:
fromEdge - The edge to pivot from.
toEdge - The edge to pivot to.
fromLayer - The layer to pivot from. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
toLayer - The layer to pivot to.
flags - Constant that indicates the type of pivot to perform. The constants begin with PIVOT_ in this interface.
Returns:
true if the pivot is successful, false if not.
Throws:
EdgeOutOfRangeException - If either edge is too large.
LayerOutOfRangeException - If either layer is negative or too large.
DataDirectorException - If a data provider error occurs.

pivotOK

public boolean pivotOK(int fromEdge,
                       int toEdge,
                       int fromLayer,
                       int toLayer,
                       int flags)
                throws EdgeOutOfRangeException,
LayerOutOfRangeException,
DataDirectorException
Indicates whether the specified pivot operation is legal. The data provider determines its own rules for legal pivot operations.
Specified by:
pivotOK in interface DataDirector
Parameters:
fromEdge - The edge to pivot from.
toEdge - The edge to pivot to.
fromLayer - The layer to pivot from. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
toLayer - The layer to pivot to.
flags - Constant that indicates the type of pivot to perform. The constants begin with PIVOT_ in this interface.
Returns:
true if the pivot is legal according to the data provider's rules, false if not.
Throws:
EdgeOutOfRangeException - If either edge is too large.
LayerOutOfRangeException - If either depth is negative or too large.
DataDirectorException - If a data provider error occurs.

drill

public boolean drill(int edge,
                     int layer,
                     int slice,
                     int flags)
              throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Drills in the data, from a single member.
Specified by:
drill in interface DataDirector
Parameters:
edge - The edge to drill.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slice to drill. The slice is zero-based. Each dimension member in the innermost dimension has a unique slice. In outer dimensions, any slice that the outer dimension spans can be used.
flags - Constant that indicates the type of drill. The constants begin with DRILLABLE_ in this interface.
Returns:
true If drilling is successful, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.

drillOK

public boolean drillOK(int edge,
                       int layer,
                       int slice,
                       int flags)
                throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Indicates whether a drill operation from a single selected member is legal.
Specified by:
drillOK in interface DataDirector
Parameters:
edge - The edge to drill.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slice to drill. The slice is zero-based. Each dimension member in the innermost dimension has a unique slice. In outer dimensions, any slice that the outer dimension spans can be used.
flags - Constant that indicates the type of drill. The constants begin with DRILLABLE_ in this interface.
Returns:
true if this drilling operation is legal, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.

changeEdgeCurrentSlice

public boolean changeEdgeCurrentSlice(int edge,
                                      int slice)
                               throws EdgeOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Changes the current slice of data on the given edge.
Specified by:
changeEdgeCurrentSlice in interface DataDirector
Parameters:
edge - The edge on which to make the change.
slice - The slice to make current. Page numbers begin at zero and are incremented as in the following example:

Suppose that you have a Time dimension and a City dimension on the page edge. Suppose the City dimension has three members. The first five pages are as follows:

  • 0. Time member 0; City member 0
  • 1. Time member 0; City member 1
  • 2. Time member 0; City member 2
  • 3. Time member 1; City member 0
  • 4. Time member 1; City member 1
Returns:
true if the page change is successful, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
SliceOutOfRangeException - If slice is too large.
DataDirectorException - If a data provider error occurs.

changeEdgeCurrentHPos

public boolean changeEdgeCurrentHPos(int edge,
                                     int[] hPos,
                                     int maxLayerSpecified)
                              throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Changes the current slice of data on the given edge.
Specified by:
changeEdgeCurrentHPos in interface DataDirector
Parameters:
edge - The edge on which to make the change.
hPos - An array of relative indices starting with the outermost layer and working in at least to maxLayerSpecified indicating the set of new values to give to the various layers that make up the target slice
maxLayerSpecified - The maximum index into hPos (layer) that the call should use in making the slice change.
Returns:
true if the page change is successful, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If number of layers in hPos is too large.
SliceOutOfRangeException - If the slices in hPos are too large.
DataDirectorException - If a data provider error occurs.

addDataDirectorListener

public void addDataDirectorListener(DataDirectorListener l)
Registers a listener to the data source for changes. The DataDirector implementor is expected to fire a DataAvailableEvent in this routine when data is available and to provide an implementation of the DataAccess interface when data is ready. Note this method may throw a QueryRuntimeException.
Specified by:
addDataDirectorListener in interface DataDirector
Parameters:
l - The listener to add.

removeDataDirectorListener

public void removeDataDirectorListener(DataDirectorListener l)
Removes a listener from the data source.
Specified by:
removeDataDirectorListener in interface DataDirector
Parameters:
l - The listener to remove.

setMetadataMap

public void setMetadataMap(int edge,
                           int layer,
MetadataMap map,
                           int size)
                    throws EdgeOutOfRangeException,
LayerOutOfRangeException,
DataDirectorException
Specifies the types of metadata to provide in an edge cursor or in a layer cursor.
Specified by:
setMetadataMap in interface DataDirector
Parameters:
edge - The edge of interest. To set a default map for all edges, pass -1.
layer - The layer of interest. Use a depth computation to identify the location of the layer; 0 is the outer-most layer on the edge. To refer to all of the layers on an edge, pass -1. This parameter is not currently used.
map - A list of the metadata types that the view wants in an edge cursor or a layer cursor that the DataAccess fetches.
size - A suggested number of metatdata values that the data provider should fetch at a time. This is a guide for the data provider about the size of metadata chunks.
Throws:
EdgeOutOfRangeException - If edge is out of range.
LayerOutOfRangeException - If layer is out of range.
DataDirectorException - If a data provider error occurs.

setDataMap

public void setDataMap(DataMap map,
                       int sizeRow,
                       int sizeColumn)
                throws DataDirectorException
Specifies the types of data to provide in a data cursor.
Specified by:
setDataMap in interface DataDirector
Parameters:
map - A list of the data planes that the caller wants to get in data cursors that the DataAccess implementation fetches.
sizeRow - The suggested number of rows that the data provider should fetch at a time.
sizeColumn - The suggested number of columns that the data provider should fetch at a time.
Throws:
DataDirectorException - If a data provider error occurs

getMetadataMap

public MetadataMap getMetadataMap(int edge,
                                  int layer)
                           throws EdgeOutOfRangeException,
LayerOutOfRangeException
Retrieves the list of available types of metadata. This list includes the types of metadata that have been specified in metadata maps by any views that use this data provider.
Specified by:
getMetadataMap in interface DataDirector
Parameters:
edge - The edge of interest. A value of -1 is a request for for the default MetadataMap.
layer - The layer of interest. Uses a depth computation to identify the location of the layer; 0 is the outer-most layer on the edge. A layer value of -1 indicates all of the layers on an edge.
Returns:
The map of available types of metadata.
Throws:
EdgeOutOfRangeException - if edge is out of range.
LayerOutOfRangeException - If no layer exists at this location.

getDataMap

public DataMap getDataMap()
Retrieves the list of types of data that can be retrieved or set for each location in the data cursor. This list includes the types of data that have been specified in data maps by any views that use this data provider.
Specified by:
getDataMap in interface DataDirector
Returns:
The map of available types of data.

reorder

public boolean reorder(int edge,
                       int fromLayer,
                       int toLayer,
                       int flags)
                throws EdgeOutOfRangeException,
LayerOutOfRangeException,
DataDirectorException
Reorder dimension members or edge items and updates data. In a CubeDataDirector, reorders dimension members. In a RelationalDataDirector, reorders edge items. This method moves one dimension member or edge item to a new position within the dimension or edge, or swaps one dimension member or edge item with another, within the dimension or edge.
Specified by:
reorder in interface DataDirector
Parameters:
edge - A constant that identifies the edge that contains the dimension or items to reorder.
fromLayer - The layer from which to reorder.
toLayer - The layer to which to move the item near, or with which to swap.
flags - Constant that indicates whether to move fromLayer before or after toLayer, or whether to swap the two layers. You can use the PIVOT_ constants.
Returns:
true if reordering is successful, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
DataDirectorException - If a data provider error occurs.

insertValueCalc

public boolean insertValueCalc(int row,
                               int column,
                               int flags,
                               java.lang.Object calc)
                        throws RowOutOfRangeException,
ColumnOutOfRangeException,
DataDirectorException
Inserts a calculation at a specified row and column. Fields identify the type of calculation to insert. The data provider specifies the fields for the available calculations. Other information about the calculation is dependent on each data provider and is based on the data parameter. For example, the data parameter could indicate the selected range information.

This implementation returns false.

Specified by:
insertValueCalc in interface DataDirector
Parameters:
row - The row at which the calculation should be inserted.
column - The column at which the calculation should be inserted.
flags - A constant that specifies he type of calculation to insert. The data provider specifies the constants.
calc - Flag and data-provider-dependent information about the calculation to insert.
Returns:
true if the calculation is inserted, false if not.
Throws:
RowOutOfRangeException - If row is negative or too large.
ColumnOutOfRangeException - If column is negative or too large.
DataDirectorException - If a data provider error occurs.

insertMemberCalc

public boolean insertMemberCalc(int edge,
                                int layer,
                                int slice,
                                int flags,
                                java.lang.Object calc)
                         throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Inserts a calculation at a specified edge, layer, and slice. Fields identify the type of calculation to insert. The data provider specifies the fields for the available calculations. Other information about the calculation is dependent on each data provider and is based on the data parameter. For example, the data parameter could indicate the selected range information.

This implementation returns false.

Specified by:
insertMemberCalc in interface DataDirector
Parameters:
edge - A constant that specifies the edge on which to insert the calculation.
layer - The layer at which to insert the calculation. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slice at which to insert the calculation.
flags - A constant that specifies the type of calculation to insert. The data provider specifies the constants.
calc - Flag and data-provider-dependent information about the calculation to insert.
Returns:
true if the calculation is inserted, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.

deleteValueCalc

public boolean deleteValueCalc(int row,
                               int column)
                        throws RowOutOfRangeException,
ColumnOutOfRangeException,
DataDirectorException
Deletes a calculated value at the specified row and column. Deletes the calculation only if it is present at the specified location.

This implementation returns false.

Specified by:
deleteValueCalc in interface DataDirector
Parameters:
row - The row at which to delete the calculation.
column - The column at which to delete the calculation.
Returns:
true if the calculation is deleted, false if not.
Throws:
RowOutOfRangeException - If row is negative or too large.
ColumnOutOfRangeException - If column is negative or too large.
DataDirectorException - If a data provider error occurs

deleteMemberCalc

public boolean deleteMemberCalc(int edge,
                                int layer,
                                int slice)
                         throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Deletes a calculated value at the specified edge, layer, and slice. Deletes the calculation only if it is present at the specified location.

This implementation returns false.

Specified by:
deleteMemberCalc in interface DataDirector
Parameters:
edge - A constant that specifies the edge from which to delete the calculation.
layer - The layer at which to delete the calculation. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slice at which to delete the calculation.
Returns:
true if the calculation is inserted, false if not.
Throws:
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If sliceDataDirectorException - If a data provider error occurs.

drill

public boolean drill(int edge,
                     int layer,
                     int[] slice,
                     int flags)
              throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Drills in data, from multiple selected members.

This implementation returns false.

Specified by:
drill in interface DataDirector
Parameters:
edge - The edge to drill.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slices to drill. Slices are zero-based. Each dimension member in the innermost dimension has a unique slice. In outer dimensions, any slice that the outer dimension spans can be used.
flags - Constant that indicates the type of drill. The constants begin with DRILLSTATE_ in this interface.
Returns:
true If drilling is successful, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.

drillOK

public boolean drillOK(int edge,
                       int layer,
                       int[] slice,
                       int flags)
                throws EdgeOutOfRangeException,
LayerOutOfRangeException,
SliceOutOfRangeException,
DataDirectorException
Indicates whether the drill operation from multiple selected members is legal.

This implementation returns false.

Specified by:
drillOK in interface DataDirector
Parameters:
edge - The edge to drill.
layer - The layer to drill. The layer identifies the location of the dimension or dimension member; 0 is the outer-most dimension on the edge.
slice - The slice to drill. The slice is zero-based. Each dimension member in the innermost dimension has a unique slice. In outer dimensions, any slice that the outer dimension spans can be used.
flags - Constant that indicates the type of drill. The constants begin with DRILLSTATE_ in this interface.
Returns:
true if this drilling operation is legal, false if not.
Throws:
EdgeOutOfRangeException - If edge is too large.
LayerOutOfRangeException - If layer is negative or too large.
SliceOutOfRangeException - If slice is negative or too large.
DataDirectorException - If a data provider error occurs.

refresh

public boolean refresh()
                throws DataDirectorException
Refreshes data and fires a DataChangedEvent.
Specified by:
refresh in interface DataDirector
Returns:
true if data will be refreshed, false if not.
Throws:
DataDirectorException - If a data provider error occurs

revalidate

public boolean revalidate()
                   throws DataDirectorException
Rebuilds a query, refreshes data, and fires a DataChangedEvent.
Specified by:
revalidate in interface DataDirector
Returns:
true if data will be refreshed, false if not.
Throws:
DataDirectorException - If a data provider error occurs

setOutline

public void setOutline(boolean outline)
                throws DataDirectorException
Specifies whether the data is provided in outline form. Updates the data and fires a DataChanged event. This is an optional method. Outline form lists outer dimensions in the same depth as inner dimensions, whereas inline form shows outer dimensions at different depths.

For example, if the row edge uses outline form, all dimensions appear in the same label column. If it does not use outline form, there is a separate column for each dimension.

Specified by:
setOutline in interface DataDirector
Parameters:
outline - true to set data provision to outline form, false to use inline form.
Throws:
DataDirectorException - If a data provider error occurs

isOutline

public boolean isOutline()
Indicates whether the data is provided in outline form or inline form. Outline form lists outer dimensions in the same depth as inner dimensions, whereas inline form shows outer dimensions at different depths.

For example, if the row edge uses outline form, all dimensions appear in the same label column. If it does not use outline form, there is a separate column for each dimension.

Specified by:
isOutline in interface DataDirector
Returns:
true if the data is provided in outline form, false if the data is provided in inline form.

isCancelable

public boolean isCancelable()
Indicates whether this DataDirector implementor allows views to cancel an operation that takes a long time.
Specified by:
isCancelable in interface DataDirector
Returns:
true if the data provider supports cancelation of long operations, false if not.

cancel

public boolean cancel()
Cancels the current long-running operation, if possible.
Specified by:
cancel in interface DataDirector
Returns:
true if the implementor canceled the operation, false if the implementor did not or could not cancel the operation.

setManualUpdate

public void setManualUpdate()
Batches DataDirector operations. If the implementor supports command batching, operations between this call and a call to update are batched. Note this method may throw a QueryRuntimeException.
Specified by:
setManualUpdate in interface DataDirector
See Also:
update()

update

public void update()
            throws DataDirectorException
Processes batched DataDirector operations. Operations between a call to setManualUpdate and this method are batched. This method should also turn off manual update mode.
Specified by:
update in interface DataDirector
Throws:
DataDirectorException - If a data provider error occurs
See Also:
setManualUpdate()

getSupportedMetadataMap

public MetadataMap getSupportedMetadataMap()
Return a MetadataMap containing all of the types the implementor can support. This is not meant to guarantee views that they can get the types they want in every query.
Specified by:
getSupportedMetadataMap in interface DataDirector
Returns:
MetadataMap containing all of the possibly supported types

getSupportedLayerMetadataMap

public LayerMetadataMap getSupportedLayerMetadataMap()
Return a LayerMetadataMap containing all of the types the implementor can support. This is not meant to guarantee views that they can get the types they want in every query.
Specified by:
getSupportedLayerMetadataMap in interface DataDirector
Returns:
LayerMetadataMap containing all of the possibly supported types

getSupportedDataMap

public DataMap getSupportedDataMap()
Return a Datamap containing all of the types the implementor can support. This is not meant to guarantee views that they can get the types they want in every query.
Specified by:
getSupportedDataMap in interface DataDirector
Returns:
DataMap containing all of the possibly supported types

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.