--- 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 <T> the type of the result of the {@link Operation}
- * @see ParameterizedCountOperation
- */
-public interface CountOperation<T> extends Operation<T> {
-
- /**
- * 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<T> apply(Function<Result.Count, ? extends T> function);
-
- @Override
- public CountOperation<T> onError(Consumer<Throwable> handler);
-
- @Override
- public CountOperation<T> timeout(Duration minTime);
-
-}
--- 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 <T> type of the result of this DynamicMultiOperation
- */
-public interface DynamicMultiOperation<T> extends OutOperation<T> {
-
- /**
- * 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<T> onCount(BiConsumer<Integer, CountOperation<T>> 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<T> onRows(BiConsumer<Integer, RowOperation<T>> 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<T> onError(BiConsumer<Integer, Throwable> 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<T> onError(Consumer<Throwable> handler);
-
- @Override
- public DynamicMultiOperation<T> outParameter(String id, SqlType type);
-
- @Override
- public DynamicMultiOperation<T> apply(Function<Result.OutParameterMap, ? extends T> processor);
-
- @Override
- public DynamicMultiOperation<T> set(String id, Object value);
-
- @Override
- public DynamicMultiOperation<T> set(String id, Object value, SqlType type);
-
- @Override
- public DynamicMultiOperation<T> set(String id, CompletionStage<?> source);
-
- @Override
- public DynamicMultiOperation<T> set(String id, CompletionStage<?> source, SqlType type);
-
- @Override
- public DynamicMultiOperation<T> timeout(Duration minTime);
-
-}
--- 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 <T> the type of the result of this {@link Operation}
- */
-public interface ParameterizedCountOperation<T> extends ParameterizedOperation<T>, CountOperation<T> {
-
- /**
- * 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<T> returning(String ... keys);
-
- // Covariant overrides
-
- @Override
- public ParameterizedCountOperation<T> onError(Consumer<Throwable> handler);
-
- @Override
- ParameterizedCountOperation<T> apply(Function<Result.Count, ? extends T> processor);
-
- @Override
- public ParameterizedCountOperation<T> set(String id, Object value);
-
- @Override
- public ParameterizedCountOperation<T> set(String id, Object value, SqlType type);
-
- @Override
- public ParameterizedCountOperation<T> set(String id, CompletionStage<?> source);
-
- @Override
- public ParameterizedCountOperation<T> set(String id, CompletionStage<?> source, SqlType type);
-
- @Override
- public ParameterizedCountOperation<T> timeout(Duration minTime);
-
-}
--- 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 <T> The type of the result of this {@link Operation}
- * @see DynamicMultiOperation
- */
-public interface StaticMultiOperation<T> extends OutOperation<T> {
-
- /**
- * 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<T> 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<T> countOperation();
-
- // Covariant overrides
-
- @Override
- public StaticMultiOperation<T> onError(Consumer<Throwable> handler);
-
- @Override
- public StaticMultiOperation<T> apply(Function<Result.OutParameterMap, ? extends T> processor);
-
- @Override
- public StaticMultiOperation<T> outParameter(String id, SqlType type);
-
- @Override
- public StaticMultiOperation<T> set(String id, Object value, SqlType type);
-
- @Override
- public StaticMultiOperation<T> set(String id, Object value);
-
- @Override
- public StaticMultiOperation<T> set(String id, CompletionStage<?> source, SqlType type);
-
- @Override
- public StaticMultiOperation<T> set(String id, CompletionStage<?> source);
-
- @Override
- public StaticMultiOperation<T> timeout(Duration minTime);
-
-}