├── driver-core ├── .gitignore └── src │ ├── test │ ├── unit │ │ └── com │ │ │ └── mongodb │ │ │ ├── internal │ │ │ └── connection │ │ │ │ ├── DefaultServerMonitorSpecification.groovy │ │ │ │ └── ServerListenerFactory.java │ │ │ └── spock │ │ │ └── Slow.java │ └── resources │ │ └── logback-test.xml │ └── main │ ├── resources │ └── META-INF │ │ └── native-image │ │ ├── resource-config.json │ │ └── native-image.properties │ └── com │ └── mongodb │ ├── assertions │ └── package-info.java │ ├── lang │ └── package-info.java │ ├── package-info.java │ ├── annotations │ └── package-info.java │ ├── session │ └── package-info.java │ ├── DBObjectFactory.java │ ├── bulk │ └── package-info.java │ ├── connection │ └── package-info.java │ ├── event │ └── package-info.java │ ├── client │ ├── result │ │ └── package-info.java │ ├── model │ │ ├── bulk │ │ │ ├── package-info.java │ │ │ ├── BaseClientDeleteOptions.java │ │ │ ├── ClientNamespacedInsertOneModel.java │ │ │ ├── ClientNamespacedDeleteManyModel.java │ │ │ └── ClientNamespacedUpdateManyModel.java │ │ ├── geojson │ │ │ ├── package-info.java │ │ │ └── codecs │ │ │ │ └── package-info.java │ │ ├── changestream │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── vault │ │ │ └── package-info.java │ │ ├── WriteModel.java │ │ ├── fill │ │ │ ├── LocfFillOutputField.java │ │ │ ├── LinearFillOutputField.java │ │ │ └── ValueFillOutputField.java │ │ └── ApproximateQuantileMethod.java │ ├── cursor │ │ └── package-info.java │ └── gridfs │ │ ├── model │ │ └── package-info.java │ │ └── codecs │ │ └── package-info.java │ ├── management │ ├── package-info.java │ └── NullMBeanServer.java │ ├── internal │ ├── connection │ │ ├── ServerMonitor.java │ │ ├── package-info.java │ │ ├── DnsSrvRecordMonitor.java │ │ ├── netty │ │ │ └── package-info.java │ │ ├── Pool.java │ │ └── CommandEventSender.java │ ├── observability │ │ ├── micrometer │ │ │ ├── TraceContext.java │ │ │ └── package-info.java │ │ └── package-info.java │ ├── dns │ │ └── package-info.java │ ├── package-info.java │ ├── event │ │ └── package-info.java │ ├── inject │ │ └── package-info.java │ ├── thread │ │ └── package-info.java │ ├── time │ │ └── package-info.java │ ├── async │ │ ├── package-info.java │ │ ├── function │ │ │ └── package-info.java │ │ └── AsyncConsumer.java │ ├── bulk │ │ └── package-info.java │ ├── function │ │ └── package-info.java │ ├── logging │ │ └── package-info.java │ ├── selector │ │ └── package-info.java │ ├── session │ │ └── package-info.java │ ├── binding │ │ └── package-info.java │ ├── capi │ │ └── package-info.java │ ├── client │ │ ├── package-info.java │ │ ├── model │ │ │ ├── package-info.java │ │ │ ├── bulk │ │ │ │ └── package-info.java │ │ │ └── changestream │ │ │ │ └── package-info.java │ │ └── vault │ │ │ └── package-info.java │ ├── operation │ │ ├── package-info.java │ │ └── retry │ │ │ └── package-info.java │ ├── validator │ │ └── package-info.java │ ├── authentication │ │ └── package-info.java │ └── diagnostics │ │ └── logging │ │ └── package-info.java │ ├── selector │ └── package-info.java │ └── observability │ └── package-info.java ├── java-security-ocsp-property ├── driver-legacy └── src │ ├── test │ ├── resources │ │ └── GridFSLegacy │ │ │ └── GridFSTestFile.txt │ └── functional │ │ └── com │ │ └── mongodb │ │ ├── ClassA.java │ │ └── ClassB.java │ ├── examples │ └── tour │ │ └── package-info.java │ └── main │ └── com │ └── mongodb │ ├── WriteRequest.java │ ├── client │ └── jndi │ │ └── package-info.java │ ├── DBCallback.java │ ├── gridfs │ └── package-info.java │ ├── DBDecoderFactory.java │ └── DBEncoderFactory.java ├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── bump-version.sh │ └── bump-and-tag.sh ├── graalvm-native-image-app └── src │ └── main │ ├── resources │ └── META-INF │ │ ├── native-image │ │ ├── proxy-config.json │ │ ├── predefined-classes-config.json │ │ ├── serialization-config.json │ │ └── jni-config.json │ │ └── services │ │ ├── com.mongodb.spi.dns.DnsClientProvider │ │ └── com.mongodb.spi.dns.InetAddressResolverProvider │ └── com │ └── mongodb │ └── internal │ └── graalvm │ └── package-info.java ├── mongodb-crypt └── src │ ├── test │ └── resources │ │ ├── list-collections-filter.json │ │ ├── command.json │ │ ├── encrypted-value.json │ │ ├── command-reply.json │ │ ├── key-filter-keyAltName.json │ │ ├── fle2-find-range-explicit-v2 │ │ └── int32 │ │ │ ├── rangeopts.json │ │ │ ├── key-filter.json │ │ │ └── value-to-encrypt.json │ │ ├── encrypted-command.json │ │ ├── key-filter.json │ │ ├── json-schema.json │ │ ├── kms-reply.txt │ │ ├── encrypted-command-reply.json │ │ ├── mongocryptd-reply.json │ │ ├── mongocryptd-command.json │ │ └── keys │ │ └── ABCDEFAB123498761234123456789012-local-document.json │ └── main │ ├── com │ └── mongodb │ │ ├── crypt │ │ └── capi │ │ │ └── package-info.java │ │ └── internal │ │ └── crypt │ │ └── capi │ │ └── package-info.java │ └── resources │ └── META-INF │ └── native-image │ └── native-image.properties ├── .gitattributes ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── scala │ └── lib │ └── scala-ant-2.13.1.jar ├── .gitmodules ├── config ├── spock │ ├── ExcludeSlow.groovy │ └── OnlySlow.groovy ├── scala │ └── scalafmt.conf ├── LICENSE └── mongodb.license ├── sbom.json ├── bson-scala └── src │ ├── main │ └── scala │ │ └── org │ │ └── mongodb │ │ └── scala │ │ └── bson │ │ ├── annotations │ │ ├── BsonIgnore.scala │ │ └── BsonProperty.scala │ │ └── conversions │ │ └── package.scala │ └── test │ └── scala │ └── org │ └── mongodb │ └── scala │ └── bson │ └── BaseSpec.scala ├── bson └── src │ ├── test │ ├── resources │ │ └── bson │ │ │ ├── null.json │ │ │ ├── maxkey.json │ │ │ ├── minkey.json │ │ │ ├── undefined.json │ │ │ ├── boolean.json │ │ │ └── oid.json │ └── unit │ │ └── org │ │ └── bson │ │ ├── codecs │ │ ├── SimpleEnum.java │ │ ├── pojo │ │ │ └── entities │ │ │ │ ├── InterfaceBasedModel.java │ │ │ │ ├── package-info.java │ │ │ │ ├── conventions │ │ │ │ ├── CollectionNameModel.java │ │ │ │ ├── DiscriminatorNameModel.java │ │ │ │ ├── package-info.java │ │ │ │ ├── FieldStorageModel.java │ │ │ │ ├── PropertyNameModel.java │ │ │ │ ├── InterfaceModel.java │ │ │ │ └── AnnotationNameCollision.java │ │ │ │ ├── InterfaceUpperBoundsModel.java │ │ │ │ ├── InterfaceModelA.java │ │ │ │ ├── InterfaceGenericModel.java │ │ │ │ ├── InterfaceModelB.java │ │ │ │ ├── InterfaceUpperBoundsModelAbstract.java │ │ │ │ ├── ConcreteField.java │ │ │ │ ├── AbstractCollectionSpecificReturnTypeCreatorModel.java │ │ │ │ ├── InterfaceModelC.java │ │ │ │ ├── ConcreteModel.java │ │ │ │ ├── DiscriminatorModel.java │ │ │ │ └── UpperBoundsConcreteModel.java │ │ └── BsonDocumentSubclass.java │ │ └── internal │ │ └── Holder.java │ └── main │ ├── resources │ └── META-INF │ │ └── native-image │ │ ├── reflect-config.json │ │ └── native-image.properties │ └── org │ └── bson │ ├── package-info.java │ ├── json │ ├── package-info.java │ ├── JsonStringConverter.java │ ├── JsonBooleanConverter.java │ ├── JsonBuffer.java │ ├── JsonDoubleConverter.java │ ├── JsonInt32Converter.java │ ├── JsonNullConverter.java │ ├── RelaxedExtendedJsonInt64Converter.java │ ├── ShellMaxKeyConverter.java │ ├── ShellMinKeyConverter.java │ ├── ShellUndefinedConverter.java │ ├── JsonSymbolConverter.java │ └── JsonJavaScriptConverter.java │ ├── types │ └── package-info.java │ ├── codecs │ ├── package-info.java │ ├── pojo │ │ ├── package-info.java │ │ ├── annotations │ │ │ └── package-info.java │ │ ├── PojoCodec.java │ │ └── PropertyModelSerializationImpl.java │ ├── jsr310 │ │ └── package-info.java │ ├── configuration │ │ └── package-info.java │ └── Codec.java │ ├── conversions │ └── package-info.java │ ├── assertions │ └── package-info.java │ ├── io │ └── package-info.java │ ├── annotations │ └── package-info.java │ └── diagnostics │ └── package-info.java ├── driver-benchmarks └── src │ ├── resources │ ├── logback.xml │ └── keyDocument.json │ └── main │ └── com │ └── mongodb │ └── benchmark │ ├── benchmarks │ └── IdRemover.java │ └── framework │ └── BenchmarkResultWriter.java ├── .git-blame-ignore-revs ├── driver-sync └── src │ ├── test │ ├── resources │ │ └── logback-test.xml │ └── functional │ │ └── com │ │ └── mongodb │ │ └── client │ │ ├── unified │ │ ├── OperationAsserter.java │ │ ├── SessionsTest.java │ │ └── UnifiedAuthTest.java │ │ ├── ExplainTest.java │ │ └── ServerSelectionProseTest.java │ ├── examples │ ├── tour │ │ └── package-info.java │ └── gridfs │ │ └── package-info.java │ └── main │ └── com │ └── mongodb │ └── client │ ├── package-info.java │ ├── vault │ └── package-info.java │ ├── gridfs │ └── package-info.java │ └── internal │ └── package-info.java ├── driver-reactive-streams └── src │ ├── test │ ├── resources │ │ └── logback-test.xml │ └── functional │ │ └── com │ │ └── mongodb │ │ └── reactivestreams │ │ └── client │ │ └── syncadapter │ │ └── package-info.java │ ├── examples │ └── reactivestreams │ │ ├── tour │ │ └── package-info.java │ │ ├── helpers │ │ └── package-info.java │ │ ├── gridfs │ │ └── package-info.java │ │ └── primer │ │ └── PrimerTestCase.java │ └── main │ └── com │ └── mongodb │ └── reactivestreams │ └── client │ ├── vault │ └── package-info.java │ ├── gridfs │ └── package-info.java │ └── internal │ ├── package-info.java │ ├── crypt │ └── package-info.java │ ├── vault │ └── package-info.java │ └── gridfs │ └── package-info.java ├── .evergreen ├── run-deployed-lambda-aws-tests.sh ├── run-reactive-streams-tck-tests.sh ├── static-checks.sh ├── run-atlas-search-tests.sh ├── run-atlas-search-index-management-tests.sh └── run-perf-tests.sh ├── driver-scala ├── src │ ├── integrationTest │ │ └── scala │ │ │ └── org │ │ │ └── mongodb │ │ │ └── scala │ │ │ ├── syncadapter │ │ │ └── SyncMongoClient.scala │ │ │ ├── unified │ │ │ ├── UnifiedCrudTest.scala │ │ │ └── ClientEncryptionTest.scala │ │ │ └── BaseSpec.scala │ ├── test │ │ ├── resources │ │ │ └── logback-test.xml │ │ └── scala │ │ │ └── org │ │ │ └── mongodb │ │ │ └── scala │ │ │ └── BaseSpec.scala │ └── main │ │ └── scala │ │ └── org │ │ └── mongodb │ │ └── scala │ │ ├── vault │ │ └── package.scala │ │ └── Tag.scala └── rootdoc.txt ├── .gitignore ├── bson-record-codec └── src │ ├── test │ └── unit │ │ └── org │ │ └── bson │ │ └── codecs │ │ └── record │ │ └── samples │ │ ├── TestRecordEmbedded.java │ │ ├── TestRecordParameterized.java │ │ ├── TestRecordWithIllegalBsonIgnoreOnComponent.java │ │ ├── TestRecordWithNestedParameterized.java │ │ ├── TestRecordWithNullableField.java │ │ ├── TestRecordWithIllegalBsonDiscriminatorOnRecord.java │ │ ├── TestRecordWithIllegalBsonExtraElementsOnComponent.java │ │ ├── TestRecordWithListOfRecords.java │ │ ├── TestRecordWithMapOfRecords.java │ │ ├── TestSelfReferentialHolderRecord.java │ │ └── TestRecordWithIllegalBsonIdOnAccessor.java │ └── main │ └── org │ └── bson │ └── codecs │ └── record │ └── package-info.java └── driver-lambda └── samconfig.toml /driver-core/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /java-security-ocsp-property: -------------------------------------------------------------------------------- 1 | ocsp.enable=true 2 | -------------------------------------------------------------------------------- /driver-legacy/src/test/resources/GridFSLegacy/GridFSTestFile.txt: -------------------------------------------------------------------------------- 1 | GridFS Test File 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Listing code owners is required by DRIVERS-3098 2 | * @mongodb/dbx-java -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/native-image/proxy-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | ] -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/list-collections-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test" 3 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=auto -------------------------------------------------------------------------------- /driver-core/src/test/unit/com/mongodb/internal/connection/DefaultServerMonitorSpecification.groovy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-java-driver/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/scala/lib/scala-ant-2.13.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/mongo-java-driver/HEAD/gradle/scala/lib/scala-ant-2.13.1.jar -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/command.json: -------------------------------------------------------------------------------- 1 | { 2 | "find": "test", 3 | "filter": { 4 | "ssn": "457-55-5462" 5 | } 6 | } -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "specifications"] 2 | path = driver-core/src/test/resources/specifications 3 | url = https://github.com/mongodb/specifications 4 | -------------------------------------------------------------------------------- /config/spock/ExcludeSlow.groovy: -------------------------------------------------------------------------------- 1 | package spock 2 | 3 | runner { 4 | println "Excluding Slow Spock tests" 5 | exclude com.mongodb.spock.Slow 6 | } 7 | -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/services/com.mongodb.spi.dns.DnsClientProvider: -------------------------------------------------------------------------------- 1 | com.mongodb.internal.graalvm.CustomDnsClientProvider 2 | -------------------------------------------------------------------------------- /config/spock/OnlySlow.groovy: -------------------------------------------------------------------------------- 1 | package spock 2 | 3 | runner { 4 | println "Only including Slow Spock tests" 5 | include com.mongodb.spock.Slow 6 | } 7 | -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/services/com.mongodb.spi.dns.InetAddressResolverProvider: -------------------------------------------------------------------------------- 1 | com.mongodb.internal.graalvm.CustomInetAddressResolverProvider 2 | -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/native-image/predefined-classes-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type":"agent-extracted", 4 | "classes":[ 5 | ] 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/native-image/serialization-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "types":[ 3 | ], 4 | "lambdaCapturingTypes":[ 5 | ], 6 | "proxies":[ 7 | ] 8 | } -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/resources/META-INF/native-image/jni-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name":"com.mongodb.internal.graalvm.NativeImageApp", 4 | "methods":[{"name":"main","parameterTypes":["java.lang.String[]"] }] 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/encrypted-value.json: -------------------------------------------------------------------------------- 1 | { 2 | "v": { 3 | "$binary": "AWFhYWFhYWFhYWFhYWFhYWECW+zDjR/69eS6VtuMD5+O2lZw6JyiWOw3avI7mnUkdpKzPfvy8F/nlZrgZa2cGmQsb0TmLZuk5trldosnGKD91w==", 4 | "$type": "06" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /sbom.json: -------------------------------------------------------------------------------- 1 | { 2 | "serialNumber": "urn:uuid:a291eaa6-9c96-4c46-9fb1-474f745cf6f5", 3 | "version": 1, 4 | "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", 5 | "bomFormat": "CycloneDX", 6 | "specVersion": "1.5" 7 | } 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gitsubmodule" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | commit-message: 8 | prefix: "build" 9 | include: "scope" 10 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/command-reply.json: -------------------------------------------------------------------------------- 1 | { 2 | "cursor": { 3 | "firstBatch": [ 4 | { 5 | "_id": 1, 6 | "ssn": "457-55-5462" 7 | } 8 | ], 9 | "id": 0, 10 | "ns": "test.test" 11 | }, 12 | "ok": 1 13 | } 14 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/key-filter-keyAltName.json: -------------------------------------------------------------------------------- 1 | { 2 | "$or": [ 3 | { 4 | "_id": { 5 | "$in": [] 6 | } 7 | }, 8 | { 9 | "keyAltNames": { 10 | "$in": ["altKeyName"] 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /bson-scala/src/main/scala/org/mongodb/scala/bson/annotations/BsonIgnore.scala: -------------------------------------------------------------------------------- 1 | package org.mongodb.scala.bson.annotations 2 | 3 | import scala.annotation.StaticAnnotation 4 | 5 | /** 6 | * Annotation to ignore a property. 7 | * 8 | * @since 4.2 9 | */ 10 | case class BsonIgnore() extends StaticAnnotation 11 | -------------------------------------------------------------------------------- /driver-core/src/main/resources/META-INF/native-image/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources":{ 3 | "includes":[{ 4 | "pattern":"\\QMETA-INF/services/com.mongodb.spi.dns.DnsClientProvider\\E" 5 | }, { 6 | "pattern":"\\QMETA-INF/services/com.mongodb.spi.dns.InetAddressResolverProvider\\E" 7 | }]}, 8 | "bundles":[] 9 | } 10 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/null.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Null type", 3 | "bson_type": "0x0A", 4 | "test_key": "a", 5 | "valid": [ 6 | { 7 | "description": "Null", 8 | "canonical_bson": "080000000A610000", 9 | "canonical_extjson": "{\"a\" : null}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/fle2-find-range-explicit-v2/int32/rangeopts.json: -------------------------------------------------------------------------------- 1 | { 2 | "min": { 3 | "$numberInt": "0" 4 | }, 5 | "max": { 6 | "$numberInt": "200" 7 | }, 8 | "sparsity": { 9 | "$numberLong": "1" 10 | }, 11 | "trimFactor": { 12 | "$numberInt": "1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/maxkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Maxkey type", 3 | "bson_type": "0x7F", 4 | "test_key": "a", 5 | "valid": [ 6 | { 7 | "description": "Maxkey", 8 | "canonical_bson": "080000007F610000", 9 | "canonical_extjson": "{\"a\" : {\"$maxKey\" : 1}}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/minkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Minkey type", 3 | "bson_type": "0xFF", 4 | "test_key": "a", 5 | "valid": [ 6 | { 7 | "description": "Minkey", 8 | "canonical_bson": "08000000FF610000", 9 | "canonical_extjson": "{\"a\" : {\"$minKey\" : 1}}" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/encrypted-command.json: -------------------------------------------------------------------------------- 1 | { 2 | "filter": { 3 | "ssn": { 4 | "$binary": { 5 | "base64": "AWFhYWFhYWFhYWFhYWFhYWECRTOW9yZzNDn5dGwuqsrJQNLtgMEKaujhs9aRWRp+7Yo3JK8N8jC8P0Xjll6C1CwLsE/iP5wjOMhVv1KMMyOCSCrHorXRsb2IKPtzl2lKTqQ=", 6 | "subType": "06" 7 | } 8 | } 9 | }, 10 | "find": "test" 11 | } 12 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/key-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$or": [ 3 | { 4 | "_id": { 5 | "$in": [ 6 | { 7 | "$binary": "YWFhYWFhYWFhYWFhYWFhYQ==", 8 | "$type": "04" 9 | } 10 | ] 11 | } 12 | }, 13 | { 14 | "keyAltNames": { 15 | "$in": [] 16 | } 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /.github/workflows/bump-version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | if [ "$#" -ne 2 ]; then 5 | echo "Usage: $0 " >&2 6 | exit 1 7 | fi 8 | 9 | FROM_VERSION=$1 10 | TO_VERSION=$2 11 | 12 | sed --in-place "s/version=${FROM_VERSION}/version=${TO_VERSION}/g" gradle.properties 13 | git commit -m "Version: bump ${TO_VERSION}" gradle.properties 14 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/json-schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "ssn": { 4 | "encrypt": { 5 | "keyId": { 6 | "$binary": "YWFhYWFhYWFhYWFhYWFhYQ==", 7 | "$type": "04" 8 | }, 9 | "type": "string", 10 | "algorithm": "AEAD_AES_CBC_HMAC_SHA512-Deterministic" 11 | } 12 | } 13 | }, 14 | "bsonType": "object" 15 | } -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/fle2-find-range-explicit-v2/int32/key-filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$or": [ 3 | { 4 | "_id": { 5 | "$in": [ 6 | { 7 | "$binary": "q83vqxI0mHYSNBI0VniQEg==", 8 | "$type": "04" 9 | } 10 | ] 11 | } 12 | }, 13 | { 14 | "keyAltNames": { 15 | "$in": [] 16 | } 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /driver-benchmarks/src/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/kms-reply.txt: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | x-amzn-RequestId: deeb35e5-4ecb-4bf1-9af5-84a54ff0af0e 3 | Content-Type: application/x-amz-json-1.1 4 | Content-Length: 233 5 | 6 | {"KeyId": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", "Plaintext": "TqhXy3tKckECjy4/ZNykMWG8amBF46isVPzeOgeusKrwheBmYaU8TMG5AHR/NeUDKukqo8hBGgogiQOVpLPkqBQHD8YkLsNbDmHoGOill5QAHnniF/Lz405bGucB5TfR"} -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # .git-blame-ignore-revs 2 | # Checkstyle fixes 3 | 94780bc8b72c62d9bc09beaa9ac62b942debab5f 4 | # Copyright fixes 5 | 0aa2ec20d5215c0ac727602dd2cd891c22c69ba8 6 | # Scala spotless changes 7 | fd21430c967571ed172259cc4100f291257a9a01 8 | # IntelliJ automated code cleanup 9 | d9aa6044e1a6b440bcb013c330497f2813484050 10 | # Remove `final` in catch clauses 11 | 4b3b48546fb0457e5c515ccfe8780e373ad7de5f 12 | -------------------------------------------------------------------------------- /driver-sync/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/scala/scalafmt.conf: -------------------------------------------------------------------------------- 1 | version = "3.7.1" 2 | runner.dialect = scala213 3 | 4 | preset = default 5 | 6 | danglingParentheses.preset = true 7 | docstrings.style = keep 8 | #docstrings.style = Asterisk 9 | #docstrings.wrap = no 10 | maxColumn = 120 11 | rewrite.rules = [SortImports] 12 | newlines.topLevelStatements = [] 13 | newlines.source=keep 14 | newlines.implicitParamListModifierPrefer=before 15 | 16 | spaces.inImportCurlyBraces = true 17 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/encrypted-command-reply.json: -------------------------------------------------------------------------------- 1 | { 2 | "cursor" : { 3 | "firstBatch" : [ 4 | { 5 | "_id": 1, 6 | "ssn": { 7 | "$binary": "AWFhYWFhYWFhYWFhYWFhYWECRTOW9yZzNDn5dGwuqsrJQNLtgMEKaujhs9aRWRp+7Yo3JK8N8jC8P0Xjll6C1CwLsE/iP5wjOMhVv1KMMyOCSCrHorXRsb2IKPtzl2lKTqQ=", 8 | "$type": "06" 9 | } 10 | } 11 | ], 12 | "id" : 0, 13 | "ns" : "test.test" 14 | }, 15 | "ok" : 1 16 | } -------------------------------------------------------------------------------- /bson/src/main/resources/META-INF/native-image/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name":"java.lang.Object", 4 | "queryAllDeclaredMethods":true 5 | }, 6 | { 7 | "name":"sun.security.provider.NativePRNG", 8 | "methods":[{"name":"","parameterTypes":[] }, {"name":"","parameterTypes":["java.security.SecureRandomParameters"] }] 9 | }, 10 | { 11 | "name":"sun.security.provider.SHA", 12 | "methods":[{"name":"","parameterTypes":[] }] 13 | }, 14 | { 15 | "name":"org.slf4j.Logger" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/undefined.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Undefined type (deprecated)", 3 | "bson_type": "0x06", 4 | "deprecated": true, 5 | "test_key": "a", 6 | "valid": [ 7 | { 8 | "description": "Undefined", 9 | "canonical_bson": "0800000006610000", 10 | "canonical_extjson": "{\"a\" : {\"$undefined\" : true}}", 11 | "converted_bson": "080000000A610000", 12 | "converted_extjson": "{\"a\" : null}" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.evergreen/run-deployed-lambda-aws-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" 7 | . "${RELATIVE_DIR_PATH}/setup-env.bash" 8 | 9 | # compiled outside of lambda workflow. Note "SkipBuild: True" in template.yaml 10 | ./gradlew -version 11 | ./gradlew --info driver-lambda:shadowJar 12 | 13 | . ${DRIVERS_TOOLS}/.evergreen/aws_lambda/run-deployed-lambda-aws-tests.sh 14 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/fle2-find-range-explicit-v2/int32/value-to-encrypt.json: -------------------------------------------------------------------------------- 1 | { 2 | "v": { 3 | "$and": [ 4 | { 5 | "age": { 6 | "$gte": { 7 | "$numberInt": "23" 8 | } 9 | } 10 | }, 11 | { 12 | "age": { 13 | "$lte": { 14 | "$numberInt": "35" 15 | } 16 | } 17 | } 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/mongocryptd-reply.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaRequiresEncryption": true, 3 | "ok": { 4 | "$numberInt": "1" 5 | }, 6 | "result": { 7 | "filter": { 8 | "ssn": { 9 | "$binary": { 10 | "base64": "ADgAAAAQYQABAAAABWtpABAAAAAEYWFhYWFhYWFhYWFhYWFhYQJ2AAwAAAA0NTctNTUtNTQ2MgAA", 11 | "subType": "06" 12 | } 13 | } 14 | }, 15 | "find": "test" 16 | }, 17 | "hasEncryptedPlaceholders": true 18 | } -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/mongocryptd-command.json: -------------------------------------------------------------------------------- 1 | { 2 | "find": "test", 3 | "filter": { 4 | "ssn": "457-55-5462" 5 | }, 6 | "jsonSchema": { 7 | "properties": { 8 | "ssn": { 9 | "encrypt": { 10 | "keyId": { 11 | "$binary": "YWFhYWFhYWFhYWFhYWFhYQ==", 12 | "$type": "04" 13 | }, 14 | "type": "string", 15 | "algorithm": "AEAD_AES_CBC_HMAC_SHA512-Deterministic" 16 | } 17 | } 18 | }, 19 | "bsonType": "object" 20 | }, 21 | "isRemoteSchema": true 22 | } -------------------------------------------------------------------------------- /.evergreen/run-reactive-streams-tck-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | ############################################ 7 | # Main Program # 8 | ############################################ 9 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")" 10 | . "${RELATIVE_DIR_PATH}/setup-env.bash" 11 | 12 | echo "Running Reactive Streams TCK tests with Java ${JAVA_VERSION}" 13 | 14 | ./gradlew -version 15 | ./gradlew --stacktrace --info driver-reactive-streams:tckTest 16 | -------------------------------------------------------------------------------- /config/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008-$today.year MongoDB, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /.evergreen/static-checks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace # Write all commands first to stderr 4 | set -o errexit # Exit the script with error if any of the commands fail 5 | 6 | ############################################ 7 | # Main Program # 8 | ############################################ 9 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" 10 | . "${RELATIVE_DIR_PATH}/setup-env.bash" 11 | 12 | echo "Compiling JVM drivers" 13 | 14 | ./gradlew -version 15 | ./gradlew -PxmlReports.enabled=true --info -x test -x integrationTest -x spotlessApply clean check scalaCheck jar testClasses docs 16 | -------------------------------------------------------------------------------- /config/mongodb.license: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoClient.scala: -------------------------------------------------------------------------------- 1 | package org.mongodb.scala.syncadapter 2 | 3 | import com.mongodb.MongoDriverInformation 4 | import com.mongodb.client.{ MongoClient => JMongoClient } 5 | import org.mongodb.scala.MongoClient 6 | 7 | case class SyncMongoClient(wrapped: MongoClient) extends SyncMongoCluster(wrapped) with JMongoClient { 8 | 9 | override def close(): Unit = wrapped.close() 10 | 11 | override def getClusterDescription = throw new UnsupportedOperationException 12 | 13 | override def appendMetadata(mongoDriverInformation: MongoDriverInformation): Unit = 14 | wrapped.appendMetadata(mongoDriverInformation) 15 | } 16 | -------------------------------------------------------------------------------- /driver-benchmarks/src/resources/keyDocument.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": { 3 | "$binary": { 4 | "base64": "YWFhYWFhYWFhYWFhYWFhYQ==", 5 | "subType": "04" 6 | } 7 | }, 8 | "keyMaterial": { 9 | "$binary": { 10 | "base64": "ACR7Hm33dDOAAD7l2ubZhSpSUWK8BkALUY+qW3UgBAEcTV8sBwZnaAWnzDsmrX55dgmYHWfynDlJogC/e33u6pbhyXvFTs5ow9OLCuCWBJ39T/Ivm3kMaZJybkejY0V+uc4UEdHvVVz/SbitVnzs2WXdMGmo1/HmDRrxGYZjewFslquv8wtUHF5pyB+QDlQBd/al9M444/8bJZFbMSmtIg==", 11 | "subType": "00" 12 | } 13 | }, 14 | "creationDate": { 15 | "$date": "2023-08-21T14:28:20.875Z" 16 | }, 17 | "updateDate": { 18 | "$date": "2023-08-21T14:28:20.875Z" 19 | }, 20 | "status": 0, 21 | "masterKey": { 22 | "provider": "local" 23 | } 24 | } -------------------------------------------------------------------------------- /.github/workflows/bump-and-tag.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | if [ "$#" -ne 3 ]; then 5 | echo "Usage: $0 " >&2 6 | exit 1 7 | fi 8 | 9 | CURRENT_VERSION=$1 10 | RELEASE_VERSION=$2 11 | NEXT_VERSION=$3 12 | 13 | SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) 14 | 15 | echo "Bump version in gradle.properties to ${RELEASE_VERSION}" 16 | ${SCRIPT_DIR}/bump-version.sh "${RELEASE_VERSION_WITHOUT_SUFFIX}-SNAPSHOT" "${RELEASE_VERSION}" 17 | 18 | echo "Create release tag for ${RELEASE_VERSION}" 19 | git tag -a -m "${RELEASE_VERSION}" r${RELEASE_VERSION} 20 | 21 | echo "Bump to snapshot version for ${NEXT_VERSION}" 22 | ${SCRIPT_DIR}/bump-version.sh "${RELEASE_VERSION}" "${NEXT_VERSION}-SNAPSHOT" 23 | -------------------------------------------------------------------------------- /bson/src/main/resources/META-INF/native-image/native-image.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-present MongoDB, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | Args = --initialize-at-run-time=org.bson.types.ObjectId 17 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/examples/reactivestreams/tour/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package reactivestreams.tour; 19 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains the base BSON classes. 19 | */ 20 | package org.bson; 21 | -------------------------------------------------------------------------------- /driver-scala/rootdoc.txt: -------------------------------------------------------------------------------- 1 | This is the documentation for the MongoDB Scala driver. 2 | 3 | == Driver structure == 4 | 5 | The [[http://mongodb.org mongodb]] scala driver. 6 | 7 | To get started you need a [[org.mongodb.scala.MongoClient MongoClient]] instance, either from a 8 | [[https://www.mongodb.com/docs/manual/reference/connection-string/ connection string]] or via a [[org.mongodb.scala.MongoClientSettings]]. 9 | 10 | Notable packages include: 11 | 12 | - [[org.mongodb.scala.MongoClient MongoClient]] The MongoClient used to connect and access MongoDB 13 | - [[org.mongodb.scala.MongoDatabase MongoDatabase]] Providing access to a specific database 14 | - [[org.mongodb.scala.MongoCollection MongoCollection]] Providing access to a specific collection in a database. 15 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/examples/reactivestreams/helpers/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package reactivestreams.helpers; 19 | -------------------------------------------------------------------------------- /driver-core/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /driver-scala/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /driver-sync/src/examples/tour/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the quick tour examples 19 | */ 20 | package tour; 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * JSON serialization and deserialization. 19 | */ 20 | package org.bson.json; 21 | -------------------------------------------------------------------------------- /driver-legacy/src/examples/tour/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the quick tour examples 19 | */ 20 | package tour; 21 | -------------------------------------------------------------------------------- /driver-sync/src/examples/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the gridfs tour example 19 | */ 20 | package gridfs; 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/types/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes implementing various BSON types. 19 | */ 20 | package org.bson.types; 21 | -------------------------------------------------------------------------------- /.evergreen/run-atlas-search-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | # Supported/used environment variables: 6 | # MONGODB_URI Set the connection to an Atlas cluster 7 | 8 | ############################################ 9 | # Main Program # 10 | ############################################ 11 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" 12 | source "${RELATIVE_DIR_PATH}/setup-env.bash" 13 | 14 | echo "Running Atlas Search tests" 15 | 16 | ./gradlew -version 17 | ./gradlew --stacktrace --info \ 18 | -Dorg.mongodb.test.atlas.search=true \ 19 | -Dorg.mongodb.test.uri=${ATLAS_SEARCH_URI} \ 20 | driver-core:test --tests AggregatesSearchIntegrationTest \ 21 | --tests AggregatesBinaryVectorSearchIntegrationTest \ 22 | --tests AggregatesSearchTest \ 23 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains all the default BSON codecs. 19 | */ 20 | package org.bson.codecs; 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/conversions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the Bson interface 19 | */ 20 | package org.bson.conversions; 21 | -------------------------------------------------------------------------------- /.evergreen/run-atlas-search-index-management-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | # Supported/used environment variables: 6 | # MONGODB_URI Set the connection to an Atlas cluster 7 | 8 | ############################################ 9 | # Main Program # 10 | ############################################ 11 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")" 12 | source "${RELATIVE_DIR_PATH}/setup-env.bash" 13 | 14 | echo "Running Atlas Search tests" 15 | ./gradlew -version 16 | ./gradlew --stacktrace --info \ 17 | -Dorg.mongodb.test.atlas.search.index.helpers=true \ 18 | -Dorg.mongodb.test.uri=${MONGODB_URI} \ 19 | driver-sync:test --tests AtlasSearchIndexManagementProseTest \ 20 | driver-reactive-streams:test --tests AtlasSearchIndexManagementProseTest \ 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/assertions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains design by contract assertions 19 | */ 20 | package org.bson.assertions; 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/io/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes implementing I/O operations used by BSON objects. 19 | */ 20 | package org.bson.io; 21 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/assertions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains design by contract assertions 19 | */ 20 | package com.mongodb.assertions; 21 | -------------------------------------------------------------------------------- /mongodb-crypt/src/main/com/mongodb/crypt/capi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | /** 19 | * The mongocrypt API package 20 | */ 21 | package com.mongodb.crypt.capi; 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .#* 3 | .git 4 | *# 5 | 6 | # os x stuff 7 | *Thumbs.db* 8 | *.DS_Store 9 | 10 | # Build artifacts 11 | build 12 | target 13 | out 14 | mongo*.jar 15 | 16 | # Eclipse files 17 | .classpath 18 | .project 19 | .settings 20 | 21 | # Intellij IDEA files 22 | *.ipr 23 | *.iws 24 | *.iml 25 | *.idea 26 | workspace.xml 27 | atlassian-ide-plugin.xml 28 | 29 | # gradle 30 | .gradle 31 | 32 | # code review 33 | codereview.rc 34 | 35 | # evergreen 36 | expansion.yml 37 | 38 | # local settings 39 | **/gradle.properties 40 | local.properties 41 | 42 | # jenv 43 | .java-version 44 | 45 | #sdkman 46 | .sdkmanrc 47 | 48 | # mongocryptd 49 | **/mongocryptd*.pid 50 | 51 | # shell scripts 52 | *.sh 53 | !.evergreen/*.sh 54 | 55 | # security-sensitive files 56 | *.gpg 57 | 58 | # bin build directories 59 | **/bin 60 | 61 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/SimpleEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs; 18 | 19 | public enum SimpleEnum { 20 | ALPHA, 21 | BRAVO, 22 | CHARLIE 23 | } 24 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/pojo/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes specific to mapping user POJOs. 19 | */ 20 | package org.bson.codecs.pojo; 21 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/boolean.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Boolean", 3 | "bson_type": "0x08", 4 | "test_key": "b", 5 | "valid": [ 6 | { 7 | "description": "True", 8 | "canonical_bson": "090000000862000100", 9 | "canonical_extjson": "{\"b\" : true}" 10 | }, 11 | { 12 | "description": "False", 13 | "canonical_bson": "090000000862000000", 14 | "canonical_extjson": "{\"b\" : false}" 15 | } 16 | ], 17 | "decodeErrors": [ 18 | { 19 | "description": "Invalid boolean value of 2", 20 | "bson": "090000000862000200" 21 | }, 22 | { 23 | "description": "Invalid boolean value of -1", 24 | "bson": "09000000086200FF00" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceBasedModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | public interface InterfaceBasedModel { 20 | } 21 | -------------------------------------------------------------------------------- /graalvm-native-image-app/src/main/com/mongodb/internal/graalvm/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @NonNullApi 17 | package com.mongodb.internal.graalvm; 18 | 19 | import com.mongodb.lang.NonNullApi; 20 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/annotations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains annotations that can apply to any part of the BSON library code. 19 | */ 20 | package org.bson.annotations; 21 | -------------------------------------------------------------------------------- /mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | /** 19 | * The mongocrypt internal package 20 | */ 21 | package com.mongodb.internal.crypt.capi; 22 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/jsr310/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes specific to the JSR-310 Date and Time API 19 | */ 20 | package org.bson.codecs.jsr310; 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/diagnostics/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains the classes for visibility of the BSON layer, for example Logging. 19 | */ 20 | package org.bson.diagnostics; 21 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/lang/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains JSR 305-compatible annotations related to nullability. 19 | */ 20 | package com.mongodb.lang; 21 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * The core mongodb package 19 | */ 20 | @NonNullApi 21 | package com.mongodb; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordEmbedded.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | public record TestRecordEmbedded(String name) { 20 | } 21 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Test entities and related classes for the conventions tests 19 | */ 20 | package org.bson.codecs.pojo.entities; 21 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/annotations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains annotations that can apply to any part of the driver code. 19 | */ 20 | package com.mongodb.annotations; 21 | -------------------------------------------------------------------------------- /driver-lambda/samconfig.toml: -------------------------------------------------------------------------------- 1 | # More information about the configuration file can be found here: 2 | # https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html 3 | version = 0.1 4 | 5 | [default] 6 | [default.global.parameters] 7 | stack_name = "lambdatest" 8 | 9 | [default.build.parameters] 10 | cached = true 11 | parallel = false 12 | 13 | [default.validate.parameters] 14 | lint = true 15 | 16 | [default.deploy.parameters] 17 | capabilities = "CAPABILITY_IAM" 18 | confirm_changeset = false # headless 19 | resolve_s3 = true 20 | 21 | [default.package.parameters] 22 | resolve_s3 = true 23 | 24 | [default.sync.parameters] 25 | watch = true 26 | 27 | [default.local_start_api.parameters] 28 | warm_containers = "EAGER" 29 | 30 | [default.local_start_lambda.parameters] 31 | warm_containers = "EAGER" 32 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/examples/reactivestreams/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | /** 19 | * This package contains the gridfs tour example 20 | */ 21 | package reactivestreams.gridfs; 22 | -------------------------------------------------------------------------------- /bson-record-codec/src/main/org/bson/codecs/record/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes for encoding and decoding Java records. 19 | */ 20 | package org.bson.codecs.record; 21 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/CollectionNameModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | public final class CollectionNameModel { 20 | } 21 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains codec configurations and the codec registry helper 19 | */ 20 | package org.bson.codecs.configuration; 21 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/DiscriminatorNameModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | public final class DiscriminatorNameModel { 20 | } 21 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Package contains test models for conventions 19 | */ 20 | package org.bson.codecs.pojo.entities.conventions; 21 | -------------------------------------------------------------------------------- /mongodb-crypt/src/main/resources/META-INF/native-image/native-image.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-present MongoDB, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | Args =\ 17 | --initialize-at-run-time=\ 18 | com.mongodb.internal.crypt.capi.CAPI,\ 19 | com.sun.jna.Native,\ 20 | com.sun.jna.Structure 21 | -------------------------------------------------------------------------------- /driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/IdRemover.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.mongodb.benchmark.benchmarks; 19 | 20 | public interface IdRemover { 21 | void removeId(T document); 22 | } 23 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/WriteRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | abstract class WriteRequest { 20 | abstract com.mongodb.internal.bulk.WriteRequest toNew(DBCollection dbCollection); 21 | } 22 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/client/jndi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains a JNDI ObjectFactory implementation. 19 | * 20 | * @since 3.4 21 | */ 22 | package com.mongodb.client.jndi; 23 | -------------------------------------------------------------------------------- /driver-scala/src/integrationTest/scala/org/mongodb/scala/unified/UnifiedCrudTest.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.unified 18 | 19 | object UnifiedCrudTest extends UnifiedTest { 20 | val directory = "crud" 21 | } 22 | -------------------------------------------------------------------------------- /driver-scala/src/main/scala/org/mongodb/scala/vault/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mongodb.scala 17 | 18 | /** 19 | * This package contains the Key Vault API 20 | * 21 | * @since 2.7 22 | */ 23 | package object vault {} 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/session/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes related to sessions 19 | */ 20 | @NonNullApi 21 | package com.mongodb.session; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-legacy/src/test/functional/com/mongodb/ClassA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | public class ClassA extends BasicDBObject { 20 | private static final long serialVersionUID = -5066012099738511289L; 21 | } 22 | -------------------------------------------------------------------------------- /driver-legacy/src/test/functional/com/mongodb/ClassB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | public class ClassB extends BasicDBObject { 20 | private static final long serialVersionUID = -270548788202734185L; 21 | } 22 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/FieldStorageModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | public final class FieldStorageModel { 20 | private String id; 21 | } 22 | -------------------------------------------------------------------------------- /driver-sync/src/main/com/mongodb/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the synchronous CRUD API. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/syncadapter/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @NonNullApi 18 | package com.mongodb.reactivestreams.client.syncadapter; 19 | 20 | import com.mongodb.lang.NonNullApi; 21 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceUpperBoundsModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | public interface InterfaceUpperBoundsModel { 20 | T getNestedModel(); 21 | } 22 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/DBCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | import org.bson.BSONCallback; 20 | 21 | /** 22 | * The DB callback interface. 23 | */ 24 | public interface DBCallback extends BSONCallback { 25 | } 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/DBObjectFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | import java.util.List; 20 | 21 | interface DBObjectFactory { 22 | DBObject getInstance(); 23 | 24 | DBObject getInstance(List path); 25 | } 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/bulk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes for representing the result of a bulk write operation. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.bulk; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/connection/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes that manage connecting to MongoDB servers. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.connection; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/event/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains cluster and connection event related classes 19 | */ 20 | @NonNullApi 21 | package com.mongodb.event; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/result/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes representing operation results 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.result; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceModelA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | 20 | public interface InterfaceModelA { 21 | 22 | String getPropertyA(); 23 | 24 | void setPropertyA(String property); 25 | } 26 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/internal/Holder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.internal; 18 | 19 | import java.util.Collection; 20 | 21 | public class Holder { 22 | @SuppressWarnings("VisibilityModifier") 23 | public Collection> c; 24 | } 25 | -------------------------------------------------------------------------------- /driver-scala/src/integrationTest/scala/org/mongodb/scala/unified/ClientEncryptionTest.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.unified 18 | 19 | object ClientEncryptionTest extends UnifiedTest { 20 | val directory = "client-side-encryption/tests/unified" 21 | } 22 | -------------------------------------------------------------------------------- /driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mongodb.scala 17 | 18 | import org.scalatest.flatspec.AnyFlatSpec 19 | import org.scalatest.matchers.should.Matchers 20 | 21 | abstract class BaseSpec extends AnyFlatSpec with Matchers {} 22 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/BsonDocumentSubclass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs; 18 | 19 | import org.bson.BsonDocument; 20 | 21 | public class BsonDocumentSubclass extends BsonDocument { 22 | private static final long serialVersionUID = 1L; 23 | } 24 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceGenericModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | 20 | public interface InterfaceGenericModel { 21 | 22 | T getPropertyA(); 23 | 24 | void setPropertyA(T property); 25 | } 26 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/PropertyNameModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | public final class PropertyNameModel { 20 | private int myModelField; 21 | private int myModel2Field; 22 | } 23 | -------------------------------------------------------------------------------- /driver-sync/src/main/com/mongodb/client/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the Key Vault API 19 | * 20 | * @since 3.11 21 | */ 22 | 23 | @NonNullApi 24 | package com.mongodb.client.vault; 25 | 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /bson-scala/src/test/scala/org/mongodb/scala/bson/BaseSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mongodb.scala.bson 17 | 18 | import org.scalatest.flatspec.AnyFlatSpec 19 | import org.scalatest.matchers.should.Matchers 20 | 21 | abstract class BaseSpec extends AnyFlatSpec with Matchers {} 22 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/bulk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Models, options, results for the client-level bulk write operation. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.model.bulk; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/geojson/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes that represent GeoJSON objects. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.model.geojson; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-scala/src/integrationTest/scala/org/mongodb/scala/BaseSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.mongodb.scala 17 | 18 | import org.scalatest.flatspec.AnyFlatSpec 19 | import org.scalatest.matchers.should.Matchers 20 | 21 | abstract class BaseSpec extends AnyFlatSpec with Matchers {} 22 | -------------------------------------------------------------------------------- /driver-sync/src/main/com/mongodb/client/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the new GridFS implementation 19 | * 20 | * @since 3.1 21 | */ 22 | @NonNullApi 23 | package com.mongodb.client.gridfs; 24 | 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/changestream/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes for the change stream api 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.model.changestream; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/management/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes for monitoring the server/driver via Java Management Extensions (JMX). 19 | */ 20 | @NonNullApi 21 | package com.mongodb.management; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-sync/src/test/functional/com/mongodb/client/unified/OperationAsserter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.unified; 18 | 19 | import org.bson.BsonDocument; 20 | 21 | interface OperationAsserter { 22 | void assertOperation(BsonDocument operation, int index); 23 | } 24 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/InterfaceModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonDiscriminator; 20 | 21 | @BsonDiscriminator 22 | public interface InterfaceModel { 23 | } 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/cursor/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains models and options that help describe MongoCollection operations 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.cursor; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/gridfs/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains models for use with GridFS 19 | * 20 | * @since 3.1 21 | */ 22 | @NonNullApi 23 | package com.mongodb.client.gridfs.model; 24 | 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains models and options that help describe MongoCollection operations 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.model; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-scala/src/main/scala/org/mongodb/scala/Tag.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala 18 | 19 | import com.mongodb.{ Tag => JTag } 20 | 21 | /** 22 | * A replica set tag. 23 | */ 24 | object Tag { 25 | def apply(name: String, value: String): Tag = new JTag(name, value) 26 | } 27 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordParameterized.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import java.util.List; 20 | 21 | public record TestRecordParameterized(N number, List parameterizedList) { 22 | } 23 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceModelB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | 20 | public interface InterfaceModelB extends InterfaceModelA { 21 | 22 | String getPropertyB(); 23 | 24 | void setPropertyB(String propertyB); 25 | } 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/gridfs/codecs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains codecs for use with GridFS 19 | * 20 | * @since 3.3 21 | */ 22 | @NonNullApi 23 | package com.mongodb.client.gridfs.codecs; 24 | 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/geojson/codecs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains classes that encode and decode GeoJSON objects. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.client.model.geojson.codecs; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains options classes for the key vault API 19 | * 20 | * @since 3.11 21 | */ 22 | @NonNullApi 23 | package com.mongodb.client.model.vault; 24 | 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/ServerMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.connection; 18 | 19 | interface ServerMonitor { 20 | 21 | void start(); 22 | 23 | void connect(); 24 | 25 | void close(); 26 | 27 | void cancelCurrentCheck(); 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/selector/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes that determine how to select the server to connect to in order to send commands or queries. 19 | */ 20 | @NonNullApi 21 | package com.mongodb.selector; 22 | 23 | import com.mongodb.lang.NonNullApi; 24 | -------------------------------------------------------------------------------- /.evergreen/run-perf-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o xtrace 4 | set -o errexit 5 | 6 | rm -rf driver-performance-test-data 7 | git clone https://github.com/mongodb-labs/driver-performance-test-data.git 8 | cd driver-performance-test-data 9 | tar xf extended_bson.tgz 10 | tar xf parallel.tgz 11 | tar xf single_and_multi_document.tgz 12 | cd .. 13 | 14 | RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")" 15 | . "${RELATIVE_DIR_PATH}/setup-env.bash" 16 | 17 | export TEST_PATH="${PROJECT_DIRECTORY}/driver-performance-test-data/" 18 | export OUTPUT_FILE="${PROJECT_DIRECTORY}/results.json" 19 | 20 | if [ "${PROVIDER}" = "Netty" ]; then 21 | TASK="driver-benchmarks:runNetty" 22 | else 23 | TASK="driver-benchmarks:run" 24 | fi 25 | 26 | start_time=$(date +%s) 27 | ./gradlew -Dorg.mongodb.benchmarks.data=${TEST_PATH} -Dorg.mongodb.benchmarks.output=${OUTPUT_FILE} ${TASK} 28 | end_time=$(date +%s) 29 | elapsed_secs=$((end_time-start_time)) 30 | 31 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceUpperBoundsModelAbstract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | abstract class InterfaceUpperBoundsModelAbstract implements InterfaceUpperBoundsModel { 20 | public abstract String getName(); 21 | } 22 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/observability/micrometer/TraceContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.observability.micrometer; 18 | 19 | @SuppressWarnings("InterfaceIsType") 20 | public interface TraceContext { 21 | TraceContext EMPTY = new TraceContext() { 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the Key Vault API 19 | * 20 | * @since 1.12 21 | */ 22 | @NonNullApi 23 | package com.mongodb.reactivestreams.client.vault; 24 | 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonStringConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonStringConverter implements Converter { 20 | @Override 21 | public void convert(final String value, final StrictJsonWriter writer) { 22 | writer.writeString(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/pojo/annotations/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package defines various annotations used by the driver provided when used in conjunction with the 19 | * {@link org.bson.codecs.pojo.Conventions#ANNOTATION_CONVENTION}. 20 | */ 21 | package org.bson.codecs.pojo.annotations; 22 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonBooleanConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonBooleanConverter implements Converter { 20 | @Override 21 | public void convert(final Boolean value, final StrictJsonWriter writer) { 22 | writer.writeBoolean(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/pojo/PojoCodec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo; 18 | 19 | import org.bson.codecs.Codec; 20 | 21 | abstract class PojoCodec implements Codec { 22 | 23 | abstract ClassModel getClassModel(); 24 | 25 | abstract DiscriminatorLookup getDiscriminatorLookup(); 26 | } 27 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonBuffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | interface JsonBuffer { 20 | 21 | int getPosition(); 22 | 23 | int read(); 24 | 25 | void unread(int c); 26 | 27 | int mark(); 28 | 29 | void reset(int markPos); 30 | 31 | void discard(int markPos); 32 | } 33 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/observability/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes related to observability 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.observability; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithIllegalBsonIgnoreOnComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonIgnore; 20 | 21 | public record TestRecordWithIllegalBsonIgnoreOnComponent(@BsonIgnore String name) { 22 | } 23 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/ConcreteField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | public class ConcreteField extends BaseField { 20 | 21 | public ConcreteField() { 22 | } 23 | 24 | public ConcreteField(final String name) { 25 | super(name); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mongodb-crypt/src/test/resources/keys/ABCDEFAB123498761234123456789012-local-document.json: -------------------------------------------------------------------------------- 1 | { 2 | "_id": { 3 | "$binary": { 4 | "base64": "q83vqxI0mHYSNBI0VniQEg==", 5 | "subType": "04" 6 | } 7 | }, 8 | "keyMaterial": { 9 | "$binary": { 10 | "base64": "27OBvUqHAuYFy60nwCdvq2xmZ4kFzVySphXzBGq+HEot13comCoydEfnltBzLTuXLbV9cnREFJIO5f0jMqrlkxIuvAV8yO84p5VJTEa8j/xSNe7iA594rx7UeKT0fOt4VqM47fht8h+8PZYc5JVezvEMvwk115IBCwENxDjLtT0g+y8Hf+aTUEGtxrYToH8zf1/Y7S16mHiIc4jK3/vxHw==", 11 | "subType": "00" 12 | } 13 | }, 14 | "creationDate": { 15 | "$date": { 16 | "$numberLong": "1648915408923" 17 | } 18 | }, 19 | "updateDate": { 20 | "$date": { 21 | "$numberLong": "1648915408923" 22 | } 23 | }, 24 | "status": { 25 | "$numberInt": "0" 26 | }, 27 | "masterKey": { 28 | "provider": "local" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithNestedParameterized.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | public record TestRecordWithNestedParameterized( 20 | TestRecordParameterized parameterizedRecord, 21 | B other) { 22 | } 23 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonDoubleConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonDoubleConverter implements Converter { 20 | @Override 21 | public void convert(final Double value, final StrictJsonWriter writer) { 22 | writer.writeNumber(Double.toString(value)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonInt32Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonInt32Converter implements Converter { 20 | @Override 21 | public void convert(final Integer value, final StrictJsonWriter writer) { 22 | writer.writeNumber(Integer.toString(value)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/AbstractCollectionSpecificReturnTypeCreatorModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | import java.util.List; 20 | 21 | public abstract class AbstractCollectionSpecificReturnTypeCreatorModel { 22 | public abstract List getProperties(); 23 | } 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/dns/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.dns; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains the classes for supporting MongoDB's specification for storing very large files, GridFS. 19 | * @mongodb.driver.manual core/gridfs/ GridFS 20 | */ 21 | package com.mongodb.reactivestreams.client.gridfs; 22 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/Codec.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs; 18 | 19 | /** 20 | * Implementations of this interface can both encode and decode values of type {@code T}. 21 | * 22 | * @param the value type 23 | * 24 | * @since 3.0 25 | */ 26 | public interface Codec extends Encoder, Decoder { 27 | } 28 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/InterfaceModelC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | 20 | public interface InterfaceModelC extends InterfaceModelA { 21 | 22 | default String getPropertyC() { 23 | return "c"; 24 | } 25 | 26 | void setPropertyC(String propertyC); 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/event/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.event; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/inject/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.inject; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/thread/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.thread; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/time/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.time; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains the classes for supporting MongoDB's specification for storing very large files, GridFS. 19 | * @mongodb.driver.manual core/gridfs/ GridFS 20 | */ 21 | @NonNullApi 22 | package com.mongodb.gridfs; 23 | 24 | import com.mongodb.lang.NonNullApi; 25 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonNullConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | import org.bson.BsonNull; 20 | 21 | class JsonNullConverter implements Converter { 22 | @Override 23 | public void convert(final BsonNull value, final StrictJsonWriter writer) { 24 | writer.writeNull(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/bulk/BaseClientDeleteOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.model.bulk; 18 | 19 | /** 20 | * The methods declared in this interface are part of the public API of subclasses or sub-interfaces. 21 | */ 22 | interface BaseClientDeleteOptions extends BaseClientWriteModelOptions { 23 | } 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/async/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.async; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/bulk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.bulk; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/function/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.function; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/logging/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.logging; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/selector/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.selector; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/session/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.session; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/test/unit/com/mongodb/internal/connection/ServerListenerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.connection; 18 | 19 | import com.mongodb.ServerAddress; 20 | import com.mongodb.event.ServerListener; 21 | 22 | interface ServerListenerFactory { 23 | ServerListener create(ServerAddress serverAddress); 24 | } 25 | -------------------------------------------------------------------------------- /driver-sync/src/main/com/mongodb/client/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.client.internal; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithNullableField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonId; 20 | import org.bson.types.ObjectId; 21 | 22 | public record TestRecordWithNullableField(@BsonId ObjectId id, String name, int age) { 23 | } 24 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/binding/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.binding; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/capi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | 22 | @Internal 23 | @NonNullApi 24 | package com.mongodb.internal.capi; 25 | 26 | import com.mongodb.annotations.Internal; 27 | import com.mongodb.lang.NonNullApi; 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.client; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.connection; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/operation/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.operation; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/validator/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.validator; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithIllegalBsonDiscriminatorOnRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonDiscriminator; 20 | 21 | @BsonDiscriminator 22 | public record TestRecordWithIllegalBsonDiscriminatorOnRecord(String name) { 23 | } 24 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithIllegalBsonExtraElementsOnComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonExtraElements; 20 | 21 | public record TestRecordWithIllegalBsonExtraElementsOnComponent(@BsonExtraElements String name) { 22 | } 23 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/RelaxedExtendedJsonInt64Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class RelaxedExtendedJsonInt64Converter implements Converter { 20 | @Override 21 | public void convert(final Long value, final StrictJsonWriter writer) { 22 | writer.writeNumber(Long.toString(value)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/DnsSrvRecordMonitor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.connection; 18 | 19 | /** 20 | *

This class is not part of the public API and may be removed or changed at any time

21 | */ 22 | public interface DnsSrvRecordMonitor { 23 | void start(); 24 | 25 | void close(); 26 | } 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/observability/micrometer/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes related to micrometer observability 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.observability.micrometer; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/ConcreteModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | public class ConcreteModel extends GenericBaseModel { 20 | 21 | public ConcreteModel() { 22 | } 23 | 24 | public ConcreteModel(final ConcreteField field) { 25 | super(field); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/client/model/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.client.model; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/client/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.client.vault; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/operation/retry/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.operation.retry; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/ShellMaxKeyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | import org.bson.BsonMaxKey; 20 | 21 | class ShellMaxKeyConverter implements Converter { 22 | @Override 23 | public void convert(final BsonMaxKey value, final StrictJsonWriter writer) { 24 | writer.writeRaw("MaxKey"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/ShellMinKeyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | import org.bson.BsonMinKey; 20 | 21 | class ShellMinKeyConverter implements Converter { 22 | @Override 23 | public void convert(final BsonMinKey value, final StrictJsonWriter writer) { 24 | writer.writeRaw("MinKey"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/async/function/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.async.function; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/WriteModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.model; 18 | 19 | /** 20 | * A base class for models that can be used in a bulk write operations. 21 | * 22 | * @param the document type for storage 23 | * @since 3.0 24 | */ 25 | public abstract class WriteModel { 26 | WriteModel() { 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/authentication/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | 22 | @Internal 23 | @NonNullApi 24 | package com.mongodb.internal.authentication; 25 | 26 | import com.mongodb.annotations.Internal; 27 | import com.mongodb.lang.NonNullApi; 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/client/model/bulk/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.client.model.bulk; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/netty/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.connection.netty; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/diagnostics/logging/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.internal.diagnostics.logging; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-benchmarks/src/main/com/mongodb/benchmark/framework/BenchmarkResultWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package com.mongodb.benchmark.framework; 19 | 20 | import java.io.Closeable; 21 | 22 | public interface BenchmarkResultWriter extends Closeable { 23 | void write(BenchmarkResult benchmarkResult); 24 | 25 | void write(MongocryptBecnhmarkResult result); 26 | } 27 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/DBDecoderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | /** 20 | * Creates concrete DBDecoder instances. 21 | */ 22 | public interface DBDecoderFactory { 23 | /** 24 | * Creates an instance. 25 | * 26 | * @return the concrete implementation of {@code DBDecoder}. 27 | */ 28 | DBDecoder create(); 29 | } 30 | -------------------------------------------------------------------------------- /driver-legacy/src/main/com/mongodb/DBEncoderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb; 18 | 19 | /** 20 | * Creates concrete DBEncoder instances. 21 | */ 22 | public interface DBEncoderFactory { 23 | /** 24 | * Creates an instance. 25 | * 26 | * @return the concrete implementation of {@code DBEncoder}. 27 | */ 28 | DBEncoder create(); 29 | } 30 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/ShellUndefinedConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | import org.bson.BsonUndefined; 20 | 21 | class ShellUndefinedConverter implements Converter { 22 | @Override 23 | public void convert(final BsonUndefined value, final StrictJsonWriter writer) { 24 | writer.writeRaw("undefined"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/DiscriminatorModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonDiscriminator; 20 | 21 | @BsonDiscriminator(key = "discriminatorKey", value = "discriminatorValue") 22 | public class DiscriminatorModel { 23 | 24 | public DiscriminatorModel() { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/conventions/AnnotationNameCollision.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities.conventions; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonProperty; 20 | 21 | public final class AnnotationNameCollision { 22 | 23 | public String id; 24 | 25 | @BsonProperty("id") 26 | public String alternative; 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/fill/LocfFillOutputField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.client.model.fill; 17 | 18 | import com.mongodb.annotations.Evolving; 19 | 20 | /** 21 | * @see FillOutputField#locf(String) 22 | * @mongodb.server.release 5.3 23 | * @since 4.7 24 | */ 25 | @Evolving 26 | public interface LocfFillOutputField extends FillOutputField { 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/async/AsyncConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.async; 18 | 19 | /** 20 | * See {@link AsyncRunnable}. 21 | *

22 | * This class is not part of the public API and may be removed or changed at any time 23 | */ 24 | @FunctionalInterface 25 | public interface AsyncConsumer extends AsyncFunction { 26 | } 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/client/model/changestream/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.internal.client.model.changestream; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/management/NullMBeanServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.management; 18 | 19 | class NullMBeanServer implements MBeanServer { 20 | @Override 21 | public void unregisterMBean(final String mBeanName) { 22 | } 23 | 24 | @Override 25 | public void registerMBean(final Object mBean, final String mBeanName) { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/resources/META-INF/native-image/native-image.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008-present MongoDB, Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | Args =\ 17 | --initialize-at-run-time=\ 18 | com.mongodb.UnixServerAddress,\ 19 | com.mongodb.internal.connection.SnappyCompressor,\ 20 | com.mongodb.internal.connection.ClientMetadata,\ 21 | com.mongodb.internal.connection.ServerAddressHelper,\ 22 | com.mongodb.internal.dns.DefaultDnsResolver 23 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/bulk/ClientNamespacedInsertOneModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.model.bulk; 18 | 19 | import com.mongodb.annotations.Sealed; 20 | 21 | /** 22 | * A model for inserting a document. 23 | * 24 | * @since 5.3 25 | */ 26 | @Sealed 27 | public interface ClientNamespacedInsertOneModel extends ClientNamespacedWriteModel { 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/fill/LinearFillOutputField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.client.model.fill; 17 | 18 | import com.mongodb.annotations.Evolving; 19 | 20 | /** 21 | * @see FillOutputField#linear(String) 22 | * @mongodb.server.release 5.3 23 | * @since 4.7 24 | */ 25 | @Evolving 26 | public interface LinearFillOutputField extends FillOutputField { 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/Pool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.connection; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | interface Pool { 22 | T get(); 23 | 24 | T get(long timeout, TimeUnit timeUnit); 25 | 26 | void release(T t); 27 | 28 | void close(); 29 | 30 | void release(T t, boolean discard); 31 | } 32 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | 21 | @Internal 22 | @NonNullApi 23 | package com.mongodb.reactivestreams.client.internal; 24 | 25 | import com.mongodb.annotations.Internal; 26 | import com.mongodb.lang.NonNullApi; 27 | -------------------------------------------------------------------------------- /bson-scala/src/main/scala/org/mongodb/scala/bson/annotations/BsonProperty.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson.annotations 18 | 19 | import scala.annotation.StaticAnnotation 20 | 21 | /** 22 | * Annotation to change the stored key of a property 23 | * 24 | * @param key the key for the stored property 25 | */ 26 | case class BsonProperty(key: String) extends StaticAnnotation 27 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/ApproximateQuantileMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.client.model; 17 | 18 | import com.mongodb.annotations.Sealed; 19 | 20 | 21 | /** 22 | * @see QuantileMethod#approximate() 23 | * @since 4.10 24 | * @mongodb.server.release 7.0 25 | */ 26 | @Sealed 27 | public interface ApproximateQuantileMethod extends QuantileMethod { 28 | } 29 | 30 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/fill/ValueFillOutputField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.client.model.fill; 17 | 18 | import com.mongodb.annotations.Evolving; 19 | 20 | /** 21 | * @see FillOutputField#value(String, Object) 22 | * @mongodb.server.release 5.3 23 | * @since 4.7 24 | */ 25 | @Evolving 26 | public interface ValueFillOutputField extends FillOutputField { 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/internal/connection/CommandEventSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.internal.connection; 18 | 19 | interface CommandEventSender { 20 | void sendStartedEvent(); 21 | 22 | void sendFailedEvent(Throwable t); 23 | 24 | void sendSucceededEvent(ResponseBuffers responseBuffers); 25 | 26 | void sendSucceededEventForOneWayCommand(); 27 | } 28 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.reactivestreams.client.internal.crypt; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.reactivestreams.client.internal.vault; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithListOfRecords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonId; 20 | import org.bson.types.ObjectId; 21 | 22 | import java.util.List; 23 | 24 | public record TestRecordWithListOfRecords(@BsonId ObjectId id, List nestedRecords) { 25 | } 26 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/codecs/pojo/PropertyModelSerializationImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo; 18 | 19 | class PropertyModelSerializationImpl implements PropertySerialization { 20 | 21 | PropertyModelSerializationImpl() { 22 | } 23 | 24 | @Override 25 | public boolean shouldSerialize(final T value) { 26 | return value != null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains internal functionality that may change at any time. 19 | */ 20 | @Internal 21 | @NonNullApi 22 | package com.mongodb.reactivestreams.client.internal.gridfs; 23 | 24 | import com.mongodb.annotations.Internal; 25 | import com.mongodb.lang.NonNullApi; 26 | -------------------------------------------------------------------------------- /driver-sync/src/test/functional/com/mongodb/client/ExplainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client; 18 | 19 | import com.mongodb.MongoClientSettings; 20 | 21 | public class ExplainTest extends AbstractExplainTest { 22 | @Override 23 | protected MongoClient createMongoClient(final MongoClientSettings settings) { 24 | return MongoClients.create(settings); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithMapOfRecords.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonId; 20 | import org.bson.types.ObjectId; 21 | 22 | import java.util.Map; 23 | 24 | public record TestRecordWithMapOfRecords(@BsonId ObjectId id, Map nestedRecords) { 25 | } 26 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestSelfReferentialHolderRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonId; 20 | 21 | public record TestSelfReferentialHolderRecord(@BsonId String id, 22 | TestSelfReferentialRecord selfReferentialRecord) { 23 | } 24 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonSymbolConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonSymbolConverter implements Converter { 20 | @Override 21 | public void convert(final String value, final StrictJsonWriter writer) { 22 | writer.writeStartObject(); 23 | writer.writeString("$symbol", value); 24 | writer.writeEndObject(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /driver-reactive-streams/src/examples/reactivestreams/primer/PrimerTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package reactivestreams.primer; 19 | 20 | 21 | import com.mongodb.reactivestreams.client.MongoDatabase; 22 | 23 | import static com.mongodb.reactivestreams.client.Fixture.getMongoClient; 24 | 25 | public class PrimerTestCase { 26 | MongoDatabase db = getMongoClient().getDatabase("test"); 27 | } 28 | -------------------------------------------------------------------------------- /bson/src/main/org/bson/json/JsonJavaScriptConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.json; 18 | 19 | class JsonJavaScriptConverter implements Converter { 20 | @Override 21 | public void convert(final String value, final StrictJsonWriter writer) { 22 | writer.writeStartObject(); 23 | writer.writeString("$code", value); 24 | writer.writeEndObject(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bson/src/test/unit/org/bson/codecs/pojo/entities/UpperBoundsConcreteModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.pojo.entities; 18 | 19 | public final class UpperBoundsConcreteModel extends UpperBoundsModel { 20 | 21 | public UpperBoundsConcreteModel() { 22 | } 23 | 24 | public UpperBoundsConcreteModel(final Long myGenericField) { 25 | super(myGenericField); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /driver-core/src/test/unit/com/mongodb/spock/Slow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.spock; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Target({ElementType.METHOD, ElementType.TYPE}) 25 | public @interface Slow { 26 | } 27 | -------------------------------------------------------------------------------- /driver-sync/src/test/functional/com/mongodb/client/ServerSelectionProseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.mongodb.client; 17 | 18 | import com.mongodb.MongoClientSettings; 19 | 20 | final class ServerSelectionProseTest extends AbstractServerSelectionProseTest { 21 | protected MongoClient createClient(final MongoClientSettings settings) { 22 | return MongoClients.create(settings); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /driver-sync/src/test/functional/com/mongodb/client/unified/SessionsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.unified; 18 | 19 | import org.junit.jupiter.params.provider.Arguments; 20 | 21 | import java.util.Collection; 22 | 23 | final class SessionsTest extends UnifiedSyncTest { 24 | private static Collection data() { 25 | return getTestData("sessions"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAuthTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.unified; 18 | 19 | import org.junit.jupiter.params.provider.Arguments; 20 | 21 | import java.util.Collection; 22 | 23 | final class UnifiedAuthTest extends UnifiedSyncTest { 24 | private static Collection data() { 25 | return getTestData("auth"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bson-record-codec/src/test/unit/org/bson/codecs/record/samples/TestRecordWithIllegalBsonIdOnAccessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bson.codecs.record.samples; 18 | 19 | import org.bson.codecs.pojo.annotations.BsonId; 20 | 21 | public record TestRecordWithIllegalBsonIdOnAccessor(String name) { 22 | 23 | @Override 24 | @BsonId 25 | public String name() { 26 | return name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bson-scala/src/main/scala/org/mongodb/scala/bson/conversions/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.mongodb.scala.bson 18 | 19 | /** 20 | * The conversions package. 21 | */ 22 | package object conversions { 23 | 24 | /** 25 | * Type alias to the Bson interface - an interface for types that are able to render themselves into a `BsonDocument`. 26 | */ 27 | type Bson = org.bson.conversions.Bson 28 | } 29 | -------------------------------------------------------------------------------- /bson/src/test/resources/bson/oid.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "ObjectId", 3 | "bson_type": "0x07", 4 | "test_key": "a", 5 | "valid": [ 6 | { 7 | "description": "All zeroes", 8 | "canonical_bson": "1400000007610000000000000000000000000000", 9 | "canonical_extjson": "{\"a\" : {\"$oid\" : \"000000000000000000000000\"}}" 10 | }, 11 | { 12 | "description": "All ones", 13 | "canonical_bson": "14000000076100FFFFFFFFFFFFFFFFFFFFFFFF00", 14 | "canonical_extjson": "{\"a\" : {\"$oid\" : \"ffffffffffffffffffffffff\"}}" 15 | }, 16 | { 17 | "description": "Random", 18 | "canonical_bson": "1400000007610056E1FC72E0C917E9C471416100", 19 | "canonical_extjson": "{\"a\" : {\"$oid\" : \"56e1fc72e0c917e9c4714161\"}}" 20 | } 21 | ], 22 | "decodeErrors": [ 23 | { 24 | "description": "OID truncated", 25 | "bson": "1200000007610056E1FC72E0C917E9C471" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/bulk/ClientNamespacedDeleteManyModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.model.bulk; 18 | 19 | import com.mongodb.annotations.Sealed; 20 | 21 | /** 22 | * A model for deleting all documents matching a filter. 23 | * 24 | * @since 5.3 25 | */ 26 | @Sealed 27 | public interface ClientNamespacedDeleteManyModel extends ClientNamespacedWriteModel { 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/client/model/bulk/ClientNamespacedUpdateManyModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mongodb.client.model.bulk; 18 | 19 | import com.mongodb.annotations.Sealed; 20 | 21 | /** 22 | * A model for updating all documents matching a filter. 23 | * 24 | * @since 5.3 25 | */ 26 | @Sealed 27 | public interface ClientNamespacedUpdateManyModel extends ClientNamespacedWriteModel { 28 | } 29 | -------------------------------------------------------------------------------- /driver-core/src/main/com/mongodb/observability/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-present MongoDB, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Contains classes related to MongoDB observability, including tracing. 19 | * 20 | * @since 5.7 21 | */ 22 | @Alpha(Reason.CLIENT) 23 | @NonNullApi 24 | package com.mongodb.observability; 25 | 26 | import com.mongodb.lang.NonNullApi; 27 | import com.mongodb.annotations.Alpha; 28 | import com.mongodb.annotations.Reason; 29 | --------------------------------------------------------------------------------