Skip to content

Commit 741b3b3

Browse files
committed
refactor to converter seperate handlers - no new behavier code
- Extract Discover handlers (DBSCHEMA_*, MDSCHEMA_*, DISCOVER_*) - Extract Execute handlers (Statement, Alter, Cancel, ClearCache) - Simplify XmlaApiAdapter with handler dispatch maps - Add type-safe getXxxList() methods to Convert/Handler - Constantd for String and QName decentralized - add tests - Formatter and organite imports Signed-off-by: Stefan Bischof <[email protected]>
1 parent eeba643 commit 741b3b3

File tree

252 files changed

+18738
-12672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+18738
-12672
lines changed

api/src/main/java/org/eclipse/daanse/xmla/api/PropertyDefinition.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.eclipse.daanse.xmla.api;
1919

2020
import java.util.EnumSet;
21-
import java.util.Enumeration;
2221
import java.util.Set;
2322

2423
/**
@@ -197,13 +196,13 @@ public enum PropertyDefinition {
197196
"DBMSVersion");
198197

199198
final RowsetDefinitionType type;
200-
final Set<? extends Enum> enumSet;
199+
final Set<? extends Enum<?>> enumSet;
201200
final XmlaConstants.Access access;
202201
final XmlaConstants.Method usage;
203202
final String value;
204203
final String description;
205204

206-
PropertyDefinition(RowsetDefinitionType type, Set<? extends Enum> enumSet, XmlaConstants.Access access,
205+
PropertyDefinition(RowsetDefinitionType type, Set<? extends Enum<?>> enumSet, XmlaConstants.Access access,
207206
String value, XmlaConstants.Method usage, String description) {
208207
// Line endings must be UNIX style (LF) not Windows style (LF+CR).
209208
// Thus the client will receive the same XML, regardless

api/src/main/java/org/eclipse/daanse/xmla/api/XmlaException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* @author <a>Richard M. Emberson</a>
2323
*/
24+
@SuppressWarnings("serial")
2425
public class XmlaException extends RuntimeException {
2526

2627
public static String formatFaultCode(XmlaException xex) {

api/src/main/java/org/eclipse/daanse/xmla/api/XmlaUtil.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static org.eclipse.daanse.xmla.api.XmlaConstants.CLIENT_FAULT_FC;
1717
import static org.eclipse.daanse.xmla.api.XmlaConstants.USM_DOM_PARSE_CODE;
1818
import static org.eclipse.daanse.xmla.api.XmlaConstants.USM_DOM_PARSE_FAULT_FS;
19+
1920
import java.io.StringWriter;
2021
import java.util.ArrayList;
2122
import java.util.List;
@@ -231,21 +232,6 @@ public static String normalizeNumericString(String numericStr) {
231232
return numericStr;
232233
}
233234

234-
235-
private static <T> String toString(List<T> list) {
236-
StringBuilder buf = new StringBuilder();
237-
int k = -1;
238-
for (T t : list) {
239-
if (++k > 0) {
240-
buf.append(", ");
241-
}
242-
buf.append(t);
243-
}
244-
return buf.toString();
245-
}
246-
247-
248-
249235
/**
250236
* Result of a metadata query.
251237
*/

api/src/main/java/org/eclipse/daanse/xmla/api/common/enums/AccessEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.common.enums;
1515

16-
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
17-
1816
import java.util.stream.Stream;
1917

18+
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
19+
2020
@Enumerator(name = "Access")
2121
public enum AccessEnum {
2222
READ("Read"), WRITE("Write"), READ_WRITE("ReadWrite");

api/src/main/java/org/eclipse/daanse/xmla/api/common/enums/AuthenticationModeEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.common.enums;
1515

16-
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
17-
1816
import java.util.stream.Stream;
1917

18+
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
19+
2020
@Enumerator(name = "AuthenticationMode")
2121
public enum AuthenticationModeEnum {
2222

api/src/main/java/org/eclipse/daanse/xmla/api/common/enums/ProviderTypeEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.common.enums;
1515

16-
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
17-
1816
import java.util.stream.Stream;
1917

18+
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
19+
2020
@Enumerator(name = "ProviderType")
2121
public enum ProviderTypeEnum {
2222

api/src/main/java/org/eclipse/daanse/xmla/api/common/enums/TreeOpEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.common.enums;
1515

16-
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
17-
1816
import java.util.stream.Stream;
1917

18+
import org.eclipse.daanse.xmla.api.annotation.Enumerator;
19+
2020
/**
2121
* Applies only to a single member:
2222
*/

api/src/main/java/org/eclipse/daanse/xmla/api/common/properties/PropertyListElementDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public enum PropertyListElementDefinition {
3131
LOCALE_IDENTIFIER("LocaleIdentifier", Type.UNSIGNED_INTEGER, null, Access.READ_WRITE, null, true, true);
3232

3333
final Type type;
34-
final Set<? extends Enum> enumSet;
34+
final Set<? extends Enum<?>> enumSet;
3535
final Access access;
3636
final boolean discover;
3737
final boolean execute;
3838
final String value;
3939
final String nameValue;
4040

41-
PropertyListElementDefinition(String nameValue, Type type, Set<? extends Enum> enumSet, Access access, String value,
41+
PropertyListElementDefinition(String nameValue, Type type, Set<? extends Enum<?>> enumSet, Access access, String value,
4242
boolean discover, boolean execute) {
4343

4444
assert (enumSet != null) == type.isEnum();

api/src/main/java/org/eclipse/daanse/xmla/api/discover/dbschema/catalogs/DbSchemaCatalogsRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.discover.dbschema.catalogs;
1515

16+
import static org.eclipse.daanse.xmla.api.common.properties.OperationNames.DBSCHEMA_CATALOGS;
17+
1618
import org.eclipse.daanse.xmla.api.annotation.Operation;
1719
import org.eclipse.daanse.xmla.api.discover.Properties;
1820

19-
import static org.eclipse.daanse.xmla.api.common.properties.OperationNames.DBSCHEMA_CATALOGS;
20-
2121
@Operation(name = DBSCHEMA_CATALOGS, guid = "C8B52211-5CF3-11CE-ADE5-00AA0044773D")
2222
public interface DbSchemaCatalogsRequest {
2323
Properties properties();

api/src/main/java/org/eclipse/daanse/xmla/api/discover/dbschema/catalogs/DbSchemaCatalogsRestrictions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
*/
1414
package org.eclipse.daanse.xmla.api.discover.dbschema.catalogs;
1515

16-
import org.eclipse.daanse.xmla.api.annotation.Restriction;
16+
import static org.eclipse.daanse.xmla.api.common.properties.XsdType.XSD_STRING;
1717

1818
import java.util.Optional;
1919

20-
import static org.eclipse.daanse.xmla.api.common.properties.XsdType.XSD_STRING;
20+
import org.eclipse.daanse.xmla.api.annotation.Restriction;
2121

2222
public interface DbSchemaCatalogsRestrictions {
2323
String RESTRICTIONS_CATALOG_NAME = "CATALOG_NAME";

0 commit comments

Comments
 (0)