Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions nexus-sdk/src/main/java/io/nexusrpc/Experimental.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.nexusrpc;

import java.lang.annotation.*;

/**
* Annotation that specifies that an element is experimental, has unstable API or may change without
* notice. This annotation is inherited.
*/
@Inherited
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.FIELD, ElementType.TYPE, ElementType.METHOD})
public @interface Experimental {}
1 change: 1 addition & 0 deletions nexus-sdk/src/main/java/io/nexusrpc/OperationInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.jspecify.annotations.Nullable;

/** Information about an operation. */
@Experimental
public class OperationInfo {
/** Create a builder. */
public static Builder newBuilder() {
Expand Down
3 changes: 3 additions & 0 deletions nexus-sdk/src/main/java/io/nexusrpc/handler/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.nexusrpc.OperationException;
import io.nexusrpc.OperationInfo;
import io.nexusrpc.OperationStillRunningException;
import io.nexusrpc.Experimental;

/** Top-level handler for service calls. */
public interface Handler {
Expand All @@ -23,6 +24,7 @@ OperationStartResult<HandlerResultContent> startOperation(
*
* <p>If the result is an output stream, it will be closed later by the caller.
*/
@Experimental
HandlerResultContent fetchOperationResult(
OperationContext context, OperationFetchResultDetails details)
throws OperationStillRunningException, OperationException, HandlerException;
Expand All @@ -31,6 +33,7 @@ HandlerResultContent fetchOperationResult(
* Fetch information about the asynchronously started operation. See {@link
* OperationHandler#fetchInfo} for details.
*/
@Experimental
OperationInfo fetchOperationInfo(OperationContext context, OperationFetchInfoDetails details)
throws HandlerException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;

import io.nexusrpc.Experimental;
import org.jspecify.annotations.Nullable;

/** Content that can be fixed or streaming as a result of an operation. */
@Experimental
public class HandlerResultContent {
/** Create a builder for content. */
public static Builder newBuilder() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package io.nexusrpc.handler;

import java.util.Objects;

import io.nexusrpc.Experimental;
import org.jspecify.annotations.Nullable;

/** Details for handling operation fetch info. */
@Experimental
public class OperationFetchInfoDetails {
/** Create a builder. */
public static Builder newBuilder() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.nexusrpc.handler;

import io.nexusrpc.Experimental;
import io.nexusrpc.OperationStillRunningException;
import java.time.Duration;
import java.util.Objects;
import org.jspecify.annotations.Nullable;

/** Details for handling operation fetch result. */
@Experimental
public class OperationFetchResultDetails {
/** Create a builder. */
public static Builder newBuilder() {
Expand Down
Loading