diff --git a/olap/action/api/pom.xml b/olap/action/api/pom.xml deleted file mode 100644 index 80cd87b703..0000000000 --- a/olap/action/api/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.olap.action - ${revision} - - org.eclipse.daanse.olap.action.api - - - - org.eclipse.daanse - org.eclipse.daanse.emondrian - compile - ${revision} - - - org.eclipse.daanse - org.eclipse.daanse.xmla.api - ${revision} - compile - - - diff --git a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/DrillThroughAction.java b/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/DrillThroughAction.java deleted file mode 100644 index f778b68787..0000000000 --- a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/DrillThroughAction.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.action.api; - -import java.util.List; -import java.util.Optional; - -public non-sealed interface DrillThroughAction extends XmlaAction { - - - Optional> catalogs(); -} diff --git a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/ReportAction.java b/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/ReportAction.java deleted file mode 100644 index f1b4ad3e5c..0000000000 --- a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/ReportAction.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.action.api; - -public non-sealed interface ReportAction extends XmlaAction { - -} diff --git a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/UrlAction.java b/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/UrlAction.java deleted file mode 100644 index 2c956de77f..0000000000 --- a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/UrlAction.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.action.api; - -public non-sealed interface UrlAction extends XmlaAction { - -} diff --git a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/XmlaAction.java b/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/XmlaAction.java deleted file mode 100644 index 06ad63703d..0000000000 --- a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/XmlaAction.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.action.api; - -import org.eclipse.daanse.xmla.api.common.enums.CoordinateTypeEnum; - -import java.util.Optional; - -public sealed interface XmlaAction permits DrillThroughAction, ReportAction, UrlAction { - String content( String coordinate, String cubeName ); - Optional catalogName(); - Optional schemaName(); - String cubeName(); - Optional actionName(); - Optional actionCaption(); - Optional description(); - String coordinate(); - CoordinateTypeEnum coordinateType(); -} diff --git a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/package-info.java b/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/package-info.java deleted file mode 100644 index e44d940862..0000000000 --- a/olap/action/api/src/main/java/org/eclipse/daanse/olap/action/api/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.action.api; diff --git a/olap/action/pom.xml b/olap/action/pom.xml deleted file mode 100644 index 9c0fefb928..0000000000 --- a/olap/action/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.olap - ${revision} - - org.eclipse.daanse.olap.action - pom - - api - - diff --git a/olap/api/pom.xml b/olap/api/pom.xml deleted file mode 100644 index 3aeb519f76..0000000000 --- a/olap/api/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - 4.0.0 - - org.eclipse.daanse - org.eclipse.daanse.olap - ${revision} - - org.eclipse.daanse.olap.api - jar - - - - org.osgi - org.osgi.annotation.versioning - 1.1.2 - - - org.osgi - org.osgi.annotation.bundle - - - org.eclipse.daanse - org.eclipse.daanse.jdbc.db.dialect.api - 0.0.1-SNAPSHOT - - - org.eclipse.daanse - org.eclipse.daanse.mdx.parser.api - 0.0.1-SNAPSHOT - - - org.eclipse.daanse - org.eclipse.daanse.sql.guard.api - 0.0.1-SNAPSHOT - - - org.eclipse.daanse - org.eclipse.daanse.mdx.model.api - 0.0.1-SNAPSHOT - - - diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/AggregationFactory.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/AggregationFactory.java deleted file mode 100644 index e340d9483b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/AggregationFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import org.eclipse.daanse.olap.api.aggregator.Aggregator; - -public interface AggregationFactory { - Aggregator getAggregator(Object measure); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CacheControl.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/CacheControl.java deleted file mode 100644 index 78592125c6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CacheControl.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -import java.io.PrintWriter; -import java.util.List; -import java.util.Map; - -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.element.Member; - -/** - * API for controlling the contents of the cell cache and the member cache. - * A {@link CellRegion} denotes a portion of the cell cache, and a - * {@link MemberSet} denotes a portion of the member cache. Both caches can be - * flushed, and the member cache can be edited. - * - *

To create an instance of this interface, use - * {@link org.eclipse.daanse.olap.api.Connection#getCacheControl}.

- * - *

Methods concerning cell cache:

    - *
  • {@link #createMemberRegion(Member, boolean)}
  • - *
  • {@link #createMemberRegion(boolean, Member, boolean, Member, boolean)}
  • - *
  • {@link #createUnionRegion(org.eclipse.daanse.olap.api.CacheControl.CellRegion[])}
  • - *
  • {@link #createCrossjoinRegion(org.eclipse.daanse.olap.api.CacheControl.CellRegion[])}
  • - *
  • {@link #createMeasuresRegion(Cube)}
  • - *
  • {@link #flush(org.eclipse.daanse.olap.api.CacheControl.CellRegion)}
  • - *

- * - *

Methods concerning member cache:

    - *
  • {@link #createMemberSet(Member, boolean)}
  • - *
  • {@link #createMemberSet(boolean, Member, boolean, Member, boolean)}
  • - *
  • {@link #createAddCommand(Member)}
  • - *
  • {@link #createDeleteCommand(Member)}
  • - *
  • {@link #createDeleteCommand(org.eclipse.daanse.olap.api.CacheControl.MemberSet)}
  • - *
  • {@link #createCompoundCommand(java.util.List)}
  • - *
  • {@link #createCompoundCommand(org.eclipse.daanse.olap.api.CacheControl.MemberEditCommand[])}
  • - *
  • {@link #createSetPropertyCommand(Member, String, Object)}
  • - *
  • {@link #createSetPropertyCommand(org.eclipse.daanse.olap.api.CacheControl.MemberSet,java.util.Map)}
  • - *
  • {@link #flush(org.eclipse.daanse.olap.api.CacheControl.MemberSet)}
  • - *
  • {@link #execute(org.eclipse.daanse.olap.api.CacheControl.MemberEditCommand)}
  • - *

- * - * @author jhyde - * @since Sep 27, 2006 - */ -public interface CacheControl { - - // cell cache control - - /** - * Creates a cell region consisting of a single member. - * - * @param member the member - * @param descendants When true, include descendants of the member in the - * region. - * @return the new cell region - */ - CellRegion createMemberRegion(Member member, boolean descendants); - - /** - * Creates a cell region consisting of a range between two members. - * - *

The members must belong to the same level of the same hierarchy. - * One of the bounds may be null. - * - *

For example, given - * - *

Member member97Q3; // [Time].[1997].[Q3]
-     * Member member98Q2; // [Time].[1998].[Q2]
-     * 
- * - * then - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ExpressionMeaning
- * createMemberRegion(true, member97Q3, true, member98Q2, - * false) - * The members between 97Q3 and 98Q2, inclusive:
- * [Time].[1997].[Q3],
- * [Time].[1997].[Q4],
- * [Time].[1998].[Q1],
- * [Time].[1998].[Q2]
- * createMemberRegion(true, member97Q3, false, member98Q2, - * false) - * The members between 97Q3 and 98Q2, exclusive:
- * [Time].[1997].[Q4],
- * [Time].[1998].[Q1]
- * createMemberRegion(true, member97Q3, false, member98Q2, - * false) - * The members between 97Q3 and 98Q2, including their descendants, and - * including the lower bound but not the upper bound:
- * [Time].[1997].[Q3],
- * [Time].[1997].[Q3].[7],
- * [Time].[1997].[Q3].[8],
- * [Time].[1997].[Q3].[9],
- * [Time].[1997].[Q4],
- * [Time].[1997].[Q4].[10],
- * [Time].[1997].[Q4].[11],
- * [Time].[1997].[Q4].[12],
- * [Time].[1998].[Q1],
- * [Time].[1998].[Q1].[1],
- * [Time].[1998].[Q1].[2],
- * [Time].[1998].[Q1].[3]
- * - * @param lowerInclusive whether the the range includes the lower bound; - * ignored if the lower bound is not specified - * @param lowerMember lower bound member. - * If null, takes all preceding members - * @param upperInclusive whether the the range includes the upper bound; - * ignored if the upper bound is not specified - * @param upperMember upper bound member. - * If null, takes all preceding members - * @param descendants when true, include descendants of the member in the - * region - * @return the new cell region - */ - CellRegion createMemberRegion( - boolean lowerInclusive, - Member lowerMember, - boolean upperInclusive, - Member upperMember, - boolean descendants); - - /** - * Forms the cartesian product of two or more cell regions. - * @param regions the operands - * @return the cartesian product of the operands - */ - CellRegion createCrossjoinRegion(CellRegion... regions); - - /** - * Forms the union of two or more cell regions. - * The regions must have the same dimensionality. - * - * @param regions the operands - * @return the cartesian product of the operands - - */ - CellRegion createUnionRegion(CellRegion... regions); - - /** - * Creates a region consisting of all measures in a given cube. - * @param cube a cube - * @return the region - */ - CellRegion createMeasuresRegion(Cube cube); - - /** - * Atomically flushes all the cells in the cell cache that correspond to - * measures in a cube and to a given region. - * - * @param region a region - */ - void flush(CellRegion region); - - /** - * Prints the state of the cell cache as it pertains to a given region. - * @param pw the output target - * @param region the CellRegion of interest - */ - void printCacheState(PrintWriter pw, CellRegion region); - - // member cache control - - /** - * Creates a member set containing either a single member, or a member and - * its descendants. - * @param member a member - * @param descendants when true, include descendants in the set - * @return the set - */ - MemberSet createMemberSet(Member member, boolean descendants); - - /** - * Creates a member set consisting of a range between two members. - * The members must belong to the same level of the same hierarchy. One of - * the bounds may be null. (Similar to {@link #createMemberRegion(boolean, - * Member, boolean, Member, boolean)}, which see for examples.) - * - * @param lowerInclusive whether the the range includes the lower bound; - * ignored if the lower bound is not specified - * @param lowerMember lower bound member. - * If null, takes all preceding members - * @param upperInclusive whether the the range includes the upper bound; - * ignored if the upper bound is not specified - * @param upperMember upper bound member. - * If null, takes all preceding members - * @param descendants when true, include descendants of the member in the - * region - * @return the set - */ - MemberSet createMemberSet( - boolean lowerInclusive, - Member lowerMember, - boolean upperInclusive, - Member upperMember, - boolean descendants); - - /** - * Forms the union of two or more member sets. - * - * @param sets the operands - * @return the union of the operands - */ - MemberSet createUnionSet(MemberSet... sets); - - /** - * Filters a member set, keeping all members at a given Level. - * - * @param level Level - * @param baseSet Member set - * @return Member set with members not at the given level removed - */ - MemberSet filter(Level level, MemberSet baseSet); - - /** - * Atomically flushes all members in the member cache which belong to a - * given set. - * - * @param set a set of members - */ - void flush(MemberSet set); - - /** - * Prints the state of the member cache as it pertains to a given member - * set. - * @param pw the output target - * @param set the MemberSet of interest - */ - void printCacheState(PrintWriter pw, MemberSet set); - - - // edit member cache contents - - /** - * Executes a command that edits the member cache. - * @param cmd the command - */ - void execute(MemberEditCommand cmd); - - /** - * Builds a compound command which is executed atomically. - * - * @param cmds a list of the component commands - * @return the compound command - */ - MemberEditCommand createCompoundCommand(List cmds); - - /** - * Builds a compound command which is executed atomically. - * @param cmds the component commands - * @return the compound command - */ - MemberEditCommand createCompoundCommand(MemberEditCommand... cmds); - - // commands to change the structure of the member cache - - /** - * Creates a command to delete a member and its descendants from the member - * cache. - * - * @param member the member - * @return the command - */ - MemberEditCommand createDeleteCommand(Member member); - - /** - * Creates a command to delete a set of members from the member cache. - * - * @param memberSet the set - * @return the command - */ - MemberEditCommand createDeleteCommand(MemberSet memberSet); - - /** - * Creates a command to add a member to the cache. The added member and its - * parent must have the same Dimension and the correct Levels, Null parent - * means add to the top level of its Dimension. - * - *

The ordinal position of the new member among its siblings is implied - * by its properties.

- * - * @param member the new member - * @return the command - * - * @throws IllegalArgumentException if member null - * or if member belongs to a parent-child hierarchy - */ - MemberEditCommand createAddCommand( - Member member) throws IllegalArgumentException; - - /** - * Creates a command to Move a member (with its descendants) to a new - * location, that is to a new parent. - * @param member the member moved - * @param loc the new parent - * @return the command - * - * @throws IllegalArgumentException if member is null, - * or loc is null, - * or member belongs to a parent-child hierarchy, - * or if loc is incompatible with member - */ - MemberEditCommand createMoveCommand( - Member member, - Member loc) throws IllegalArgumentException; - - // commands to change member properties - - /** - * Creates a command to change one property of a member. - * - * @param member the member - * @param name the property name - * @param value the property value - * @return the command - * @throws IllegalArgumentException if the property is invalid for the - * member - */ - MemberEditCommand createSetPropertyCommand( - Member member, - String name, - Object value) throws IllegalArgumentException; - - /** - * Creates a command to several properties changes over a set of - * members. All members must belong to the same Level. - * - * @param set the set of members - * @param propertyValues Collection of property-value pairs - * @return the command - * @throws IllegalArgumentException for an invalid property, or if all - * members in the set do not belong to the same Level. - */ - MemberEditCommand createSetPropertyCommand( - MemberSet set, - Map propertyValues) - throws IllegalArgumentException; - - // other - - /** - * Prints a debug message. - * - * @param message the message - */ - void trace(String message); - - /** - * Tells if tracing is enabled. - */ - boolean isTraceEnabled(); - - /** - * Flushes the cache which maps schema URLs to metadata. - * - *

This cache is referenced only when creating a new connection, so - * existing connections will continue to use the same schema definition. - * - *

Flushing the schema cache will flush all aggregations and segments - * associated to it as well. - */ - void flushSchemaCache(); - - - - /** a region of cells in the cell cache */ - public interface CellRegion { - /** - * Returns the dimensionality of a region. - * @return a list of {@link org.eclipse.daanse.olap.api.element.Dimension} objects. - */ - List getDimensionality(); - } - - /** - * A specification of a set of members in the member cache. - * - *

Member sets can be created using methods - * {@link CacheControl#createMemberSet(Member, boolean)}, - * {@link CacheControl#createMemberSet(boolean, Member, boolean, Member, boolean)}, - * {@link CacheControl#createUnionSet(org.eclipse.daanse.olap.api.CacheControl.MemberSet[])}. - */ - public interface MemberSet { - } - - /** - * An operation to be applied to the member cache. The operation does not - * take effect until {@link CacheControl#execute} is called. - */ - public interface MemberEditCommand { - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogCache.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogCache.java deleted file mode 100644 index a14f13c5e7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogCache.java +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* -*/ -package org.eclipse.daanse.olap.api; - -public interface CatalogCache { - - void clear(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogReader.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogReader.java deleted file mode 100644 index 4922eefc5d..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/CatalogReader.java +++ /dev/null @@ -1,578 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2003-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * Copyright (C) 2021 Sergei Semenkov - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; -import java.util.Map; - -import javax.sql.DataSource; - -import org.eclipse.daanse.olap.api.access.AccessMember; -import org.eclipse.daanse.olap.api.access.Role; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.element.Catalog; -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.DatabaseSchema; -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.NamedSet; -import org.eclipse.daanse.olap.api.element.OlapElement; -import org.eclipse.daanse.olap.api.function.FunctionDefinition; -import org.eclipse.daanse.olap.api.query.component.Expression; - -/** - * A CatalogReader queries schema objects ({@link Catalog}, - * {@link Cube}, {@link Dimension}, {@link Hierarchy}, {@link Level}, - * {@link Member}). - * - *

It is generally created using {@link Connection#getCatalogReader}, - * but also via {@link Cube#getCatalogReader(Role)}.

- * - *

CatalogReader is deprecated for code outside of mondrian. For new code, - * use the metadata provided by olap4j, for example - * {@link mondrian.olap4j.MondrianOlap4jSchema#getCubes()}. - * - *

If you use a CatalogReader from outside of a mondrian statement, you may - * get a {@link java.util.EmptyStackException} indicating that mondrian cannot - * deduce the current locus (statement context). If you get that error, call - * {@link #withLocus()} to create a CatalogReader that automatically provides a - * locus whenever a call is made.

- * - * @author jhyde - * @since Feb 24, 2003 - */ -public interface CatalogReader { - /** - * Returns the schema. - * - * @return Schema, never null - */ - Catalog getCatalog(); - - /** - * Returns the access-control profile that this CatalogReader - * is implementing. - */ - Role getRole(); - - /** - * Returns the accessible dimensions of a cube. - * - * @pre dimension != null - * @post return != null - */ - List getCubeDimensions(Cube cube); - - /** - * Returns the accessible hierarchies of a dimension. - * - * @pre dimension != null - * @post return != null - */ - List getDimensionHierarchies(Dimension dimension); - - /** - * Returns an array of the root members of hierarchy. - * - * @param hierarchy Hierarchy - * @see #getCalculatedMembers(Hierarchy) - */ - List getHierarchyRootMembers(Hierarchy hierarchy); - - /** - * Returns number of children parent of a member, - * if the information can be retrieved from cache, otherwise -1. - */ - int getChildrenCountFromCache(Member member); - - /** - * Returns the number of members in a level, returning an approximation if - * acceptable. - * - * @param level Level - * @param approximate Whether an approximation is acceptable - * @param materialize Whether to go to disk if no approximation - * for the count is available and the members are not in - * cache. If false, returns {@link Integer#MIN_VALUE} if value - * is not in cache. - */ - int getLevelCardinality( - Level level, boolean approximate, boolean materialize); - - /** - * Substitutes a member with an equivalent member which enforces the - * access control policy of this CatalogReader. - */ - Member substitute(Member member); - - /** - * Returns direct children of member. - * @pre member != null - * @post return != null - */ - List getMemberChildren(Member member); - - /** - * Returns direct children of member, optimized - * for NON EMPTY. - *

- * If context == null then - * there is no context and all members are returned - then - * its identical to {@link #getMemberChildren(Member)}. - * If context is not null, the resulting members - * may be restricted to those members that have a - * non empty row in the fact table for context. - * Wether or not optimization is possible depends - * on the CatalogReader implementation. - */ - List getMemberChildren(Member member, Evaluator context); - - /** - * Returns direct children of each element of members. - * - * @param members Array of members - * @return array of child members - * - * @pre members != null - * @post return != null - */ - List getMemberChildren(List members); - - /** - * Returns direct children of each element of members - * which is not empty in context. - * - * @param members Array of members - * @param context Evaluation context - * @return array of child members - * - * @pre members != null - * @post return != null - */ - List getMemberChildren(List members, Evaluator context); - - /** - * Returns a list of contributing children of a member of a parent-child - * hierarchy. - * - * @param dataMember Data member for a member of the parent-child hierarcy - * @param hierarchy Hierarchy - * @param list List of members to populate - */ - void getParentChildContributingChildren( - Member dataMember, - Hierarchy hierarchy, - List list); - - /** - * Returns the parent of member. - * - * @param member Member - * @pre member != null - * @return null if member is a root member - */ - Member getMemberParent(Member member); - - /** - * Returns a list of ancestors of member, in depth order. - * - *

For example, for [Store].[USA].[CA], returns - * {[Store].[USA], [Store].[All Stores]}. - * - * @param member Member - * @param ancestorList List of ancestors - */ - void getMemberAncestors(Member member, List ancestorList); - - /** - * Returns the depth of a member. - * - *

This may not be the same as - * member.{@link Member#getLevel getLevel}(). - * {@link Level#getDepth getDepth}() - * for three reasons:

    - *
  1. Access control. The most senior visible member has - * level 0. If the client is not allowed to see the "All" and "Nation" - * levels of the "Store" hierarchy, then members of the "State" level will - * have depth 0.
  2. - *
  3. Parent-child hierarchies. Suppose Fred reports to Wilma, and - * Wilma reports to no one. "All Employees" has depth 0, Wilma has depth - * 1, and Fred has depth 2. Fred and Wilma are both in the "Employees" - * level, which has depth 1.
  4. - *
  5. Ragged hierarchies. If Israel has only one, hidden, province - * then the depth of Tel Aviv, Israel is 2, whereas the depth of another - * city, San Francisco, CA, USA is 3.
  6. - *
- */ - int getMemberDepth(Member member); - - /** - * Finds a member based upon its unique name. - * - * @param uniqueNameParts Unique name of member - * @param failIfNotFound Whether to throw an error, as opposed to returning - * null, if there is no such member. - * @param matchType indicates the match mode; if not specified, EXACT - * @return The member, or null if not found - */ - Member getMemberByUniqueName( - List uniqueNameParts, - boolean failIfNotFound, - MatchType matchType); - - /** - * Finds a member based upon its unique name, requiring an exact match. - * - *

This method is equivalent to calling - * {@link #getMemberByUniqueName(java.util.List, boolean, MatchType)} - * with {@link MatchType#EXACT}. - * - * @param uniqueNameParts Unique name of member - * @param failIfNotFound Whether to throw an error, as opposed to returning - * null, if there is no such member. - * @return The member, or null if not found - */ - Member getMemberByUniqueName( - List uniqueNameParts, - boolean failIfNotFound); - - /** - * Looks up an MDX object by name, specifying how to - * match if no object exactly matches the name. - * - *

Resolves a name such as - * '[Products].[Product Department].[Produce]' by resolving the - * components ('Products', and so forth) one at a time. - * - * @param parent Parent element to search in - * @param names Exploded compound name, such as {"Products", - * "Product Department", "Produce"} - * @param failIfNotFound If the element is not found, determines whether - * to return null or throw an error - * @param category Type of returned element, a {@link DataType} value; - * {@link DataType#UNKNOWN} if it doesn't matter. - * @param matchType indicates the match mode; if not specified, EXACT - * - * @pre parent != null - * @post !(failIfNotFound && return == null) - */ - OlapElement lookupCompound( - OlapElement parent, - List names, - boolean failIfNotFound, - DataType category, - MatchType matchType); - - /** - * Looks up an MDX object by name. - * - *

Resolves a name such as - * '[Products].[Product Department].[Produce]' by resolving the - * components ('Products', and so forth) one at a time. - * - * @param parent Parent element to search in - * @param names Exploded compound name, such as {"Products", - * "Product Department", "Produce"} - * @param failIfNotFound If the element is not found, determines whether - * to return null or throw an error - * @param category Type of returned element, a {@link DataType} value; - * {@link DataType#UNKNOWN} if it doesn't matter. - * - * @pre parent != null - * @post !(failIfNotFound && return == null) - */ - OlapElement lookupCompound( - OlapElement parent, - List names, - boolean failIfNotFound, - DataType category); - - /** - * Should only be called by implementations of - * {@link #lookupCompound(OlapElement, java.util.List, boolean, int, MatchType)}. - * - * @param parent Parent element to search in - * @param names Exploded compound name, such as {"Products", - * "Product Department", "Produce"} - * @param failIfNotFound If the element is not found, determines whether - * to return null or throw an error - * @param category Type of returned element, a {@link Category} value; - * {@link Category#UNKNOWN} if it doesn't matter. - * @param matchType indicates the match mode; if not specified, EXACT - * @return Found element - - OlapElement lookupCompoundInternal( - OlapElement parent, - List names, - boolean failIfNotFound, - int category, - MatchType matchType); - */ - - /** - * Looks up a calculated member by name. If the name is not found in the - * current scope, returns null. - */ - Member getCalculatedMember(List nameParts); - - /** - * Looks up a set by name. If the name is not found in the current scope, - * returns null. - */ - NamedSet getNamedSet(List nameParts); - - /** - * Appends to list all members between startMember - * and endMember (inclusive) which belong to - * level. - */ - void getMemberRange( - Level level, Member startMember, Member endMember, List list); - - /** - * Returns a member n further along in the same level from - * member. - * - * @pre member != null - */ - Member getLeadMember(Member member, int n); - - /** - * Compares a pair of {@link Member}s according to their order in a prefix - * traversal. (that is, it - * is an ancestor or a earlier), is a sibling, or comes later in a prefix - * traversal. - * @return A negative integer if m1 is an ancestor, an earlier - * sibling of an ancestor, or a descendent of an earlier sibling, of - * m2; - * zero if m1 is a sibling of m2; - * a positive integer if m1 comes later in the prefix - * traversal then m2. - */ - int compareMembersHierarchically(Member m1, Member m2); - - /** - * Looks up the child of parent called name, or - * an approximation according to matchType, returning - * null if no element is found. - * - * @param parent Parent element to search in - * @param name Compound in compound name, such as "[Product]" or "&[1]" - * @param matchType Match type - * - * @return Element with given name, or null - */ - OlapElement getElementChild( - OlapElement parent, - Segment name, - MatchType matchType); - - /** - * Looks up the child of parent name, returning - * null if no element is found. - * - *

Always equivalent to - * getElementChild(parent, name, MatchType.EXACT). - * - * @param parent Parent element to search in - * @param name Compound in compound name, such as "[Product]" or "&[1]" - * - * @return Element with given name, or null - */ - OlapElement getElementChild( - OlapElement parent, - Segment name); - - /** - * Returns the members of a level, optionally including calculated members. - */ - List getLevelMembers( - Level level, - boolean includeCalculated); - - List getLevelMembers( - Level level, - boolean includeCalculated, - Evaluator context); - - /** - * Returns the members of a level, optionally filtering out members which - * are empty. - * - * @param level Level - * @param context Context for filtering - * @return Members of this level - */ - List getLevelMembers( - Level level, - Evaluator context); - - /** - * Returns the accessible levels of a hierarchy. - * - * @param hierarchy Hierarchy - * - * @pre hierarchy != null - * @post return.length >= 1 - */ - List getHierarchyLevels(Hierarchy hierarchy); - - /** - * Returns the default member of a hierarchy. If the default member is in - * an inaccessible level, returns the nearest ascendant/descendant member. - * - * @param hierarchy Hierarchy - * - * @return Default member of hierarchy - */ - Member getHierarchyDefaultMember(Hierarchy hierarchy); - - /** - * Returns whether a member has visible children. - */ - boolean isDrillable(Member member); - - /** - * Returns whether a member is visible. - */ - boolean isVisible(Member member); - - /** - * Returns the list of accessible cubes. - */ - List getCubes(); - - /** - * Returns a list of calculated members in a given hierarchy. - */ - List getCalculatedMembers(Hierarchy hierarchy); - - /** - * Returns a list of calculated members in a given level. - */ - List getCalculatedMembers(Level level); - - /** - * Returns the list of calculated members. - */ - List getCalculatedMembers(); - - /** - * Finds a child of a member with a given name. - */ - Member lookupMemberChildByName( - Member parent, - Segment childName, - MatchType matchType); - - /** - * Finds a list of child members with the given names. - */ - List lookupMemberChildrenByNames( - Member parent, - List childNames, - MatchType matchType); - - /** - * Returns an object which can evaluate an expression in native SQL, or - * null if this is not possible. - * - * @param fun Function - * @param args Arguments to the function - * @param evaluator Evaluator, provides context - * @param calc the calc to be natively evaluated - */ - NativeEvaluator getNativeSetEvaluator( - FunctionDefinition fun, - Expression[] args, - Evaluator evaluator, - Calc calc); - - /** - * Returns the definition of a parameter with a given name, or null if not - * found. - */ - Parameter getParameter(String name); - - /** - * Returns the data source. - * - * @return data source - */ - @Deprecated - DataSource getDataSource(); - - /** - * Returns a similar schema reader that has no access control. - * - * @return Schema reader that has a similar perspective (e.g. cube) but - * no access control - */ - CatalogReader withoutAccessControl(); - - /** - * Returns a schema reader that automatically assigns a locus to each - * operation. - * - *

It is less efficient; use this only if the operation is occurring - * outside the context of a statement. If you get the internal error - * "no locus", that's a sign you should use this method.

- * - * @return Schema reader that assigns a locus to each operation - */ - CatalogReader withLocus(); - - /** - * Returns a list of namespaces to search when resolving elements by name. - * - *

For example, a schema reader from the perspective of a cube will - * return cube and schema namespaces.

- * - * @return List of namespaces - */ - List getNamespaces(); - - /** - * Similar to {@link #getMemberChildren(Member, Evaluator)} - * but returns a map of the grand-children and their access details - * and costs more to invoke because of the access controls. - * - * Called by {@link Hierarchy} when determining the lowest access - * level of a Role within a hierarchy. - */ - Map - getMemberChildrenWithDetails(Member member, Evaluator evaluator); - - Context getContext(); - - List getDatabaseSchemas(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Command.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Command.java deleted file mode 100644 index 871e1e68f8..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Command.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -public enum Command { - BEGIN, - COMMIT, - ROLLBACK -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConfigConstants.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConfigConstants.java deleted file mode 100644 index 70c01c8114..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConfigConstants.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - -import java.util.concurrent.TimeUnit; - -public class ConfigConstants { - public static final String QUERY_LIMIT = "queryLimit"; - public static final String SEGMENT_CACHE = "segmentCache"; - public static final String ENABLE_TOTAL_COUNT = "enableTotalCount"; - public static final String SEGMENT_CACHE_MANAGER_NUMBER_CACHE_THREADS = "segmentCacheManagerNumberCacheThreads"; - public static final String CELL_BATCH_SIZE = "cellBatchSize"; - public static final String ROLAP_CONNECTION_SHEPHERD_NB_THREADS = "rolapConnectionShepherdNbThreads"; - public static final String ROLAP_CONNECTION_SHEPHERD_THREAD_POLLING_INTERVAL = "rolapConnectionShepherdThreadPollingInterval"; - public static final String ROLAP_CONNECTION_SHEPHERD_THREAD_POLLING_INTERVAL_UNIT = "rolapConnectionShepherdThreadPollingIntervalUnit"; - public static final String SEGMENT_CACHE_MANAGER_NUMBER_SQL_THREADS = "segmentCacheManagerNumberSqlThreads"; - public static final String SOLVE_ORDER_MODE = "solveOrderMode"; - public static final String CHOOSE_AGGREGATE_BY_VOLUME = "chooseAggregateByVolume"; - public static final String DISABLE_CACHING = "disableCaching"; - public static final String DISABLE_LOCAL_SEGMENT_CACHE = "disableLocalSegmentCache"; - public static final String ENABLE_GROUPING_SETS = "enableGroupingSets"; - public static final String ENABLE_SESSION_CACHING = "enableSessionCaching"; - public static final String COMPOUND_SLICER_MEMBER_SOLVE_ORDER = "compoundSlicerMemberSolveOrder"; - public static final String ENABLE_DRILL_THROUGH = "enableDrillThrough"; - public static final String ENABLE_NATIVE_FILTER = "enableNativeFilter"; - public static final String ENABLE_NATIVE_CROSS_JOIN = "enableNativeCrossJoin"; - public static final String ENABLE_NATIVE_NON_EMPTY = "enableNativeNonEmpty"; - public static final String ENABLE_NATIVE_TOP_COUNT = "enableNativeTopCount"; - public static final String ENABLE_IN_MEMORY_ROLLUP = "enableInMemoryRollup"; - public static final String EXPAND_NON_NATIVE = "expandNonNative"; - public static final String GENERATE_AGGREGATE_SQL = "generateAggregateSql"; - public static final String IGNORE_INVALID_MEMBERS_DURING_QUERY = "ignoreInvalidMembersDuringQuery"; - public static final String IGNORE_MEASURE_FOR_NON_JOINING_DIMENSION = "ignoreMeasureForNonJoiningDimension"; - public static final String ITERATION_LIMIT = "iterationLimit"; - public static final String LEVEL_PRE_CACHE_THRESHOLD = "levelPreCacheThreshold"; - public static final String MAX_CONSTRAINTS = "maxConstraints"; - public static final String TEST_EXP_DEPENDENCIES = "testExpDependencies"; - public static final String READ_AGGREGATES = "readAggregates"; - public static final String ALERT_NATIVE_EVALUATION_UNSUPPORTED = "alertNativeEvaluationUnsupported"; - public static final String CROSS_JOIN_OPTIMIZER_SIZE = "crossJoinOptimizerSize"; - public static final String CURRENT_MEMBER_WITH_COMPOUND_SLICER_ALERT = "currentMemberWithCompoundSlicerAlert"; - public static final String IGNORE_INVALID_MEMBERS = "ignoreInvalidMembers"; - public static final String MAX_EVAL_DEPTH = "maxEvalDepth"; - public static final String CHECK_CANCEL_OR_TIMEOUT_INTERVAL = "checkCancelOrTimeoutInterval"; - public static final String MEMORY_MONITOR = "memoryMonitor"; - public static final String WARN_IF_NO_PATTERN_FOR_DIALECT = "warnIfNoPatternForDialect"; - public static final String USE_AGGREGATES = "useAggregates"; - public static final String QUERY_TIMEOUT = "queryTimeout"; - public static final String OPTIMIZE_PREDICATES = "optimizePredicates"; - public static final String NULL_DENOMINATOR_PRODUCES_NULL = "nullDenominatorProducesNull"; - public static final String NEED_DIMENSION_PREFIX = "needDimensionPrefix"; - public static final String NATIVIZE_MIN_THRESHOLD = "nativizeMinThreshold"; - public static final String NATIVIZE_MAX_RESULTS = "nativizeMaxResults"; - public static final String SPARSE_SEGMENT_COUNT_THRESHOLD = "sparseSegmentCountThreshold"; - public static final String SPARSE_SEGMENT_DENSITY_THRESHOLD = "sparseSegmentDensityThreshold"; - public static final String MEMORY_MONITOR_THRESHOLD = "memoryMonitorThreshold"; - public static final String GENERATE_FORMATTED_SQL = "generateFormattedSql"; - public static final String EXECUTE_DURATION = "executeDuration"; - public static final String EXECUTE_DURATION_UNIT = "executeDurationUnit"; - - - public static final Integer QUERY_LIMIT_DEFAULT_VALUE = 40; - public static final String SEGMENT_CACHE_DEFAULT_VALUE = null; - public static final Boolean ENABLE_TOTAL_COUNT_DEFAULT_VALUE = false; - public static final Integer SEGMENT_CACHE_MANAGER_NUMBER_CACHE_THREADS_DEFAULT_VALUE = 100; - public static final Integer CELL_BATCH_SIZE_DEFAULT_VALUE = -1; - public static final Integer ROLAP_CONNECTION_SHEPHERD_NB_THREADS_DEFAULT_VALUE = 20; - public static final Long ROLAP_CONNECTION_SHEPHERD_THREAD_POLLING_INTERVAL_DEFAULT_VALUE = 1000L; - public static final TimeUnit ROLAP_CONNECTION_SHEPHERD_THREAD_POLLING_INTERVAL_UNIT_DEFAULT_VALUE = TimeUnit.MILLISECONDS; - public static final Integer SEGMENT_CACHE_MANAGER_NUMBER_SQL_THREADS_DEFAULT_VALUE = 100; - public static final String SOLVE_ORDER_MODE_DEFAULT_VALUE = "ABSOLUTE"; - public static final boolean CHOOSE_AGGREGATE_BY_VOLUME_DEFAULT_VALUE = false; - public static final boolean DISABLE_CACHING_DEFAULT_VALUE = false; - public static final boolean DISABLE_LOCAL_SEGMENT_CACHE_DEFAULT_VALUE = false; - public static final boolean ENABLE_GROUPING_SETS_DEFAULT_VALUE = false; - public static final boolean ENABLE_SESSION_CACHING_DEFAULT_VALUE = false; - public static final int COMPOUND_SLICER_MEMBER_SOLVE_ORDER_DEFAULT_VALUE = -99999; - public static final boolean ENABLE_DRILL_THROUGH_DEFAULT_VALUE = true; - public static final boolean ENABLE_NATIVE_FILTER_DEFAULT_VALUE = true; - public static final boolean ENABLE_NATIVE_CROSS_JOIN_DEFAULT_VALUE = true; - public static final boolean ENABLE_NATIVE_TOP_COUNT_DEFAULT_VALUE = true; - public static final boolean ENABLE_IN_MEMORY_ROLLUP_DEFAULT_VALUE = true; - public static final boolean EXPAND_NON_NATIVE_DEFAULT_VALUE = false; - public static final boolean GENERATE_AGGREGATE_SQL_DEFAULT_VALUE = false; - public static final Boolean IGNORE_INVALID_MEMBERS_DURING_QUERY_DEFAULT_VALUE = false; - public static final boolean IGNORE_MEASURE_FOR_NON_JOINING_DIMENSION_DEFAULT_VALUE = false; - public static final int ITERATION_LIMIT_DEFAULT_VALUE = 0; - public static final int LEVEL_PRE_CACHE_THRESHOLD_DEFAULT_VALUE = 300; - public static final int MAX_CONSTRAINTS_DEFAULT_VALUE = 1000; - public static final int TEST_EXP_DEPENDENCIES_DEFAULT_VALUE = 0; - public static final boolean READ_AGGREGATES_DEFAULT_VALUE = false; - public static final String ALERT_NATIVE_EVALUATION_UNSUPPORTED_DEFAULT_VALUE = "OFF"; - public static final int CROSS_JOIN_OPTIMIZER_SIZE_DEFAULT_VALUE = 0; - public static final String CURRENT_MEMBER_WITH_COMPOUND_SLICER_ALERT_DEFAULT_VALUE = "ERROR"; - public static final Boolean IGNORE_INVALID_MEMBERS_DEFAULT_VALUE = false; - public static final int MAX_EVAL_DEPTH_DEFAULT_VALUE = 10; - public static final int CHECK_CANCEL_OR_TIMEOUT_INTERVAL_DEFAULT_VALUE = 1000; - public static final boolean MEMORY_MONITOR_DEFAULT_VALUE = false; - public static final String WARN_IF_NO_PATTERN_FOR_DIALECT_DEFAULT_VALUE = "NONE"; - public static final boolean USE_AGGREGATES_DEFAULT_VALUE = false; - public static final int QUERY_TIMEOUT_DEFAULT_VALUE = 20; - public static final boolean OPTIMIZE_PREDICATES_DEFAULT_VALUE = true; - public static final boolean NULL_DENOMINATOR_PRODUCES_NULL_DEFAULT_VALUE = false; - public static final boolean NEED_DIMENSION_PREFIX_DEFAULT_VALUE = false; - public static final int NATIVIZE_MIN_THRESHOLD_DEFAULT_VALUE = 100000; - public static final int NATIVIZE_MAX_RESULTS_DEFAULT_VALUE = 150000; - public static final int SPARSE_SEGMENT_COUNT_THRESHOLD_DEFAULT_VALUE = 1000; - public static final double SPARSE_SEGMENT_DENSITY_THRESHOLD_DEFAULT_VALUE = 0.5; - public static final int MEMORY_MONITOR_THRESHOLD_DEFAULT_VALUE = 90; - public static final boolean GENERATE_FORMATTED_SQL_DEFAULT_VALUE = false; - public static final long EXECUTE_DURATION_DEFAULT_VALUE = 0; - public static final String EXECUTE_DURATION_UNIT_DEFAULT_VALUE = "MILLISECONDS"; - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Connection.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Connection.java deleted file mode 100644 index b8f37f21fa..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Connection.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2000-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -import java.io.PrintWriter; -import java.util.Locale; - -import javax.sql.DataSource; - -import org.eclipse.daanse.olap.api.access.Role; -import org.eclipse.daanse.olap.api.element.Catalog; -import org.eclipse.daanse.olap.api.query.component.DrillThrough; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.query.component.Query; -import org.eclipse.daanse.olap.api.query.component.QueryComponent; -import org.eclipse.daanse.olap.api.result.Result; -import org.eclipse.daanse.olap.api.result.Scenario; - -/** - * Connection to a multi-dimensional database. - * - * @author jhyde - */ -public interface Connection { - - /** - * Get the Catalog associated with this Connection. - * - * @return the Catalog (never null). - */ - Catalog getCatalog(); - - /** - * Closes this Connection. You may not use this - * Connection after closing it. - */ - void close(); - - /** - * Executes a query. - * - * @throws RuntimeException if another thread cancels the query's statement. - * - * @deprecated This method is deprecated and will be removed in - * mondrian-4.0. It operates by internally creating a statement. Better - * to use olap4j and explicitly create a statement. - */ - @Deprecated - Result execute(Query query); - - Statement createStatement(); - - /** - * Returns the locale this connection belongs to. Determines, for example, - * the currency string used in formatting cell values. - * - * @see mondrian.util.Format - */ - Locale getLocale(); - - /** - * Parses an expresion. - */ - Expression parseExpression(String s); - - /** - * Parses a query. - */ - Query parseQuery(String s); - - /** - * Parses a statement. - * - * @param mdx MDX string - * @return A {@link Query} if it is a SELECT statement, a - * {@link DrillThrough} if it is a DRILLTHROUGH statement - */ - QueryComponent parseStatement(String mdx); - - /** - * Sets the privileges for the this connection. - * - * @pre role != null - * @pre role.isMutable() - */ - void setRole(Role role); - - /** - * Returns the access-control profile for this connection. - * @post role != null - * @post role.isMutable() - */ - Role getRole(); - - /** - * Returns a schema reader with access control appropriate to the current - * role. - */ - CatalogReader getCatalogReader(); - - - /** - * Returns an object with which to explicitly control the contents of the - * cache. - * - * @param pw Writer to which to write logging information; may be null - */ - CacheControl getCacheControl(PrintWriter pw); - - /** - * Returns the data source this connection uses to create connections - * to the underlying JDBC database. - * - * @return Data source - */ - DataSource getDataSource(); - - Context getContext(); - - Scenario getScenario(); - - Scenario createScenario(); - - void setScenario(Scenario scenario); - /** - * Returns the identifier of this connection. Unique within the lifetime of - * this JVM. - * - * @return Identifier of this connection - */ - long getId(); - - Statement getInternalStatement(); - - /** - * Executes a statement. - * - * @param execution Execution context (includes statement, query) - */ - Result execute(Execution execution); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConnectionProps.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConnectionProps.java deleted file mode 100644 index 2bb99d3de2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ConnectionProps.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.lang.ref.SoftReference; -import java.time.Duration; -import java.util.List; -import java.util.Locale; -import java.util.Optional; - -public interface ConnectionProps { - - - - /** - * The "Role" property is the name of the {@link mondrian.olap.Role role} to - * adopt. If not specified, the connection uses a role which has access to every - * object in the schema. - */ - List roles(); - - /** - * The "UseSchemaPool" property disables the schema cache. If false, the schema - * is not shared with connections which have a textually identical schema. - * Default is "true". - */ - boolean useSchemaPool(); - - /** - * The "Locale" property is the requested Locale for the - * LocalizingDynamicSchemaProcessor. Example values are "en", "en_US", "hu". If - * Locale is not specified, then the name of system's default will be used, as - * per {@link java.util.Locale#getDefault()}. - */ - Locale locale(); - - - /** - * The "PinSchemaTimeout" defines how much time must Mondrian keep a hard - * reference to schema objects within the pool of schemas. - * - *

- * After the timeout is reached, the hard reference will be cleared and the - * schema will be made a candidate for garbage collection. If the timeout wasn't - * reached yet and a second query requires the same schema, the timeout will be - * re-computed from the time of the second access and a new hard reference is - * established until the new timer reaches its end. - * - *

- * If the timeout is equal to zero, the schema will get pinned permanently. It - * is inadvisable to use this mode when using a DynamicSchemaProcessor at the - * risk of filling up the memory. - * - *

- * If the timeout is a negative value, the reference will behave the same as a - * {@link SoftReference}. This is the default behavior. - * - *

- * The timeout value must be provided as a String representing both the time - * value and the time unit. For example, 1 second is represented as "1s". Valid - * time units are [d, h, m, s, ms], representing respectively days, hours, - * minutes, seconds and milliseconds. - * - *

- * Defaults to "-1s". - */ - Duration pinSchemaTimeout(); - - /** - * The "AggregateScanSchema" property is the name of the database schema to scan - * when looking for aggregate tables. If defined, Mondrian will only look for - * aggregate tables within this schema. This means that all aggregate tables, - * including explicitly defined tables must be in this schema. If not defined, - * Mondrian will scan every schema that the database connection has access to - * when looking for aggregate tables. - */ - Optional aggregateScanSchema(); - - /** - * The "AggregateScanCatalog" property is the name of the database catalog to - * scan when looking for aggregate tables. If defined, Mondrian will only look - * for aggregate tables within this catalog. This means that all aggregate - * tables, including explicitly defined tables must be in this catalog. If not - * defined, Mondrian will scan every catalog the database connection has access - * to when looking for aggregate tables. - */ - Optional aggregateScanCatalog(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Context.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Context.java deleted file mode 100644 index 98d64446ed..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Context.java +++ /dev/null @@ -1,174 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.Semaphore; - -import javax.sql.DataSource; - -import org.eclipse.daanse.jdbc.db.dialect.api.Dialect; -import org.eclipse.daanse.mdx.parser.api.MdxParserProvider; -import org.eclipse.daanse.olap.api.aggregator.CustomAggregatorFactory; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompilerFactory; -import org.eclipse.daanse.olap.api.function.FunctionService; -import org.eclipse.daanse.olap.api.monitor.EventBus; -import org.eclipse.daanse.olap.api.query.QueryProvider; -import org.eclipse.daanse.sql.guard.api.SqlGuardFactory; - -/** - * The {@link Context} gives access to all resources and configurations that are needed - * to calculate and Data Cubes - * - * @author stbischof - * @param - * - */ -public interface Context { - - List KEYWORD_LIST = Collections.unmodifiableList(Arrays.asList("$AdjustedProbability", - "$Distance", "$Probability", "$ProbabilityStDev", "$ProbabilityStdDeV", "$ProbabilityVariance", "$StDev", - "$StdDeV", "$Support", "$Variance", "AddCalculatedMembers", "Action", "After", "Aggregate", "All", "Alter", - "Ancestor", "And", "Append", "As", "ASC", "Axis", "Automatic", "Back_Color", "BASC", "BDESC", "Before", - "Before_And_After", "Before_And_Self", "Before_Self_After", "BottomCount", "BottomPercent", "BottomSum", - "Break", "Boolean", "Cache", "Calculated", "Call", "Case", "Catalog_Name", "Cell", "Cell_Ordinal", "Cells", - "Chapters", "Children", "Children_Cardinality", "ClosingPeriod", "Cluster", "ClusterDistance", - "ClusterProbability", "Clusters", "CoalesceEmpty", "Column_Values", "Columns", "Content", "Contingent", - "Continuous", "Correlation", "Cousin", "Covariance", "CovarianceN", "Create", "CreatePropertySet", - "CrossJoin", "Cube", "Cube_Name", "CurrentMember", "CurrentCube", "Custom", "Cyclical", "DefaultMember", - "Default_Member", "DESC", "Descendents", "Description", "Dimension", "Dimension_Unique_Name", "Dimensions", - "Discrete", "Discretized", "DrillDownLevel", "DrillDownLevelBottom", "DrillDownLevelTop", "DrillDownMember", - "DrillDownMemberBottom", "DrillDownMemberTop", "DrillTrough", "DrillUpLevel", "DrillUpMember", "Drop", - "Else", "Empty", "End", "Equal_Areas", "Exclude_Null", "ExcludeEmpty", "Exclusive", "Expression", "Filter", - "FirstChild", "FirstRowset", "FirstSibling", "Flattened", "Font_Flags", "Font_Name", "Font_size", - "Fore_Color", "Format_String", "Formatted_Value", "Formula", "From", "Generate", "Global", "Head", - "Hierarchize", "Hierarchy", "Hierary_Unique_name", "IIF", "IsEmpty", "Include_Null", "Include_Statistics", - "Inclusive", "Input_Only", "IsDescendant", "Item", "Lag", "LastChild", "LastPeriods", "LastSibling", "Lead", - "Level", "Level_Number", "Level_Unique_Name", "Levels", "LinRegIntercept", "LinRegR2", "LinRegPoint", - "LinRegSlope", "LinRegVariance", "Long", "MaxRows", "Median", "Member", "Member_Caption", "Member_Guid", - "Member_Name", "Member_Ordinal", "Member_Type", "Member_Unique_Name", "Members", "Microsoft_Clustering", - "Microsoft_Decision_Trees", "Mining", "Model", "Model_Existence_Only", "Models", "Move", "MTD", "Name", - "Nest", "NextMember", "Non", "NonEmpty", "Normal", "Not", "Ntext", "Nvarchar", "OLAP", "On", - "OpeningPeriod", "OpenQuery", "Or", "Ordered", "Ordinal", "Pages", "ParallelPeriod", "Parent", - "Parent_Level", "Parent_Unique_Name", "PeriodsToDate", "PMML", "Predict", "Predict_Only", - "PredictAdjustedProbability", "PredictHistogram", "Prediction", "PredictionScore", "PredictProbability", - "PredictProbabilityStDev", "PredictProbabilityVariance", "PredictStDev", "PredictSupport", - "PredictVariance", "PrevMember", "Probability", "Probability_StDev", "Probability_StdDev", - "Probability_Variance", "Properties", "Property", "QTD", "RangeMax", "RangeMid", "RangeMin", "Rank", - "Recursive", "Refresh", "Related", "Rename", "Rollup", "Rows", "Schema_Name", "Sections", "Select", "Self", - "Self_And_After", "Sequence_Time", "Server", "Session", "Set", "SetToArray", "SetToStr", "Shape", "Skip", - "Solve_Order", "Sort", "StdDev", "Stdev", "StripCalculatedMembers", "StrToSet", "StrToTuple", "SubSet", - "Support", "Tail", "Text", "Thresholds", "ToggleDrillState", "TopCount", "TopPercent", "TopSum", - "TupleToStr", "Under", "Uniform", "UniqueName", "Use", "Value", "Var", "Variance", "VarP", "VarianceP", - "VisualTotals", "When", "Where", "With", "WTD", "Xor")); - - CatalogCache getCatalogCache(); - /** - * Gives access to the {@link javax.sql.DataSource} that holds the {@link java.sql.Connection}s to - * the Database. - * - * @return DataSource - */ - DataSource getDataSource(); - - /** - * Gives access to the {@link Dialect} that must be used to generate SQL querys - * against the {@link javax.sql.DataSource}. - * - * @return DataSource - */ - Dialect getDialect(); - - /** - * Gives access to a {@link QueryProvider}. - * - * @return {@link QueryProvider}. - */ -// QueryProvider getQueryProvider(); - /* - * The human readable name of the Context. By default the name of the Schema. - * May be overridden. - */ - String getName(); - - /* - * The human readable description of the Context. By default the getDescription - * of the Schema. May be overridden. - */ - Optional getDescription(); - List getAccessRoles(); - - ExpressionCompilerFactory getExpressionCompilerFactory(); - - /* - * Gives access to the {@link Connection}. - */ - C getConnectionWithDefaultRole(); - C getConnection(List roles); - - C getConnection(ConnectionProps props); - - - void addConnection(C rolapConnection); - - void removeConnection(C rolapConnection); - - ResultShepherd getResultShepherd(); - -// AggregationManager getAggregationManager(); - - void addStatement(Statement statement); - - void removeStatement(Statement internalStatement); - - EventBus getMonitor(); - - List getStatements(C connection); - - T getConfigValue(String key, T dflt ,Class clazz); - - Semaphore getQueryLimitSemaphore(); - - Optional> getSqlMemberSourceValuePool(); - - FunctionService getFunctionService(); - - MdxParserProvider getMdxParserProvider(); - - Optional getSqlGuardFactory(); - - default List getKeywordList() { - return KEYWORD_LIST; - } - - AggregationFactory getAggragationFactory(); - - Evaluator createEvaluator(Statement statement); - - /** - * Creates a dummy evaluator. - */ - Evaluator createDummyEvaluator(Statement statement); - - ExpressionCompiler createProfilingCompiler(ExpressionCompiler compiler); - - ExpressionCompiler createDependencyTestingCompiler(ExpressionCompiler compiler); - - List getCustomAggregators(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ContextGroup.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ContextGroup.java deleted file mode 100644 index 94d066b433..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ContextGroup.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -/** - * The {@link ContextGroup} gives access to a set of {@link Context}s. - * It guarantees that names of the {@link Context}s are unique in the group. - * - * @author stbischof - * - */ -public interface ContextGroup { - - /** - * Gives access to the valid {@link Context}s. - * - * A Context is only valid, if it in unique in the this Group. - * - * @return Context - */ - List> getValidContexts(); - - - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataType.java deleted file mode 100644 index bf603c762e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataType.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2003-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -//TODO: REMOVE and use New Type System. when this is free from inner values -public enum DataType { - - ARRAY("array", "Array"), // - CUBE("cube", "Cube"), // - DATE_TIME("datetime", "DateTime"), // - DIMENSION("dimension", "Dimension"), // - EMPTY("empty", "Empty"), // - HIERARCHY("hierarchy", "Hierarchy"), // - INTEGER("integer", "Integer"), // - LEVEL("level", "Level"), // - LOGICAL("logical", "Logical Expression"), // - MEMBER("member", "Member"), // - NULL("null", "Null"), // - NUMERIC("numeric", "Numeric Expression"), // - SET("set", "Set"), // - STRING("string", "String"), // - SYMBOL("symbol", "Symbol"), // - TUPLE("tuple", "Tuple"), // - UNKNOWN("unknown", "Unknown"), // - /** - * A {@link Category.VALUE} is a expression that results in a string or numeric. - */ - VALUE("value", "Value"); - - private String name; - private String prittyName; - - DataType(String name, String prittyName) { - this.name = name; - this.prittyName = prittyName; - } - - public boolean isScalar() { - switch (this) { - case VALUE: - case LOGICAL: - case NUMERIC: - case INTEGER: - case STRING: - case DATE_TIME: - return true; - default: - return false; - } - } - - public String getName() { - return name; - } - public String getPrittyName() { - return prittyName; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataTypeJdbc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataTypeJdbc.java deleted file mode 100644 index 06fb11d1fe..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DataTypeJdbc.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - -import java.util.stream.Stream; - -public enum DataTypeJdbc { - VARCHAR("Varchar"), - - NUMERIC("Numeric"), - - INTEGER("Integer"), - DECIMAL("Decimal"), - - FLOAT("Float"), - - REAL("Real"), - - BIGINT("BigInt"), - - SMALLINT("SmallInt"), - - DOUBLE("Double"), - - BOOLEAN("Boolean"), - - DATE("Date"), - - TIME("Time"), - - TIMESTAMP("Timestamp"); - - private String value; - - DataTypeJdbc(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static DataTypeJdbc fromValue(String v) { - return Stream.of(DataTypeJdbc.values()) - .filter(e -> (e.getValue().equals(v))) - .findFirst().orElse(NUMERIC); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughAction.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughAction.java deleted file mode 100644 index 0f902bf6c5..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughAction.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.OlapElement; - -public interface DrillThroughAction extends OlapAction{ - - boolean getIsDefault(); - - List getOlapElements(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughColumn.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughColumn.java deleted file mode 100644 index 91372de21c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/DrillThroughColumn.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api; - -import org.eclipse.daanse.olap.api.element.OlapElement; - -public interface DrillThroughColumn { - OlapElement getOlapElement(); -} - diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Evaluator.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Evaluator.java deleted file mode 100644 index c1b438f377..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Evaluator.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; - -import org.eclipse.daanse.olap.api.calc.compiler.ParameterSlot; -import org.eclipse.daanse.olap.api.calc.todo.TupleIterable; -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.NamedSet; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.query.component.Query; - -/** - * An Evaluator holds the context necessary to evaluate an - * expression. - * - * @author jhyde - * @since 27 July, 2001 - */ -public interface Evaluator{ - - /** - * Returns the current cube. - */ - Cube getCube(); - - /** - * Returns the current query. - */ - Query getQuery(); - - /** - * Returns the start time of the current query. - */ - Date getQueryStartTime(); - - /** - * Creates a savepoint encapsulating the current state of the evalutor. - * You can restore the evaluator to this state by calling - * {@link #restore(int)} with the value returned by this method. - * - *

This method is typically called before evaluating an expression which - * is known to corrupt the evaluation context. - * - *

Multiple savepoints may be active at the same time for the same - * evaluator. And, it is allowable to restore to the save savepoint more - * than once (or not at all). However, when you have rolled back to a - * particular savepoint you may not restore to a later savepoint. - * - * @return Evaluator with each given member overriding the state of the - * current Evaluator for its hierarchy - */ - int savepoint(); - - /** - * Creates a new Evaluator with the same context as this evaluator. - * - *

This method is typically called before evaluating an expression which - * may corrupt the evaluation context. - * - *

In mondrian-3.3 and later, a more efficient way to save the state of - * an evaluator is to call {@link #savepoint} followed by - * {@link #restore(int)}. We recommend using those methods most of the time. - * - *

However, it makes sense to use this method in the constructor of an - * iterator. It allows the iterator to modify its evaluation context without - * affecting the evaluation context of the calling code. This behavior - * cannot be achieved using {@code savepoint}. - * - * @return Evaluator with each given member overriding the state of the - * current Evaluator for its hierarchy - */ - Evaluator push(); - - /** - * Restores previous evaluator. - * - * @param savepoint Savepoint returned by {@link #savepoint()} - */ - void restore(int savepoint); - - /** - * Makes member the current member of its hierarchy. - * - * @param member New member - * - * @return Previous member of this hierarchy - */ - Member setContext(Member member); - - /** - * Makes member the current member of its hierarchy. - * - *

If {@code safe}, checks whether this is the first time that - * a member of this hierarchy has been changed since {@link #savepoint()} - * was called. If so, saves the previous member. If {@code safe} is false, - * never saves the previous member. - * - *

Use {@code safe = false} only if you are sure that the context has - * been set before. For example, - * - *

- * int n = 0;
- * for (Member member : members) {
- *   evaluator.setContext(member, n++ > 0);
- * }
- * - * @param member New member - * @param safe Whether to store the member of this hierarchy that was - * current last time that {@link #savepoint()} was called. - */ - void setContext(Member member, boolean safe); - - /** - * Sets the context to a list of members. - * - *

Equivalent to - * - *

for (Member member : memberList) {
- *   setContext(member);
- * }
- * - * @param memberList List of members - */ - void setContext(List memberList); - - /** - * Sets the context to a list of members, optionally skipping the check - * whether it is necessary to store the previous member of each hierarchy. - * - *

Equivalent to - * - *

for (Member member : memberList) {
- *   setContext(member, safe);
- * }
- * - * @param memberList List of members - * @param safe Whether to store the member of each hierarchy that was - * current last time that {@link #savepoint()} was called. - */ - void setContext(List memberList, boolean safe); - - /** - * Sets the context to an array of members. - * - *

Equivalent to - * - *

for (Member member : memberList) {
- *   setContext(member);
- * }
- * - * @param members Array of members - */ - void setContext(Member[] members); - - /** - * Sets the context to an array of members, optionally skipping the check - * whether it is necessary to store the previous member of each hierarchy. - * - *

Equivalent to - * - *

for (Member member : memberList) {
- *   setContext(member, safe);
- * }
- * - * @param members Array of members - * @param safe Whether to store the member of each hierarchy that was - * current last time that {@link #savepoint()} was called. - */ - void setContext(Member[] members, boolean safe); - - Member getContext(Hierarchy hierarchy); - - /** - * Calculates and returns the value of the cell at the current context. - */ - Object evaluateCurrent(); - - /** - * Returns the format string for this cell. This is computed by evaluating - * the format expression in the current context, and therefore different - * cells may have different format strings. - */ - public String getFormatString(); - - /** - * Formats a value as a string according to the current context's - * format. - */ - String format(Object o); - - /** - * Formats a value as a string according to the current context's - * format, using a given format string. - */ - String format(Object o, String formatString); - - /** - * Returns the connection's locale. - */ - Locale getConnectionLocale(); - - /** - * Retrieves the value of property name. If more than one - * member in the current context defines that property, the one with the - * highest solve order has precedence. - * - *

If the property is not defined, default value is returned. - */ - Object getProperty(String name, Object defaultValue); - - /** - * Returns a {@link CatalogReader} appropriate for the current - * access-control context. - */ - CatalogReader getCatalogReader(); - - /** - * Simple caching of the result of an Exp. The - * key for the cache consists of all members of the current - * context that exp depends on. Members of - * independent hierarchies are not part of the key. - * - * @see mondrian.calc.Calc#dependsOn(Hierarchy) - */ - Object getCachedResult(ExpCacheDescriptor key); - - /** - * Returns true for an axis that is NON EMPTY. - * - *

May be used by expression - * evaluators to optimize their result. For example, a top-level crossjoin - * may be optimized by removing all non-empty set elements before - * performing the crossjoin. This is possible because of the identity - * - *

nonempty(crossjoin(a, b)) == - * nonempty(crossjoin(nonempty(a), nonempty(b));
- */ - boolean isNonEmpty(); - - /** - * Sets whether an expression evaluation should filter out empty cells. - * Allows expressions to modify non empty flag to evaluate their children. - */ - void setNonEmpty(boolean nonEmpty); - - /** - * Creates an exception which indicates that an error has occurred during - * the runtime evaluation of a function. The caller should then throw that - * exception. - */ - RuntimeException newEvalException(Object context, String s); - - /** - * Returns an evaluator for a set. - * - * @param exp Expression - * @param create Whether to create evaluator if not found - * @return Evaluator of named set - */ - SetEvaluator getSetEvaluator(Expression exp, boolean create); - - /** - * Returns an evaluator for a named set. - * - * @param namedSet Named set - * @param create Whether to create evaluator if not found - * @return Evaluator of named set - */ - NamedSetEvaluator getNamedSetEvaluator(NamedSet namedSet, boolean create); - - /** - * Returns an array of the members which make up the current context. - */ - Member[] getMembers(); - - /** - * Returns an array of the non-All members which make up the current - * context. - * - *

Notes:

    - *
  • The 0th element is a measure, but otherwise the order of the - * members is unspecified. - *
  • No hierarchy occurs more than once. - *
  • In rare circumstances, some of the members may be an 'All' member. - *
  • The list may contain calculated members. - *
- */ - Member[] getNonAllMembers(); - - /** - * Returns the number of times that this evaluator has told a lie when - * retrieving cell values. - */ - int getMissCount(); - - /** - * Returns the value of a parameter, evaluating its default value if it is - * not set. - */ - Object getParameterValue(ParameterSlot slot); - - /** - * @return the iteration length of the current context - */ - int getIterationLength(); - - /** - * Sets the iteration length for the current evaluator context - * - * @param length length to be set - */ - void setIterationLength(int length); - - /** - * @return true if evaluating axes - */ - boolean isEvalAxes(); - - /** - * Indicate whether the evaluator is evaluating the axes - * - * @param evalAxes true if evaluating axes - */ - void setEvalAxes(boolean evalAxes); - - /** - * Returns a new Aggregator whose aggregation context adds a given list of - * tuples, and whose evaluation context is the same as this - * Aggregator. - * - * @param list List of tuples - * @return Aggregator with list added to its aggregation - * context - */ - Evaluator pushAggregation(List> list); - - /** - * Returns the base (non-virtual) cube that the current measure in the - * context belongs to. - * @return Cube - */ - Cube getMeasureCube(); - - /** - * Returns whether it is necessary to check whether to return null for - * an unrelated dimension. If false, we never need to check: we can assume - * that {@link #needToReturnNullForUnrelatedDimension(org.eclipse.daanse.olap.api.element.Member[])} - * will always return false. - * - * @return whether it is necessary to check whether to return null for - * an unrelated dimension - */ - boolean mightReturnNullForUnrelatedDimension(); - - /** - * If IgnoreMeasureForNonJoiningDimension is set to true and one or more - * members are on unrelated dimension for the measure in current context - * then returns true. - * - *

You must not call this method unless - * {@link #mightReturnNullForUnrelatedDimension()} has returned true. - * - * @param members Dimensions for the members need to be checked whether - * related or unrelated - * - * @return boolean - */ - boolean needToReturnNullForUnrelatedDimension(Member[] members); - - /** - * Returns whether native evaluation is enabled in this context. - * - * @return whether native evaluation is enabled in this context - */ - boolean nativeEnabled(); - - /** - * Sets whether native evaluation should be used. - * - * @param nativeEnabled Whether native evaluation should be used - */ - void setNativeEnabled(boolean nativeEnabled); - - /** - * Returns whether the current context is an empty cell. - * - * @return Whether the current context is an empty cell - */ - boolean currentIsEmpty(); - - /** - * Returns the member that was the current evaluation context for a - * particular hierarchy before the most recent change in context. - * - * @param hierarchy Hierarchy - * @return Previous context member for given hierarchy - */ - Member getPreviousContext(Hierarchy hierarchy); - - /** - * Returns the query timing context for this execution. - * - * @return query timing context - */ - QueryTiming getTiming(); - - /** - * Return the list of slicer members in the current evaluator context. - */ - List getSlicerMembers(); - - Map> getSlicerMembersByHierarchy(); - - /** - * Interface for evaluating a particular named set. - */ - interface NamedSetEvaluator { - /** - * Returns an iterator over the tuples of the named set. Applicable if - * the named set is a set of tuples. - * - *

The iterator from this iterable maintains the current ordinal - * property required for the methods {@link #currentOrdinal()} and - * {@link #currentTuple()}. - * - * @param eval Evaluator for current context - * - * @return Iterable over the tuples of the set - */ - TupleIterable evaluateTupleIterable(Evaluator eval); - - /** - * Returns the ordinal of the current member or tuple in the named set. - * - * @return Ordinal of the current member or tuple in the named set - */ - int currentOrdinal(); - - /** - * Returns the current member in the named set. - * - *

Applicable if the named set is a set of members. - * - * @return Current member - */ - Member currentMember(); - - /** - * Returns the current tuple in the named set. - * - *

Applicable if the named set is a set of tuples. - * - * @return Current tuple. - */ - Member[] currentTuple(); - } - - /** - * Interface for generically evaluating a set. - */ - interface SetEvaluator { - /** - * Returns an iterator over the tuples of the named set. Applicable if - * the named set is a set of tuples. - * - *

The iterator from this iterable maintains the current ordinal - * property required for the methods {@link #currentOrdinal()} and - * {@link #currentTuple()}. - * - * @return Iterable over the tuples of the set - */ - TupleIterable evaluateTupleIterable(); - - /** - * Returns the ordinal of the current member or tuple in the named set. - * - * @return Ordinal of the current member or tuple in the named set - */ - int currentOrdinal(); - - /** - * Returns the current member in the named set. - * - *

Applicable if the named set is a set of members. - * - * @return Current member - */ - Member currentMember(); - - /** - * Returns the current tuple in the named set. - * - *

Applicable if the named set is a set of tuples. - * - * @return Current tuple. - */ - Member[] currentTuple(); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Execution.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Execution.java deleted file mode 100644 index d92b8a534c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Execution.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.time.Duration; - -public interface Execution { - - void cancelSqlStatements(); - - Statement getMondrianStatement(); - - void setOutOfMemory(String string); - - long getId(); - - void checkCancelOrTimeout(); - - boolean isCancelOrTimeout(); - - Duration getElapsedMillis(); - - void tracePhase(int hitCount, int missCount, int pendingCount); - - void setCellCacheHitCount(int hitCount); - - void setCellCacheMissCount(int missCount); - - void setCellCachePendingCount(int pendingCount); - - void setExpCacheCounts(int expResultCacheHitCount, int expResultCacheMissCount); - - void registerStatement(Locus locus, java.sql.Statement stmt); - - void end(); - - void start(); - - void cancel(); - - QueryTiming getQueryTiming(); - - int getExpCacheHitCount(); - - int getExpCacheMissCount(); - - /** - * Enumeration of the states of an Execution instance. - */ - public enum State { - /** - * Identifies the state in which an execution is before it has started resolving - * the query. This doesn't mean that there are no current SQL statements already - * beeing executed. - */ - FRESH, RUNNING, ERROR, CANCELED, TIMEOUT, DONE, - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ExpCacheDescriptor.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ExpCacheDescriptor.java deleted file mode 100644 index d04b223fe4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ExpCacheDescriptor.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.query.component.Expression; - -public interface ExpCacheDescriptor { - - Calc getCalc(); - - Object evaluate(Evaluator evaluator); - - Expression getExp(); - - /** - * Returns the ordinals of the hierarchies which this expression is dependent - * upon. When the cache descriptor is used to generate a cache key, the key will - * consist of a member from each of these hierarchies. - */ - int[] getDependentHierarchyOrdinals(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/IAggregationManager.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/IAggregationManager.java deleted file mode 100644 index 23cca16156..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/IAggregationManager.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - -import java.io.PrintWriter; - -public interface IAggregationManager { - - void shutdown(); - - ISegmentCacheManager getCacheMgr(Connection mondrianConnection); - - CacheControl getCacheControl(Connection rolapConnection, PrintWriter pw); - - ISegmentCacheManager getCacheMgr(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISegmentCacheManager.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISegmentCacheManager.java deleted file mode 100644 index 6db57692fc..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISegmentCacheManager.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ - -package org.eclipse.daanse.olap.api; - -import java.io.PrintWriter; - -import org.eclipse.daanse.olap.api.CacheControl.CellRegion; - -public interface ISegmentCacheManager { - - /** - * Shuts down this cache manager and all active threads and indexes. - */ - void shutdown(); - - void printCacheState(CellRegion region, PrintWriter pw, Locus locus); - - - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISqlStatement.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISqlStatement.java deleted file mode 100644 index 39f1994b32..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ISqlStatement.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - -import java.sql.ResultSet; - -public interface ISqlStatement { - - /** - * Executes the current statement, and handles any SQLException. - */ - void execute(); - - /** - * Closes all resources (statement, result set) held by this SqlStatement. - * - *

If any of them fails, wraps them in a - * {@link RuntimeException} describing the high-level operation which this statement was performing. No further - * error-handling is required to produce a descriptive stack trace, unless you want to absorb the error.

- * - *

This method is idempotent.

- */ - void close(); - - ResultSet getResultSet(); - - /** - * Returns the result set in a proxy which automatically closes this SqlStatement (and hence also the statement and - * result set) when the result set is closed. - * - *

This helps to prevent connection leaks. The caller still has to - * remember to call ResultSet.close(), of course. - * - * @return Wrapped result set - */ - ResultSet getWrappedResultSet(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/IdentifierSegment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/IdentifierSegment.java deleted file mode 100644 index da07c925a0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/IdentifierSegment.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to Julian Hyde under one or more contributor license - * agreements. See the NOTICE file distributed with this work for - * additional information regarding copyright ownership. - * - * Julian Hyde licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -/** - * Component in a compound identifier. It is described by its name and how - * the name is quoted. - * - *

For example, the identifier - * [Store].USA.[New Mexico].&[45] has four segments:

    - *
  • "Store", {@link Quoting#QUOTED}
  • - *
  • "USA", {@link Quoting#UNQUOTED}
  • - *
  • "New Mexico", {@link Quoting#QUOTED}
  • - *
  • "45", {@link Quoting#KEY}
  • - *
- * - *

QUOTED and UNQUOTED segments are represented using a - * {@link NameSegment NameSegment}; - * KEY segments are represented using a - * {@link KeySegment KeySegment}. - * - *

To parse an identifier into a list of segments, use the method - * {@link org.olap4j.mdx.IdentifierNode#parseIdentifier(String)} and then call - * {@link org.olap4j.mdx.IdentifierNode#getSegmentList()} on the resulting - * node.

- * - * @author jhyde - */ -public sealed interface IdentifierSegment permits KeyIdentifierSegment, NameIdentifierSegment { - - /** - * Returns a string representation of this Segment. - * - *

For example, "[Foo]", "&[123]", "Abc". - * - * @return String representation of this Segment - */ - String toString(); - - /** - * Appends a string representation of this Segment to a StringBuffer. - * - * @param buf StringBuffer - */ - void toString(StringBuilder buf); - - /** - * Returns the region of the source code which this Segment was created - * from, if it was created by parsing. - * - * @return region of source code - */ - ParseRegion getRegion(); - - /** - * Returns how this Segment is quoted. - * - * @return how this Segment is quoted - */ - Quoting getQuoting(); - - /** - * Returns the name of this IdentifierSegment. - * Returns {@code null} if this IdentifierSegment represents a key. - * - * @return name of this Segment - */ - String getName(); - - -} - -// End IdentifierSegment.java diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/KeyIdentifierSegment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/KeyIdentifierSegment.java deleted file mode 100644 index 702cd1426a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/KeyIdentifierSegment.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -public non-sealed interface KeyIdentifierSegment extends IdentifierSegment { - - /** - * Returns the key components, if this IdentifierSegment is a key. (That is, if - * {@link #getQuoting()} returns {@link Quoting#KEY}.) - * - * Returns null otherwise. - * - * @return Components of key, or null if this IdentifierSegment is not a key - */ - List getKeyParts(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Locus.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Locus.java deleted file mode 100644 index 9136f6dfda..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Locus.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api; - - -//todo: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ScopedValue.html -//TODO: https://openjdk.org/jeps/462 -public interface Locus { - - Execution getExecution(); - - Context getContext(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/MatchType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/MatchType.java deleted file mode 100644 index 8841c5acc1..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/MatchType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2003-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -/** - * MatchType enumerates the allowable match modes when - * searching for a member based on its unique name. - * - * @author Zelaine Fong - */ -public enum MatchType { - /** Match the unique name exactly, do not query database for members */ - EXACT_SCHEMA, - /** Match the unique name exactly */ - EXACT, - /** If no exact match, return the preceding member */ - BEFORE, - /** If no exact match, return the next member */ - AFTER, - /** Return the first child */ - FIRST, - /** Return the last child */ - LAST; - - /** - * Return true if either Exact or Exact Schema value - * is selected. - * - * @return true if exact - */ - public boolean isExact() { - return this == EXACT || this == EXACT_SCHEMA; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameIdentifierSegment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameIdentifierSegment.java deleted file mode 100644 index 61ceadfca9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameIdentifierSegment.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -public non-sealed interface NameIdentifierSegment extends IdentifierSegment { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameResolver.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameResolver.java deleted file mode 100644 index b6b4747ac6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameResolver.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.OlapElement; - -public interface NameResolver { - - /** - * Resolves a list of segments (a parsed identifier) to an OLAP element. - * - * @param parent Parent element to search in, usually a cube - * @param segments Exploded compound name, such as {"Products", - * "Product Department", "Produce"} - * @param failIfNotFound If the element is not found, determines whether - * to return null or throw an error - * @param category Type of returned element, a {@link DataType} value; - * {@link DataType#UNKNOWN} if it doesn't matter. - * @param matchType Match type - * @param namespaces Namespaces wherein to find child element at each step - * @return OLAP element with given name, or null if not found - */ - OlapElement resolve(OlapElement parent, List segments, boolean failIfNotFound, DataType category, - MatchType matchType, List namespaces); - - /** - * Naming context within which elements are defined. - * - *

Elements' names are hierarchical, so elements are resolved one - * name segment at a time. It is possible for an element to be defined - * in a different namespace than its parent: for example, stored member - * [Dim].[Hier].[X].[Y] might have a child [Dim].[Hier].[X].[Y].[Z] which - * is a calculated member defined using a WITH MEMBER clause.

- */ - public interface Namespace { - /** - * Looks up a child element, using a match type for inexact matching. - * - *

If {@code matchType} is {@link MatchType#EXACT}, effect is - * identical to calling - * {@link #lookupChild(OlapElement, org.eclipse.daanse.olap.api.olap4j.mdx.IdentifierSegment)}.

- * - *

Match type is ignored except when searching for members.

- * - * @param parent Parent element - * @param segment Name segment - * @param matchType Match type - * @return Olap element, or null - */ - OlapElement lookupChild( - OlapElement parent, - IdentifierSegment segment, - MatchType matchType); - - /** - * Looks up a child element. - * - * @param parent Parent element - * @param segment Name segment - * @return Olap element, or null - */ - OlapElement lookupChild( - OlapElement parent, - IdentifierSegment segment); - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameSegment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameSegment.java deleted file mode 100644 index 0152951ffd..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NameSegment.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -public interface NameSegment extends Segment{ - - String getName(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NativeEvaluator.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/NativeEvaluator.java deleted file mode 100644 index 61df5aebac..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/NativeEvaluator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import org.eclipse.daanse.olap.api.calc.ResultStyle; - -/** - * Allows expressions to be evaluated native, e.g. in SQL. - * - * @author av - * @since Nov 11, 2005 - */ - -public interface NativeEvaluator { - Object execute(ResultStyle resultStyle); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/OlapAction.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/OlapAction.java deleted file mode 100644 index f8d6f323f0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/OlapAction.java +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api; - -public interface OlapAction { - - String getName(); - - String getCaption(); - - String getDescription(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Parameter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Parameter.java deleted file mode 100644 index de1764efc4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Parameter.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * Parameter to a Query. - * - *

A parameter is not an expression; see {@link ParameterExpr}. - * - * @author jhyde - * @since Jul 22, 2006 - */ -public interface Parameter { - /** - * Returns the scope where this parameter is defined. - * - * @return Scope of the parameter - */ - Scope getScope(); - - /** - * Returns the type of this Parameter. - * - * @return Type of the parameter - */ - Type getType(); - - /** - * Returns the expression which provides the default value for this - * Parameter. Never null. - * - * @return Default value expression of the parameter - */ - Expression getDefaultExp(); - - /** - * Returns the name of this Parameter. - * - * @return Name of the parameter - */ - String getName(); - - /** - * Returns the description of this Parameter. - * - * @return Description of the parameter - */ - String getDescription(); - - /** - * Returns whether the value of this Parameter can be modified in a query. - * - * @return Whether parameter is modifiable - */ - boolean isModifiable(); - - /** - * Returns the value of this parameter. - * - *

If {@link #setValue(Object)} has not been called, returns the default - * value of this parameter. - * - *

The type of the value is (depending on the type of the parameter) - * a {@link String}, {@link Number}, or {@link Member}. - * - * @return The value of this parameter - */ - Object getValue(); - - /** - * Sets the value of this parameter. - * - * @param value Value of the parameter; must be a {@link String}, - * a {@link Double}, or a {@link org.eclipse.daanse.olap.api.element.Member} - */ - void setValue(Object value); - - /** - * Returns whether the value of this parameter has been set. - * - *

If the value has not been set, this parameter will return its default - * value. - * - *

Setting a parameter to {@code null} is not equivalent to unsetting it. - * To unset a parameter, call {@link #unsetValue}. - * - * @return Whether this parameter has been assigned a value - */ - boolean isSet(); - - /** - * Unsets the value of this parameter. - * - *

After calling this method, the parameter will revert to its default - * value, as if {@link #setValue(Object)} had not been called, and - * {@link #isSet()} will return {@code false}. - */ - void unsetValue(); - - /** - * Scope where a parameter is defined. - */ - enum Scope { - System, - Schema, - Connection, - Statement - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ParseRegion.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ParseRegion.java deleted file mode 100644 index 7f647ce1b9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ParseRegion.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api; - -public interface ParseRegion { - - /** - * Return starting line number (1-based). - * - * @return 1-based starting line number - */ - int getStartLine(); - - /** - * Return starting column number (1-based). - * - * @return 1-based starting column number - */ - int getStartColumn(); - - /** - * Return ending line number (1-based). - * - * @return 1-based ending line number - */ - int getEndLine(); - - /** - * Return ending column number (1-based). - * - * @return 1-based starting endings column number - */ - int getEndColumn(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ProfileHandler.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ProfileHandler.java deleted file mode 100644 index e4da40c6c8..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ProfileHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -/* -* This software is subject to the terms of the Eclipse Public License v1.0 -* Agreement, available at the following URL: -* http://www.eclipse.org/legal/epl-v10.html. -* You must accept the terms of that agreement to use this software. -* -* Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. -*/ - -package org.eclipse.daanse.olap.api; - -/** - * Called when a statement has profile information. - */ -public interface ProfileHandler { - /** - * Called when a statement has finished executing. - * - * @param plan Annotated plan - * @param timing Query timings - */ - public void explain(String plan, QueryTiming timing); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/QueryTiming.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/QueryTiming.java deleted file mode 100644 index 1e154cdbfa..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/QueryTiming.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.time.Duration; - -public interface QueryTiming { - - /** - * Marks the start of a Query component's execution. - * - * @param name Name of the component - */ - void markStart(String name); - - /** - * Marks the end of a Query component's execution. - * - * @param name Name of the component - */ - void markEnd(String name); - - /** - * Marks the duration of a Query component's execution. - * - * markFull is synchronized because it may be called from either Actor's spawn - * thread or RolapResultShepherd thread - * - * @param name Name of the component - * @param duration Duration of the execution - */ - - void markFull(String string, Duration duration); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Quoting.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Quoting.java deleted file mode 100644 index 9741db3d97..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Quoting.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -public enum Quoting { - /** - * Unquoted identifier, for example "Measures". - */ - UNQUOTED, - - /** - * Quoted identifier, for example "[Measures]". - */ - QUOTED, - - /** - * Identifier quoted with an ampersand to indicate a key value, for - * example the second segment in "[Employees].&[89]". - */ - KEY -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ResultShepherd.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/ResultShepherd.java deleted file mode 100644 index 5e75005023..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/ResultShepherd.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.concurrent.Callable; - -import org.eclipse.daanse.olap.api.result.Result; - -public interface ResultShepherd { - - /** - * Executes and shepherds the execution of an Execution instance. - * The shepherd will wrap the Execution instance into a Future object - * which can be monitored for exceptions. If any are encountered, - * two things will happen. First, the user thread will be returned and - * the resulting exception will bubble up. Second, the execution thread - * will attempt to do a graceful stop of all running SQL statements and - * release all other resources gracefully in the background. - * @param execution An Execution instance. - * @param callable A callable to monitor returning a Result instance. - * @throws mondrian.olap.ResourceLimitExceededException if some resource limit specified - * in the property file was exceeded - * @throws mondrian.olap.QueryCanceledException if query was canceled during execution - * @throws mondrian.olap.QueryTimeoutException if query exceeded timeout specified in - * the property file - * @return A Result object, as supplied by the Callable passed as a - * parameter. - */ - Result shepherdExecution(Execution execution, Callable callable); - - void shutdown(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Segment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Segment.java deleted file mode 100644 index 2bcf08b610..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Segment.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -public interface Segment { - - Quoting getQuoting(); - - List getKeyParts(); - - boolean matches(String name); - - void toString(StringBuilder buf); - - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlExpression.java deleted file mode 100644 index c332700886..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlExpression.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -public interface SqlExpression { - - List getSqls(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlStatement.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlStatement.java deleted file mode 100644 index bc4548025a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SqlStatement.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -import java.util.List; - -public interface SqlStatement { - - List getDialects(); - - String getSql(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Statement.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Statement.java deleted file mode 100644 index 7905745f59..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Statement.java +++ /dev/null @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Optional; - -import org.eclipse.daanse.olap.api.element.Catalog; -import org.eclipse.daanse.olap.api.query.component.Query; -import org.eclipse.daanse.olap.api.query.component.QueryComponent; -import org.eclipse.daanse.olap.api.result.CellSet; -import org.eclipse.daanse.olap.api.result.Result; - -public interface Statement { - - - Connection getConnection() ; - - /** - * Executes an mdx SelectStatement. - * - * @param mdx MDX tabFields, int[] rowCountSlot); - - ResultSet executeQuery(QueryComponent queryComponent, Optional tabFields, int[] rowCountSlot); - - Query getQuery(); - - - - /** - * Closes this statement. - */ - void close(); - - /** - * Returns this statement's schema reader. - * - * @return Schema reader, not null - */ - CatalogReader getCatalogReader(); - - /** - * Returns this statement's Catalog. - * - * @return Catalog, not null - */ - Catalog getCatalog(); - - /** - * Returns this statement's connection. - * - * @return connection - */ - Connection getMondrianConnection(); - - - void setQuery(Query query); - - /** - * Enables profiling. - * - *

Profiling information will be sent to the given writer when - * {@link org.eclipse.daanse.olap.api.result.Result#close()} is called. - * - *

If profileHandler is null, disables profiling. - * - * @param profileHandler Writer to which to send profiling information - */ - void enableProfiling(ProfileHandler profileHandler); - - ProfileHandler getProfileHandler(); - - /** - * Sets the timeout of this statement, in milliseconds. - * - *

Zero means no timeout. - * - *

Contrast with JDBC's {@link java.sql.Statement#setQueryTimeout(int)} - * method, which uses an {@code int} value and a granularity of seconds. - * - * @param timeoutMillis Timeout in milliseconds - */ - void setQueryTimeoutMillis(long timeoutMillis); - - /** - * Returns the query timeout of this statement, in milliseconds. - * - *

Zero means no timeout.

- * - *

Contrast with JDBC's {@link java.sql.Statement#getQueryTimeout()} - * method, which uses an {@code int} value and a granularity of seconds. - * - * @return Timeout in milliseconds - */ - long getQueryTimeoutMillis(); - - /** - * Issues a cancel request on this statement. - * - *

Once the thread running the statement detects the cancel request, - * execution will throw an exception. See - * BasicQueryTest.testCancel for an example of usage of this - * method.

- * - * @throws java.sql.SQLException on error - */ - void cancel() throws SQLException; - - /** - * Returns execution context if currently executing, null otherwise. - * - * @return Execution context - */ - Execution getCurrentExecution(); - - /** - * Ends the current execution. - * - * @param execution Execution; must match the execution that was started - * - * @throws IllegalArgumentException if not started, - * or if execution does not match - */ - void end(Execution execution); - - /** - * Starts an execution. - * - * @param execution Execution context - */ - void start(Execution execution); - - /** - * Returns the ID of this statement, unique within the JVM. - * - * @return Unique ID of this statement - */ - long getId(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SubtotalVisibility.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/SubtotalVisibility.java deleted file mode 100644 index 6e64856486..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/SubtotalVisibility.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api; - -/** - * SubtotalVisibility enumerates the allowed values of - * whether subtotals are visible. - */ -public enum SubtotalVisibility { - Undefined, - Hide, - Show; -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Validator.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Validator.java deleted file mode 100644 index cb07b7f0e8..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Validator.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -import java.util.List; - -import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; -import org.eclipse.daanse.olap.api.function.FunctionDefinition; -import org.eclipse.daanse.olap.api.function.FunctionResolver; -import org.eclipse.daanse.olap.api.function.FunctionService; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.query.component.Formula; -import org.eclipse.daanse.olap.api.query.component.MemberProperty; -import org.eclipse.daanse.olap.api.query.component.ParameterExpression; -import org.eclipse.daanse.olap.api.query.component.Query; -import org.eclipse.daanse.olap.api.query.component.QueryAxis; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * Provides context necessary to resolve identifiers to objects, function - * calls to specific functions. - * - *

An expression calls {@link #validate} on each of its children, - * which in turn calls {@link Expression#accept}. - * - * @author jhyde - */ -public interface Validator { - /** - * Returns the {@link Query} which is being validated. - */ - Query getQuery(); - - /** - * Validates an expression, and returns the expression it resolves to. - * - * @param exp Expression to validate - * @param scalar Whether the context requires that the expression is - * evaluated to a value, as opposed to a tuple - */ - Expression validate(Expression exp, boolean scalar); - - /** - * Validates a usage of a parameter. - * - *

It must resolve to the same object (although sub-objects may change). - */ - void validate(ParameterExpression parameterExpr); - - /** - * Validates a child member property. - * - *

It must resolve to the same object (although sub-objects may change). - */ - void validate(MemberProperty memberProperty); - - /** - * Validates an axis. - * - * It must resolve to the same object (although sub-objects may change). - */ - void validate(QueryAxis axis); - - /** - * Validates a formula. - * - * It must resolve to the same object (although sub-objects may change). - */ - void validate(Formula formula); - - /** - * Returns whether the current context requires an expression. - */ - boolean requiresExpression(); - - /** - * Returns whether we can convert an argument to a parameter type. - * - * @param ordinal argument ordinal - * @param fromExp argument type - * @param to parameter type - * @param conversions List of conversions performed; - * method adds an element for each non-trivial conversion (for - * example, converting a member to a level). - * @return Whether we can convert an argument to a parameter type - */ - boolean canConvert( - int ordinal, - Expression fromExp, - DataType to, - List conversions); - - /** - * Returns the table of function and operator definitions. - */ - FunctionService getFunctionService(); - - /** - * Creates or retrieves the parameter corresponding to a "Parameter" or - * "ParamRef" function call. - */ - Parameter createOrLookupParam( - boolean definition, - String name, - Type type, - Expression defaultExp, - String description); - - /** - * Resolves a function call to a particular function. If the function is - * overloaded, returns as precise a match to the argument types as - * possible. - */ - FunctionDefinition getDef( - Expression[] args, - OperationAtom operationAtom ); - - /** - * Whether to resolve function name and arguments to a function definition - * each time a node is validated, not just the first time. - * - *

Default implementation returns {@code false}. - * - * @return whether to resolve function each time - */ - boolean alwaysResolveFunDef(); - - /** - * Returns the schema reader with which to resolve names of MDX objects - * (dimensions, hierarchies, levels, members, named sets). - * - *

The schema reader is initially in the context of the query's cube, - * and during a traversal it may change if named sets are introduced using - * the 'expr AS alias' construct. - * - * @return Schema reader - */ - CatalogReader getCatalogReader(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Walkable.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/Walkable.java deleted file mode 100644 index d3a5041c26..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/Walkable.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api; - -/** - * Allows others to walk to the children of an Object or Tree by using - * {@link #getChildren()}. - */ -public interface Walkable { - -//public interface Walkable> { - - /** - * Returns an array of the object's children. Those which are not - * {@link Walkable} are ignored. - */ - T[] getChildren(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCatalog.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCatalog.java deleted file mode 100644 index 9a0894cf44..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCatalog.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessCatalog { - - /** No access to an object and its children. */ - NONE, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** Access to all shared dimensions (applies to schema grant). */ - ALL_DIMENSIONS, - - /** All access to an object and its children. */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessCatalog.NONE, AccessCatalog.ALL, - AccessCatalog.ALL_DIMENSIONS, AccessCatalog.CUSTOM); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCube.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCube.java deleted file mode 100644 index e641f81ba4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessCube.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessCube { - - /** No access to an object and its children. */ - NONE, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** All access to an object and its children. */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessCube.NONE, AccessCube.ALL, AccessCube.CUSTOM); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseColumn.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseColumn.java deleted file mode 100644 index 3ae63cae61..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseColumn.java +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessDatabaseColumn { - - /** No access to an object and its children. */ - NONE, - - /** All access to an object and its children. */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessDatabaseColumn.NONE, AccessDatabaseColumn.ALL); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseSchema.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseSchema.java deleted file mode 100644 index 802013fa36..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseSchema.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessDatabaseSchema { - - /** No access to an object and its children. */ - NONE, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** All access to an object and its children. */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessDatabaseSchema.NONE, AccessDatabaseSchema.ALL, AccessDatabaseSchema.CUSTOM); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseTable.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseTable.java deleted file mode 100644 index a40f81668c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDatabaseTable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessDatabaseTable { - - /** No access to an object and its children. */ - NONE, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** All access to an object and its children. */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessDatabaseTable.NONE, AccessDatabaseTable.ALL, AccessDatabaseTable.CUSTOM); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDimension.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDimension.java deleted file mode 100644 index a59b5616f6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessDimension.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessDimension { - /** No access to an object and its children. */ - NONE, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** Access to all shared dimensions (applies to schema grant). */ - ALL; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessDimension.NONE, AccessDimension.ALL, - AccessDimension.CUSTOM); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessEnvironment.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessEnvironment.java deleted file mode 100644 index d8f8323976..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessEnvironment.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -public enum AccessEnvironment { - /** No access to an object and its children. */ - NONE, - /** - * A grant that covers none of the children - * unless explicitly granted. - */ - CUSTOM, - /** Access to all shared dimensions (applies to schema grant). */ - ALL_DIMENSIONS, - /** All access to an object and its children. */ - ALL; - @Override - public String toString() { - return this.name(); - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessHierarchy.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessHierarchy.java deleted file mode 100644 index fafdbdc9f0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessHierarchy.java +++ /dev/null @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessHierarchy { - /** No access to an object and its children. */ - NONE, - /** - * A grant that covers none of the children - * unless explicitly granted. - */ - CUSTOM, - /** All access to an object and its children. */ - ALL; - @Override - public String toString() { - return this.name(); - } - - - public static final Set ALLOWED_SET = EnumSet.of(AccessHierarchy.NONE, AccessHierarchy.ALL, - AccessHierarchy.CUSTOM); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessMember.java deleted file mode 100644 index f6161c4534..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AccessMember.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.access; - -import java.util.EnumSet; -import java.util.Set; - -public enum AccessMember { - - /** No access to an object and its children. */ - NONE, - - /** All access to an object and its children. */ - ALL, - - /** - * A grant that covers none of the children unless explicitly granted. - */ - CUSTOM, - - /** - * Grant that covers all children except those denied. (internal use only) - */ - RESTRICTED; - - @Override - public String toString() { - return this.name(); - } - - public static final Set ALLOWED_SET = EnumSet.of(AccessMember.NONE, AccessMember.ALL); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AllHierarchyAccess.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AllHierarchyAccess.java deleted file mode 100644 index 02ff70ce7b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/AllHierarchyAccess.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2002-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * jhyde, Oct 5, 2002 - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.access; - -/** - * Represents the access that a role has to whole particular hierarchy. - */ -public interface AllHierarchyAccess extends HierarchyAccess { - - /** - * Returns the access to whole hierarchy. - * - * @return the access to the hierarchy. - */ - AccessHierarchy getAccess(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/HierarchyAccess.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/HierarchyAccess.java deleted file mode 100644 index 230cfae7bb..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/HierarchyAccess.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2002-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * jhyde, Oct 5, 2002 - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.access; - -import org.eclipse.daanse.olap.api.element.Member; - -/** - * Represents the access that a role has to a particular hierarchy. - */ -public interface HierarchyAccess { - /** - * Returns the access the current role has to a given member. - * - *

Visibility is:

    - *
  • {@link Access#NONE} if member is not visible, - *
  • {@link Access#ALL} if member and all children are visible, - *
  • {@link Access#CUSTOM} if some of the children are not visible. - *

- * - *

For these purposes, children which are below the bottom level are - * regarded as visible.

- * - * @param member Member. - * @return Return current role's access to member. - */ - AccessMember getAccess(Member member); - - /** - * Returns the depth of the highest level to which the current Role has - * access. The 'all' level, if present, has a depth of zero. - * - * @return Returns depth of the highest accessible level. - */ - int getTopLevelDepth(); - - /** - * Returns the depth of the lowest level to which the current Role has - * access. The 'all' level, if present, has a depth of zero. - * - * @return Returns depth of the lowest accessible level. - */ - int getBottomLevelDepth(); - - /** - * Returns the policy by which cell values are calculated if not all - * of a member's children are visible. - * - * @return Returns rollup policy. - */ - RollupPolicy getRollupPolicy(); - - /** - * Returns true if at least one of the descendants of the - * given Member is inaccessible to this Role. - * - *

Descendants which are inaccessible because they are below the - * bottom level are ignored. - * - * @param member Member - * @return Returns whether a descendant is inaccessible. - */ - boolean hasInaccessibleDescendants(Member member); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/Role.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/Role.java deleted file mode 100644 index ce8de8655c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/Role.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2002-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * jhyde, Oct 5, 2002 - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.access; - -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.DatabaseColumn; -import org.eclipse.daanse.olap.api.element.DatabaseSchema; -import org.eclipse.daanse.olap.api.element.DatabaseTable; -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.NamedSet; -import org.eclipse.daanse.olap.api.element.OlapElement; -import org.eclipse.daanse.olap.api.element.Catalog; - -/** - * A Role is a collection of access rights to cubes, permissions, - * and so forth. - * - *

At present, the only way to create a role is programmatically. You then - * add appropriate permissions, and associate the role with a connection. - * Queries executed for the duration of the connection will be using the role - * for security control. - * - *

Mondrian does not have any notion of a 'user'. It is the client - * application's responsibility to create a role appropriate for the user who - * is establishing the connection. - * - * @author jhyde - * @since Oct 5, 2002 - */ -public interface Role { - - /** - * Returns the access this role has to a given schema. - * - * @pre schema != null - * @post return == Access.ALL - * || return == Access.NONE - * || return == Access.ALL_DIMENSIONS - */ - AccessCatalog getAccess(Catalog schema); - - /** - * Returns the access this role has to a given cube. - * - * @pre cube != null - * @post return == Access.ALL || return == Access.NONE - */ - AccessCube getAccess(Cube cube); - - - /** - * Returns the access this role has to a given dimension. - * - * @pre dimension != null - * @post Access.instance().isValid(return) - */ - AccessDimension getAccess(Dimension dimension); - - /** - * Returns the access this role has to a given hierarchy. - * - * @pre hierarchy != null - * @post return == Access.NONE - * || return == Access.ALL - * || return == Access.CUSTOM - */ - AccessHierarchy getAccess(Hierarchy hierarchy); - - /** - * Returns the details of this hierarchy's access, or null if the hierarchy - * has not been given explicit access. - * - * @pre hierarchy != null - */ - HierarchyAccess getAccessDetails(Hierarchy hierarchy); - - /** - * Returns the access this role has to a given level. - * - * @pre level != null - * @post Access.instance().isValid(return) - */ - AccessMember getAccess(Level level); - - /** - * Returns the access this role has to a given member. - * - * @pre member != null - * @pre isMutable() - * @post return == Access.NONE - * || return == Access.ALL - * || return == Access.CUSTOM - */ - AccessMember getAccess(Member member); - - /** - * Returns the access this role has to a given named set. - * - * @pre set != null - * @pre isMutable() - * @post return == Access.NONE || return == Access.ALL - */ - AccessMember getAccess(NamedSet set); - - /** - * Returns whether this role is allowed to see a given element. - * @pre olapElement != null - */ - boolean canAccess(OlapElement olapElement); - - boolean canAccess(DatabaseSchema databaseSchema, Catalog catalog); - - AccessDatabaseSchema getAccess(DatabaseSchema databaseSchema, Catalog catalog); - - AccessDatabaseTable getAccess(DatabaseTable databaseTable, AccessDatabaseSchema accessDatabaseSchemaParent); - - AccessDatabaseColumn getAccess(DatabaseColumn column, AccessDatabaseTable accessDatabaseTable); -} - diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/RollupPolicy.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/RollupPolicy.java deleted file mode 100644 index d024e9a3c6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/RollupPolicy.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2002-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * jhyde, Oct 5, 2002 - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.access; - -/** - * Enumeration of the policies by which a cell is calculated if children of a - * member are not accessible. - */ -public enum RollupPolicy { - /** - * The value of the cell is null if any of the children are inaccessible. - */ - HIDDEN, - - /** - * The value of the cell is obtained by rolling up the values of accessible - * children. - */ - PARTIAL, - - /** - * The value of the cell is obtained by rolling up the values of all children. - */ - FULL, -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/package-info.java deleted file mode 100644 index a0c3abfe38..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/access/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.access; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/Aggregator.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/Aggregator.java deleted file mode 100644 index 83ce920ebc..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/Aggregator.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2003-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.aggregator; - -import java.util.List; - -import org.eclipse.daanse.olap.api.DataTypeJdbc; -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.todo.TupleList; -import org.eclipse.daanse.olap.api.function.FunctionDefinition; - - -/** - * Describes an aggregation operator, such as "sum" or "count". - * - * @see FunctionDefinition - * @see Evaluator - * - * @author jhyde$ - * @since Jul 9, 2003$ - */ -public interface Aggregator { - - /** - * Returns the name of the Aggregator. - * @return name of the Aggregator - */ - String getName(); - - /** - * Returns the aggregator used to combine sub-totals into a grand-total. - * - * @return aggregator used to combine sub-totals into a grand-total - */ - Aggregator getRollup(); - - /** - * Applies this aggregator to an expression over a set of members and - * returns the result. - * - * @param evaluator Evaluation context - * @param members List of members, not null - * @param calc Expression to evaluate - * - * @return result of applying this aggregator to a set of members/tuples - */ - Object aggregate(Evaluator evaluator, TupleList members, Calc calc); - - /** - * Tells Mondrian if this aggregator can perform fast aggregation - * using only the raw data of a given object type. This will - * determine if Mondrian will attempt to perform in-memory rollups - * on raw segment data by invoking {@link #aggregate}. - * - *

This is only invoked for rollup operations. - * - * @param datatype The datatype of the object we would like to rollup. - * @return Whether this aggregator supports fast aggregation - */ - boolean supportsFastAggregates(DataTypeJdbc datatype); - - /** - * Applies this aggregator over a raw list of objects for a rollup - * operation. This is useful when the values are already resolved - * and we are dealing with a raw {@link SegmentBody} object. - * - *

Only gets called if - * {@link #supportsFastAggregates(DataTypeJdbc)} is true. - * - *

This is only invoked for rollup operations. - * - * @param rawData An array of values in its raw form, to be aggregated. - * @return A rolled up value of the raw data. - * if the object type is not supported. - */ - Object aggregate(List rawData, DataTypeJdbc datatype); - - StringBuilder getExpression(CharSequence inner); - - boolean isDistinct(); - - Aggregator getNonDistinctAggregator(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/CustomAggregatorFactory.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/CustomAggregatorFactory.java deleted file mode 100644 index 77e661e5c2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/CustomAggregatorFactory.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.aggregator; - -import java.util.List; - -public interface CustomAggregatorFactory { - - String getName(); - - Aggregator getAggregator(String template, - List properties, List columns); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/package-info.java deleted file mode 100644 index b99bc42589..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/aggregator/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.aggregator; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/cache/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/cache/package-info.java deleted file mode 100644 index a7abee9d4c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/cache/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.cache; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/BooleanCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/BooleanCalc.java deleted file mode 100644 index cd821a1571..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/BooleanCalc.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc; - -/** - * @author: Stefan Bischof - * - * Marker interface to check the returning type of an {@link org.eclipse.daanse.olap.api.calc.Calc} - */ - - -public interface BooleanCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ByteCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ByteCalc.java deleted file mode 100644 index dbfee498b5..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ByteCalc.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc; - -/** - * @author: Stefan Bischof - * - * Marker interface to check the returning type of an {@link org.eclipse.daanse.olap.api.calc.Calc} - */ - - -public interface ByteCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/Calc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/Calc.java deleted file mode 100644 index f154b933d3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/Calc.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * Calc is the base class for all calculable expressions. - * - *

Logical and physical expression languages

- * - * Mondrian has two expression languages:
    - *
  • The logical language of parsed MDX fragments ({@link org.eclipse.daanse.olap.api.query.component.Expression}). - *
  • The phyiscal language of compiled expressions ({@link Calc}). - *

- * - * The two languages allow us to separate logical (how an - * MDX expression was specified) from physical (how it is to be evaluated). - * The physical language is more strongly typed, and certain constructs which - * are implicit in the logical language (such as the addition of calls - * to the <Member>.CurrentMember function) are made - * explicit in the physical language.

- * - *

Compilation

- * - * Expressions are generally created from using an expression compiler - * ({@link ExpressionCompiler}). There are often more than one evaluation strategy - * for a given expression, and compilation process gives us an opportunity to - * choose the optimal one.

- * - * - * - * @author jhyde - * @since Sep 26, 2005 - */ -public interface Calc { - /** - * Evaluates this expression. - * - * @param evaluator Provides dimensional context in which to evaluate - * this expression - * @return Result of expression evaluation - */ - E evaluate(Evaluator evaluator); - - - /** - * Returns whether this expression depends upon a given hierarchy. - * - *

If it does not depend on the hierarchy, then re-evaluating the - * expression with a different member of this context must produce the - * same answer.

- * - * Some examples:

    - * - *
  • The expression - *
    [Measures].[Unit Sales]
    - * depends on all dimensions except [Measures]. - * - *
  • The boolean expression - *
    ([Measures].[Unit Sales], - * [Time].[1997]) > 1000
    - * depends on all hierarchies except [Measures] and [Time]. - * - *
  • The list expression - *
    Filter([Store].[USA].Children, - * [Measures].[Unit Sales] < 50)
    - * depends upon all hierarchies except [Store] and [Measures]. - * How so? Normally the scalar expression would depend upon all hierarchies - * except [Measures], but the Filter function sets the [Store] - * context before evaluating the scalar expression, so it is not inherited - * from the surrounding context. - * - *

- * - * @param hierarchy Hierarchy - * @return Whether this expression's result depends upon the current member - * of the hierarchy - */ - boolean dependsOn(Hierarchy hierarchy); - - /** - * Returns the type. - */ - Type getType(); - - /** - * Returns style in which the result of evaluating this expression is - * returned. - * - *

One application of this method is for the compiler to figure out - * whether the compiled expression is returning a mutable list. If a mutable - * list is required, the compiler can create a mutable copy. - * - * @see ExpressionCompiler#compileList(org.eclipse.daanse.olap.api.query.component.Expression, boolean) - */ - ResultStyle getResultStyle(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ConstantCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ConstantCalc.java deleted file mode 100644 index 0324977ca7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ConstantCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc; - -/** - * Marker Interface for {@link Calc} that returns the same value on each call of - * {@link #evaluate(mondrian.olap.Evaluator)} method. - */ -public interface ConstantCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DateTimeCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DateTimeCalc.java deleted file mode 100644 index 9d12ca4c9d..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DateTimeCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import java.util.Date; - - -public interface DateTimeCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DimensionCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DimensionCalc.java deleted file mode 100644 index 9a451b6e3a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DimensionCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.element.Dimension; - - -public interface DimensionCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DoubleCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DoubleCalc.java deleted file mode 100644 index 7dab9c896a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/DoubleCalc.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -public interface DoubleCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/FloatCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/FloatCalc.java deleted file mode 100644 index 3e7baac02e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/FloatCalc.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -public interface FloatCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/HierarchyCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/HierarchyCalc.java deleted file mode 100644 index 1bad412841..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/HierarchyCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.element.Hierarchy; - - -public interface HierarchyCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/IntegerCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/IntegerCalc.java deleted file mode 100644 index 6a00811977..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/IntegerCalc.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.Evaluator; - -/** - * @author: Stefan Bischof - * - * Marker interface to check the returning type of an {@link org.eclipse.daanse.olap.api.calc.Calc} - * Returns {@link mondrian.olap.fun.FunUtil#INTEGER_NULL} If result {@link #evaluate(Evaluator)} would be null - */ -public interface IntegerCalc extends Calc { -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LevelCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LevelCalc.java deleted file mode 100644 index 5b48d7fac4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LevelCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.element.Level; - - -public interface LevelCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LongCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LongCalc.java deleted file mode 100644 index 9954ee6c9f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/LongCalc.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.Evaluator; - -/** - * @author: Stefan Bischof - * - * Marker interface to check the returning type of an {@link org.eclipse.daanse.olap.api.calc.Calc} - * Returns {@link mondrian.olap.fun.FunUtil#INTEGER_NULL} If result {@link #evaluate(Evaluator)} would be null - */ -public interface LongCalc extends Calc { -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/MemberCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/MemberCalc.java deleted file mode 100644 index 198598da6f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/MemberCalc.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.element.Member; - -public interface MemberCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ResultStyle.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ResultStyle.java deleted file mode 100644 index ca2ed38042..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/ResultStyle.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.calc; - -import java.util.Arrays; -import java.util.List; - -/** - * Enumeration of ways that a compiled expression can return its result to - * its caller. - * - * @author jhyde - */ -public enum ResultStyle { - /** - * Indicates that caller will accept any applicable style. - */ - ANY, - - /** - * Indicates that the expression returns its result as a list which may - * safely be modified by the caller. - */ - MUTABLE_LIST, - - /** - * Indicates that the expression returns its result as a list which must - * not be modified by the caller. - */ - LIST, - - /** - * Indicates that the expression returns its result as an Iterable - * which must not be modified by the caller. - */ - ITERABLE, - - /** - * Indicates that the expression results its result as an immutable - * value. This is typical for expressions which return string, datetime and - * numeric values. - */ - VALUE, - - /** - * Indicates that the expression results its result as an immutable - * value which will never be null. This is typical for expressions which - * return string, datetime and numeric values. - */ - VALUE_NOT_NULL; - - // --------------------------------------------------------------- - // There follow a set of convenience constants for commonly-used - // collections of result styles. - - public static final List ANY_LIST = - Arrays.asList( - ANY); - - public static final List ITERABLE_ONLY = - Arrays.asList( - ITERABLE); - - public static final List MUTABLELIST_ONLY = - Arrays.asList( - MUTABLE_LIST); - - public static final List LIST_ONLY = - Arrays.asList( - LIST); - - public static final List ITERABLE_ANY = - Arrays.asList( - ITERABLE, - ANY); - - public static final List ITERABLE_LIST = - Arrays.asList( - ITERABLE, - LIST); - - public static final List ITERABLE_MUTABLELIST = - Arrays.asList( - ITERABLE, - MUTABLE_LIST); - - public static final List ITERABLE_LIST_MUTABLELIST = - Arrays.asList( - ITERABLE, - LIST, - MUTABLE_LIST); - - public static final List LIST_MUTABLELIST = - Arrays.asList( - LIST, - MUTABLE_LIST); - - public static final List MUTABLELIST_LIST = - Arrays.asList( - MUTABLE_LIST, - LIST); - - public static final List ITERABLE_LIST_MUTABLELIST_ANY = - Arrays.asList( - ITERABLE, - LIST, - MUTABLE_LIST, - ANY); - - public static final List ITERABLE_MUTABLELIST_LIST = - Arrays.asList( - ITERABLE, - MUTABLE_LIST, - LIST); - - public static final List ANY_ONLY = - Arrays.asList( - ANY); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/StringCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/StringCalc.java deleted file mode 100644 index 53fc24ba0f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/StringCalc.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -public interface StringCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleCalc.java deleted file mode 100644 index 0463c665ed..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleCalc.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.element.Member; - - -public interface TupleCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleIterableCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleIterableCalc.java deleted file mode 100644 index ae085e996c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/TupleIterableCalc.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -import org.eclipse.daanse.olap.api.calc.todo.TupleIterable; - -public interface TupleIterableCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/VoidCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/VoidCalc.java deleted file mode 100644 index abf534a910..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/VoidCalc.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc; - -public interface VoidCalc extends Calc { -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/CompilableParameter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/CompilableParameter.java deleted file mode 100644 index db8d21f2f6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/CompilableParameter.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.calc.compiler; - -import org.eclipse.daanse.olap.api.Parameter; -import org.eclipse.daanse.olap.api.calc.Calc; - -/** - * A {@link org.eclipse.daanse.olap.api.Parameter} can be compiled in an {@link Calc} using an - * {@link ExpressionCompiler}. - */ -public interface CompilableParameter extends Parameter { - Calc compile(ExpressionCompiler expressionCompiler); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompiler.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompiler.java deleted file mode 100644 index ea7d5c2833..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompiler.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.calc.compiler; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.Parameter; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.BooleanCalc; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.DateTimeCalc; -import org.eclipse.daanse.olap.api.calc.DimensionCalc; -import org.eclipse.daanse.olap.api.calc.DoubleCalc; -import org.eclipse.daanse.olap.api.calc.HierarchyCalc; -import org.eclipse.daanse.olap.api.calc.IntegerCalc; -import org.eclipse.daanse.olap.api.calc.LevelCalc; -import org.eclipse.daanse.olap.api.calc.MemberCalc; -import org.eclipse.daanse.olap.api.calc.ResultStyle; -import org.eclipse.daanse.olap.api.calc.StringCalc; -import org.eclipse.daanse.olap.api.calc.TupleCalc; -import org.eclipse.daanse.olap.api.calc.todo.TupleIteratorCalc; -import org.eclipse.daanse.olap.api.calc.todo.TupleList; -import org.eclipse.daanse.olap.api.calc.todo.TupleListCalc; -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * Mediates the compilation of an expression ({@link org.eclipse.daanse.olap.api.query.component.Expression}) - * into a compiled expression ({@link Calc}). - * - * @author jhyde - * @since Sep 28, 2005 - */ -public interface ExpressionCompiler { - - /** - * Returns the evaluator to be used for evaluating expressions during the - * compilation process. - */ - Evaluator getEvaluator(); - - /** - * Returns the validator which was used to validate this expression. - * - * @return validator - */ - Validator getValidator(); - - /** - * Compiles an expression. - * - * @param exp Expression - * @return Compiled expression - */ - Calc compile(Expression exp); - - /** - * Compiles an expression to a given result type. - * - *

If resultType is not null, casts the expression to that - * type. Throws an exception if that conversion is not allowed by the - * type system. - * - *

The preferredResultStyles parameter specifies a list - * of desired result styles. It must not be null, but may be empty. - * - * @param exp Expression - * - * @param resultType Desired result type, or null to use expression's - * current type - * - * @param preferredResultStyles List of result types, in descending order - * of preference. Never null. - * - * @return Compiled expression, or null if none can satisfy - */ - Calc compileAs( - Expression exp, - Type resultType, - List preferredResultStyles); - - /** - * Compiles an expression which yields a {@link Member} result. - */ - MemberCalc compileMember(Expression exp); - - /** - * Compiles an expression which yields a {@link Level} result. - */ - LevelCalc compileLevel(Expression exp); - - /** - * Compiles an expression which yields a {@link Dimension} result. - */ - DimensionCalc compileDimension(Expression exp); - - /** - * Compiles an expression which yields a {@link Hierarchy} result. - */ - HierarchyCalc compileHierarchy(Expression exp); - - /** - * Compiles an expression which yields an int result. - * The expression is implicitly converted into a scalar. - */ - IntegerCalc compileInteger(Expression exp); - - /** - * Compiles an expression which yields a {@link String} result. - * The expression is implicitly converted into a scalar. - */ - StringCalc compileString(Expression exp); - - /** - * Compiles an expression which yields a {@link java.util.Date} result. - * The expression is implicitly converted into a scalar. - */ - DateTimeCalc compileDateTime(Expression exp); - - /** - * Compiles an expression which yields an immutable {@link TupleList} - * result. - * - *

Always equivalent to {@link #compileList}(exp, false). - */ - TupleListCalc compileList(Expression exp); - - /** - * Compiles an expression which yields {@link TupleList} result. - * - *

Such an expression is generally a list of {@link Member} objects or a - * list of tuples (each represented by a {@link Member} array). - * - *

See {@link #compileList(org.eclipse.daanse.olap.api.query.component.Expression)}. - * - * @param exp Expression - * @param mutable Whether resulting list is mutable - */ - TupleListCalc compileList(Expression exp, boolean mutable); - - /** - * Compiles an expression which yields an immutable {@link Iterable} result. - * - * @param exp Expression - * @return Calculator which yields an Iterable - */ - TupleIteratorCalc compileIter(Expression exp); - - /** - * Compiles an expression which yields a boolean result. - * - * @param exp Expression - * @return Calculator which yields a boolean - */ - BooleanCalc compileBoolean(Expression exp); - - /** - * Compiles an expression which yields a double result. - * - * @param exp Expression - * @return Calculator which yields a double - */ - DoubleCalc compileDouble(Expression exp); - - /** - * Compiles an expression which yields a tuple result. - * - * @param exp Expression - * @return Calculator which yields a tuple - */ - TupleCalc compileTuple(Expression exp); - - /** - * Compiles an expression to yield a scalar result. - * - *

If the expression yields a member or tuple, the calculator will - * automatically apply that member or tuple to the current dimensional - * context and return the value of the current measure. - * - * @param exp Expression - * @param specific Whether to try to use the specific compile method for - * scalar types. For example, if specific is true and - * exp is a string expression, calls - * {@link #compileString(org.eclipse.daanse.olap.api.query.component.Expression)} - * @return Calculation which returns the scalar value of the expression - */ - Calc compileScalar(Expression exp, boolean specific); - - /** - * Implements a parameter, returning a unique slot which will hold the - * parameter's value. - * - * @param parameter Parameter - * @return Slot - */ - ParameterSlot registerParameter(Parameter parameter); - - /** - * Returns a list of the {@link ResultStyle}s - * acceptable to the caller. - */ - List getAcceptableResultStyles(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompilerFactory.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompilerFactory.java deleted file mode 100644 index 7d29573812..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ExpressionCompilerFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.calc.compiler; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.ResultStyle; - -/** - * The {@link ExpressionCompilerFactory} create a new {@link ExpressionCompiler} - * instance, each call of a - * {@link #createExpressionCompiler(Evaluator, Validator)} or - * {@link #createExpressionCompiler(Evaluator, Validator, List)} - */ -public interface ExpressionCompilerFactory { - - /** - * Create a new {@link ExpressionCompiler} instance, each call. - * - * @param evaluator the {@link Evaluator} that must be used from the - * {@link ExpressionCompiler} - * @param validator the {@link Validator} that must be used from the - * {@link ExpressionCompiler} - * @return the new {@link ExpressionCompiler} - */ - default ExpressionCompiler createExpressionCompiler(final Evaluator evaluator, final Validator validator) { - return createExpressionCompiler(evaluator, validator, ResultStyle.ANY_LIST); - } - - /** - * Create a new {@link ExpressionCompiler} instance, each call. - * - * @param evaluator the {@link Evaluator} that must be used from the - * {@link ExpressionCompiler} - * @param validator the {@link Validator} that must be used from the - * {@link ExpressionCompiler} - * @param resultStyles the initial {@link ResultStyle} array for the - * {@link ExpressionCompiler} - * @return the new {@link ExpressionCompiler} - */ - ExpressionCompiler createExpressionCompiler(final Evaluator evaluator, final Validator validator, - final List resultStyles); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ParameterSlot.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ParameterSlot.java deleted file mode 100644 index d0c98d4334..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/ParameterSlot.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.calc.compiler; - -import org.eclipse.daanse.olap.api.Parameter; -import org.eclipse.daanse.olap.api.calc.Calc; - -public interface ParameterSlot { - /** - * Returns the unique index of the slot. - */ - int getIndex(); - - /** - * Returns a compiled expression to compute the default value of the - * parameter. - */ - Calc getDefaultValueCalc(); - - /** - * Returns the parameter. - */ - Parameter getParameter(); - - /** - * Sets the value of this parameter. - * - *

NOTE: This method will be removed when we store parameter values - * in the {@link org.eclipse.daanse.olap.api.result.Result} rather than in the - * {@link mondrian.olap.QueryImpl}. - * - * @param value New value - * @param assigned Whether {@link #isParameterSet()} should return true; - * supply value {@code false} if this is an internal assignment, to - * remember the default value - */ - void setParameterValue(Object value, boolean assigned); - - /** - * Returns the value of this parameter. - * - *

NOTE: This method will be removed when we store parameter values - * in the {@link org.eclipse.daanse.olap.api.result.Result} rather than in the - * {@link mondrian.olap.QueryImpl}. - */ - Object getParameterValue(); - - /** - * Returns whether the parameter has been assigned a value. (That value - * may be null.) - * - * @return Whether parmaeter has been assigned a value. - */ - boolean isParameterSet(); - - void setCachedDefaultValue(Object value); - - Object getCachedDefaultValue(); - - /** - * Unsets the parameter value. - */ - void unsetParameterValue(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/package-info.java deleted file mode 100644 index 77a22211a1..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/compiler/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.calc.compiler; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/package-info.java deleted file mode 100644 index d9e3997c06..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.calc; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalcEvaluationProfile.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalcEvaluationProfile.java deleted file mode 100644 index 508d87092e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalcEvaluationProfile.java +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc.profile; - -import java.time.Instant; -import java.util.Map; - -public interface CalcEvaluationProfile { - - Instant start(); - - Instant end(); - - Object evaluationResult(); - - Map additionalValues(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalculationProfile.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalculationProfile.java deleted file mode 100644 index ea00d9e107..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/CalculationProfile.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc.profile; - -import java.time.Duration; -import java.time.Instant; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -import org.eclipse.daanse.olap.api.calc.ResultStyle; -import org.eclipse.daanse.olap.api.type.Type; - -public interface CalculationProfile { - - Class clazz(); - - Type type(); - - ResultStyle resultStyle(); - - Optional start(); - - Optional end(); - - Map additionalValues(); - - List evaluationProfiles(); - - List childProfiles(); - - Duration duration(); - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/ProfilingCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/ProfilingCalc.java deleted file mode 100644 index 33a949ece3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/ProfilingCalc.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.calc.profile; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.calc.Calc; - -public interface ProfilingCalc extends Calc { - - E evaluateWithProfile(Evaluator evaluator); - - CalculationProfile getCalculationProfile(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/package-info.java deleted file mode 100644 index dc773523c4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/profile/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.calc.profile; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleCursor.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleCursor.java deleted file mode 100644 index 7ddc42e13f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleCursor.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.calc.todo; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.element.Member; - -/** - * Cheap interface for iterating through the contents of a {@link TupleList}. - * - *

Stops short of the full {@link java.util.Iterator} interface. If you want - * that, see {@link TupleIterator}. - * - * @author Julian Hyde - */ -public interface TupleCursor { - void setContext(Evaluator evaluator); - - /** - * Moves the iterator forward one position. - * - *

Returns false only when end of data has been reached. - * - *

Similar to calling the {@link java.util.Iterator} methods - * {@link java.util.Iterator#hasNext()} followed by - * {@link java.util.Iterator#next()} but - * does not construct an object, and is therefore cheaper. - * - *

If you want to use an Iterator, see {@link TupleIterator}. - * - * @return Whether was able to move forward a position - */ - boolean forward(); - - /** - * Returns the tuple that this cursor is positioned on. - * - *

This method never returns null, and may safely be called multiple - * times (or not all) for each position in the iteration. - * - *

Invalid to call this method when the cursor is has not been - * positioned, for example, if {@link #forward()} has not been called or - * if the most recent call to {@code forward} returned {@code false}. - * - * @return Current tuple - */ - List current(); - - /** - * Returns the number of members in each tuple. - * - * @return The number of members in each tuple - */ - int getArity(); - - Member member(int column); - - /** - * Writes the member(s) of the next tuple to a given offset in an array. - * - *

This method saves the overhead of a memory allocation when the - * resulting tuple will be written immediately to an array. The effect of - * {@code currentToArray(members, 0)} is the same as calling - * {@code current().toArray(members)}. - * - *

Before calling this method, you must position the iterator at a valid - * position. Typically you would call hasNext followed by next; or forward. - * - * @param members Members - * @param offset Offset in the array to write to - */ - void currentToArray(Member[] members, int offset); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterable.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterable.java deleted file mode 100644 index 5c516c3b75..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterable.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.calc.todo; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Member; - -/** - * Extension to {@link Iterable} that returns a {@link TupleIterator}. - * - *

If efficiency is important, call {@link #tupleCursor()} rather than - * {@link #tupleIterator()} if possible. Because {@link TupleCursor} is a - * simpler API to implement than {@link TupleIterator}, in some cases the - * implementation may be more efficient. - * - * @author jhyde - */ -public interface TupleIterable extends Iterable> { - /** - * Creates an iterator over the contents of this iterable. - * - *

Always has the same effect as calling {@link #iterator()}. - * - * @see #tupleCursor() - * - * @return cursor over the tuples returned by this iterable - */ - TupleIterator tupleIterator(); - - /** - * Creates a cursor over the contents of this iterable. - * - *

The contents of the cursor will always be the same as those returned - * by {@link #tupleIterator()}. Because {@link TupleCursor} is a simpler API - * to implement than {@link TupleIterator}, in some cases the implementation - * may be more efficient. - * - * @return cursor over the tuples returned by this iterable - */ - TupleCursor tupleCursor(); - - /** - * Returns the number of members in each tuple. - * - * @return The number of members in each tuple - */ - int getArity(); - - /** - * Returns an iterable over the members at a given column. - * - *

The iteratble returns an interator that is modifiable if and only if - * this TupleIterable is modifiable. - * - *

If this {@code TupleIterable} happens to be a {@link TupleList}, - * the method is overridden to return a {@link List}<{@link Member}>. - * - * @param column Ordinal of the member in each tuple to project - * @return Iterable that returns an iterator over members - * @throws IllegalArgumentException if column is not less than arity - */ - Iterable slice(int column); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterator.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterator.java deleted file mode 100644 index 67c4947f7c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIterator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.calc.todo; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Member; - -/** - * Extension to {@link java.util.Iterator} that returns tuples. - * - *

Extends {@link TupleCursor} to support the standard Java iterator - * API. For some implementations, using the iterator API (in particular the - * {@link #next} and {@link #hasNext} methods) may be more expensive than using - * cursor's {@link #forward} method. - * - * @author jhyde - */ -public interface TupleIterator extends Iterator>, TupleCursor { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIteratorCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIteratorCalc.java deleted file mode 100644 index 7e7f88fab6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleIteratorCalc.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* -*/ - -package org.eclipse.daanse.olap.api.calc.todo; - -import org.eclipse.daanse.olap.api.calc.Calc; - -public interface TupleIteratorCalc extends Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleList.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleList.java deleted file mode 100644 index 05a29781fd..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleList.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.calc.todo; - -import java.util.List; - -import org.eclipse.daanse.olap.api.calc.TupleCalc; -import org.eclipse.daanse.olap.api.element.Member; - -/** - * List of tuples. - * - *

Design notes

- * - *
    - * - *
  • Consider changing - * {@link TupleCalc#evaluateTuple(org.eclipse.daanse.olap.api.Evaluator)} - * and {@link org.eclipse.daanse.olap.api.Evaluator.NamedSetEvaluator#currentTuple()} - * to List<Member>
  • - * - *
  • Search for potential uses of {@link TupleList#get(int, int)}
  • - * - *
  • Worth creating {@link TupleList}.addAll(TupleIterator)?
  • - * - *
- * - * @author jhyde - */ -public interface TupleList -extends List>, TupleIterable -{ - /** - * Returns a particular column of a particular row. - * - *

Note that {@code list.get(row, column)} - * is equivalent to {@code list.slice(column).get(row)} - * and {@code list.get(row).get(column)} - * but is more efficient for most implementations of TupleList. - * - * @param slice Column ordinal - * @param index Row ordinal - * @return Member at given row and column - */ - Member get(int slice, int index); - - /** - * Returns a list of the members at a given column. - * - *

The list is modifiable if and only if this TupleList is modifiable. - * Adding an element to a slice will create a tuple whose members in other - * columns are null. - * Removing an element from a slicer will remove a tuple. - * - * @param column Ordinal of the member in each tuple to project - * @return List of members - * @throws IllegalArgumentException if column is not less than arity - */ - @Override - List slice(int column); - - /** - * Creates a copy of this list that has the same type and has a given - * capacity. - * - *

If capacity is negative, populates the list. A deep copy is made, - * so that it the contents of the list are not affected to changes to any - * backing collections. - * - * @param capacity Capacity - * @return Copy of list, empty if capacity is non-negative - */ - TupleList copyList(int capacity); - - void addTuple(Member... members); - - TupleList project(int[] destIndices); - - void addCurrent(TupleCursor tupleIter); - - // override, refining return type - @Override - TupleList subList(int fromIndex, int toIndex); - - TupleList withPositionCallback(PositionCallback positionCallback); - - /** - * Fixes the tuples of this list, so that their contents will not change - * even if elements of the list are reordered or removed. Returns this - * list if possible. - * - * @return List whose tuples are invariant if the list is sorted or filtered - */ - TupleList fix(); - - interface PositionCallback { - void onPosition(int index); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleListCalc.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleListCalc.java deleted file mode 100644 index 684b7cfa6e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/TupleListCalc.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* -*/ - -package org.eclipse.daanse.olap.api.calc.todo; - -import org.eclipse.daanse.olap.api.calc.Calc; - -public interface TupleListCalc extends TupleIteratorCalc, Calc { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/package-info.java deleted file mode 100644 index a8d7eb9820..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/calc/todo/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -//TODO: RM EXPORT -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.calc.todo; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/CalculatedMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/CalculatedMember.java deleted file mode 100644 index 7cc7df10f2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/CalculatedMember.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.element; - -import org.eclipse.daanse.olap.api.query.component.Formula; - -public interface CalculatedMember extends KeyMember{ - - Formula getFormula(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Catalog.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Catalog.java deleted file mode 100644 index c08feac533..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Catalog.java +++ /dev/null @@ -1,125 +0,0 @@ - /* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.element; - -import java.time.Instant; -import java.util.List; -import java.util.Optional; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.Connection; -import org.eclipse.daanse.olap.api.IdentifierSegment; -import org.eclipse.daanse.olap.api.Parameter; -import org.eclipse.daanse.olap.api.access.Role; - -/** - * A Catalog is a collection of cubes, shared dimensions, and - * roles. - * - * @author jhyde - */ -public interface Catalog extends MetaElement { - - /** - * Returns the name of this catalog. - * - * @post return != null - * @post return.length() > 0 - */ - String getName(); - - /** - * Returns the description of this catalog. - * - * @return - */ - String getDescription(); - - /** - * Returns the uniquely generated id of this catalog. - */ - String getId(); - - /** - * Returns a list of all cubes in this catalog. - */ - List getCubes(); - - /** - * Creates a {@link CatalogReader} without any access control. - */ - CatalogReader getCatalogReaderWithDefaultRole(); - - /** - * Finds a role with a given name in the current catalog, or returns - * null if no such role exists. - */ - Role lookupRole(String role); - - /** - * Returns this schema's parameters. - */ - Parameter[] getParameters(); - - /** - * Returns when this schema was last loaded. - * - * @return Date and time when this schema was last loaded - */ - Instant getCatalogLoadDate(); - - /** - * Returns a list of warnings and errors that occurred while loading this - * schema. - * - * @return list of warnings - */ - List getWarnings(); - - /** - * looks up the cubes of this catalog for a cube with the given name. - * @param cubeName - * @return Optional of Cube - */ - Optional lookupCube(String cubeName); - - Role getDefaultRole(); - - NamedSet getNamedSet(String name); - - List getDatabaseSchemas(); - - /** - * Connection for purposes of parsing and validation. Careful! It won't have the - * correct locale or access-control profile. - */ - Connection getInternalConnection(); - - NamedSet getNamedSet(IdentifierSegment segment); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Cube.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Cube.java deleted file mode 100644 index 9460e3ef9f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Cube.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * Copyright (C) 2021 Sergei Semenkov - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.element; - -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.DataTypeJdbc; -import org.eclipse.daanse.olap.api.DrillThroughAction; -import org.eclipse.daanse.olap.api.NameSegment; -import org.eclipse.daanse.olap.api.access.Role; -import org.eclipse.daanse.olap.api.query.component.Formula; -import org.eclipse.daanse.olap.api.result.AllocationPolicy; - -/** - * Cube. - * - * @author jhyde, 2 March, 1999 - */ -public interface Cube extends OlapElement, MetaElement { - - Catalog getCatalog(); - - /** - * Returns the dimensions of this cube. - */ - List getDimensions(); - - /** - * Returns the named sets of this cube. - */ - NamedSet[] getNamedSets(); - - List getMeasures(); - - /** - * Finds a hierarchy whose name (or unique name, if unique is true) - * equals s. - */ - Hierarchy lookupHierarchy(NameSegment s, boolean unique); - - /** - * Returns Member[]. It builds Member[] by analyzing cellset, which gets created - * by running mdx sQuery. query has to be in the format of - * something like "[with calculated members] select *members* on columns from - * this". - */ - Member[] getMembersForQuery(String query, List calcMembers); - - /** - * Returns a {@link CatalogReader} for which this cube is the context for lookup - * up members. If role is null, the returned schema reader also - * obeys the access-control profile of role. - */ - CatalogReader getCatalogReader(Role role); - - /** - * Finds out non joining dimensions for this cube. - * - * @param tuple array of members - * @return Set of dimensions that do not exist (non joining) in this cube - */ - Set nonJoiningDimensions(Member[] tuple); - - /** - * Finds out non joining dimensions for this cube. - * - * @param otherDims Set of dimensions to be tested for existence in this cube - * @return Set of dimensions that do not exist (non joining) in this cube - */ - Set nonJoiningDimensions(Set otherDims); - - Member createCalculatedMember(Formula formula); - - void createNamedSet(Formula formula); - - DrillThroughAction getDefaultDrillThroughAction(); - - List getDrillThroughActions(); - - /** - * Returns the members of a level, optionally including calculated members. - */ - List getLevelMembers(Level level, boolean includeCalculated); - - /** - * Returns the number of members in a level, returning an approximation if - * acceptable. - * - * @param level Level - * @param approximate Whether an approximation is acceptable - * @param materialize Whether to go to disk if no approximation for the count is - * available and the members are not in cache. If false, - * returns {@link Integer#MIN_VALUE} if value is not in - * cache. - */ - int getLevelCardinality(Level level, boolean approximate, boolean materialize); - - List getKPIs(); - - /** - * Returns a list of all hierarchies in this cube, in order of dimension. - * - *

- * TODO: Make this method return RolapCubeHierarchy, when the measures hierarchy - * is a RolapCubeHierarchy. - * - * @return List of hierarchies - */ - List getHierarchies(); - - void modifyFact(List>> sessionValues); - - void restoreFact(); - - void commit(List>> sessionValues, String userId); - - List>> getAllocationValues(String tupleString, Object value, - AllocationPolicy allocationPolicy); - - /** - * Returns the time hierarchy for this cube. If there is no time hierarchy, - * throws. - */ - Hierarchy getTimeHierarchy(String name); - - boolean isLoadInProgress(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseColumn.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseColumn.java deleted file mode 100644 index c6dbf1f733..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseColumn.java +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -import org.eclipse.daanse.olap.api.DataTypeJdbc; - -public interface DatabaseColumn { - - String getName(); - - DataTypeJdbc getType(); - - Boolean getNullable(); - - Integer getColumnSize(); - - Integer getDecimalDigits(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseSchema.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseSchema.java deleted file mode 100644 index 30cbff608a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseSchema.java +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -public interface DatabaseSchema { - - List getDbTables(); - - String getName(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseTable.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseTable.java deleted file mode 100644 index 977a4fbbc4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DatabaseTable.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -public interface DatabaseTable { - - String getName(); - - List getDbColumns(); - - String getDescription(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Dimension.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Dimension.java deleted file mode 100644 index a14bd4c261..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Dimension.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * Copyright (C) 2021 Sergei Semenkov - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -/** - * A Dimension represents a dimension of a cube. - * - * @author jhyde, 1 March, 1999 - */ -public interface Dimension extends OlapElement, MetaElement { - public static final String MEASURES_UNIQUE_NAME = "[Measures]"; - public static final String MEASURES_NAME = "Measures"; - - /** - * Returns an array of the hierarchies which belong to this dimension. - */ - List getHierarchies(); - - /** - * Returns whether this is the [Measures] dimension. - */ - boolean isMeasures(); - - /** - * Returns the type of this dimension ({@link DimensionType#STANDARD_DIMENSION} - * or {@link DimensionType#TIME_DIMENSION} - */ - DimensionType getDimensionType(); - - /** - * Returns the schema this dimension belongs to. - */ - Catalog getCatalog(); - - Cube getCube(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DimensionType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DimensionType.java deleted file mode 100644 index baccd6f33c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/DimensionType.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2004-2005 Galt Johnson - * Copyright (C) 2004-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.element; - -/** - * Enumerates the types of dimensions. - * - * @author Galt Johnson - * @since 5 April, 2004 - */ -public enum DimensionType { - /** - * Indicates that the dimension is not related to time. - */ - STANDARD_DIMENSION("StandardDimension"), - - /** - * Indicates that a dimension is a time dimension. - */ - TIME_DIMENSION("TimeDimension"), - - /** - * Indicates the a dimension is the measures dimension. - */ - MEASURES_DIMENSION("MeasuresDimension"); - - private final String value; - - DimensionType(String v) { - value = v; - } - - public String getValue() { - return value; - } - - public static DimensionType fromValue(String v) { - for (DimensionType c : DimensionType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Hierarchy.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Hierarchy.java deleted file mode 100644 index f64330d59c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Hierarchy.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.query.component.Formula; - -/** - * A Hierarchy is a set of members, organized into levels. - */ -public interface Hierarchy extends OlapElement, MetaElement { - /** - * Returns the dimension this hierarchy belongs to. - */ - @Override - Dimension getDimension(); - - /** - * Returns the levels in this hierarchy. - * - *

- * If a hierarchy is subject to access-control, some of the levels may not be - * visible; use {@link CatalogReader#getHierarchyLevels} instead. - * - * @post return != null - */ - List getLevels(); - - /** - * Returns the default member of this hierarchy. - * - *

- * If a hierarchy is subject to access-control, the default member may not be - * visible, so use {@link CatalogReader#getHierarchyDefaultMember}. - * - * @post return != null - */ - Member getDefaultMember(); - - /** - * Returns the "All" member of this hierarchy. - * - * @post return != null - */ - Member getAllMember(); - - /** - * Returns a special member representing the "null" value. This never occurs on - * an axis, but may occur if functions such as Lead, - * NextMember and ParentMember walk off the end of the - * hierarchy. - * - * @post return != null - */ - Member getNullMember(); - - boolean hasAll(); - - /** - * Creates a member of this hierarchy. If this is the measures hierarchy, a - * calculated member is created, and formula must not be null. - */ - Member createMember(Member parent, Level level, String name, Formula formula); - - /** - * Returns the unique name of this hierarchy, always including the dimension - * name, e.g. "[Time].[Time]", regardless of whether - * {@link SystemWideProperties#SsasCompatibleNaming} is enabled. - * - * @deprecated Will be removed in mondrian-4.0, when {@link #getUniqueName()} - * will have this behavior. - * - * @return Unique name of hierarchy. - */ - @Deprecated - String getUniqueNameSsas(); - - String getDisplayFolder(); - - String origin(); - - List getRootMembers(); - - /** - * Returns the ordinal of this hierarchy in its cube. - * - *

- * Temporarily defined against RolapHierarchy; will be moved to - * RolapCubeHierarchy as soon as the measures hierarchy is a RolapCubeHierarchy. - * - * @return Ordinal of this hierarchy in its cube - */ - int getOrdinalInCube(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KPI.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KPI.java deleted file mode 100644 index 886721ab45..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KPI.java +++ /dev/null @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -public interface KPI { - String getName(); - - String getDisplayFolder(); - - String getCurrentTimeMember(); - - String getTrend(); - - String getWeight(); - - String getTrendGraphic(); - - String getStatusGraphic(); - - KPI getParentKpi(); - - String getValue(); - - String getGoal(); - - String getStatus(); - - String getDescription(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KeyMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KeyMember.java deleted file mode 100644 index 11a30bcdd9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/KeyMember.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.element; - -public interface KeyMember extends Member{ - Object getKey(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Level.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Level.java deleted file mode 100644 index febaf3c8ea..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Level.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.SqlExpression; -import org.eclipse.daanse.olap.api.formatter.MemberFormatter; - -/** - * A Level is a group of {@link Member}s in a {@link Hierarchy}, - * all with the same attributes and at the same depth in the hierarchy. - * - * @author jhyde, 1 March, 1999 - */ -public interface Level extends OlapElement, MetaElement { - - /** - * Returns the depth of this level. - * - *

- * Note #1: In an access-controlled context, the first visible level of a - * hierarchy (as returned by {@link CatalogReader#getHierarchyLevels}) may not - * have a depth of 0. - *

- * - *

- * Note #2: In a parent-child hierarchy, the depth of a member (as returned by - * {@link CatalogReader#getMemberDepth}) may not be the same as the depth of its - * level. - */ - int getDepth(); - - @Override - Hierarchy getHierarchy(); - - Level getChildLevel(); - - Level getParentLevel(); - - boolean isAll(); - - boolean areMembersUnique(); - - LevelType getLevelType(); - - /** Returns properties defined against this level. */ - Property[] getProperties(); - - /** Returns properties defined against this level and parent levels. */ - Property[] getInheritedProperties(); - - /** - * Returns the object that is used to format members of this level. - */ - MemberFormatter getMemberFormatter(); - - /** - * Returns the approximate number of members in this level, or - * {@link Integer#MIN_VALUE} if no approximation is known. - */ - int getApproxRowCount(); - - int getCardinality(); - - List getMembers(); - - boolean isUnique(); - - SqlExpression getOrdinalExp(); - - boolean isParentChild(); - - boolean isParentAsLeafEnable(); - - String getParentAsLeafNameFormat(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LevelType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LevelType.java deleted file mode 100644 index d8471bf6b0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LevelType.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2004-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.element; - -/** - * Enumerates the types of levels. - */ -public enum LevelType { - - /** Indicates that the level is not related to time. */ - REGULAR("Regular"), - - /** - * Indicates that a level refers to years. It must be used in a dimension whose - * type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_YEARS("TimeYears"), - - /** - * Indicates that a level refers to half years. It must be used in a dimension - * whose type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_HALF_YEARS("TimeHalfYears"), - - /** - * Indicates that a level refers to quarters. It must be used in a dimension - * whose type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_QUARTERS("TimeQuarters"), - - /** - * Indicates that a level refers to months. It must be used in a dimension whose - * type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_MONTHS("TimeMonths"), - - /** - * Indicates that a level refers to weeks. It must be used in a dimension whose - * type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_WEEKS("TimeWeeks"), - - /** - * Indicates that a level refers to days. It must be used in a dimension whose - * type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_DAYS("TimeDays"), - - /** - * Indicates that a level refers to hours. It must be used in a dimension whose - * type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_HOURS("TimeHours"), - - /** - * Indicates that a level refers to minutes. It must be used in a dimension - * whose type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_MINUTES("TimeMinutes"), - - /** - * Indicates that a level refers to seconds. It must be used in a dimension - * whose type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_SECONDS("TimeSeconds"), - - /** - * Indicates that a level is an unspecified time period. It must be used in a - * dimension whose type is {@link DimensionType#TIME_DIMENSION}. - */ - TIME_UNDEFINED("TimeUndefined"), - - /** - * Indicates that a level holds the null member. - */ - NULL("Null"), - - /** - * Indicates that a level holds the geographical object Continent. - */ - GEO_CONTINENT("GeographicContinent"), - - /** - * Indicates that a level holds the geographical object Region. - */ - GEO_REGION("GeographicRegion"), - - /** - * Indicates that a level holds the geographical object Country. - */ - GEO_COUNTRY("GeographicCountry"), - - /** - * Indicates that a level holds the geographical objects State or Province. - */ - GEO_STATE_OR_PROVINCE("GeographicProvince"), - - /** - * Indicates that a level holds the geographical object County. - */ - GEO_COUNTY("GeographicCounty"), - - /** - * Indicates that a level holds the geographical object City. - */ - GEO_CITY("GeographicCity"), - - /** - * Indicates that a level holds the geographical object PostalCode. - */ - GEO_POSTALCODE("GeographicPostalCode"), - - /** - * Indicates that a level holds the geographical object Point. - */ - GEO_POINT("GeographicPoint"), - - /** - * Indicates that a level holds a OrganisationUnit. - */ - ORG_UNIT("OrganisationUnit"), - - /** - * Indicates that a level holds a Bom Resource. - */ - BOM_RESOURCE("BomResource"), - - /** - * Indicates that a level is a QUANTITATIVE. - */ - QUANTITATIVE("Quantitative"), - - /** - * Indicates that a level is a Account. - */ - ACCOUNT("Account"), - - /** - * Indicates that a level is a Customer. - */ - CUSTOMER("Customer"), - - /** - * Indicates that a level is a CustomerGroup. - */ - CUSTOMER_GROUP("CustomerGroup"), - - /** - * Indicates that a level is a CustomerGroup. - */ - CUSTOMER_HOUSEHOLD("CustomerHouseHold"), - - /** - * Indicates that a level is a Product. - */ - PRODUCT("Product"), - - /** - * Indicates that a level is a ProductGroup. - */ - PRODUCT_GROUP("ProductGroup"), - - /** - * Indicates that a level is a Scenario. - */ - SCENARIO("Scenario"), - - /** - * Indicates that a level is a Utility. - */ - UTILITY("Utility"), - - /** - * Indicates that a level is a Person. - */ - PERSON("Person"), - - /** - * Indicates that a level is a Company. - */ - COMPANY("Company"), - - /** - * Indicates that a level is a CurrencySource. - */ - CURRENCY_SOURCE("CurrencySource"), - /** - * Indicates that a level is a CurrencyDestination. - */ - CURRENCY_DESTINATION("CurrencyDestination"), - - /** - * Indicates that a level is a Channel. - */ - CHANNEL("Channel"), - - /** - * Indicates that a level is a Representative. - */ - REPRESENTATIVE("Representative"), - - /** - * Indicates that a level is a Promotion. - */ - PROMOTION("Promotion"); - - private final String value; - - LevelType(String v) { - value = v; - } - - public String getValue() { - return value; - } - - public static LevelType fromValue(String v) { - for (LevelType c : LevelType.values()) { - if (c.value.equals(v)) { - return c; - } - } - return REGULAR; -// throw new IllegalArgumentException(v); - } - - /** - * Returns whether this is a time level. - * - * @return Whether this is a time level. - */ - public boolean isTime() { - return switch (this) { - case TIME_YEARS, // - TIME_HALF_YEARS, // - TIME_QUARTERS, // - TIME_MONTHS, // - TIME_WEEKS, // - TIME_DAYS, // - TIME_HOURS, // - TIME_MINUTES, // - TIME_SECONDS, // - TIME_UNDEFINED -> - true; - default -> false; - }; - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LimitedMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LimitedMember.java deleted file mode 100644 index b8affc3e4a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/LimitedMember.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -import org.eclipse.daanse.olap.api.access.HierarchyAccess; - -public interface LimitedMember extends Member { - - Member getMember(); - - HierarchyAccess getHierarchyAccess(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Measure.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Measure.java deleted file mode 100644 index fd953e70b9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Measure.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.element; - -public interface Measure extends Member { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Member.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Member.java deleted file mode 100644 index 6c06b8a8b1..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Member.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2020 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.query.component.Expression; - -/** - * A Member is a 'point' on a dimension of a cube. Examples are - * [Time].[1997].[January], - * [Customer].[All Customers], - * [Customer].[USA].[CA], - * [Measures].[Unit Sales]. - * - *

Every member belongs to a {@link Level} of a {@link Hierarchy}. Members - * except the root member have a parent, and members not at the leaf level have one or more children. - * - *

Measures are a special kind of member. They belong to their own - * dimension, [Measures]. - * - *

There are also special members representing the 'All' value of a - * hierarchy, the null value, and the error value. - * - *

Members can have member properties. Their {@link Level#getProperties} - * defines which are allowed. - * - * @author jhyde, 2 March, 1999 - */ -public interface Member extends OlapElement, Comparable, MetaElement { - - /** - * Returns this member's parent, or null (not the 'null member', as returned by {@link Hierarchy#getNullMember}) - * if it - * has no parent. - * - *

In an access-control context, a member may have no visible - * parents, so use {@link CatalogReader#getMemberParent}. - */ - Member getParentMember(); - - Level getLevel(); - - @Override -Hierarchy getHierarchy(); - - /** - * Returns name of parent member, or empty string (not null) if we are the root. - */ - String getParentUniqueName(); - - /** - * Returns the type of member. - */ - MemberType getMemberType(); - - /** - * @return True when the member is a leaf member, meaning it has no children - */ - boolean isParentChildLeaf(); - - /** - * @return True when the member is part of a Parent-Child hierarchy and it is a physical member. In a Parent Child - * Hierarchy without a closure table, each member needs to be treated as calculated. We need a way to distinguish - * between true calculated members and physical members that exist in the source data - */ - boolean isParentChildPhysicalMember(); - - enum MemberType { - UNKNOWN, - REGULAR, // adMemberRegular - ALL, - MEASURE, - FORMULA, - /** - * This member is its hierarchy's NULL member (such as is returned by - * [Gender].[All Gender].PrevMember, for example). - */ - NULL - } - - /** - * Only allowable if the member is part of the WITH clause of a query. - */ - void setName( String name ); - - /** - * Returns whether this is the 'all' member. - */ - boolean isAll(); - - /** - * Returns whether this is a member of the measures dimension. - */ - boolean isMeasure(); - - /** - * Returns whether this is the 'null member'. - */ - boolean isNull(); - - /** - * Returns whether member is equal to, a child, or a descendent of this Member. - */ - boolean isChildOrEqualTo( Member member ); - - /** - * Returns whether this member is computed using either a with member clause in an mdx query or a - * calculated member defined in cube. - */ - boolean isCalculated(); - - /** - * Returns whether this member should be evaluated within the Evaluator. - * - *

Normally {@link #isCalculated} and {@link #isEvaluated} should return - * the same value, but in situations where mondrian would like to treat the two concepts separately such in role based - * security, these values may differ. - * - * @return true if evaluated - */ - boolean isEvaluated(); - - int getSolveOrder(); - - Expression getExpression(); - - /** - * Returns a list of the ancestor members of this member. - * - * @deprecated Use {@link CatalogReader#getMemberAncestors(Member, java.util.List)}. - */ - @Deprecated -List getAncestorMembers(); - - /** - * Returns whether this member is computed from a {@code WITH MEMBER} clause in an MDX query. - */ - boolean isCalculatedInQuery(); - - /** - * Returns the value of the property named propertyName. Name match is case-sensitive. - */ - Object getPropertyValue( String propertyName ); - - /** - * Returns the value of the property named propertyName, matching according to the required - * case-sensitivity. - */ - Object getPropertyValue( String propertyName, boolean matchCase ); - - /** - * Returns the formatted value of the property named - * propertyName. - */ - String getPropertyFormattedValue( String propertyName ); - - /** - * Sets a property of this member to a given value. - */ - void setProperty( String name, Object value ); - - /** - * Returns the definitions of the properties this member may have. - */ - Property[] getProperties(); - - /** - * Returns the ordinal of the member. - */ - int getOrdinal(); - - /** - * Returns the order key of the member (relative to its siblings); null if undefined or unavailable. - */ - Comparable getOrderKey(); - - /** - * Returns whether this member is 'hidden', as per the rules which define a ragged hierarchy. - */ - boolean isHidden(); - - /** - * returns the depth of this member, which is not the level's depth in case of parent child dimensions - * - * @return depth - */ - int getDepth(); - - /** - * Returns the system-generated data member that is associated with a nonleaf member of a dimension. - * - *

Returns this member if this member is a leaf member, or if the - * nonleaf member does not have an associated data member.

- */ - Member getDataMember(); - - /** - * Returns true if this member is on the same hierarchy chain as otherMember. - * - * @param otherMember - * @return - */ - boolean isOnSameHierarchyChain( Member otherMember ); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaData.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaData.java deleted file mode 100644 index 86d11affe9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaData.java +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.element; - -import java.util.Locale; -import java.util.Optional; - -import org.eclipse.daanse.olap.api.element.OlapElement.LocalizedProperty; - -public interface MetaData { - - Optional getLocalized(LocalizedProperty prop, Locale locale); - - Object get(String key); - - Integer size(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaElement.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaElement.java deleted file mode 100644 index cbf7a28d54..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/MetaElement.java +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.element; - -public interface MetaElement { - /** - * Returns the {@link MetaData} of Element. - * - * @return {@link MetaData} with additional Metadata for the Element. - */ - MetaData getMetaData(); -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/NamedSet.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/NamedSet.java deleted file mode 100644 index 7b4721c8b4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/NamedSet.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2000-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.element; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * A named set of members or tuples. - * - *

- * A set can be defined in a query, using a WITH SET clause, or in - * a schema. Named sets in a schema can be defined against a particular cube or - * virtual cube, or shared between all cubes. - *

- * - * @author jhyde - * @since 6 August, 2001 - */ -public interface NamedSet extends OlapElement, MetaElement { - /** - * Sets the name of this named set. - */ - void setName(String newName); - - /** - * Returns the type of this named set. - */ - Type getType(); - - /** - * Returns the expression used to derive this named set. - */ - Expression getExp(); - - NamedSet validate(Validator validator); - - /** - * Returns a name for this set that is unique within the query. - * - *

- * This is necessary when there are several 'AS' expressions, or an 'AS' - * expression overrides a named set defined using 'WITH MEMBER' clause or - * against a cube. - */ - String getNameUniqueWithinQuery(); - - /** - * Returns whether this named set is dynamic. - * - *

- * Evaluation rules: - *

    - *
  • A dynamic set is evaluated each time it is used, and inherits the context - * in which it is evaluated. - *
  • A static set is evaluated only on first use, in the base context of the - * cube. - *
- * - * @return Whether this named set is dynamic - */ - boolean isDynamic(); - - List getHierarchies(); - - String getDisplayFolder(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/OlapElement.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/OlapElement.java deleted file mode 100644 index 0cb10efc66..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/OlapElement.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1998-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.element; - -import java.util.Locale; - -import org.eclipse.daanse.olap.api.MatchType; -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.Segment; - -/** - * An OlapElement is a catalog object (dimension, hierarchy, level, - * member). - * - * @author jhyde, 21 January, 1999 - */ -public interface OlapElement { - String getUniqueName(); - - String getName(); - - String getDescription(); - - /** - * Looks up a child element, returning null if it does not exist. - */ - OlapElement lookupChild(CatalogReader schemaReader, Segment s, MatchType matchType); - - /** - * Returns the name of this element qualified by its class, for example - * "hierarchy 'Customers'". - */ - String getQualifiedName(); - - String getCaption(); - - /** - * Returns the value of a property (caption or description) of this element in - * the given locale. - * - * @param locale Locale - * @return Localized caption or description - */ - String getLocalized(LocalizedProperty prop, Locale locale); - - Hierarchy getHierarchy(); - - /** - * Returns the dimension of a this expression, or null if no dimension is - * defined. Applicable only to set expressions. - * - *

- * Example 1:

- * - *
-     * [Sales].children
-     * 
- * - *
has dimension [Sales]. - *

- * - *

- * Example 2:

- * - *
-     * order(except([Promotion Media].[Media Type].members,
-     *              {[Promotion Media].[Media Type].[No Media]}),
-     *       [Measures].[Unit Sales], DESC)
-     * 
- * - *
has dimension [Promotion Media]. - *

- * - *

- * Example 3:

- * - *
-     * CrossJoin([Product].[Product Department].members,
-     *           [Gender].members)
-     * 
- * - *
has no dimension (well, actually it is [Product] x [Gender], - * but we can't represent that, so we return null); - *

- */ - Dimension getDimension(); - - /** - * Returns whether this element is visible to end-users. - * - *

- * Visibility is a hint for client applications. An element's visibility does - * not affect how it is treated when MDX queries are evaluated. - * - * @return Whether this element is visible - */ - boolean isVisible(); - - enum LocalizedProperty { - CAPTION, DESCRIPTION - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/ParentChildMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/ParentChildMember.java deleted file mode 100644 index 945f3732a5..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/ParentChildMember.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.element; - -public interface ParentChildMember extends KeyMember{ - - Member createPseudoLeafMember(Member child, String name); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PhysicalCube.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PhysicalCube.java deleted file mode 100644 index 2fb579a039..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PhysicalCube.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.element; - -public interface PhysicalCube extends Cube { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Property.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Property.java deleted file mode 100644 index 6d1ca32431..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/Property.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2018 Hitachi Vantara and others - * All Rights Reserved. - * - * jhyde, 12 September, 2002 - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.element; - -import org.eclipse.daanse.olap.api.formatter.MemberPropertyFormatter; - -public interface Property { - - /** - * Returns the datatype of the property. - */ - Datatype getType(); - - MemberPropertyFormatter getFormatter(); - - /** - * Returns the caption of this property. - */ - String getCaption(); - - /** - * Returns whether this property is for system use only. - */ - boolean isInternal(); - - /** - * Returns whether this property is a standard member property. - */ - boolean isMemberProperty(); - - /** - * Returns whether this property is a standard cell property. - */ - boolean isCellProperty(); - - String getName(); - - String getDescription(); - - public enum Datatype { - TYPE_STRING(null), TYPE_NUMERIC(null), TYPE_INTEGER("INT"), TYPE_LONG("LONG"), - TYPE_BOOLEAN(null), TYPE_DATE(null), TYPE_TIME(null), TYPE_TIMESTAMP(null), TYPE_OTHER(null); - - private String type; - - Datatype(String type) { - this.type = type; - } - - public String getInternalType() { - return type; - } - - public boolean isNumeric() { - return this == TYPE_NUMERIC || this == TYPE_INTEGER || this == TYPE_LONG; - } - } - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PseudoLeafMember.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PseudoLeafMember.java deleted file mode 100644 index 989db96b8e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/PseudoLeafMember.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.element; - -public interface PseudoLeafMember { -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/StoredMeasure.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/StoredMeasure.java deleted file mode 100644 index b4180c0c63..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/StoredMeasure.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.element; - -public interface StoredMeasure extends Measure { - - String getAggregateFunction(); - - /** - * Returns the cube this measure belongs to. - */ - Cube getCube(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCube.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCube.java deleted file mode 100644 index d175105f01..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCube.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.element; - -public interface VirtualCube extends Cube { - - boolean shouldIgnoreUnrelatedDimensions(String name); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCubeMeasure.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCubeMeasure.java deleted file mode 100644 index 26b71da8e2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/VirtualCubeMeasure.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.element; - -public interface VirtualCubeMeasure extends StoredMeasure { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/package-info.java deleted file mode 100644 index a4e47ec6ba..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/element/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.element; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/CellRequestQuantumExceededException.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/CellRequestQuantumExceededException.java deleted file mode 100644 index a34b6f2c8a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/CellRequestQuantumExceededException.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.exception; - -/** - * Signals that there are enough outstanding cell requests that it is - * worth terminating this phase of execution and asking the segment cache - * for all of the cells that have been asked for. - * - *

Not really an exception, just a way of aborting a process so that we can - * do some work and restart the process. Any code that handles this exception - * is typically in a loop that calls {@link mondrian.rolap.RolapResult#phase}. - *

- * - *

There are several advantages to this:

- *
    - *
  • If the query has been run before, the cells will be in the - * cache already, and this is an opportunity to copy them into the - * local cache.
  • - *
  • If cell requests are for the same or similar cells, it gives - * opportunity to fetch these cells. Then the requests can be answered - * from local cache, and we don't need to bother the cache manager with - * similar requests.
  • - *
  • Prevents memory from filling up with cell requests.
  • - *
- */ -public final class CellRequestQuantumExceededException - extends RuntimeException -{ - public static final CellRequestQuantumExceededException INSTANCE = - new CellRequestQuantumExceededException(); - - private CellRequestQuantumExceededException() { - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/OlapRuntimeException.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/OlapRuntimeException.java deleted file mode 100644 index 20d5b6c17b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/OlapRuntimeException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - */ -package org.eclipse.daanse.olap.api.exception; - -@SuppressWarnings("serial") -public class OlapRuntimeException extends RuntimeException { - - public OlapRuntimeException(Throwable cause) { - super(cause); - } - - public OlapRuntimeException(String message) { - super(message); - } - - public OlapRuntimeException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/package-info.java deleted file mode 100644 index c004fa36d1..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/exception/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.exception; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/CellFormatter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/CellFormatter.java deleted file mode 100644 index 389a45557e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/CellFormatter.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.formatter; - -public interface CellFormatter { - - String format(Object value); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberFormatter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberFormatter.java deleted file mode 100644 index cc43feea19..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberFormatter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2004-2005 TONBELLER AG - * Copyright (C) 2006-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.formatter; - -import org.eclipse.daanse.olap.api.element.Member; - - -public interface MemberFormatter { - - - String format(Member member); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberPropertyFormatter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberPropertyFormatter.java deleted file mode 100644 index 4eec8f9244..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/MemberPropertyFormatter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2004-2005 TONBELLER AG - * Copyright (C) 2006-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.formatter; - -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.Property; - -public interface MemberPropertyFormatter { - - String format(Member member, Property property, Object value); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/package-info.java deleted file mode 100644 index df2b456042..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/formatter/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.formatter; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionDefinition.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionDefinition.java deleted file mode 100644 index 6d802b517c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionDefinition.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.function; - -import java.io.PrintWriter; - -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.query.component.Expression; -import org.eclipse.daanse.olap.api.query.component.ResolvedFunCall; - -public interface FunctionDefinition { - - FunctionMetaData getFunctionMetaData(); - - /** - * Creates an expression which represents a call to this function with - * a given set of arguments. The result is usually a {@link ResolvedFunCall} but - * not always. - */ - Expression createCall(Validator validator, Expression[] args); - - /** - * Returns an Signature-Description of the function. - */ - String getSignature(); -// FunctionMetaData fi= getFunctionMetaData(); -// return fi.functionAtom().syntax().getSignature( -// fi.functionAtom().name(), -// fi.returnCategory(), -// fi.parameterDataTypes()); - - - /** - * Writes a function call with given {@link Expression}s into MDX. - */ - void unparse(Expression[] args, PrintWriter pw); - -// getFunctionMetaData().functionAtom().syntax().unparse(getFunctionMetaData().functionAtom().name(), args, pw); - - - Calc compileCall(ResolvedFunCall call, ExpressionCompiler compiler); - - - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionMetaData.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionMetaData.java deleted file mode 100644 index 5e55c332d3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionMetaData.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.function; - -import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; -import org.eclipse.daanse.olap.api.DataType; - -public interface FunctionMetaData { - - OperationAtom operationAtom(); - - String description(); - - DataType returnCategory(); - - DataType[] parameterDataTypes(); - - FunctionParameter[] parameters(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionParameter.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionParameter.java deleted file mode 100644 index ec0828624f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionParameter.java +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ - -package org.eclipse.daanse.olap.api.function; - -import java.util.List; -import java.util.Optional; - -import org.eclipse.daanse.olap.api.DataType; - -public interface FunctionParameter { - - DataType dataType(); - - Optional name(); - - Optional description(); - - Optional> reservedWords(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionResolver.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionResolver.java deleted file mode 100644 index dc5ef64fe3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionResolver.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2002-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.function; - -import java.util.List; - -import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.query.component.Expression; - -/** - * A {@link FunctionResolver} converts a function name, invocation type, and set - * of arguments into a {@link FunctionDefinition}. - */ -public interface FunctionResolver { - - public OperationAtom getFunctionAtom(); - - /** - * Given a particular set of arguments the function is applied to, returns the - * correct overloaded form of the function. - * - *

- * The method adds an item to conversions every time it performs an - * implicit type-conversion. If there are several candidate functions with the - * same signature, the validator will choose the one which used the fewest - * implicit conversions. - *

- * - * @param args Expressions which this function call is applied to. - * @param validator Validator - * @param conversions List of implicit conversions performed (out) - * - * @return The function definition which matches these arguments, or null if no - * function definition that this resolver knows about matches. - */ - FunctionDefinition resolve(Expression[] args, Validator validator, List conversions); - - /** - * iIndicated whether a argument with a given positionOfArgument - * must be a scalar expression. Returns false if any of the - * variants of this resolver allows a set as its - * positionOfArgumentth argument; true otherwise. - * - * if the ( positionOfArgument < 1 ) implementations must return false; - * - */ - boolean requiresScalarExpressionOnArgument(int positionOfArgument); - - /** - * Returns a {@link List} of symbolic constants which can appear as arguments to - * this function. - * - *

- * For example, the DrilldownMember may take the symbol - * RECURSIVE as an argument. Most functions do not define any - * symbolic constants. - * - * @return An {@link List} of the names of the symbolic constants - */ - default List getReservedWords() { - return List.of(); - } - - default List getRepresentativeFunctionMetaDatas() { - return List.of(); - } - - /** - * Description of an implicit conversion that occurred while resolving an - * operator call. - */ - public interface Conversion { - /** - * Returns the cost of the conversion. If there are several matching overloads, - * the one with the lowest overall cost will be preferred. - * - * @return Cost of conversion - */ - int getCost(); - - /** - * Checks the viability of implicit conversions. Converting from a dimension to - * a hierarchy is valid if is only one hierarchy. - */ - void checkValid(); - - /** - * Applies this conversion to its argument, modifying the argument list in - * place. - * - * @param validator Validator - * @param args Argument list - */ - void apply(Validator validator, List args); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionService.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionService.java deleted file mode 100644 index 86905cbd9b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/FunctionService.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.function; - -import java.util.List; -import java.util.Set; - -import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; - -public interface FunctionService { - - void addResolver(FunctionResolver resolver); - - void removeResolver(FunctionResolver resolver); - - /** - * Returns a Set of all words, that are used in Functions and may not be used as - * identifiers. - */ - Set getPropertyWords(); - - List getFunctionMetaDatas(); - - /** - * Returns whether a string is a reserved word. - */ - boolean isReservedWord(String word); - - /** - * Returns a list of - * {@link org.eclipse.daanse.olap.api.function.FunctionResolver} objects. - */ - List getResolvers(); - - /** - * Returns a list of resolvers for an operator with a given name and syntax. - * Never returns null; if there are no resolvers, returns the empty list. - * - * @param operationAtom OperationAtom - * @return List of resolvers for the OperationAtom - */ - List getResolvers(OperationAtom operationAtom); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/package-info.java deleted file mode 100644 index 278ba7b19e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/function/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.function; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/EventBus.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/EventBus.java deleted file mode 100644 index fa07fcd5a2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/EventBus.java +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.monitor; - -import org.eclipse.daanse.olap.api.monitor.event.Event; - -public interface EventBus extends java.util.function.Consumer { - - /** - * Accepts an Event - * - * @param event the event - */ - @Override - default void accept(Event event) { - - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEvent.java deleted file mode 100644 index d0294f0008..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEvent.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.monitor.event; - -import org.eclipse.daanse.olap.api.CacheControl; - -public sealed interface CellCacheEvent extends ExecutionEvent - permits CellCacheSegmentCreateEvent, CellCacheSegmentDeleteEvent { - /** - * Enumeration of sources of a cell cache segment. - */ - public enum Source { - /** - * A segment that is placed into the cache by an external cache. - * - *

- * Some caches (e.g. memcached) never generate this kind of event. - *

- * - *

- * In JBoss Infinispan, one scenario that causes this kind of event is as - * follows. A user issues an MDX query against a different Mondrian node in the - * same Infinispan cluster. To resolve missing cells, that node issues a SQL - * statement to load a segment. Infinispan propagates that segment to its peers, - * and each peer is notified that an "external segment" is now in the cache. - *

- */ - EXTERNAL, - - /** - * A segment that has been loaded in response to a user query, and populated by - * generating and executing a SQL statement. - */ - SQL, - - /** - * a segment that has been loaded in response to a user query, and populated by - * rolling up existing cache segments. - */ - ROLLUP, - - /** - * a segment that has been deleted by a call through the {@link CacheControl} - * API. - */ - CACHE_CONTROL, - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEventCommon.java deleted file mode 100644 index 889ab1be59..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheEventCommon.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -import org.eclipse.daanse.olap.api.monitor.event.CellCacheEvent.Source; - -public record CellCacheEventCommon(ExecutionEventCommon executionEventCommon, Source source) { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentCreateEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentCreateEvent.java deleted file mode 100644 index 4c1413ff71..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentCreateEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record CellCacheSegmentCreateEvent(CellCacheEventCommon cellCacheEventCommon, int coordinateCount, - int actualCellCount) implements CellCacheEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentDeleteEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentDeleteEvent.java deleted file mode 100644 index 2e4794c6f2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/CellCacheSegmentDeleteEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record CellCacheSegmentDeleteEvent(CellCacheEventCommon cellCacheEventCommon, int coordinateCount) - implements CellCacheEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEndEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEndEvent.java deleted file mode 100644 index 6a5fd71be6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEndEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ConnectionEndEvent(ConnectionEventCommon connectionEventCommon) implements ConnectionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEvent.java deleted file mode 100644 index 73e7590777..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface ConnectionEvent extends OlapEvent permits ConnectionStartEvent, ConnectionEndEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEventCommon.java deleted file mode 100644 index a3ea0375b8..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionEventCommon.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ConnectionEventCommon(ServertEventCommon servertEventCommon, long connectionId) { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionStartEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionStartEvent.java deleted file mode 100644 index fe1971311a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ConnectionStartEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ConnectionStartEvent(ConnectionEventCommon connectionEventCommon) implements ConnectionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/Event.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/Event.java deleted file mode 100644 index b253e0a0c0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/Event.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface Event permits OlapEvent, UserSpaceEvent { - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/EventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/EventCommon.java deleted file mode 100644 index 5b6cc2ccaf..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/EventCommon.java +++ /dev/null @@ -1,23 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api.monitor.event; - -import java.time.Instant; - -public record EventCommon(Instant timestamp) { - - public static EventCommon ofNow() { - return new EventCommon(Instant.now()); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEndEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEndEvent.java deleted file mode 100644 index 779ad3d7f0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEndEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -import org.eclipse.daanse.olap.api.Execution; - -public record ExecutionEndEvent(ExecutionEventCommon executionEventCommon, int phaseCount, Execution.State state, - int cellCacheHitCount, int cellCacheMissCount, int cellCachePendingCount, int expCacheHitCount, - int expCacheMissCount) implements ExecutionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEvent.java deleted file mode 100644 index 4b46f2ec98..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface ExecutionEvent extends OlapEvent - permits CellCacheEvent, ExecutionStartEvent, ExecutionPhaseEvent, ExecutionEndEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEventCommon.java deleted file mode 100644 index aa88c0ea36..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionEventCommon.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ExecutionEventCommon(MdxStatementEventCommon mdxStatementEventCommon, long executionId) { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionPhaseEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionPhaseEvent.java deleted file mode 100644 index 4b53a99aca..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionPhaseEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ExecutionPhaseEvent(ExecutionEventCommon executionEventCommon, int phase, int hitCount, int missCount, - int pendingCount) implements ExecutionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionStartEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionStartEvent.java deleted file mode 100644 index a63199a101..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ExecutionStartEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ExecutionStartEvent(ExecutionEventCommon eventCommon, String mdx) implements ExecutionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEndEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEndEvent.java deleted file mode 100644 index d7cb6001fe..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEndEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record MdxStatementEndEvent(MdxStatementEventCommon mdxStatementEventCommon) implements StatementEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEventCommon.java deleted file mode 100644 index bde60e1121..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementEventCommon.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record MdxStatementEventCommon(ConnectionEventCommon connectionEventCommon, long mdxStatementId) { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementStartEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementStartEvent.java deleted file mode 100644 index 603b73762e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/MdxStatementStartEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record MdxStatementStartEvent(MdxStatementEventCommon mdxStatementEventCommon) implements StatementEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/OlapEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/OlapEvent.java deleted file mode 100644 index 104d0db145..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/OlapEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface OlapEvent extends Event - permits ExecutionEvent, SqlStatementEvent, StatementEvent, ConnectionEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ServertEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ServertEventCommon.java deleted file mode 100644 index 34378bc157..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/ServertEventCommon.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public record ServertEventCommon(EventCommon commonEventInfo, String serverId) { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEndEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEndEvent.java deleted file mode 100644 index 9d25bc6ba2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEndEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api.monitor.event; - -public record SqlStatementEndEvent(SqlStatementEventCommon sqlStatementEventInfo, long rowFetchCount, boolean canceled, - Throwable throwable) implements SqlStatementEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEvent.java deleted file mode 100644 index 0849552b91..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface SqlStatementEvent extends OlapEvent - permits SqlStatementStartEvent, SqlStatementEndEvent, SqlStatementExecuteEvent { - public enum Purpose { - DRILL_THROUGH, CELL_SEGMENT, TUPLES, OTHER - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEventCommon.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEventCommon.java deleted file mode 100644 index 627f9bcffd..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementEventCommon.java +++ /dev/null @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api.monitor.event; - -import org.eclipse.daanse.olap.api.monitor.event.SqlStatementEvent.Purpose; - -public record SqlStatementEventCommon(EventCommon eventCommon, long mdxStatementId, long sqlStatementId, String sql, - Purpose purpose) { -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementExecuteEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementExecuteEvent.java deleted file mode 100644 index c56b9cd81f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementExecuteEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -package org.eclipse.daanse.olap.api.monitor.event; - -public record SqlStatementExecuteEvent(SqlStatementEventCommon sqlStatementEventCommon, long executeNanos) - implements SqlStatementEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementStartEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementStartEvent.java deleted file mode 100644 index 2dc8603476..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/SqlStatementStartEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -/** - * The Record SqlStatementStartEvent. - * - * @param sqlStatementEventInfo - * @param cellRequestCount Number of missed cells that led to this request - */ -public record SqlStatementStartEvent(SqlStatementEventCommon sqlStatementEventCommon, long cellRequestCount) - implements SqlStatementEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/StatementEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/StatementEvent.java deleted file mode 100644 index 08f4dfffc3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/StatementEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public sealed interface StatementEvent extends OlapEvent permits MdxStatementStartEvent, MdxStatementEndEvent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/UserSpaceEvent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/UserSpaceEvent.java deleted file mode 100644 index c78a26cd32..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/UserSpaceEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ -package org.eclipse.daanse.olap.api.monitor.event; - -public non-sealed interface UserSpaceEvent extends Event { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/package-info.java deleted file mode 100644 index b15a542fee..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/event/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.monitor.event; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/package-info.java deleted file mode 100644 index 4e54cb5373..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/monitor/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2024 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.monitor; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/package-info.java deleted file mode 100644 index 6d0d4740e0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/ExpressionProvider.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/ExpressionProvider.java deleted file mode 100644 index 2e7be8f6f0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/ExpressionProvider.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query; - -import org.eclipse.daanse.mdx.model.api.expression.MdxExpression; -import org.eclipse.daanse.olap.api.query.component.Expression; - -public interface ExpressionProvider { - - Expression createExpression(MdxExpression expression); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/QueryProvider.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/QueryProvider.java deleted file mode 100644 index 18774ee515..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/QueryProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query; - -import org.eclipse.daanse.mdx.model.api.DMVStatement; -import org.eclipse.daanse.mdx.model.api.DrillthroughStatement; -import org.eclipse.daanse.mdx.model.api.ExplainStatement; -import org.eclipse.daanse.mdx.model.api.MdxStatement; -import org.eclipse.daanse.mdx.model.api.RefreshStatement; -import org.eclipse.daanse.mdx.model.api.SelectStatement; -import org.eclipse.daanse.mdx.model.api.UpdateStatement; -import org.eclipse.daanse.olap.api.Statement; -import org.eclipse.daanse.olap.api.query.component.CellProperty; -import org.eclipse.daanse.olap.api.query.component.DmvQuery; -import org.eclipse.daanse.olap.api.query.component.DrillThrough; -import org.eclipse.daanse.olap.api.query.component.Explain; -import org.eclipse.daanse.olap.api.query.component.Formula; -import org.eclipse.daanse.olap.api.query.component.Query; -import org.eclipse.daanse.olap.api.query.component.QueryAxis; -import org.eclipse.daanse.olap.api.query.component.QueryComponent; -import org.eclipse.daanse.olap.api.query.component.Refresh; -import org.eclipse.daanse.olap.api.query.component.Subcube; -import org.eclipse.daanse.olap.api.query.component.Update; - -public interface QueryProvider { - - QueryComponent createQuery(Statement statement, MdxStatement selectStatement, boolean strictValidation); - - Query createQuery(Statement statement, SelectStatement selectStatement, boolean strictValidation); - - DrillThrough createDrillThrough(Statement statement, DrillthroughStatement drillThroughStatement, boolean strictValidation); - - Explain createExplain(Statement statement, ExplainStatement explainStatement, boolean strictValidation); - - DmvQuery createDMV(DMVStatement dmvStatement); - - Refresh createRefresh(RefreshStatement refreshStatement); - - Update createUpdate(UpdateStatement updateStatement); - - Query createQuery(Statement statement, - Formula[] formula, - QueryAxis[] axes, - Subcube subcube, - QueryAxis slicerAxis, - CellProperty[] cellProps, - boolean strictValidation); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/AxisOrdinal.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/AxisOrdinal.java deleted file mode 100644 index 51b13b1629..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/AxisOrdinal.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2003-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.query.component; - -/** - * AxisOrdinal describes the allowable values for an axis code. - * - * @author jhyde - * @since Feb 21, 2003 - */ -public interface AxisOrdinal { - /** - * Returns the name of this axis, e.g. "COLUMNS", "SLICER", "AXIS(17)". - * - * @return Name of the axis - */ - String name(); - - /** - * Returns the ordinal of this axis. {@link StandardAxisOrdinal#COLUMNS} = 0, - * {@link StandardAxisOrdinal#ROWS} = 1, etc. - * - * @return ordinal of this axis - */ - int logicalOrdinal(); - - /** - * Returns whether this is the filter (slicer) axis. - * - * @return whether this is the filter axis - */ - boolean isFilter(); - - public enum StandardAxisOrdinal implements AxisOrdinal { - /** No axis. */ - NONE, - - /** Slicer axis. */ - SLICER, - - /** Columns axis (also known as X axis), logical ordinal = 0. */ - COLUMNS, - - /** Rows axis (also known as Y axis), logical ordinal = 1. */ - ROWS, - - /** Pages axis, logical ordinal = 2. */ - PAGES, - - /** Chapters axis, logical ordinal = 3. */ - CHAPTERS, - - /** Sections axis, logical ordinal = 4. */ - SECTIONS; - - /** - * Returns an axis with a given number. - * - *

- * If ordinal is greater than 4, returns a non-standard axis called "AXIS(n)". - * Never returns null. - * - * @param ordinal Ordinal - * @return Axis - */ - public static AxisOrdinal forLogicalOrdinal(final int ordinal) { - if (ordinal + 2 > SECTIONS.ordinal()) { - return new AxisOrdinalR(ordinal, false); - } else { - return values()[ordinal + 2]; - } - } - - @Override - public int logicalOrdinal() { - return ordinal() - 2; - } - - @Override - public boolean isFilter() { - return this == SLICER; - } - } - - record AxisOrdinalR(int logicalOrdinal, boolean isFilter) implements AxisOrdinal { - @Override - public String name() { - return new StringBuilder("AXIS(").append(logicalOrdinal).append(")").toString(); - } - - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CalculatedFormula.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CalculatedFormula.java deleted file mode 100644 index abda1c1107..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CalculatedFormula.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface CalculatedFormula extends QueryComponent { - - String getCubeName(); - - Formula getFormula(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CellProperty.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CellProperty.java deleted file mode 100644 index 101415a451..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/CellProperty.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface CellProperty extends QueryComponent { - - boolean isNameEquals(String propertyName); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DimensionExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DimensionExpression.java deleted file mode 100644 index c265b3855e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DimensionExpression.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.element.Dimension; - -public non-sealed interface DimensionExpression extends QueryComponent { - - Dimension getDimension(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DmvQuery.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DmvQuery.java deleted file mode 100644 index 48589e757a..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DmvQuery.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.List; - -public non-sealed interface DmvQuery extends QueryComponent { - - String getTableName(); - - Expression getWhereExpression(); - - List getColumns(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DrillThrough.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DrillThrough.java deleted file mode 100644 index f1ecc988d2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/DrillThrough.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.OlapElement; - -public non-sealed interface DrillThrough extends QueryComponent { - - Query getQuery(); - - int getMaxRowCount(); - - int getFirstRowOrdinal(); - - List getReturnList(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Explain.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Explain.java deleted file mode 100644 index 901d70eaa8..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Explain.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface Explain extends QueryComponent { - - QueryComponent getQuery(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Expression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Expression.java deleted file mode 100644 index 0dbcc14478..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Expression.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1999-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - -package org.eclipse.daanse.olap.api.query.component; - -import java.io.PrintWriter; - -import org.eclipse.daanse.olap.api.DataType; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.query.component.visit.QueryComponentVisitor; -import org.eclipse.daanse.olap.api.type.Type; - -/** - * An {@link Expression} is an MDX expression. - */ -public interface Expression { - - Expression cloneExp(); - - /** - * Returns the {@link DataType} of the expression. - * - * @post Category.instance().isValid(return) - */ - DataType getCategory(); - - /** - * Returns the type of this expression. Never null. - */ - Type getType(); - - /** - * Writes the MDX representation of this expression to a print writer. - * Sub-expressions are invoked recursively. - * - * @param pw PrintWriter - */ - void unparse(PrintWriter pw); - - /** - * Validates this expression. - * - * The validator acts in the role of 'visitor' (see Gang of Four - * 'visitor pattern'), and an expression in the role of 'visitee'. - * - * @param validator Validator contains validation context - * - * @return The validated expression; often but not always the same as - * this expression - */ - Expression accept(Validator validator); - - /** - * Converts this expression into an a tree of expressions which can be - * efficiently evaluated. - * - * @param compiler - * @return A compiled expression - */ - Calc accept(ExpressionCompiler compiler); - - /** - * Accepts a visitor to this {@link Expression}. - * The implementation should generally dispatches to the - * {@link QueryComponentVisitor} method appropriate to the type of expression. - * - * @param visitor Visitor - */ - Object accept(QueryComponentVisitor visitor); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Formula.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Formula.java deleted file mode 100644 index 89fe4dacc6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Formula.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.NamedSet; -import org.eclipse.daanse.olap.api.element.OlapElement; -import org.eclipse.daanse.olap.api.query.component.visit.QueryComponentVisitor; - -public non-sealed interface Formula extends QueryComponent { - - boolean isMember(); - - NamedSet getNamedSet(); - - Id getIdentifier(); - - String getName(); - - String getCaption(); - - Expression getExpression(); - - Expression setExpression(Expression exp); - - Member getMdxMember(); - - Number getSolveOrder(); - - void compile(); - - Id getId(); - - Expression getExp(); - - NamedSet getMdxSet(); - - MemberProperty[] getPemberProperties(); - - void accept(Validator validator); - - Object accept(QueryComponentVisitor visitor); - - void createElement(Query q); - - OlapElement getElement(); - - String getUniqueName(); - - void rename(String newName); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/FunctionCall.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/FunctionCall.java deleted file mode 100644 index dd139efa2c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/FunctionCall.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 1998-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.mdx.model.api.expression.operation.OperationAtom; -import org.eclipse.daanse.olap.api.function.FunctionDefinition; - -/** - * A FunCall is a function applied to a list of operands. - * - *

The parser creates function calls as an - * {@link mondrian.mdx.UnresolvedFunCallImpl unresolved function call}. - * The validator converts it to a - * {@link mondrian.mdx.ResolvedFunCallImpl resolved function call}, - * which has a {@link FunctionDefinition function definition} and extra type information. - * - * @author jhyde - * @since Jan 6, 2006 - */ -public interface FunctionCall extends Expression { - /** - * Returns the indexth argument to this function - * call. - * - * @param index Ordinal of the argument - * @return indexth argument to this function call - */ - Expression getArg(int index); - - /** - * Returns the arguments to this function. - * - * @return array of arguments - */ - Expression[] getArgs(); - - /** - * Returns the number of arguments to this function. - * - * @return number of arguments - */ - int getArgCount(); - - /** - * Returns the OperationAtom. - */ - OperationAtom getOperationAtom(); - - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/HierarchyExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/HierarchyExpression.java deleted file mode 100644 index 07c901e208..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/HierarchyExpression.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.element.Hierarchy; - -public non-sealed interface HierarchyExpression extends QueryComponent { - - /** - * Returns the hierarchy. - */ - Hierarchy getHierarchy(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Id.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Id.java deleted file mode 100644 index 891f305241..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Id.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Segment; - -public non-sealed interface Id extends QueryComponent { - - String[] toStringArray(); - - List getSegments(); - - Segment getElement(int i); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/LevelExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/LevelExpression.java deleted file mode 100644 index 42f42d76c4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/LevelExpression.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.element.Level; - -public non-sealed interface LevelExpression extends QueryComponent { - - Level getLevel(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Literal.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Literal.java deleted file mode 100644 index 35f27c9adb..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Literal.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public sealed interface Literal extends QueryComponent permits NullLiteral, StringLiteral, NumericLiteral, SymbolLiteral { - - R getValue(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberExpression.java deleted file mode 100644 index 89011a08f7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberExpression.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.element.Member; - -public non-sealed interface MemberExpression extends QueryComponent, Expression { - - Member getMember(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberProperty.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberProperty.java deleted file mode 100644 index bc4d727029..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/MemberProperty.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.Validator; - -public non-sealed interface MemberProperty extends QueryComponent{ - - Expression getExp(); - - String getName(); - - void resolve(Validator validator); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NamedSetExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NamedSetExpression.java deleted file mode 100644 index d5bcd1b3be..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NamedSetExpression.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.Evaluator; -import org.eclipse.daanse.olap.api.element.NamedSet; - -public non-sealed interface NamedSetExpression extends QueryComponent { - - NamedSet getNamedSet(); - - Evaluator.NamedSetEvaluator getEval(Evaluator evaluator); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NullLiteral.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NullLiteral.java deleted file mode 100644 index 084903a5f7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NullLiteral.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface NullLiteral extends Literal { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NumericLiteral.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NumericLiteral.java deleted file mode 100644 index cb237f2bcf..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/NumericLiteral.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.math.BigDecimal; - -public non-sealed interface NumericLiteral extends Literal { - - int getIntValue(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ParameterExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ParameterExpression.java deleted file mode 100644 index 84c818992b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ParameterExpression.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.Parameter; - -public non-sealed interface ParameterExpression extends QueryComponent , Expression{ - - Parameter getParameter(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Query.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Query.java deleted file mode 100644 index c424e70a2b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Query.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.daanse.olap.api.CatalogReader; -import org.eclipse.daanse.olap.api.Connection; -import org.eclipse.daanse.olap.api.Parameter; -import org.eclipse.daanse.olap.api.Statement; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.ResultStyle; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.OlapElement; -import org.eclipse.daanse.olap.api.function.FunctionDefinition; -import org.eclipse.daanse.olap.api.query.component.visit.QueryComponentVisitor; - -public non-sealed interface Query extends QueryComponent { - - CatalogReader getCatalogReader(boolean b); - - Cube getCube(); - - void setResultStyle(ResultStyle list); - - QueryAxis[] getAxes(); - - Calc compileExpression(Expression exp, boolean scalar, ResultStyle resultStyle); - - Map getSubcubeHierarchyCalcs(); - - void replaceSubcubeMembers(); - - void resolve(); - - void clearEvalCache(); - - QueryAxis getSlicerAxis(); - - QueryComponent[] getCellProperties(); - - Set getMeasuresMembers(); - - Calc getSlicerCalc(); - - Calc[] getAxisCalcs(); - - void setSubcubeHierarchies(HashMap> subcubeHierarchies); - - void putEvalCache(String key, Object value); - - Object getEvalCache(String key); - - Formula[] getFormulas(); - - Statement getStatement(); - - Connection getConnection(); - - void addFormulas(Formula[] toArray); - - Formula findFormula(String toString); - - Validator createValidator(); - - Collection getBaseCubes(); - - void addMeasuresMembers(OlapElement olapElement); - - void setBaseCubes(List baseCubeList); - - boolean nativeCrossJoinVirtualCube(); - - boolean shouldAlertForNonNative(FunctionDefinition fun); - - ExpressionCompiler createCompiler(); - - boolean hasCellProperty(String name); - - Parameter[] getParameters(); - - ResultStyle getResultStyle(); - - boolean ignoreInvalidMembers(); - - boolean isCellPropertyEmpty(); - - void setVirtualCubeNonNativeCrossJoin(); - - Object accept(QueryComponentVisitor visitor); - - Hierarchy[] getMdxHierarchiesOnAxis(AxisOrdinal forLogicalOrdinal); - - void setParameter(String string, Object object); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryAxis.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryAxis.java deleted file mode 100644 index 7ff42adafd..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryAxis.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.SubtotalVisibility; -import org.eclipse.daanse.olap.api.Validator; -import org.eclipse.daanse.olap.api.calc.Calc; -import org.eclipse.daanse.olap.api.calc.ResultStyle; -import org.eclipse.daanse.olap.api.calc.compiler.ExpressionCompiler; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.query.component.visit.QueryComponentVisitor; - -public non-sealed interface QueryAxis extends QueryComponent { - - String getAxisName(); - - AxisOrdinal getAxisOrdinal(); - - boolean isNonEmpty(); - - void setNonEmpty(boolean nonEmpty); - - Expression getSet(); - - void setSet(Expression set); - - Calc compile(ExpressionCompiler compiler, ResultStyle resultStyle); - - Object accept(QueryComponentVisitor visitor); - - Id[] getDimensionProperties(); - - SubtotalVisibility getSubtotalVisibility(); - - void validate(Validator validator); - - void addLevel(Level level); - - void resolve(Validator validator); - - boolean isOrdered(); - - void setOrdered(boolean ordered); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryComponent.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryComponent.java deleted file mode 100644 index ff5acebca7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/QueryComponent.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.io.PrintWriter; - -public sealed interface QueryComponent permits - CalculatedFormula, - CellProperty, - DimensionExpression, - DmvQuery, - DrillThrough, - Explain, - Formula, - HierarchyExpression, - Id, - LevelExpression, - Literal, - MemberProperty, - NamedSetExpression, - ParameterExpression, - Query, - QueryAxis, - Refresh, - ResolvedFunCall, - Subcube, - TransactionCommand, - UnresolvedFunCall, - Update, - MemberExpression, - WrapExpression, - UpdateClause, - SqlQuery { - - /** - * Returns an array of the object's children. Those which are not are ignored. - */ - Object[] getChildren(); - - /** - * Writes a string representation of this parse tree - * node to the given writer. - * - * @param pw writer - */ - void unparse(PrintWriter pw); - - /** - * Returns the plan that Mondrian intends to use to execute this query. - * - * @param pw Print writer - */ - void explain(PrintWriter pw); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Refresh.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Refresh.java deleted file mode 100644 index dbb5055e99..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Refresh.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface Refresh extends QueryComponent { - - String getCubeName(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ResolvedFunCall.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ResolvedFunCall.java deleted file mode 100644 index 13845addac..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/ResolvedFunCall.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.function.FunctionDefinition; -import org.eclipse.daanse.olap.api.type.Type; - -public non-sealed interface ResolvedFunCall extends QueryComponent, FunctionCall { - - int getArgCount(); - - FunctionDefinition getFunDef(); - - Expression getArg(int i); - - Expression[] getArgs(); - - Type getType(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SqlQuery.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SqlQuery.java deleted file mode 100644 index 4af75f8ce0..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SqlQuery.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2025 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena, Stefan Bischof - initial - * - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.sql.ResultSet; - -public non-sealed interface SqlQuery extends QueryComponent{ - - String getSql(); - - ResultSet execute(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/StringLiteral.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/StringLiteral.java deleted file mode 100644 index 87916f1ddd..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/StringLiteral.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface StringLiteral extends Literal { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Subcube.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Subcube.java deleted file mode 100644 index 7b4995b743..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Subcube.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.List; - -public non-sealed interface Subcube extends QueryComponent{ - - String getCubeName(); - - List getAxisExps(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SymbolLiteral.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SymbolLiteral.java deleted file mode 100644 index 53ef9dd4b7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/SymbolLiteral.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface SymbolLiteral extends Literal{ - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/TransactionCommand.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/TransactionCommand.java deleted file mode 100644 index edab34e349..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/TransactionCommand.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.olap.api.Command; - -public non-sealed interface TransactionCommand extends QueryComponent { - - Command getCommand(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UnresolvedFunCall.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UnresolvedFunCall.java deleted file mode 100644 index ed3c685755..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UnresolvedFunCall.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface UnresolvedFunCall extends QueryComponent,FunctionCall { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Update.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Update.java deleted file mode 100644 index 42de8b2e98..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/Update.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import java.util.List; - -public non-sealed interface Update extends QueryComponent { - - String getCubeName(); - - List getUpdateClauses(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UpdateClause.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UpdateClause.java deleted file mode 100644 index a3ea988bc7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/UpdateClause.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -import org.eclipse.daanse.mdx.model.api.select.Allocation; - -public non-sealed interface UpdateClause extends QueryComponent { - - Expression getTupleExp(); - - Expression getValueExp(); - - Allocation getAllocation(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/WrapExpression.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/WrapExpression.java deleted file mode 100644 index 39cd036932..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/WrapExpression.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component; - -public non-sealed interface WrapExpression extends QueryComponent { - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/package-info.java deleted file mode 100644 index 4f0382fa9f..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.query.component; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/QueryComponentVisitor.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/QueryComponentVisitor.java deleted file mode 100644 index 0b3dc73dd3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/QueryComponentVisitor.java +++ /dev/null @@ -1,145 +0,0 @@ - /* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.query.component.visit; - -import org.eclipse.daanse.olap.api.query.component.DimensionExpression; -import org.eclipse.daanse.olap.api.query.component.Formula; -import org.eclipse.daanse.olap.api.query.component.HierarchyExpression; -import org.eclipse.daanse.olap.api.query.component.Id; -import org.eclipse.daanse.olap.api.query.component.LevelExpression; -import org.eclipse.daanse.olap.api.query.component.Literal; -import org.eclipse.daanse.olap.api.query.component.MemberExpression; -import org.eclipse.daanse.olap.api.query.component.NamedSetExpression; -import org.eclipse.daanse.olap.api.query.component.ParameterExpression; -import org.eclipse.daanse.olap.api.query.component.Query; -import org.eclipse.daanse.olap.api.query.component.QueryAxis; -import org.eclipse.daanse.olap.api.query.component.ResolvedFunCall; -import org.eclipse.daanse.olap.api.query.component.UnresolvedFunCall; - -/** - * Visitor to an Tree of QueryComponents that must implement - * {@link Visitee}. - * - */ -public interface QueryComponentVisitor { - /** - * Indicates that {@link Visitee} must also call - * {@link QueryComponentVisitee#accept(QueryComponentVisitor)a} on existing - * children - */ - boolean visitChildren(); - - /** - * Visits a Query. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitQuery(Query query); - - /** - * Visits a QueryAxis. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitQueryAxis(QueryAxis queryAxis); - - /** - * Visits a Formula. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitFormula(Formula formula); - - /** - * Visits an UnresolvedFunCall. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - * - */ - Object visitUnresolvedFunCall(UnresolvedFunCall call); - - /** - * Visits a ResolvedFunCall. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitResolvedFunCall(ResolvedFunCall call); - - /** - * Visits an Id. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitId(Id id); - - /** - * Visits a Parameter. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitParameterExpression(ParameterExpression parameterExpr); - - /** - * Visits a DimensionExpr. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitDimensionExpression(DimensionExpression dimensionExpr); - - /** - * Visits a HierarchyExpr. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitHierarchyExpression(HierarchyExpression hierarchyExpr); - - /** - * Visits a LevelExpr. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitLevelExpression(LevelExpression levelExpr); - - /** - * Visits a MemberExpr. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitMemberExpression(MemberExpression memberExpr); - - /** - * Visits a NamedSetExpr. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitNamedSetExpression(NamedSetExpression namedSetExpr); - - /** - * Visits a Literal. - * - * {@link QueryComponentVisitor#accept(QueryComponentVisitor) } - */ - Object visitLiteral(Literal literal); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/Visitee.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/Visitee.java deleted file mode 100644 index 280852f551..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/Visitee.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.query.component.visit; - -/** - * - * Visitee equivalent of QueryComponentVisitor - * See also {@link QueryComponentVisitor} - */ -public interface Visitee { - - - public T accept(QueryComponentVisitor visitor); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/package-info.java deleted file mode 100644 index ebc80763c2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/component/visit/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.query.component.visit; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/package-info.java deleted file mode 100644 index b390fa5515..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/query/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.query; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/AllocationPolicy.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/AllocationPolicy.java deleted file mode 100644 index 420159343b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/AllocationPolicy.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to Julian Hyde under one or more contributor license - * agreements. See the NOTICE file distributed with this work for - * additional information regarding copyright ownership. - * - * Julian Hyde licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.result; - - - -/** - * Enumeration of the policies that can be used to modify the values of - * child cells when their parent cell is modified in a writeback operation. - * - * @see Cell#setValue - * - * @author jhyde - * @since Aug 22, 2006 - */ -public enum AllocationPolicy { - /** - * Every atomic cell that contributes to the updated cell will be - * assigned an equal value that is: - * - *
- * <atomic cell value> = - * <value> / Count(atomic cells contained in <tuple>) - *
- */ - EQUAL_ALLOCATION, - - /** - * Every atomic cell that contributes to the updated cell will be - * changed according to: - * - *
- * <atomic cell value> = <atomic cell value> + - * (<value> - <existing value>) / - * Count(atomic cells contained in <tuple>) - *
- */ - EQUAL_INCREMENT, - - /** - * Every atomic cell that contributes to the updated cell will be - * assigned an equal value that is: - * - *
- * <atomic cell value> = - * <value> * <weight value expression> - *
- * - *

Takes an optional argument, {@code weight_value_expression}. - * If {@code weight_value_expression} is not provided, the following - * expression is assigned to it by default: - * - *

- * <weight value expression> = - * <atomic cell value> / <existing value> - *
- * - *

The value of {@code weight value expression} should be expressed - * as a value between 0 and 1. This value specifies the ratio of the - * allocated value you want to assign to the atomic cells that are - * affected by the allocation. It is the client application programmer's - * responsibilffity to create expressions whose rollup aggregate values - * will equal the allocated value of the expression. - */ - WEIGHTED_ALLOCATION, - - /** - * Every atomic cell that contributes to the updated cell will be - * changed according to: - * - *

- * <atomic cell value> = <atomic cell value> + - * (<value> - <existing value>) * - * <weight value expression> - *
- * - *

Takes an optional argument, {@code weight_value_expression}. - * If {@code weight_value_expression} is not provided, the following - * expression is assigned to it by default: - * - *

- * <weight value expression> = - * <atomic cell value> / <existing value> - *
- * - *

The value of {@code weight value expression} should be expressed - * as a value between 0 and 1. This value specifies the ratio of the - * allocated value you want to assign to the atomic cells that are - * affected by the allocation. It is the client application programmer's - * responsibility to create expressions whose rollup aggregate values - * will equal the allocated value of the expression. - */ - WEIGHTED_INCREMENT, -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Axis.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Axis.java deleted file mode 100644 index c7497f0cce..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Axis.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.calc.todo.TupleList; - -/** - * A Axis is a component of a {@link Result}. - * It contains a list of {@link Position}s. - * - * @author jhyde - * @since 6 August, 2001 - */ -public interface Axis { - List getPositions(); - - TupleList getTupleList(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Cell.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Cell.java deleted file mode 100644 index ce732318a9..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Cell.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API -* - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.ISqlStatement; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.element.OlapElement; -import org.slf4j.Logger; - - -/** - * A Cell is an item in the grid of a {@link Result}. It is - * returned by {@link Result#getCell}. - * - * @author jhyde - * @since 6 August, 2001 - */ -public interface Cell { - /** - * Returns the coordinates of this Cell in its {@link Result}. - * - * @return Coordinates of this Cell - */ - List getCoordinateList(); - - /** - * Returns the cell's raw value. This is useful for sending to further data - * processing, such as plotting a chart. - * - *

The value is never null. It may have various types:

    - *
  • if the cell is null, the value is {@link Util#nullValue};
  • - *
  • if the cell contains an error, the value is an instance of - * {@link Throwable};
  • - *
  • otherwise, the type of this value depends upon the type of - * measure: possible types include {@link java.math.BigDecimal}, - * {@link Double}, {@link Integer} and {@link String}.
  • - *
- * - * @post return != null - * @post (return instanceof Throwable) == isError() - * @post (return instanceof Util.NullCellValue) == isNull() - */ - Object getValue(); - - /** - * Return the cached formatted string, that survives an aggregate cache - * clear. - */ - String getCachedFormatString(); - - /** - * Returns the cell's value formatted according to the current format - * string, and locale-specific settings such as currency symbol. The - * current format string may itself be derived via an expression. For more - * information about format strings, see {@link mondrian.util.Format}. - */ - String getFormattedValue(); - - /** - * Returns whether the cell's value is null. - */ - boolean isNull(); - - /** - * Returns whether the cell's calculation returned an error. - */ - boolean isError(); - - /** - * Returns a SQL query that, when executed, returns drill through data - * for this Cell. - * - *

If the parameter {@code extendedContext} is true, then the query will - * include all the levels (i.e. columns) of non-constraining members - * (i.e. members which are at the "All" level). - * - *

If the parameter {@code extendedContext} is false, the query will - * exclude the levels (coulmns) of non-constraining members. - * - *

The result is null if the cell is based upon a calculated member. - */ - String getDrillThroughSQL(boolean extendedContext); - - /** - * Returns true if drill through is possible for this Cell. - * Returns false if the Cell is based on a calculated measure. - * - * @return Whether can drill through on this cell - */ - boolean canDrillThrough(); - - /** - * Returns the number of fact table rows which contributed to this Cell. - */ - int getDrillThroughCount(); - - /** - * Returns the value of a property. - * - * @param propertyName Case-sensitive property name - * @return Value of property - */ - Object getPropertyValue(String propertyName); - - /** - * Returns the context member for a particular dimension. - * - * The member is defined as follows (note that there is always a - * member):

    - * - *
  • If the dimension appears on one of the visible axes, the context - * member is simply the member on the current row or column. - * - *
  • If the dimension appears in the slicer, the context member is the - * member of that dimension in the slier. - * - *
  • Otherwise, the context member is the default member of that - * dimension (usually the 'all' member).
- * - * @param hierarchy Hierarchy - * @return current member of given hierarchy - */ - Member getContextMember(Hierarchy hierarchy); - - /** - * Helper method to implement {@link org.olap4j.Cell#setValue}. - * - * @param scenario Scenario - * @param newValue New value - * @param allocationPolicy Allocation policy - * @param allocationArgs Arguments for allocation policy - */ - void setValue( - Scenario scenario, - Object newValue, - AllocationPolicy allocationPolicy, - Object... allocationArgs); - - ISqlStatement drillThroughInternal(int maxRowCount, int firstRowOrdinal, List fields, - boolean extendedContext, Logger logger); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSet.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSet.java deleted file mode 100644 index 8c5abd8a0b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSet.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.Statement; - -public interface CellSet { - - CellSetMetaData getMetaData(); - - List getAxes(); - - CellSetAxis getFilterAxis(); - - Cell getCell(List pos); - - Statement getStatement(); - - void close(); - - void execute(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxis.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxis.java deleted file mode 100644 index a7f033414d..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxis.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import java.util.List; -import java.util.ListIterator; - -public interface CellSetAxis { - IAxis getAxisOrdinal(); - - CellSet getCellSet(); - - CellSetAxisMetaData getAxisMetaData(); - - List getPositions(); - - int getPositionCount(); - - ListIterator iterator(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxisMetaData.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxisMetaData.java deleted file mode 100644 index b8675d3bd2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetAxisMetaData.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Hierarchy; - -public interface CellSetAxisMetaData { - IAxis getAxisOrdinal(); - - List getHierarchies(); - - List getProperties(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetMetaData.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetMetaData.java deleted file mode 100644 index c5a3bf896c..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/CellSetMetaData.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Cube; - -public interface CellSetMetaData { - List getCellProperties(); - - /** - * Returns the Cube which was referenced in this statement. - * - * @return cube referenced in this statement - */ - Cube getCube(); - - /** - * Returns a list of CellSetAxisMetaData describing each result axis. - * - * @return list of metadata describing each result axis - */ - List getAxesMetaData(); - - /** - * Returns a CellSetAxisMetaData describing the filter axis. Never returns - * null; if the MDX statement contains no WHERE clause, the description of - * the filter contains no hierarchies. - * - * @return metadata describing filter axis - */ - CellSetAxisMetaData getFilterAxisMetaData(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Datatype.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Datatype.java deleted file mode 100644 index 9a44d04ef1..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Datatype.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -public enum Datatype { - // The following values exactly match VARENUM - // in Automation and may be used in VARIANT. - - INTEGER(3, "DBTYPE_I4", "A four-byte, signed integer: INTEGER"), - - DOUBLE(5, "DBTYPE_R8", "A double-precision floating-point value: Double"), - - CURRENCY( - 6, - "DBTYPE_CY", - "A currency value: LARGE_INTEGER, Currency is a fixed-point number with " - + "four digits to the right of the decimal point. It is stored in an " - + "eight-byte signed integer, scaled by 10,000."), - - BOOLEAN( - 11, - "DBTYPE_BOOL", - "A Boolean value stored in the same way as in Automation: VARIANT_BOOL; " - + "0 means false and ~0 (bitwise, the value is not 0; that is, all bits " - + "are set to 1) means true."), - - /** - * Used by SQL Server for value. - */ - VARIANT(12, "DBTYPE_VARIANT", "An Automation VARIANT"), - - /** - * Used by SQL Server for font size. - */ - UNSIGNED_SHORT(18, "DBTYPE_UI2", "A two-byte, unsigned integer"), - - /** - * Used by SQL Server for colors, font flags and cell ordinal. - */ - UNSIGNED_INTEGER(19, "DBTYPE_UI4", "A four-byte, unsigned integer"), - - // The following values exactly match VARENUM - // in Automation but cannot be used in VARIANT. - - LARGE_INTEGER( - 20, - "DBTYPE_I8", - "An eight-byte, signed integer: LARGE_INTEGER"), - - // The following values are not in VARENUM in OLE. - - STRING( - 130, - "DBTYPE_WSTR", - "A null-terminated Unicode character string: wchar_t[length]; If " - + "DBTYPE_WSTR is used by itself, the number of bytes allocated " - + "for the string, including the null-termination character, is " - + "specified by cbMaxLen in the DBBINDING structure. If " - + "DBTYPE_WSTR is combined with DBTYPE_BYREF, the number of bytes " - + "allocated for the string, including the null-termination character, " - + "is at least the length of the string plus two. In either case, the " - + "actual length of the string is determined from the bound length " - + "value. The maximum length of the string is the number of allocated " - + "bytes divided by sizeof(wchar_t) and truncated to the nearest " - + "integer."), - - /** - * Used by SAP BW. Represents a Character - */ - ACCP(1000, "ACCP", "SAP BW Character"), - - /** - * Used by SAP BW. Represents a CHAR - */ - CHAR(1001, "CHAR", "SAP BW CHAR"), - - /** - * Used by SAP BW. Represents a CHAR - */ - CUKY(1002, "CUKY", "SAP BW CHAR"), - - /** - * Used by SAP BW. Represents a Currency - Packed decimal, Integer - */ - CURR(1003, "CURR", "SAP BW Currency - Packed decimal, Integer"), - - /** - * Used by SAP BW. Represents a Date - */ - DATS(1004, "DATS", "SAP BW Date"), - - /** - * Used by SAP BW. Represents a Decimal - */ - DEC(1005, "DEC", "SAP BW Decimal"), - - /** - * Used by SAP BW. Represents a Point - */ - FLTP(1006, "FLTP", "SAP BW Floating Point"), - - /** - * Used by SAP BW. Represents a Byte - */ - INT1(1007, "INT1", "SAP BW Byte"), - - /** - * Used by SAP BW. Represents a Small integer - */ - INT2(1008, "INT2", "SAP BW Small integer"), - - /** - * Used by SAP BW. Represents an Integer - */ - INT4(1009, "INT4", "SAP BW Integer"), - - /** - * Used by SAP BW. Represents a Text - */ - LCHR(1010, "LCHR", "SAP BW Text"), - - /** - * Used by SAP BW. Represents a Numeric - */ - NUMC(1011, "NUMC", "SAP BW Numeric"), - - /** - * Used by SAP BW. Represents a Tiny Int - */ - PREC(1012, "PREC", "SAP BW Tiny Int"), - - /** - * Used by SAP BW. Represents a QUAN Integer - */ - QUAN(1013, "QUAN", "SAP BW QUAN Integer"), - - /** - * Used by SAP BW. Represents a String - */ - SSTR(1014, "SSTR", "SAP BW String"), - - /** - * Used by SAP BW. Represents a Long String - */ - STRG(1015, "STRG", "SAP BW Long String"), - - /** - * Used by SAP BW. Represents a Time - */ - TIMS(1016, "TIMS", "SAP BW Time"), - - /** - * Used by SAP BW. Represents a Varchar - */ - VARC(1017, "VARC", "SAP BW Varchar"), - - /** - * Used by SAP BW. Represents a Long String for Units - */ - UNIT(1018, "UNIT", "SAP BW Long String for Units"); - - private final int xmlaOrdinal; - private String dbTypeIndicator; - private String description; - - Datatype( - int xmlaOrdinal, - String dbTypeIndicator, - String description) - { - this.xmlaOrdinal = xmlaOrdinal; - this.dbTypeIndicator = dbTypeIndicator; - this.description = description; - } - - /** - * The internal name of this Datatype. - * Might not be unique across Datatype instances. - */ - public String xmlaName() { - return dbTypeIndicator; - } - - /** - * Human readable description of a Datatype instance. - */ - public String getDescription() { - return description; - } - - /** - * Unique identifier of a Datatype instance. - */ - public int xmlaOrdinal() { - return xmlaOrdinal; - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IAxis.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IAxis.java deleted file mode 100644 index eec6bea968..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IAxis.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import java.util.Locale; - -public interface IAxis { - - /** - * Abbreviation for {@link IAxis.Standard#FILTER}. - */ - IAxis.Standard FILTER = IAxis.Standard.FILTER; - - /** - * Abbreviation for {@link IAxis.Standard#COLUMNS}. - */ - IAxis.Standard COLUMNS = IAxis.Standard.COLUMNS; - - /** - * Abbreviation for {@link IAxis.Standard#ROWS}. - */ - IAxis.Standard ROWS = IAxis.Standard.ROWS; - - /** - * Abbreviation for {@link IAxis.Standard#PAGES}. - */ - IAxis.Standard PAGES = IAxis.Standard.PAGES; - - /** - * Abbreviation for {@link IAxis.Standard#CHAPTERS}. - */ - IAxis.Standard SECTIONS = IAxis.Standard.SECTIONS; - - /** - * Abbreviation for {@link IAxis.Standard#FILTER}. - */ - IAxis.Standard CHAPTERS = IAxis.Standard.CHAPTERS; - - /** - * Returns the name of this axis, e.g. "COLUMNS", "FILTER", "AXIS(17)". - * - * @return Name of the axis - */ - String name(); - - /** - * Returns whether this is the filter (slicer) axis. - * - * @return whether this is the filter axis - */ - boolean isFilter(); - - - /** - * Returns the ordinal which is to be used for retrieving this axis from - * the {@link org.olap4j.CellSet#getAxes()}, or retrieving its - * coordinate from {@link Cell#getCoordinateList()}. - * - *

For example: - *

    - *
  • -1 {@link IAxis.Standard#FILTER FILTER}
  • - *
  • 0 {@link IAxis.Standard#COLUMNS COLUMNS}
  • - *
  • 1 {@link IAxis.Standard#ROWS ROWS}
  • - *
  • 2 {@link IAxis.Standard#PAGES PAGES}
  • - *
  • 3 {@link IAxis.Standard#CHAPTERS CHAPTERS}
  • - *
  • 4 {@link IAxis.Standard#SECTIONS SECTIONS}
  • - *
  • 5 {@link IAxis.Standard#SECTIONS SECTIONS}
  • - *
  • 6 AXES(6)
  • - *
  • 123 AXES(123)
  • - *
- * - * @return ordinal of this axis - */ - int axisOrdinal(); - - /** - * Returns localized name for this Axis. - * - *

Examples: "FILTER", "ROWS", "COLUMNS", "AXIS(10)". - * - * @param locale Locale for which to give the name - * @return localized name for this Axis - */ - String getCaption(Locale locale); - - /** - * Enumeration of standard, named axes descriptors. - */ - public enum Standard implements IAxis { - /** - * Filter axis, also known as the slicer axis, and represented by the - * WHERE clause of an MDX query. - */ - FILTER, - - /** COLUMNS axis, also known as X axis and AXIS(0). */ - COLUMNS, - - /** ROWS axis, also known as Y axis and AXIS(1). */ - ROWS, - - /** PAGES axis, also known as AXIS(2). */ - PAGES, - - /** CHAPTERS axis, also known as AXIS(3). */ - CHAPTERS, - - /** SECTIONS axis, also known as AXIS(4). */ - SECTIONS; - - public int axisOrdinal() { - return ordinal() - 1; - } - - public boolean isFilter() { - return this == FILTER; - } - - public String getCaption(Locale locale) { - // TODO: localize - return name(); - } - } - - /** - * Container class for various Axis factory methods. - */ - class Factory { - private static final IAxis.Standard[] STANDARD_VALUES = IAxis.Standard.values(); - - /** - * Returns the axis with a given ordinal. - * - *

For example, {@code forOrdinal(0)} returns the COLUMNS axis; - * {@code forOrdinal(-1)} returns the SLICER axis; - * {@code forOrdinal(100)} returns AXIS(100). - * - * @param ordinal Axis ordinal - * @return Axis whose ordinal is as given - */ - public static IAxis forOrdinal(final int ordinal) { - if (ordinal < -1) { - throw new IllegalArgumentException( - "Axis ordinal must be -1 or higher"); - } - if (ordinal + 1 < STANDARD_VALUES.length) { - return STANDARD_VALUES[ordinal + 1]; - } - return new IAxis() { - public String toString() { - return name(); - } - - public String name() { - return "AXIS(" + ordinal + ")"; - } - - public boolean isFilter() { - return false; - } - - public int axisOrdinal() { - return ordinal; - } - - public String getCaption(Locale locale) { - // TODO: localize - return name(); - } - }; - } - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IMondrianOlap4jProperty.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IMondrianOlap4jProperty.java deleted file mode 100644 index 1d75aa6054..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/IMondrianOlap4jProperty.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2024 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ -package org.eclipse.daanse.olap.api.result; - -import org.eclipse.daanse.olap.api.element.Level; - -public interface IMondrianOlap4jProperty extends Property{ - /** - * @return {@mondrian.olap.Level} - */ - Level getLevel(); - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Position.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Position.java deleted file mode 100644 index 2fd4c60890..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Position.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.result; - -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Member; - -/** - * A Position is an item on an {@link Axis}. It contains - * one or more {@link Member}s. - * - * @author jhyde - * @since 6 August, 2001 - */ -public interface Position extends List { - - List getMembers(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Property.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Property.java deleted file mode 100644 index 01d810a0c6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Property.java +++ /dev/null @@ -1,709 +0,0 @@ -/* - * Licensed to Julian Hyde under one or more contributor license - * agreements. See the NOTICE file distributed with this work for - * additional information regarding copyright ownership. - * - * Julian Hyde licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.result; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Set; - -public interface Property { - - String getName(); - - Datatype getDatatype(); - - Set getType(); - - String getCaption(); - - - - /** - * Enumeration of aspects of the type of a Property. In particular, whether - * it belongs to a member or a cell. - * - *

The values are as specified by XMLA for the PROPERTY_TYPE attribute - * of the MDSCHEMA_PROPERTIES data set. - * For example, XMLA specifies that the value 9 (0x1 | 0x8) means that a - * property belongs to a member and is a binary large object (BLOB). - * In this case, {@link Property#getType} will return the {@link Set} - * {{@link #MEMBER}, {@link #BLOB}}. - */ - enum TypeFlag { - /** - * Identifies a property of a member. This property can be used in the - * DIMENSION PROPERTIES clause of the SELECT statement. - */ - MEMBER(1), - - /** - * Identifies a property of a cell. This property can be used in the - * CELL PROPERTIES clause that occurs at the end of the SELECT - * statement. - */ - CELL(2), - - /** - * Identifies an internal property. - */ - SYSTEM(4), - - /** - * Identifies a property which contains a binary large object (blob). - */ - BLOB(8); - - private final int xmlaOrdinal; - - public static final Set CELL_TYPE_FLAG = - Collections.unmodifiableSet( - EnumSet.of(Property.TypeFlag.CELL)); - public static final Set MEMBER_TYPE_FLAG = - Collections.unmodifiableSet( - EnumSet.of(Property.TypeFlag.MEMBER)); - - - - private TypeFlag(int xmlaOrdinal) { - this.xmlaOrdinal = xmlaOrdinal; - } - - public String xmlaName() { - return "MDPROP_" + name(); - } - - public String getDescription() { - return null; - } - - public int xmlaOrdinal() { - return xmlaOrdinal; - } - - } - - - /** - * Enumeration of the system properties available for every . - * - *

The following properties are mandatory for members:

    - *
  • {@link #CATALOG_NAME}
  • - *
  • {@link #SCHEMA_NAME}
  • - *
  • {@link #CUBE_NAME}
  • - *
  • {@link #DIMENSION_UNIQUE_NAME}
  • - *
  • {@link #HIERARCHY_UNIQUE_NAME}
  • - *
  • {@link #LEVEL_UNIQUE_NAME}
  • - *
  • {@link #LEVEL_NUMBER}
  • - *
  • {@link #MEMBER_UNIQUE_NAME}
  • - *
  • {@link #MEMBER_NAME}
  • - *
  • {@link #MEMBER_TYPE}
  • - *
  • {@link #MEMBER_GUID}
  • - *
  • {@link #MEMBER_CAPTION}
  • - *
  • {@link #MEMBER_ORDINAL}
  • - *
  • {@link #CHILDREN_CARDINALITY}
  • - *
  • {@link #PARENT_LEVEL}
  • - *
  • {@link #PARENT_UNIQUE_NAME}
  • - *
  • {@link #PARENT_COUNT}
  • - *
  • {@link #DESCRIPTION}
  • - *
- */ - enum StandardMemberProperty implements Property { - - /** - * Definition of the property which - * holds the name of the current catalog. - */ - CATALOG_NAME( - Datatype.STRING, - false, - null, - "Optional. The name of the catalog to which this member belongs. " - + "NULL if the provider does not support catalogs."), - - /** - * Definition of the property which - * holds the name of the current schema. - */ - SCHEMA_NAME( - Datatype.STRING, - false, - null, - "Optional. The name of the schema to which this member belongs. " - + "NULL if the provider does not support schemas."), - - /** - * Definition of the property which - * holds the name of the current cube. - */ - CUBE_NAME( - Datatype.STRING, - false, - null, "Required. Name of the cube to which this member belongs."), - - /** - * Definition of the property which - * holds the unique name of the current dimension. - */ - DIMENSION_UNIQUE_NAME( - Datatype.STRING, - false, - null, - "Required. Unique name of the dimension to which this member " - + "belongs. For providers that generate unique names by " - + "qualification, each component of this name is delimited."), - - /** - * Definition of the property which - * holds the unique name of the current hierarchy. - */ - HIERARCHY_UNIQUE_NAME( - Datatype.STRING, - false, - null, - "Required. Unique name of the hierarchy. If the member belongs to " - + "more than one hierarchy, there is one row for each hierarchy " - + "to which it belongs. For providers that generate unique names " - + "by qualification, each component of this name is delimited."), - - /** - * Definition of the property which - * holds the unique name of the current level. - */ - LEVEL_UNIQUE_NAME( - Datatype.STRING, - false, - null, - "Required. Unique name of the level to which the member belongs. " - + "For providers that generate unique names by qualification, " - + "each component of this name is delimited."), - - /** - * Definition of the property which - * holds the ordinal of the current level. - */ - LEVEL_NUMBER( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Required. The distance of the member from the root of the " - + "hierarchy. The root level is zero."), - - /** - * Definition of the property which - * holds the ordinal of the current member. - */ - MEMBER_ORDINAL( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Required. Ordinal number of the member. Sort rank of the member " - + "when members of this dimension are sorted in their natural " - + "sort order. If providers do not have the concept of natural " - + "ordering, this should be the rank when sorted by MEMBER_NAME."), - - /** - * Definition of the property which - * holds the name of the current member. - */ - MEMBER_NAME( - Datatype.STRING, - false, - null, - "Required. Name of the member."), - - /** - * Definition of the property which - * holds the unique name of the current member. - */ - MEMBER_UNIQUE_NAME( - Datatype.STRING, - false, - null, - "Required. Unique name of the member. For providers that generate " - + "unique names by qualification, each component of this name is " - + "delimited."), - - /** - * Definition of the property which - * holds the type of the member. - */ - MEMBER_TYPE( - Datatype.STRING, - false, - null, - "Required. Type of the member. Can be one of the following values: " - + "MDMEMBER_Datatype.TYPE_REGULAR, MDMEMBER_Datatype.TYPE_ALL, " - + "MDMEMBER_Datatype.TYPE_FORMULA, MDMEMBER_Datatype.TYPE_MEASURE, " - + "MDMEMBER_Datatype.TYPE_UNKNOWN. MDMEMBER_Datatype.TYPE_FORMULA " - + "takes precedence over MDMEMBER_Datatype.TYPE_MEASURE. " - + "Therefore, if there is a formula (calculated) member on the " - + "Measures dimension, it is listed as " - + "MDMEMBER_Datatype.TYPE_FORMULA."), - - /** - * Definition of the property which - * holds the GUID of the member - */ - MEMBER_GUID( - Datatype.STRING, - false, - null, - "Optional. Member GUID. NULL if no GUID exists."), - - /** - * Definition of the property which - * holds the label or caption associated with the member, or the - * member's name if no caption is defined. - */ - MEMBER_CAPTION( - Datatype.STRING, - false, - null, - "Required. A label or caption associated with the member. Used " - + "primarily for display purposes. If a caption does not exist, " - + "MEMBER_NAME is returned."), - - /** - * Definition of the property which holds the - * number of children this member has. - */ - CHILDREN_CARDINALITY( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Required. Number of children that the member has. This can be an " - + "estimate, so consumers should not rely on this to be the exact " - + "count. Providers should return the best estimate possible."), - - /** - * Definition of the property which holds the - * distance from the root of the hierarchy of this member's parent. - */ - PARENT_LEVEL( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Required. The distance of the member's parent from the root level " - + "of the hierarchy. The root level is zero."), - - /** - * Definition of the property which holds the - * Name of the current catalog. - */ - PARENT_UNIQUE_NAME( - Datatype.STRING, - false, - null, - "Required. Unique name of the member's parent. NULL is returned " - + "for any members at the root level. For providers that generate " - + "unique names by qualification, each component of this name is " - + "delimited."), - - /** - * Definition of the property which holds the - * number of parents that this member has. Generally 1, or 0 - * for root members. - */ - PARENT_COUNT( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Required. Number of parents that this member has."), - - /** - * Definition of the property which holds the - * description of this member. - */ - DESCRIPTION( - Datatype.STRING, - false, - null, - "Optional. A human-readable description of the member."), - - /** - * Definition of the internal property which holds the - * name of the system property which determines whether to show a member - * (especially a measure or calculated member) in a user interface such - * as JPivot. - */ - $visible( - Datatype.BOOLEAN, - true, - null, - null), - - /** - * Definition of the internal property which holds the - * value of the member key in the original data type. MEMBER_KEY is for - * backward-compatibility. MEMBER_KEY has the same value as KEY0 for - * non-composite keys, and MEMBER_KEY property is null for composite - * keys. - */ - MEMBER_KEY( - Datatype.VARIANT, - true, - null, - "Optional. The value of the member key. Null for composite keys."), - - /** - * Definition of the boolean property that indicates whether - * a member is a placeholder member for an empty position in a - * dimension hierarchy. - */ - IS_PLACEHOLDERMEMBER( - Datatype.BOOLEAN, - false, - null, - "Required. Whether the member is a placeholder member for an empty " - + "position in a dimension hierarchy."), - - /** - * Definition of the property that indicates whether the member is a - * data member. - */ - IS_DATAMEMBER( - Datatype.BOOLEAN, - false, - null, - "Required. whether the member is a data member"), - - /** - * Definition of the property which - * holds the level depth of a member. - * - *

Caution: Level depth of members in parent-child hierarchy isn't - * from their levels. It's calculated from the underlying data - * dynamically. - */ - DEPTH( - Datatype.UNSIGNED_INTEGER, - true, - null, - "The level depth of a member"), - - /** - * Definition of the property which - * holds the DISPLAY_INFO required by XML/A. - * - *

Caution: This property's value is calculated based on a specified - * MDX query, so its value is dynamic at runtime. - */ - DISPLAY_INFO( - Datatype.UNSIGNED_INTEGER, - false, - null, - "Display instruction of a member for XML/A"), - - /** - * Definition of the property which - * holds the value of a cell. Is usually numeric (since most measures - * are numeric) but is occasionally another type. - */ - VALUE( - Datatype.VARIANT, - false, - null, - "The unformatted value of the cell."); - - private final Datatype type; - private final String description; - private final boolean internal; - - private StandardMemberProperty( - Datatype type, - boolean internal, - Class enumClazz, - String description) - { -// assert ordinal == ordinal(); - this.internal = internal; - this.type = type; - this.description = description; - } - - public String getName() { - return name(); - } - - public String getUniqueName() { - return name(); - } - - public String getCaption() { - // NOTE: This caption will be the same in all locales, since - // StandardMemberProperty has no way of deducing the current - // connection. Providers that wish to localize the caption of - // built-in properties should create a wrapper around - // StandardMemberProperty that is aware of the current connection or - // locale. - return name(); - } - - public String getDescription() { - // NOTE: This description will be the same in all locales, since - // StandardMemberProperty has no way of deducing the current - // connection. Providers that wish to localize the description of - // built-in properties should create a wrapper around - // StandardCellProperty that is aware of the current connection or - // locale. - return description; - } - - public Datatype getDatatype() { - return type; - } - - public Set getType() { - return TypeFlag.MEMBER_TYPE_FLAG; - } - - public boolean isInternal() { - return internal; - } - - public boolean isVisible() { - return !internal; - } - } - - - /** - * Enumeration of the system properties available for every - * {@link org.olap4j.Cell}. - * - *

The following propertiess are mandatory for cells:

    - *
  • {@link #BACK_COLOR}
  • - *
  • {@link #CELL_EVALUATION_LIST}
  • - *
  • {@link #CELL_ORDINAL}
  • - *
  • {@link #FORE_COLOR}
  • - *
  • {@link #FONT_NAME}
  • - *
  • {@link #FONT_SIZE}
  • - *
  • {@link #FONT_FLAGS}
  • - *
  • {@link #FORMAT_STRING}
  • - *
  • {@link #FORMATTED_VALUE}
  • - *
  • {@link #NON_EMPTY_BEHAVIOR}
  • - *
  • {@link #SOLVE_ORDER}
  • - *
  • {@link #VALUE}
  • - *
- */ - enum StandardCellProperty implements Property { - BACK_COLOR( - Datatype.STRING, - false, - "The background color for displaying the VALUE or FORMATTED_VALUE " - + "property. For more information, see FORE_COLOR and BACK_COLOR " - + "Contents."), - - CELL_EVALUATION_LIST( - Datatype.STRING, - false, - "The semicolon-delimited list of evaluated formulas applicable to " - + "the cell, in order from lowest to highest solve order. For more " - + "information about solve order, see Understanding Pass Order and " - + "Solve Order"), - - CELL_ORDINAL( - Datatype.UNSIGNED_INTEGER, - false, - "The ordinal number of the cell in the dataset."), - - FORE_COLOR( - Datatype.STRING, - false, - "The foreground color for displaying the VALUE or FORMATTED_VALUE " - + "property. For more information, see FORE_COLOR and BACK_COLOR " - + "Contents."), - - FONT_NAME( - Datatype.STRING, - false, - "The font to be used to display the VALUE or FORMATTED_VALUE " - + "property."), - - FONT_SIZE( - Datatype.STRING, - false, - "Font size to be used to display the VALUE or FORMATTED_VALUE " - + "property."), - - FONT_FLAGS( - Datatype.UNSIGNED_INTEGER, - false, - "The bitmask detailing effects on the font. The value is the " - + "result of a bitwise OR operation of one or more of the " - + "following constants: MDFF_BOLD = 1, MDFF_ITALIC = 2, " - + "MDFF_UNDERLINE = 4, MDFF_STRIKEOUT = 8. For example, the value " - + "5 represents the combination of bold (MDFF_BOLD) and underline " - + "(MDFF_UNDERLINE) font effects."), - - /** - * Definition of the property which - * holds the formatted value of a cell. - */ - FORMATTED_VALUE( - Datatype.STRING, - false, - "The character string that represents a formatted display of the " - + "VALUE property."), - - /** - * Definition of the property which - * holds the format string used to format cell values. - */ - FORMAT_STRING( - Datatype.STRING, - false, - "The format string used to create the FORMATTED_VALUE property " - + "value. For more information, see FORMAT_STRING Contents."), - - NON_EMPTY_BEHAVIOR( - Datatype.STRING, - false, - "The measure used to determine the behavior of calculated members " - + "when resolving empty cells."), - - /** - * Definition of the property which - * determines the solve order of a calculated member with respect to - * other calculated members. - */ - SOLVE_ORDER( - Datatype.INTEGER, - false, - "The solve order of the cell."), - - /** - * Definition of the property which - * holds the value of a cell. Is usually numeric (since most measures - * are numeric) but is occasionally another type. - */ - VALUE( - Datatype.VARIANT, - false, - "The unformatted value of the cell."), - - /** - * Definition of the property which - * holds the datatype of a cell. Valid values are "String", - * "Numeric", "Integer". The property's value derives from the - * "datatype" attribute of the "Measure" element; if the - * datatype attribute is not specified, the datatype is - * "Numeric" by default, except measures whose aggregator is - * "Count", whose datatype is "Integer". - */ - DATATYPE( - Datatype.STRING, - false, - "The datatype of the cell."), - - LANGUAGE( - Datatype.UNSIGNED_INTEGER, - false, - "The locale where the FORMAT_STRING will be applied. LANGUAGE is " - + "usually used for currency conversion."), - - ACTION_TYPE( - Datatype.INT4, - false, - "A bitmask that indicates which types of actions exist on the " - + "cell."), - - UPDATEABLE( - Datatype.UNSIGNED_INTEGER, - false, - "A value that indicates whether the cell can be updated."); - - /** - * The datatype of the property. - */ - private final Datatype type; - private final String description; - private final boolean internal; - - private StandardCellProperty( - Datatype type, - boolean internal, - String description) - { - this.type = type; - this.internal = internal; - this.description = description; - } - - public Datatype getDatatype() { - return type; - } - - public Set getType() { - return TypeFlag.CELL_TYPE_FLAG; - } - - public String getName() { - return name(); - } - - public String getUniqueName() { - return name(); - } - - public String getCaption() { - // NOTE: This caption will be the same in all locales, since - // StandardCellProperty has no way of deducing the current - // connection. Providers that wish to localize the caption of - // built-in properties should create a wrapper around - // StandardCellProperty that is aware of the current connection or - // locale. - return name(); - } - - public String getDescription() { - // NOTE: This description will be the same in all locales, since - // StandardCellProperty has no way of deducing the current - // connection. Providers that wish to localize the description of - // built-in properties should create a wrapper around - // StandardCellProperty that is aware of the current connection or - // locale. - return description; - } - - public boolean isInternal() { - return internal; - } - - public boolean isVisible() { - return !internal; - } - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Result.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Result.java deleted file mode 100644 index ad78037ee2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Result.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2001-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara and others - * All Rights Reserved. - * - * Contributors: - * SmartCity Jena - refactor, clean API - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.result; - -import java.io.PrintWriter; - -import org.eclipse.daanse.olap.api.Connection; -import org.eclipse.daanse.olap.api.Execution; -import org.eclipse.daanse.olap.api.element.Member; -import org.eclipse.daanse.olap.api.query.component.Query; - -/** - * A Result is the result of running an MDX query. See {@link - * Connection#execute}. - * - * @author jhyde - * @since 6 August, 2001 - */ -public interface Result { - /** Returns the query which generated this result. */ - Query getQuery(); - /** Returns the non-slicer axes. */ - Axis[] getAxes(); - /** Returns the slicer axis. */ - Axis getSlicerAxis(); - /** Returns the cell at a given set of coordinates. For example, in a result - * with 4 columns and 6 rows, the top-left cell has coordinates [0, 0], - * and the bottom-right cell has coordinates [3, 5]. */ - Cell getCell(int[] pos); - void print(PrintWriter pw); - void close(); - - Execution getExecution(); - - Member[] getCellMembers(int[] coordinates); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Scenario.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Scenario.java deleted file mode 100644 index d20ec63398..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/Scenario.java +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2023 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.result; - -import java.util.List; -import java.util.Map; - -import org.eclipse.daanse.olap.api.Connection; -import org.eclipse.daanse.olap.api.DataTypeJdbc; -import org.eclipse.daanse.olap.api.element.Member; - -/** - * Context for a set of writeback operations. - * - *

An analyst performing a what-if analysis would first create a scenario, - * or open an existing scenario, then modify a sequence of cell values. - * - *

Some OLAP engines allow scenarios to be saved (to a file, or perhaps to - * the database) and restored in a future session. - * - *

Multiple scenarios may be open at the same time, by different users of - * the OLAP engine. - * - * @see AllocationPolicy - * - * @author jhyde - * @since 24 April, 2009 - */ -public interface Scenario { - /** - * Returns the unique identifier of this Scenario. - * - *

The format of the string returned is implementation defined. Client - * applications must not make any assumptions about the structure or - * contents of such strings. - * - * @return Unique identifier of this Scenario. - */ - String getId(); - - List getWritebackCells(); - - void setCellValue( - Connection connection, - List members, - double newValue, - double currentValue, - AllocationPolicy allocationPolicy, - Object[] allocationArgs); - - List>> getSessionValues(); - - void clear(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/WritebackCell.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/WritebackCell.java deleted file mode 100644 index 02160f04f5..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/WritebackCell.java +++ /dev/null @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2025 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -* Stefan Bischof (bipolis.org) - initial -*/ -package org.eclipse.daanse.olap.api.result; - -import org.eclipse.daanse.olap.api.element.Member; - -public interface WritebackCell { - - double getNewValue(); - - double getCurrentValue(); - - AllocationPolicy getAllocationPolicy(); - - Member[] getMembersByOrdinal(); - - double getAtomicCellCount(); - - /** - * Returns the amount by which the cell value has increased with this override. - * - * @return Amount by which value has increased - */ - double getOffset(); - - CellRelation getRelationTo(Member[] members); - - /** - * Decribes the relationship between two cells. - */ - enum CellRelation { - ABOVE, EQUAL, BELOW, NONE - } - -} \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/package-info.java deleted file mode 100644 index afcebff554..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/result/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.result; \ No newline at end of file diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/BooleanType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/BooleanType.java deleted file mode 100644 index ae162a2657..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/BooleanType.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - - -public class BooleanType extends ScalarType { - - public static final BooleanType INSTANCE = new BooleanType(); - - private BooleanType() { - super("BOOLEAN"); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof BooleanType; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Boolean; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/CubeType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/CubeType.java deleted file mode 100644 index fee9228283..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/CubeType.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -import org.eclipse.daanse.olap.api.element.Cube; -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * The type of an expression which represents a Cube or Virtual Cube. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class CubeType implements Type { - private final Cube cube; - - /** - * Creates a type representing a cube. - */ - public CubeType(Cube cube) { - this.cube = cube; - } - - /** - * Returns the cube. - * - * @return Cube - */ - public Cube getCube() { - return cube; - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - return false; - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - return false; - } - - @Override - public Dimension getDimension() { - return null; - } - - @Override - public Hierarchy getHierarchy() { - return null; - } - - @Override - public Level getLevel() { - return null; - } - - @Override - public int hashCode() { - return cube.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof CubeType that) { - return this.cube.equals(that.cube); - } else { - return false; - } - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - return this.equals(type) - ? this - : null; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Cube; - } - - @Override - public int getArity() { - // not meaningful; cube cannot be used in an expression - throw new UnsupportedOperationException(); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DateTimeType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DateTimeType.java deleted file mode 100644 index e2b34e23d4..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DateTimeType.java +++ /dev/null @@ -1,50 +0,0 @@ - /* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - - -public class DateTimeType extends ScalarType { - - public static final DateTimeType INSTANCE = new DateTimeType(); - - private DateTimeType() { - super("DATETIME"); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof DateTimeType; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public boolean isInstance(Object value) { - return value instanceof java.util.Date; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DecimalType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DecimalType.java deleted file mode 100644 index 83da24c0db..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DecimalType.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -import java.util.Objects; - -/** - * Subclass of {@link NumericType} which guarantees fixed number of decimal - * places. In particular, a decimal with zero scale is an integer. - * - * @author jhyde - * @since May 3, 2005 - */ -public class DecimalType extends NumericType { - private final int precision; - private final int scale; - - /** - * Creates a decimal type with precision and scale. - * - *

Examples:

    - *
  • 123.45 has precision 5, scale 2. - *
  • 12,345,000 has precision 5, scale -3. - *
- * - *

The largest value is 10 ^ (precision - scale). Hence the largest - * DECIMAL(5, -3) value is 10 ^ 8. - * - * @param precision Maximum number of decimal digits which a value of - * this type can have. - * Must be greater than zero. - * Use {@link Integer#MAX_VALUE} if the precision is unbounded. - * @param scale Number of digits to the right of the decimal point. - */ - public DecimalType(int precision, int scale) { - super( - precision == Integer.MAX_VALUE - ? "DecimalType(" + scale + ")" - : "DecimalType(" + precision + ", " + scale + ")"); - assert precision>0; - this.precision = precision; - this.scale = scale; - } - - /** - * Returns the maximum number of decimal digits which a value of - * this type can have. - * - * @return precision of this type - */ - public int getPrecision() { - return precision; - } - - /** - * Returns the number of digits to the right of the decimal point. - * - * @return scale of this type - */ - public int getScale() { - return scale; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof DecimalType that) { - return this.precision == that.precision - && this.scale == that.scale; - } - return false; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), precision, scale); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DimensionType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DimensionType.java deleted file mode 100644 index 34e9ef3d75..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/DimensionType.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -import java.util.Objects; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - - -/** - * The type of an expression which represents a Dimension. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class DimensionType implements Type { - private final Dimension dimension; - private final String digest; - - public static final DimensionType Unknown = new DimensionType(null); - - /** - * Creates a type representing a dimension. - * - * @param dimension Dimension that values of this type must belong to, or - * null if the dimension is unknown - */ - public DimensionType(Dimension dimension) { - this.dimension = dimension; - StringBuilder buf = new StringBuilder("DimensionType<"); - if (dimension != null) { - buf.append("dimension=").append(dimension.getUniqueName()); - } - buf.append(">"); - this.digest = buf.toString(); - } - - public static DimensionType forDimension(Dimension dimension) { - return new DimensionType(dimension); - } - - public static DimensionType forType(Type type) { - return new DimensionType(type.getDimension()); - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - // REVIEW: Should be '!definitely'? - return this.dimension == dimension - || (definitely && this.dimension == null); - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - // If hierarchy belongs to this type's dimension, we might use it. - return hierarchy.getDimension() == this.dimension - && !definitely; - } - - @Override - public Hierarchy getHierarchy() { - if (dimension == null) { - return null; - } else { - return dimension.getHierarchy(); - } - } - - @Override - public Level getLevel() { - return null; - } - - @Override - public Dimension getDimension() { - return dimension; - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof DimensionType that) { - return Objects.equals(this.getDimension(), that.getDimension()); - } - return false; - } - - @Override - public String toString() { - return digest; - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (conversionCount != null && type instanceof HierarchyType hierarchyType) { - if (Objects.equals(hierarchyType.getDimension(), dimension)) { - ++conversionCount[0]; - return this; - } - return null; - } - if (!(type instanceof DimensionType that)) { - return null; - } - if (this.getDimension() != null - && this.getDimension().equals(that.getDimension())) - { - return new DimensionType( - this.getDimension()); - } - return DimensionType.Unknown; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Dimension - && (dimension == null - || value.equals(dimension)); - } - - @Override - public int getArity() { - return 1; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/EmptyType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/EmptyType.java deleted file mode 100644 index 2ff32fd56b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/EmptyType.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -public class EmptyType extends ScalarType { - - public static final EmptyType INSTANCE = new EmptyType(); - - private EmptyType() { - super(""); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof EmptyType; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/HierarchyType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/HierarchyType.java deleted file mode 100644 index 6728a74d9b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/HierarchyType.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -import java.util.Objects; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * The type of an expression which represents a hierarchy. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class HierarchyType implements Type { - private final Dimension dimension; - private final Hierarchy hierarchy; - private final String digest; - - public static final HierarchyType Unknown = new HierarchyType(null, null); - - /** - * Creates a type representing a hierarchy. - * - * @param dimension Dimension that values of this type must belong to, or - * null if the dimension is unknown - * @param hierarchy Hierarchy that values of this type must belong to, - * null if the hierarchy is unknown - */ - public HierarchyType(Dimension dimension, Hierarchy hierarchy) { - this.dimension = dimension; - this.hierarchy = hierarchy; - StringBuilder buf = new StringBuilder("HierarchyType<"); - if (hierarchy != null) { - buf.append("hierarchy=").append(hierarchy.getUniqueName()); - } else if (dimension != null) { - buf.append("dimension=").append(dimension.getUniqueName()); - } - buf.append(">"); - this.digest = buf.toString(); - } - - public static HierarchyType forHierarchy(Hierarchy hierarchy) { - return new HierarchyType(hierarchy.getDimension(), hierarchy); - } - - public static HierarchyType forType(Type type) { - return new HierarchyType(type.getDimension(), type.getHierarchy()); - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - return this.dimension == dimension - || (!definitely && this.dimension == null); - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - return this.hierarchy == hierarchy - || (!definitely - && this.hierarchy == null - && (this.dimension == null - || this.dimension == hierarchy.getDimension())); - } - - @Override - public Dimension getDimension() { - return dimension; - } - - @Override - public Hierarchy getHierarchy() { - return hierarchy; - } - - @Override - public Level getLevel() { - return null; - } - - @Override - public String toString() { - return digest; - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof HierarchyType that) { - return Objects.equals(this.hierarchy, that.hierarchy) - && Objects.equals(this.dimension, that.dimension); - } - return false; - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (!(type instanceof HierarchyType that)) { - return null; - } - if (this.getHierarchy() != null - && this.getHierarchy().equals(that.getHierarchy())) - { - return this; - } - if (this.getDimension() != null - && this.getDimension().equals(that.getDimension())) - { - return new HierarchyType( - this.getDimension(), - null); - } - return HierarchyType.Unknown; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Hierarchy hValue - && (hierarchy == null - || value.equals(hierarchy)) - && (dimension == null - || hValue.getDimension().equals(dimension)); - } - - @Override - public int getArity() { - return 1; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/LevelType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/LevelType.java deleted file mode 100644 index 8b3b284405..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/LevelType.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - -package org.eclipse.daanse.olap.api.type; - -import java.util.Objects; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * The type of an expression which represents a level. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class LevelType implements Type { - private final Dimension dimension; - private final Hierarchy hierarchy; - private final Level level; - private final String digest; - - public static final LevelType Unknown = new LevelType(null, null, null); - - /** - * Creates a type representing a level. - * - * @param dimension Dimension which values of this type must belong to, or - * null if not known - * @param hierarchy Hierarchy which values of this type must belong to, or - * null if not known - * @param level Level which values of this type must belong to, or null if - */ - public LevelType(Dimension dimension, Hierarchy hierarchy, Level level) { - this.dimension = dimension; - this.hierarchy = hierarchy; - this.level = level; - if (level != null) { - assert hierarchy != null; - assert - level.getHierarchy() == hierarchy; - } - if (hierarchy != null) { - assert dimension != null; - assert hierarchy.getDimension() == dimension; - } - StringBuilder buf = new StringBuilder("LevelType<"); - if (level != null) { - buf.append("level=").append(level.getUniqueName()); - } else if (hierarchy != null) { - buf.append("hierarchy=").append(hierarchy.getUniqueName()); - } else if (dimension != null) { - buf.append("dimension=").append(dimension.getUniqueName()); - } - buf.append(">"); - this.digest = buf.toString(); - } - - public static LevelType forType(Type type) { - return new LevelType( - type.getDimension(), - type.getHierarchy(), - type.getLevel()); - } - - public static LevelType forLevel(Level level) { - return new LevelType( - level.getDimension(), - level.getHierarchy(), - level); - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - return this.dimension == dimension - || (!definitely && this.dimension == null); - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - return this.hierarchy == hierarchy - || (!definitely - && this.hierarchy == null - && (this.dimension == null - || this.dimension == hierarchy.getDimension())); - } - - @Override - public Dimension getDimension() { - return dimension; - } - - @Override - public Hierarchy getHierarchy() { - return hierarchy; - } - - @Override - public Level getLevel() { - return level; - } - - @Override - public String toString() { - return digest; - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof LevelType that) { - return Objects.equals(this.level, that.level) - && Objects.equals(this.hierarchy, that.hierarchy) - && Objects.equals(this.dimension, that.dimension); - } - return false; - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (!(type instanceof LevelType that)) { - return null; - } - if (this.getLevel() != null - && this.getLevel().equals(that.getLevel())) - { - return this; - } - if (this.getHierarchy() != null - && this.getHierarchy().equals(that.getHierarchy())) - { - return new LevelType( - this.getDimension(), - this.getHierarchy(), - null); - } - if (this.getDimension() != null - && this.getDimension().equals(that.getDimension())) - { - return new LevelType( - this.getDimension(), - null, - null); - } - return LevelType.Unknown; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Level - && (level == null - || value.equals(level)) - && (hierarchy == null - || ((Level) value).getHierarchy().equals(hierarchy)) - && (dimension == null - || ((Level) value).getDimension().equals(dimension)); - } - - @Override - public int getArity() { - return 1; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/MemberType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/MemberType.java deleted file mode 100644 index 656c1b47d3..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/MemberType.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.element.Member; - - -/** - * The type of an expression which represents a member. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class MemberType implements Type { - private final Hierarchy hierarchy; - private final Dimension dimension; - private final Level level; - private final Member member; - private final String digest; - - public static final MemberType Unknown = - new MemberType(null, null, null, null); - - /** - * Creates a type representing a member. - * - * @param dimension Dimension the member belongs to, or null if not known - * @param hierarchy Hierarchy the member belongs to, or null if not known - * @param level Level the member belongs to, or null if not known - * @param member The precise member, or null if not known - */ - public MemberType( - Dimension dimension, - Hierarchy hierarchy, - Level level, - Member member) - { - this.dimension = dimension; - this.hierarchy = hierarchy; - this.level = level; - this.member = member; - if (member != null) { - assert level != null; - assert member.getLevel() == level; - } - if (level != null) { - assert hierarchy != null; - assert level.getHierarchy() == hierarchy; - } - if (hierarchy != null) { - assert dimension != null; - assert hierarchy.getDimension() == dimension; - } - StringBuilder buf = new StringBuilder("MemberType<"); - if (member != null) { - buf.append("member=").append(member.getUniqueName()); - } else if (level != null) { - buf.append("level=").append(level.getUniqueName()); - } else if (hierarchy != null) { - buf.append("hierarchy=").append(hierarchy.getUniqueName()); - } else if (dimension != null) { - buf.append("dimension=").append(dimension.getUniqueName()); - } - buf.append(">"); - this.digest = buf.toString(); - } - - public static MemberType forDimension(Dimension dimension) { - return new MemberType(dimension, null, null, null); - } - - public static MemberType forHierarchy(Hierarchy hierarchy) { - final Dimension dimension; - if (hierarchy == null) { - dimension = null; - } else { - dimension = hierarchy.getDimension(); - } - return new MemberType(dimension, hierarchy, null, null); - } - - public static MemberType forLevel(Level level) { - final Dimension dimension; - final Hierarchy hierarchy; - if (level == null) { - dimension = null; - hierarchy = null; - } else { - dimension = level.getDimension(); - hierarchy = level.getHierarchy(); - } - return new MemberType(dimension, hierarchy, level, null); - } - - public static MemberType forMember(Member member) { - final Dimension dimension; - final Hierarchy hierarchy; - final Level level; - if (member == null) { - dimension = null; - hierarchy = null; - level = null; - } else { - dimension = member.getDimension(); - hierarchy = member.getHierarchy(); - level = member.getLevel(); - } - return new MemberType(dimension, hierarchy, level, member); - } - - @Override - public String toString() { - return digest; - } - - @Override - public Hierarchy getHierarchy() { - return hierarchy; - } - - @Override - public Level getLevel() { - return level; - } - - public Member getMember() { - return member; - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - return this.dimension == dimension - || (!definitely && this.dimension == null); - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - return this.hierarchy == hierarchy - || (!definitely - && this.hierarchy == null - && (this.dimension == null - || this.dimension == hierarchy.getDimension())); - } - - public Type getValueType() { - // todo: when members have more type information (double vs. integer - // vs. string), return better type if member != null. - return ScalarType.INSTANCE; - } - - @Override - public Dimension getDimension() { - return dimension; - } - - public static MemberType forType(Type type) { - if (type instanceof MemberType) { - return (MemberType) type; - } else { - return new MemberType( - type.getDimension(), - type.getHierarchy(), - type.getLevel(), - null); - } - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (type instanceof ScalarType) { - return getValueType().computeCommonType(type, conversionCount); - } - if (type instanceof TupleType) { - return type.computeCommonType(this, conversionCount); - } - if (!(type instanceof MemberType that)) { - return null; - } - if (this.getMember() != null - && this.getMember().equals(that.getMember())) - { - return this; - } - if (this.getLevel() != null - && this.getLevel().equals(that.getLevel())) - { - return new MemberType( - this.getDimension(), - this.getHierarchy(), - this.getLevel(), - null); - } - if (this.getHierarchy() != null - && this.getHierarchy().equals(that.getHierarchy())) - { - return new MemberType( - this.getDimension(), - this.getHierarchy(), - null, - null); - } - if (this.getDimension() != null - && this.getDimension().equals(that.getDimension())) - { - return new MemberType( - this.getDimension(), - null, - null, - null); - } - return MemberType.Unknown; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Member - && (level == null - || ((Member) value).getLevel().equals(level)) - && (hierarchy == null - || ((Member) value).getHierarchy().equals(hierarchy)) - && (dimension == null - || ((Member) value).getDimension().equals(dimension)); - } - - @Override - public int getArity() { - return 1; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NullType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NullType.java deleted file mode 100644 index d8e25afc29..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NullType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - - -public class NullType extends ScalarType -{ - - public static final NullType INSTANCE = new NullType(); - - private NullType() { - super(""); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof NullType; - } - - @Override - public int hashCode() { - return super.hashCode(); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NumericType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NumericType.java deleted file mode 100644 index 4865e30ec2..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/NumericType.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -public class NumericType extends ScalarType { - - public static final NumericType INSTANCE = new NumericType(); - - private NumericType() { - this("NUMERIC"); - } - - protected NumericType(String digest) { - super(digest); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof NumericType && toString().equals(obj.toString()); - } - - @Override - public boolean isInstance(Object value) { - return value instanceof Number || value instanceof Character; - } - - @Override - public int hashCode() { - return super.hashCode(); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/ScalarType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/ScalarType.java deleted file mode 100644 index 457913c6e5..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/ScalarType.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * Base class for types which represent scalar values. - * - *

An instance of this class means a scalar value of unknown type. - * Usually one of the derived classes {@link NumericType}, - * {@link StringType}, {@link BooleanType} is used instead. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class ScalarType implements Type { - private final String digest; - - public static final ScalarType INSTANCE = new ScalarType(); - - private ScalarType() { - this("SCALAR"); - } - - protected ScalarType(String digest) { - this.digest = digest; - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean equals(Object obj) { - return obj != null - && obj.getClass() == ScalarType.class; - } - - @Override - public String toString() { - return digest; - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - return false; - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - return false; - } - - @Override - public Hierarchy getHierarchy() { - return null; - } - - @Override - public Level getLevel() { - return null; - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (this.equals(type)) { - return this; - } else if (type instanceof NullType) { - return this; - } else if (this instanceof NullType - && type instanceof ScalarType) - { - return type; - } else if (this.getClass() == ScalarType.class - && type instanceof ScalarType) - { - return this; - } else if (type.getClass() == ScalarType.class) { - return type; - } else if (type instanceof ScalarType) { - return new ScalarType(); - } else if (type instanceof MemberType) { - return computeCommonType( - ((MemberType) type).getValueType(), - conversionCount); - } else if (type instanceof TupleType) { - return computeCommonType( - ((TupleType) type).getValueType(), - conversionCount); - } else { - return null; - } - } - - @Override - public Dimension getDimension() { - return null; - } - - @Override - public boolean isInstance(Object value) { - // Somewhat pessimistic. - return false; - } - - @Override - public int getArity() { - return 1; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SetType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SetType.java deleted file mode 100644 index 1e9d12eef6..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SetType.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * Copyright (C) 2022 Sergei Semenkov - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * Set type. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class SetType implements Type { - - private final Type elementType; - private final String digest; - - /** - * Creates a type representing a set of elements of a given type. - * - * @param elementType The type of the elements in the set, or null if not - * known - */ - public SetType(Type elementType) { - if (elementType != null) { - assert elementType instanceof MemberType - || elementType instanceof TupleType; - } - this.elementType = elementType; - this.digest = "SetType<" + elementType + ">"; - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof SetType that) { - return Objects.equals(this.elementType, that.elementType); - } else { - return false; - } - } - - @Override - public String toString() { - return digest; - } - - /** - * Returns the type of the elements of this set. - * - * @return the type of the elements in this set - */ - public Type getElementType() { - return elementType; - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - if (elementType == null) { - return definitely; - } - return elementType.usesDimension(dimension, definitely); - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - if (elementType == null) { - return definitely; - } - return elementType.usesHierarchy(hierarchy, definitely); - } - - public List getHierarchies() { - if(elementType instanceof TupleType tupleType) { - return tupleType.getHierarchies(); - } - else { //MemberType - ArrayList result = new ArrayList<>(); - result.add(this.getHierarchy()); - return result; - } - } - - @Override - public Dimension getDimension() { - return elementType == null - ? null - : elementType.getDimension(); - } - - @Override - public Hierarchy getHierarchy() { - return elementType == null - ? null - : elementType.getHierarchy(); - } - - @Override - public Level getLevel() { - return elementType == null - ? null - : elementType.getLevel(); - } - - @Override - public int getArity() { - return elementType.getArity(); - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (!(type instanceof SetType that)) { - return null; - } - final Type mostGeneralElementType = - this.getElementType().computeCommonType( - that.getElementType(), conversionCount); - if (mostGeneralElementType == null) { - return null; - } - return new SetType(mostGeneralElementType); - } - - @Override - public boolean isInstance(Object value) { - if (!(value instanceof List list)) { - return false; - } - for (Object o : list) { - if (!elementType.isInstance(o)) { - return false; - } - } - return true; - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/StringType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/StringType.java deleted file mode 100644 index de794d9b38..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/StringType.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -public class StringType extends ScalarType { - - public static final StringType INSTANCE = new StringType(); - private StringType() { - super("STRING"); - } - - @Override - public boolean equals(Object obj) { - return obj instanceof StringType; - } - - @Override - public boolean isInstance(Object value) { - return value instanceof String; - } - - @Override - public int hashCode() { - return super.hashCode(); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SymbolType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SymbolType.java deleted file mode 100644 index b63c5696f7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/SymbolType.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -public class SymbolType extends ScalarType { - public static final SymbolType INSTANCE = new SymbolType(); - - private SymbolType() { - super("SYMBOL"); - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/TupleType.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/TupleType.java deleted file mode 100644 index 112a39547b..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/TupleType.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; -import org.eclipse.daanse.olap.api.exception.OlapRuntimeException; - - - -/** - * Tuple type. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public class TupleType implements Type { - - private final static String dupHierarchiesInTuple = "Tuple contains more than one member of hierarchy ''{0}''."; - public final Type[] elementTypes; - private final String digest; - - /** - * Creates a type representing a tuple whose fields are the given types. - * - * @param elementTypes Array of types of the members in this tuple - */ - public TupleType(Type[] elementTypes) { - assert elementTypes != null; - this.elementTypes = elementTypes.clone(); - - final StringBuilder buf = new StringBuilder(); - buf.append("TupleType<"); - int k = 0; - for (Type elementType : elementTypes) { - if (k++ > 0) { - buf.append(", "); - } - buf.append(elementType); - } - buf.append(">"); - digest = buf.toString(); - } - - @Override - public String toString() { - return digest; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof TupleType that) { - return Arrays.equals(this.elementTypes, that.elementTypes); - } else { - return false; - } - } - - @Override - public int hashCode() { - return digest.hashCode(); - } - - @Override - public boolean usesDimension(Dimension dimension, boolean definitely) { - for (Type elementType : elementTypes) { - if (elementType.usesDimension(dimension, definitely)) { - return true; - } - } - return false; - } - - @Override - public boolean usesHierarchy(Hierarchy hierarchy, boolean definitely) { - for (Type elementType : elementTypes) { - if (elementType.usesHierarchy(hierarchy, definitely)) { - return true; - } - } - return false; - } - - public List getHierarchies() { - final List hierarchies = - new ArrayList<>(elementTypes.length); - for (Type elementType : elementTypes) { - hierarchies.add(elementType.getHierarchy()); - } - return hierarchies; - } - - @Override - public int getArity() { - return elementTypes.length; - } - - @Override - public Dimension getDimension() { - throw new UnsupportedOperationException(); - } - - @Override - public Hierarchy getHierarchy() { - throw new UnsupportedOperationException(); - } - - @Override - public Level getLevel() { - throw new UnsupportedOperationException(); - } - - public Type getValueType() { - for (Type elementType : elementTypes) { - if (elementType instanceof MemberType memberType) { - Dimension dimension = memberType.getDimension(); - if (dimension != null && dimension.isMeasures()) { - return memberType.getValueType(); - } - } - } - return ScalarType.INSTANCE; - } - - @Override - public Type computeCommonType(Type type, int[] conversionCount) { - if (type instanceof ScalarType) { - return getValueType().computeCommonType(type, conversionCount); - } - if (type instanceof MemberType) { - return commonTupleType( - new TupleType(new Type[]{type}), - conversionCount); - } - if (!(type instanceof TupleType)) { - return null; - } - return commonTupleType(type, conversionCount); - } - - @Override - public boolean isInstance(Object value) { - if (!(value instanceof Object[] objects)) { - return false; - } - if (objects.length != elementTypes.length) { - return false; - } - for (int i = 0; i < objects.length; i++) { - if (!elementTypes[i].isInstance(objects[i])) { - return false; - } - } - return true; - } - - private Type commonTupleType(Type type, int[] conversionCount) { - TupleType that = (TupleType) type; - - if (this.elementTypes.length < that.elementTypes.length) { - return createCommonTupleType(that, conversionCount); - } - return that.createCommonTupleType(this, conversionCount); - } - - private Type createCommonTupleType(TupleType that, int[] conversionCount) { - final List elementTypes = new ArrayList<>(); - for (int i = 0; i < this.elementTypes.length; i++) { - Type commonType = this.elementTypes[i].computeCommonType( - that.elementTypes[i], conversionCount); - elementTypes.add(commonType); - if (commonType == null) { - return null; - } - } - if (elementTypes.size() < that.elementTypes.length) { - for (int i = elementTypes.size(); - i < that.elementTypes.length; i++) - { - elementTypes.add(ScalarType.INSTANCE); - } - } - return new TupleType( - elementTypes.toArray(new Type[elementTypes.size()])); - } - - /** - * Checks that there are no duplicate dimensions in a list of member types. - * If so, the member types will form a valid tuple type. - * If not, throws {@link org.eclipse.daanse.olap.api.exception.OlapRuntimeException}. - * - * @param memberTypes Array of member types - */ - public static void checkHierarchies(MemberType[] memberTypes) { - for (int i = 0; i < memberTypes.length; i++) { - MemberType memberType = memberTypes[i]; - for (int j = 0; j < i; j++) { - MemberType member1 = memberTypes[j]; - final Hierarchy hierarchy = memberType.getHierarchy(); - final Hierarchy hierarchy1 = member1.getHierarchy(); - if (hierarchy != null && hierarchy == hierarchy1) { - throw new OlapRuntimeException(MessageFormat.format(dupHierarchiesInTuple, - hierarchy.getUniqueName())); - } - } - } - } -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/Type.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/Type.java deleted file mode 100644 index a48e8bd60e..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/Type.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * This software is subject to the terms of the Eclipse Public License v1.0 - * Agreement, available at the following URL: - * http://www.eclipse.org/legal/epl-v10.html. - * You must accept the terms of that agreement to use this software. - * - * Copyright (C) 2005-2005 Julian Hyde - * Copyright (C) 2005-2017 Hitachi Vantara - * All Rights Reserved. - * - * For more information please visit the Project: Hitachi Vantara - Mondrian - * - * ---- All changes after Fork in 2023 ------------------------ - * - * Project: Eclipse daanse - * - * Copyright (c) 2023 Contributors to the Eclipse Foundation. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors after Fork in 2023: - * SmartCity Jena - initial - * Stefan Bischof (bipolis.org) - initial - */ - - -package org.eclipse.daanse.olap.api.type; - -import org.eclipse.daanse.olap.api.element.Dimension; -import org.eclipse.daanse.olap.api.element.Hierarchy; -import org.eclipse.daanse.olap.api.element.Level; - -/** - * Type of an MDX expression. - * - * @author jhyde - * @since Feb 17, 2005 - */ -public interface Type { - /** - * Returns whether this type contains a given dimension.

- * - * For example: - *

    - *
  • DimensionType([Gender]) uses only the - * [Gender] dimension.
  • - *
  • TupleType(MemberType([Gender]), MemberType([Store])) - * uses [Gender] and [Store] - * dimensions.
  • - *

- * - * The definitely parameter comes into play when the - * dimensional information is incomplete. For example, when applied to - * TupleType(MemberType(null), MemberType([Store])), - * usesDimension([Gender], false) returns true because it - * is possible that the expression returns a member of the - * [Gender] dimension; but - * usesDimension([Gender], true) returns true because it - * is possible that the expression returns a member of the - * [Gender] dimension. - * - * @param dimension Dimension - * @param definitely If true, returns true only if this type definitely - * uses the dimension - * - * @return whether this Type uses the given Dimension - */ - boolean usesDimension(Dimension dimension, boolean definitely); - - /** - * Returns whether this type contains a given hierarchy.

- * - * For example: - *

    - *
  • HierarchyType([Customer].[Gender]) uses only the - * [Customer].[Gender] hierarchy.
  • - *
  • TupleType(MemberType([Customer].[Gender]), - * MemberType([Store].[Store])) - * uses [Gender] and [Store] - * dimensions.
  • - *

- * - * The definitely parameter comes into play when the - * dimensional information is incomplete. For example, when applied to - * TupleType(MemberType([Customer]), MemberType([Store])), - * usesDimension([Customer].[Gender], false) returns true - * because the expression returns a member of one hierarchy of the - * [Customer] dimension and that might be a member of the - * [Customer].[Gender] hierarchy; but - * usesDimension([Customer].[Gender], true) returns false - * because might return a member of a different hierarchy, such as - * [Customer].[State]. - * - * @param hierarchy Hierarchy - * @param definitely If true, returns true only if this type definitely - * uses the hierarchy - * - * @return whether this Type uses the given Hierarchy - */ - boolean usesHierarchy(Hierarchy hierarchy, boolean definitely); - - /** - * Returns the Dimension of this Type, or null if not known. - * If not applicable, throws. - * - * @return the Dimension of this Type, or null if not known. - */ - Dimension getDimension(); - - /** - * Returns the Hierarchy of this Type, or null if not known. - * If not applicable, throws. - * - * @return the Hierarchy of this type, or null if not known - */ - Hierarchy getHierarchy(); - - /** - * Returns the Level of this Type, or null if not known. - * If not applicable, throws. - * - * @return the Level of this Type - */ - Level getLevel(); - - /** - * Returns a Type which is more general than this and the given Type. - * The type returned is broad enough to hold any value of either type, - * but no broader. If there is no such type, returns null. - * - *

Some examples:

    - *
  • The common type for StringType and NumericType is ScalarType. - *
  • The common type for NumericType and DecimalType(4, 2) is - * NumericType. - *
  • DimensionType and NumericType have no common type. - *

- * - *

If conversionCount is not null, implicit conversions - * such as HierarchyType to DimensionType are considered; the parameter - * is incremented by the number of conversions performed. - * - *

Some examples:

    - *
  • The common type for HierarchyType(hierarchy=Time.Weekly) - * and LevelType(dimension=Time), if conversions are allowed, is - * HierarchyType(dimension=Time). - *
- * - *

One use of common types is to determine the types of the arguments - * to the Iif function. For example, the call - * - *

Iif(1 > 2, [Measures].[Unit Sales], - * 5)
- * - * has type ScalarType, because DecimalType(-1, 0) is a subtype of - * ScalarType, and MeasureType can be converted implicitly to ScalarType. - * - * @param type Type - * - * @param conversionCount Number of conversions; output parameter that is - * incremented each time a conversion is performed; if null, conversions - * are not considered - * - * @return More general type - */ - Type computeCommonType(Type type, int[] conversionCount); - - /** - * Returns whether a value is valid for a type. - * - * @param value Value - * @return Whether value is valid for this type - */ - boolean isInstance(Object value); - - /** - * Returns the number of fields in a tuple type, or a set of tuples. - * For most other types, in particular member type, returns 1. - * - * @return Arity of type - */ - int getArity(); -} diff --git a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/package-info.java b/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/package-info.java deleted file mode 100644 index bb4db1b6a7..0000000000 --- a/olap/api/src/main/java/org/eclipse/daanse/olap/api/type/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* Copyright (c) 2022 Contributors to the Eclipse Foundation. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* -* Contributors: -* SmartCity Jena - initial -*/ - -@org.osgi.annotation.bundle.Export -@org.osgi.annotation.versioning.Version("0.0.1") -package org.eclipse.daanse.olap.api.type; \ No newline at end of file diff --git a/olap/pom.xml b/olap/pom.xml index 9b499539d1..bd3bdcbdc2 100644 --- a/olap/pom.xml +++ b/olap/pom.xml @@ -20,9 +20,7 @@ org.eclipse.daanse.olap pom - api xmla documentation - action