src/jdk.incubator.adba/share/classes/jdk/incubator/sql2/ParameterizedRowOperation.java
author lancea
Wed, 20 Jun 2018 15:38:40 -0400
branchJDK-8188051-branch
changeset 56797 fb523d4d9185
parent 56380 f06946e00a26
child 56997 c9cbac2979fb
permissions -rw-r--r--
JDK-8188051-branch updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56380
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     1
/*
56797
fb523d4d9185 JDK-8188051-branch updates
lancea
parents: 56380
diff changeset
     2
 * Copyright (c)  2017, 2018, Oracle and/or its affiliates. All rights reserved.
56380
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     4
 *
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    10
 *
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    15
 * accompanied this code).
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    16
 *
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    20
 *
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    23
 * questions.
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    24
 */
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    25
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    26
package jdk.incubator.sql2;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    27
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    28
import java.time.Duration;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    29
import java.util.concurrent.CompletionStage;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    30
import java.util.function.Consumer;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    31
import java.util.stream.Collector;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    32
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    33
/**
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    34
 * An Operation that accepts parameters and processes a sequence of rows.
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    35
 * 
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    36
 * @param <T> the type of the result of this {@link Operation}
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    37
 */
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    38
public interface ParameterizedRowOperation<T> extends ParameterizedOperation<T>, RowOperation<T> {
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    39
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    40
  // Covariant overrides
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    41
  
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    42
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    43
  public ParameterizedRowOperation<T> onError(Consumer<Throwable> handler);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    44
  
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    45
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    46
  public ParameterizedRowOperation<T> fetchSize(long rows) throws IllegalArgumentException;
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    47
  
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    48
  @Override
56797
fb523d4d9185 JDK-8188051-branch updates
lancea
parents: 56380
diff changeset
    49
  public <A, S extends T> ParameterizedRowOperation<T> collect(Collector<? super Result.RowColumn, A, S> c);
56380
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    50
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    51
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    52
  public ParameterizedRowOperation<T> set(String id, Object value, SqlType type);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    53
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    54
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    55
  public ParameterizedRowOperation<T> set(String id, CompletionStage<?> source, SqlType type);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    56
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    57
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    58
  public ParameterizedRowOperation<T> set(String id, CompletionStage<?> source);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    59
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    60
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    61
  public ParameterizedRowOperation<T> set(String id, Object value);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    62
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    63
  @Override
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    64
  public ParameterizedRowOperation<T> timeout(Duration minTime);
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    65
f06946e00a26 JDK-8188051-branch: add jdk.incubator.adba
lancea
parents:
diff changeset
    66
}