Skip to content

Clean up internal packages #1026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2022
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
3 changes: 3 additions & 0 deletions bson/src/main/org/bson/internal/ProvidersCodecRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import static org.bson.assertions.Assertions.isTrueArgument;
import static org.bson.assertions.Assertions.notNull;

/**
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class ProvidersCodecRegistry implements CycleDetectingCodecRegistry {
private final List<CodecProvider> codecProviders;
private final CodecCache codecCache = new CodecCache();
Expand Down
2 changes: 2 additions & 0 deletions bson/src/main/org/bson/internal/UuidHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

/**
* Utilities for encoding and decoding UUID into binary.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class UuidHelper {
private static void writeLongToArrayBigEndian(final byte[] bytes, final int offset, final long x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.mongodb.internal;

/**
* This class is not part of the public API and may be removed or changed at any time.
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
@FunctionalInterface
public interface CheckedSupplier<T, E extends Exception> {
Expand Down
2 changes: 1 addition & 1 deletion driver-core/src/main/com/mongodb/internal/HexUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.security.NoSuchAlgorithmException;

/**
* This class is not part of the public API and may be removed or changed at any time.
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class HexUtils {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/**
* A {@link RequestContext} that can be ignored by the driver. Useful to ensure that we always
* have a non-null {@link RequestContext} to pass around the driver.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class IgnorableRequestContext implements RequestContext {

Expand Down
3 changes: 3 additions & 0 deletions driver-core/src/main/com/mongodb/internal/Iterables.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import static java.util.Arrays.asList;
import static java.util.Collections.singleton;

/**
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class Iterables {
@SafeVarargs
@SuppressWarnings("varargs")
Expand Down
2 changes: 1 addition & 1 deletion driver-core/src/main/com/mongodb/internal/Locks.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.function.Supplier;

/**
* This class is not part of the public API and may be removed or changed at any time.
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class Locks {
public static void withLock(final Lock lock, final Runnable action) {
Expand Down
2 changes: 2 additions & 0 deletions driver-core/src/main/com/mongodb/internal/Timeout.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
/**
* A <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html">value-based</a> class
* useful for tracking timeouts.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
@Immutable
public final class Timeout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* Denotes that the annotated program element is made more accessible than otherwise necessary for the purpose of testing.
* The annotated program element must be used as if it had the {@linkplain #otherwise() intended} access modifier
* for any purpose other than testing.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,14 @@
/**
* Extends the async batch cursor interface to include information included in an aggregate or getMore response.
*
* @param <T> The type of documents the cursor contains
* @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#wire-op-get-more OP_GET_MORE
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncAggregateResponseBatchCursor<T> extends AsyncBatchCursor<T> {
/**
* Returns the postBatchResumeToken.
*
* @return the postBatchResumeToken
*/
BsonDocument getPostBatchResumeToken();

/**
* Returns the operation time found in the aggregate or getMore response.
*
* @return the operation time
*/
BsonTimestamp getOperationTime();

/**
* Returns true if the first batch was empty.
*
* @return true if the first batch was empty
*/
boolean isFirstBatchEmpty();

/**
* Returns the max wire version.
*
* @return the max wire version
*/
int getMaxWireVersion();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
* the {@code next} method will return the first batch, and subsequent calls will trigger an asynchronous request to get the next batch
* of results. Clients can control the batch size by setting the {@code batchSize} property between calls to {@code next}.
*
* @param <T> The type of documents the cursor contains
* @mongodb.driver.manual ../meta-driver/latest/legacy/mongodb-wire-protocol/#wire-op-get-more OP_GET_MORE
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncBatchCursor<T> extends Closeable {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
import static com.mongodb.assertions.Assertions.notNull;

/**
* This class is not part of the public API and may be removed or changed at any time.
*
* @param <T> the result type
* <p>This class is not part of the public API and may be removed or changed at any time.</p>
*/
public class ErrorHandlingResultCallback<T> implements SingleResultCallback<T> {
private final SingleResultCallback<T> wrapped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
/**
* An interface to describe the completion of an asynchronous function, which may be represented as {@link AsyncCallbackFunction}.
*
* @param <T> The type of a successful result. A failed result is of the {@link Throwable} type.
* @see AsyncCallbackFunction
*<p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface SingleResultCallback<T> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* An {@linkplain AsyncCallbackFunction asynchronous callback-based function} of two parameters.
* This class is a callback-based counterpart of {@link BiFunction}.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @param <P1> The type of the first parameter to the function.
* @param <P2> The type of the second parameter to the function.
* @param <R> See {@link AsyncCallbackFunction}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* are used as they defined by the Java Language Specification, while the terms "successful" and "failed completion" are used to refer to a
* situation when the function produces either a successful or a failed result respectively.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @param <P> The type of the first parameter to the function.
* @param <R> The type of successful result. A failed result is of the {@link Throwable} type
* as defined by {@link SingleResultCallback#onResult(Object, Throwable)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* <li>the original function calls {@link LoopState#breakAndCompleteIf(Supplier, SingleResultCallback)}.</li>
* </ul>
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
@NotThreadSafe
public final class AsyncCallbackLoop implements AsyncCallbackRunnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* An {@linkplain AsyncCallbackFunction asynchronous callback-based function} of no parameters and no successful result.
* This class is a callback-based counterpart of {@link Runnable}.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @see AsyncCallbackFunction
*/
@FunctionalInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Any asynchronous callback function with parameters may be represented this way by partially applying the function to its parameters
* until no parameters are left unapplied, and only a callback is left to be consumed.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @param <R> See {@link AsyncCallbackFunction}.
* @see AsyncCallbackFunction
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* {@linkplain #attachment(AttachmentKey) Attachments} may be used by the associated loop
* to preserve a state between iterations.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @see AsyncCallbackLoop
*/
@NotThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
* {@linkplain #attachment(AttachmentKey) Attachments} may be used by the associated retryable activity either
* to preserve a state between attempts.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @see RetryingSyncSupplier
* @see RetryingAsyncCallbackSupplier
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* For example, the {@link RetryState#breakAndCompleteIfRetryAnd(Supplier, SingleResultCallback)} method may be used to
* break retrying if the original function decides so.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @see RetryingSyncSupplier
*/
@NotThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* For example, the {@link RetryState#breakAndThrowIfRetryAnd(Supplier)} method may be used to
* break retrying if the original function decides so.
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @see RetryingAsyncCallbackSupplier
*/
@NotThreadSafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Utility class for working with AWS authentication.
*
* <p>This class should not be considered a part of the public API.</p>
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class AwsCredentialHelper {
public static final Logger LOGGER = Loggers.getLogger("authenticator");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.util.function.Supplier;

public final class AwsSdkV1CredentialSupplier implements Supplier<AwsCredential> {
final class AwsSdkV1CredentialSupplier implements Supplier<AwsCredential> {

private final AWSCredentialsProvider provider = DefaultAWSCredentialsProviderChain.getInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.util.function.Supplier;

public final class AwsSdkV2CredentialSupplier implements Supplier<AwsCredential> {
final class AwsSdkV2CredentialSupplier implements Supplier<AwsCredential> {

private final AwsCredentialsProvider provider = DefaultCredentialsProvider.create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import static com.mongodb.internal.authentication.HttpHelper.getHttpContents;

public class BuiltInAwsCredentialSupplier implements Supplier<AwsCredential> {
class BuiltInAwsCredentialSupplier implements Supplier<AwsCredential> {

@Override
public AwsCredential get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* Utility class for working with GCP authentication.
*
* <p>This class should not be considered a part of the public API.</p>
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class GcpCredentialHelper {
public static BsonDocument obtainFromEnvironment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@

/**
* Utility class for working with HTTP servers.
*
* <p>This class should not be considered a part of the public API.</p>
*/
public final class HttpHelper {
final class HttpHelper {

private HttpHelper() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Utility class for working with MongoDB native authentication.
*
* <p>This class should not be considered a part of the public API.</p>
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class NativeAuthenticationHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Utility class for Sasl string preparation.
*
* <p>This class should not be considered a part of the public API.</p>
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public final class SaslPrep {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import java.util.concurrent.atomic.AtomicInteger;

/**
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public abstract class AbstractReferenceCounted implements ReferenceCounted {
private final AtomicInteger referenceCount = new AtomicInteger(1);
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.mongodb.internal.connection.Cluster;

/**
* This interface is not part of the public API and may be removed or changed at any time.
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncClusterAwareReadWriteBinding extends AsyncReadWriteBinding {
Cluster getCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* A simple ReadWriteBinding implementation that supplies write connection sources bound to a possibly different primary each time, and a
* read connection source bound to a possible different server each time.
*
* @since 3.0
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public class AsyncClusterBinding extends AbstractReferenceCounted implements AsyncClusterAwareReadWriteBinding {
private final Cluster cluster;
Expand All @@ -61,7 +61,7 @@ public class AsyncClusterBinding extends AbstractReferenceCounted implements Asy
* @param readConcern a non-null read concern
* @param serverApi a server API, which may be null
* @param requestContext the request context
* @since 3.8
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public AsyncClusterBinding(final Cluster cluster, final ReadPreference readPreference, final ReadConcern readConcern,
@Nullable final ServerApi serverApi, final RequestContext requestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* A source of connections to a single MongoDB server.
*
* @since 3.0
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncConnectionSource extends ReferenceCounted {

Expand All @@ -44,7 +44,7 @@ public interface AsyncConnectionSource extends ReferenceCounted {
*
* @return the session context, which may not be null
*
* @since 3.6
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
SessionContext getSessionContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* An asynchronous factory of connection sources to servers that can be read from and that satisfy the specified read preference.
*
* @since 3.0
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncReadBinding extends ReferenceCounted {
/**
Expand All @@ -40,7 +40,6 @@ public interface AsyncReadBinding extends ReferenceCounted {
*
* @return the session context, which may not be null
*
* @since 3.6
*/
SessionContext getSessionContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* An asynchronous factory of connection sources to servers that can be read from or written to.
*
* @since 3.0
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*/
public interface AsyncReadWriteBinding extends AsyncReadBinding, AsyncWriteBinding, ReferenceCounted {
@Override
Expand Down
Loading