14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
- package org .apache .logging .log4j .mongodb4 ;
17
+ package org .apache .logging .log4j .mongodb ;
18
18
19
19
import com .mongodb .ConnectionString ;
20
20
import com .mongodb .MongoClientSettings ;
35
35
36
36
/**
37
37
* The MongoDB implementation of {@link NoSqlProvider} using the MongoDB driver
38
- * version 4 API.
38
+ * version 5 API.
39
39
*/
40
40
@ Configurable (printObject = true )
41
- @ Plugin ("MongoDb4 " )
42
- public final class MongoDb4Provider implements NoSqlProvider <MongoDb4Connection > {
41
+ @ Plugin ("MongoDb " )
42
+ public final class MongoDbProvider implements NoSqlProvider <MongoDbConnection > {
43
43
44
44
public static class Builder <B extends Builder <B >> extends AbstractFilterable .Builder <B >
45
- implements org .apache .logging .log4j .core .util .Builder <MongoDb4Provider > {
45
+ implements org .apache .logging .log4j .plugins .util .Builder <MongoDbProvider > {
46
46
47
47
@ PluginAttribute (value = "connection" )
48
48
@ Required (message = "No connection string provided" )
@@ -55,8 +55,8 @@ public static class Builder<B extends Builder<B>> extends AbstractFilterable.Bui
55
55
private boolean capped = false ;
56
56
57
57
@ Override
58
- public MongoDb4Provider build () {
59
- return new MongoDb4Provider (connectionStringSource , capped , collectionSize );
58
+ public MongoDbProvider build () {
59
+ return new MongoDbProvider (connectionStringSource , capped , collectionSize );
60
60
}
61
61
62
62
public B setConnectionStringSource (final String connectionStringSource ) {
@@ -80,8 +80,8 @@ public B setCollectionSize(final long collectionSize) {
80
80
// @formatter:off
81
81
private static final CodecRegistry CODEC_REGISTRIES = CodecRegistries .fromRegistries (
82
82
MongoClientSettings .getDefaultCodecRegistry (),
83
- CodecRegistries .fromCodecs (MongoDb4LevelCodec .INSTANCE ),
84
- CodecRegistries .fromCodecs (new MongoDb4DocumentObjectCodec ()));
83
+ CodecRegistries .fromCodecs (MongoDbLevelCodec .INSTANCE ),
84
+ CodecRegistries .fromCodecs (new MongoDbDocumentObjectCodec ()));
85
85
// @formatter:on
86
86
87
87
// TODO Where does this number come from?
@@ -98,7 +98,7 @@ public static <B extends Builder<B>> B newBuilder() {
98
98
private final MongoDatabase mongoDatabase ;
99
99
private final ConnectionString connectionString ;
100
100
101
- private MongoDb4Provider (final String connectionStringSource , final boolean isCapped , final Long collectionSize ) {
101
+ private MongoDbProvider (final String connectionStringSource , final boolean isCapped , final Long collectionSize ) {
102
102
LOGGER .debug ("Creating ConnectionString {}..." , connectionStringSource );
103
103
this .connectionString = new ConnectionString (connectionStringSource );
104
104
LOGGER .debug ("Created ConnectionString {}" , connectionString );
@@ -122,15 +122,15 @@ private MongoDb4Provider(final String connectionStringSource, final boolean isCa
122
122
}
123
123
124
124
@ Override
125
- public MongoDb4Connection getConnection () {
126
- return new MongoDb4Connection (connectionString , mongoClient , mongoDatabase , isCapped , collectionSize );
125
+ public MongoDbConnection getConnection () {
126
+ return new MongoDbConnection (connectionString , mongoClient , mongoDatabase , isCapped , collectionSize );
127
127
}
128
128
129
129
@ Override
130
130
public String toString () {
131
131
return String .format (
132
132
"%s [connectionString=%s, collectionSize=%s, isCapped=%s, mongoClient=%s, mongoDatabase=%s]" ,
133
- MongoDb4Provider .class .getSimpleName (),
133
+ MongoDbProvider .class .getSimpleName (),
134
134
connectionString ,
135
135
collectionSize ,
136
136
isCapped ,
0 commit comments