public class PivotModelImpl extends Object implements PivotModel
Constructor and Description |
---|
PivotModelImpl(OlapDataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
void |
addModelChangeListener(ModelChangeListener listener)
Adds a model change listener
|
void |
addQueryListener(QueryListener listener)
Adds a query listener
|
protected void |
closeConnection(OlapConnection connection) |
protected OlapConnection |
createConnection(OlapDataSource dataSource) |
protected ExpressionContext |
createExpressionContext() |
protected QueryAdapter |
createQueryAdapter() |
void |
destroy()
Called once when the not used any longer.
|
protected CellSet |
executeMdx(OlapConnection connection,
String mdx) |
protected void |
fireModelChanged() |
protected void |
fireModelDestroyed() |
protected void |
fireModelInitialized() |
protected void |
fireQueryExecuted(Date start,
long duration,
String mdx) |
protected void |
fireStructureChanged() |
Catalog |
getCatalog() |
CellSet |
getCellSet()
Runs the query and returns the result.
|
protected OlapConnection |
getConnection()
Returns the connection.
|
Cube |
getCube()
Returns the cube for the query.
|
String |
getCurrentMdx()
Returns the current MDX query which this model instance is based on or
null if the model is not initialized.
|
protected String |
getCurrentMdx(boolean evaluated) |
OlapDataSource |
getDataSource() |
String |
getEvaluatedMdx()
Returns the current MDX query after all parameter expressions are
resolved.
|
ExpressionContext |
getExpressionContext() |
ExpressionEvaluatorFactory |
getExpressionEvaluatorFactory() |
Locale |
getLocale()
Returns the current locale.
|
protected org.slf4j.Logger |
getLogger() |
String |
getMdx()
Returns the mdxQuery.
|
OlapDatabaseMetaData |
getMetadata()
Returns the database metadata for the active connection.
|
protected QueryAdapter |
getQueryAdapter()
Returns the queryAdapter.
|
String |
getRoleName() |
SortCriteria |
getSortCriteria() |
List<Member> |
getSortPosMembers() |
int |
getTopBottomCount()
Number of members for topcount and bottomcount
|
<T extends Transform> |
getTransform(Class<T> type)
Returns the registered transform instance for the given type.
|
TransformFactory |
getTransformFactory() |
void |
initialize() |
boolean |
isInitialized() |
boolean |
isSortable(Position position)
returns true, if ONE of the members is a measure
|
boolean |
isSorting() |
boolean |
isSorting(Position position)
Return true if the result is sorted by the members of the position
|
protected boolean |
isSortOnQuery() |
protected String |
normalizeMdx(String mdx) |
protected void |
onMdxChanged(String mdx) |
void |
refresh()
Flushes the last query result.
|
void |
removeModelChangeListener(ModelChangeListener listener)
Removes a model change listener
|
void |
removeQueryListener(QueryListener listener)
Removes a query listener
|
void |
restoreSettings(HierarchicalConfiguration configuration) |
void |
restoreState(Serializable state) |
void |
saveSettings(HierarchicalConfiguration configuration) |
Serializable |
saveState() |
void |
setExpressionEvaluatorFactory(ExpressionEvaluatorFactory factory) |
void |
setLocale(Locale locale)
Sets the current locale.
|
void |
setMdx(String mdxQuery)
Sets the mdxQuery.
|
void |
setRoleName(String roleName) |
void |
setSortCriteria(SortCriteria sortCriteria) |
void |
setSorting(boolean sorting) |
void |
setTopBottomCount(int topBottomCount) |
void |
setTransformFactory(TransformFactory factory) |
void |
sort(CellSetAxis axisToSort,
Position position)
Changes current sorting.
|
public PivotModelImpl(OlapDataSource dataSource)
dataSource
- protected org.slf4j.Logger getLogger()
public Locale getLocale()
getLocale
in interface PivotModel
PivotModel.getLocale()
public void setLocale(Locale locale)
setLocale
in interface PivotModel
locale
- The locale to setPivotModel.setLocale(java.util.Locale)
public String getRoleName()
getRoleName
in interface PivotModel
PivotModel.getRoleName()
public void setRoleName(String roleName)
setRoleName
in interface PivotModel
roleName
- the roleName to setPivotModel.setRoleName(java.lang.String)
public void initialize()
initialize
in interface PivotModel
PivotModel.initialize()
public boolean isInitialized()
isInitialized
in interface PivotModel
PivotModel.isInitialized()
protected OlapConnection createConnection(OlapDataSource dataSource) throws SQLException
dataSource
- SQLException
public void destroy()
PivotModel
destroy
in interface PivotModel
PivotModel.destroy()
protected void closeConnection(OlapConnection connection) throws SQLException
connection
- SQLException
protected ExpressionContext createExpressionContext()
protected OlapConnection getConnection()
public OlapDataSource getDataSource()
public Catalog getCatalog()
NotInitializedException
public OlapDatabaseMetaData getMetadata()
PivotModel
getMetadata
in interface PivotModel
PivotModel.getMetadata()
public Cube getCube()
PivotModel
getCube
in interface PivotModel
PivotModel.getCube()
public CellSet getCellSet()
PivotModel
getCellSet
in interface PivotModel
PivotModel.getCellSet()
public void refresh()
PivotModel
refresh
in interface PivotModel
PivotModel.refresh()
public ExpressionContext getExpressionContext()
getExpressionContext
in interface PivotModel
PivotModel.getExpressionContext()
protected CellSet executeMdx(OlapConnection connection, String mdx) throws OlapException
connection
- mdx
- OlapException
public String getCurrentMdx()
PivotModel
getCurrentMdx
in interface PivotModel
PivotModel.getCurrentMdx()
public String getEvaluatedMdx()
PivotModel
PivotModel.getCurrentMdx()
if
no parameter expressions are present.getEvaluatedMdx
in interface PivotModel
PivotModel.getEvaluatedMdx()
protected String getCurrentMdx(boolean evaluated)
evaluated
- public String getMdx()
getMdx
in interface PivotModel
public void setMdx(String mdxQuery)
setMdx
in interface PivotModel
mdxQuery
- The mdxQuery to setprotected void onMdxChanged(String mdx)
mdx
- protected QueryAdapter createQueryAdapter()
protected QueryAdapter getQueryAdapter()
public TransformFactory getTransformFactory()
public void setTransformFactory(TransformFactory factory)
factory
- the transformFactory to setpublic ExpressionEvaluatorFactory getExpressionEvaluatorFactory()
getExpressionEvaluatorFactory
in interface PivotModel
PivotModel.getExpressionEvaluatorFactory()
public void setExpressionEvaluatorFactory(ExpressionEvaluatorFactory factory)
factory
- the expressionEvaluatorFactory to setpublic void addModelChangeListener(ModelChangeListener listener)
PivotModel
addModelChangeListener
in interface PivotModel
PivotModel.addModelChangeListener(com.eyeq.pivot4j.ModelChangeListener)
public void removeModelChangeListener(ModelChangeListener listener)
PivotModel
removeModelChangeListener
in interface PivotModel
PivotModel.removeModelChangeListener(com.eyeq.pivot4j.ModelChangeListener)
protected void fireModelInitialized()
protected void fireModelChanged()
protected void fireStructureChanged()
protected void fireModelDestroyed()
public void addQueryListener(QueryListener listener)
PivotModel
addQueryListener
in interface PivotModel
PivotModel.addQueryListener(com.eyeq.pivot4j.QueryListener)
public void removeQueryListener(QueryListener listener)
PivotModel
removeQueryListener
in interface PivotModel
PivotModel.removeQueryListener(com.eyeq.pivot4j.QueryListener)
public <T extends Transform> T getTransform(Class<T> type)
PivotModel
getTransform
in interface PivotModel
PivotModel.getTransform(java.lang.Class)
public boolean isSorting()
isSorting
in interface PivotModel
PivotModel.isSorting()
public boolean isSorting(Position position)
PivotModel
isSorting
in interface PivotModel
position
- to be checkedPivotModel.isSorting(org.olap4j.Position)
public void setSorting(boolean sorting)
setSorting
in interface PivotModel
PivotModel.setSorting(boolean)
public SortCriteria getSortCriteria()
getSortCriteria
in interface PivotModel
public void setSortCriteria(SortCriteria sortCriteria)
setSortCriteria
in interface PivotModel
PivotModel.setSortCriteria(com.eyeq.pivot4j.sort.SortCriteria)
public boolean isSortable(Position position)
isSortable
in interface PivotModel
position
- the position to check for sortabilityprotected boolean isSortOnQuery()
public List<Member> getSortPosMembers()
getSortPosMembers
in interface PivotModel
PivotModel.getSortPosMembers()
public int getTopBottomCount()
PivotModel
getTopBottomCount
in interface PivotModel
PivotModel.getTopBottomCount()
public void setTopBottomCount(int topBottomCount)
setTopBottomCount
in interface PivotModel
PivotModel.setTopBottomCount(int)
public void sort(CellSetAxis axisToSort, Position position)
PivotModel
mode
is TOPCOUNT
or
BOTTOMCOUNT
the current value of topBottomCount
will be used.sort
in interface PivotModel
axisToSort
- Axis containing the members to be sortedposition
- Position on "other axis" defining the members by which the
membersToSort are sortedpublic Serializable saveState()
saveState
in interface Bookmarkable
Bookmarkable.saveState()
public void restoreState(Serializable state)
restoreState
in interface Bookmarkable
Bookmarkable.restoreState(java.io.Serializable)
public void saveSettings(HierarchicalConfiguration configuration)
saveSettings
in interface Configurable
Configurable.saveSettings(org.apache.commons.configuration.HierarchicalConfiguration)
public void restoreSettings(HierarchicalConfiguration configuration)
restoreSettings
in interface Configurable
Configurable.restoreSettings(org.apache.commons.configuration.HierarchicalConfiguration)
Copyright © 2012–2013 Eyeq MC. All rights reserved.