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