# HG changeset patch # User lancea # Date 1529525294 14400 # Node ID 3b438b3fef46249c8e8de5c9d8bddef38968f283 # Parent fb523d4d91853a2dac30ae8eec15fec44789a638 JDK-8188051-branch removing files diff -r fb523d4d9185 -r 3b438b3fef46 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/CountOperation.java --- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/CountOperation.java Wed Jun 20 15:38:40 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.incubator.sql2; - -import java.time.Duration; -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * An {@link Operation} that returns a count. - * - * @param the type of the result of the {@link Operation} - * @see ParameterizedCountOperation - */ -public interface CountOperation extends Operation { - - /** - * Sets the result processor for this {@link Operation}. - * - * @param function processes the count produced by executing this - * {@link Operation} and returns the result - * @return this {@link CountOperation} - * @throws IllegalStateException if this method has been called previously - */ - public CountOperation apply(Function function); - - @Override - public CountOperation onError(Consumer handler); - - @Override - public CountOperation timeout(Duration minTime); - -} diff -r fb523d4d9185 -r 3b438b3fef46 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DynamicMultiOperation.java --- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/DynamicMultiOperation.java Wed Jun 20 15:38:40 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.incubator.sql2; - -import java.time.Duration; -import java.util.concurrent.CompletionStage; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * - * A multi-operation is an {@link Operation} that returns one or more results in - * addition to the result defined by the {@link Operation}. A {@link DynamicMultiOperation} is a - * multi-operation where the number and types of the results are determined at - * execution. - * - * NOTE: In general one way to do things is sufficient however the API provides - * two ways to handle multiple results. This way, the dynamic way, is required - * because the number and type of results cannot always be known in advance. The - * static way is also provided because it is much easier to use when the number - * and type of results is known. The improvement in ease of use outweighs the - * duplication IMO. If necessary one or the other can be eliminated. Eliminating - * dynamic reduces functionality. Eliminating static reduces ease of use in what - * I believe to be a common case. - * - * @param type of the result of this DynamicMultiOperation - */ -public interface DynamicMultiOperation extends OutOperation { - - /** - * Provides a handler for count results. The provided handler is called for - * each count result. When called the first argument is the number of results - * that preceeded the current result. The second argument is a CountOperation - * that will process the current result. This CountOperation has not been - * configured in any way nor has it been submitted. The handler configures the - * CountOperation and submits it. The count result is processed when the - * CountOperation is submitted. - * - * If this method is not called any count result is ignored. - * - * @param handler not null - * @return this DynamicMultiOperation - * @throws IllegalStateException if the CountOperation has not been submitted - * when the call to the handler returns - */ - public DynamicMultiOperation onCount(BiConsumer> handler); - - /** - * Provides a handler for row sequence results. The provided handler is called for - * each row sequence result. When called the first argument is the number of results - * that preceeded the current result. The second argument is a RowOperation - * that will process the current result. This RowOperation has not been - * configured in any way nor has it been submitted. The handler configures the - * RowOperation and submits it. The row sequence result is processed when the - * RowOperation is submitted. - * - * If this method is not called any row sequence result is ignored. - * - * @param handler the error handler for this operation - * @return This DynamicMultiOperation - * @throws IllegalStateException if the RowOperation has not been submitted - * when the call to the handler returns - */ - public DynamicMultiOperation onRows(BiConsumer> handler); - - /** - * Provides an error handler for this {@link Operation}. The provided handler - * is called for each error that occurs. When called the first argument is the - * number of results, including errors, that preceeded the current error. The - * second argument is a {@link Throwable} corresponding to the error. When the - * handler returns processing of the DynamicMultiOperation results continues. - * Only one onError method may be called. - * - * @param handler a BiConsumer that handles an error - * @return this DynamicMultiOperation - * @throws IllegalStateException if any onError method was called previously - */ - public DynamicMultiOperation onError(BiConsumer handler); - - // Covariant overrides - - /** - * Provides an error handler for this {@link Operation}. If execution of this - * {@link Operation} results in an error, before the Operation is completed, - * the handler is called with the {@link Throwable} as the argument. When the - * handler returns the {@link Operation} is completed exceptionally with the - * {@link Throwable}. - * - * @param handler the error handler for this operation - * @return this DynamicMultiOperation - * @throws IllegalStateException if any onError method was called previously - */ - @Override - public DynamicMultiOperation onError(Consumer handler); - - @Override - public DynamicMultiOperation outParameter(String id, SqlType type); - - @Override - public DynamicMultiOperation apply(Function processor); - - @Override - public DynamicMultiOperation set(String id, Object value); - - @Override - public DynamicMultiOperation set(String id, Object value, SqlType type); - - @Override - public DynamicMultiOperation set(String id, CompletionStage source); - - @Override - public DynamicMultiOperation set(String id, CompletionStage source, SqlType type); - - @Override - public DynamicMultiOperation timeout(Duration minTime); - -} diff -r fb523d4d9185 -r 3b438b3fef46 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ParameterizedCountOperation.java --- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ParameterizedCountOperation.java Wed Jun 20 15:38:40 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jdk.incubator.sql2; - -import java.time.Duration; -import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * A {@link ParameterizedCountOperation} is a {@link ParameterizedOperation} that returns a count. - * - * @param the type of the result of this {@link Operation} - */ -public interface ParameterizedCountOperation extends ParameterizedOperation, CountOperation { - - /** - * Returns a {@link RowOperation} to process the auto-generated keys, if any, returned - * by this {@link Operation}. If no keys are named the columns of the returned - * rows are implementation dependent. If keys are specified the columns of the - * returned rows are the keys. The {@link RowOperation} must be submitted before this - * {@link Operation} is submitted. If it has not submitting this {@link Operation} will - * result throw {@link IllegalStateException}. - * - * ISSUE: Should this be in {@link CountOperation}? - * - * @param keys the names of the returned columns or null. - * @return A RowOperation that will process the auto-generated keys - * @throws IllegalStateException if this method has already been called on this - * {@link Operation} or if this {@link Operation} has already been submitted. - */ - public RowOperation returning(String ... keys); - - // Covariant overrides - - @Override - public ParameterizedCountOperation onError(Consumer handler); - - @Override - ParameterizedCountOperation apply(Function processor); - - @Override - public ParameterizedCountOperation set(String id, Object value); - - @Override - public ParameterizedCountOperation set(String id, Object value, SqlType type); - - @Override - public ParameterizedCountOperation set(String id, CompletionStage source); - - @Override - public ParameterizedCountOperation set(String id, CompletionStage source, SqlType type); - - @Override - public ParameterizedCountOperation timeout(Duration minTime); - -} diff -r fb523d4d9185 -r 3b438b3fef46 src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/StaticMultiOperation.java --- a/src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/StaticMultiOperation.java Wed Jun 20 15:38:40 2018 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.incubator.sql2; - -import java.time.Duration; -import java.util.concurrent.CompletionStage; -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * A multi-operation is an {@link Operation} that returns one or more results in - * addition to the result defined by the {@link Operation}. A - * {@link StaticMultiOperation} is a multi-operation where the number and types - * of the results are known in advance. Operations are executed in the order - * submitted. If an {@link Operation} is created but not submitted prior to the - * {@link StaticMultiOperation} being submitted, submitting the - * {@link StaticMultiOperation} throws {@link IllegalStateException}. - * - * @param The type of the result of this {@link Operation} - * @see DynamicMultiOperation - */ -public interface StaticMultiOperation extends OutOperation { - - /** - * Returns a {@link RowOperation} to process a row sequence result. The - * {@link Operation}s are executed in the order they are submitted. If a - * result is of the wrong type for the next submitted {@link Operation} the - * {@link StaticMultiOperation} is completed with - * {@link IllegalStateException}. - * - * @return a {@link RowOperation} that is part of this {@link StaticMultiOperation} - */ - public RowOperation rowOperation(); - - /** - * Returns a {@link CountOperation} to process a count result. The {@link Operation}s - * are executed in the order they are submitted. If a result is of the wrong - * type for the next submitted Operation the {@link StaticMultiOperation} is completed - * with {@link IllegalStateException}. - * - * @return a {@link CountOperation} that is part of this {@link StaticMultiOperation} - */ - public CountOperation countOperation(); - - // Covariant overrides - - @Override - public StaticMultiOperation onError(Consumer handler); - - @Override - public StaticMultiOperation apply(Function processor); - - @Override - public StaticMultiOperation outParameter(String id, SqlType type); - - @Override - public StaticMultiOperation set(String id, Object value, SqlType type); - - @Override - public StaticMultiOperation set(String id, Object value); - - @Override - public StaticMultiOperation set(String id, CompletionStage source, SqlType type); - - @Override - public StaticMultiOperation set(String id, CompletionStage source); - - @Override - public StaticMultiOperation timeout(Duration minTime); - -}