|
|
|
|
@ -20,6 +20,7 @@ import com.mongodb.ConnectionString;
@@ -20,6 +20,7 @@ import com.mongodb.ConnectionString;
|
|
|
|
|
import org.bson.UuidRepresentation; |
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Configuration properties for Mongo. |
|
|
|
|
@ -74,10 +75,7 @@ public class MongoProperties {
@@ -74,10 +75,7 @@ public class MongoProperties {
|
|
|
|
|
*/ |
|
|
|
|
private String authenticationDatabase; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* GridFS database name. |
|
|
|
|
*/ |
|
|
|
|
private String gridFsDatabase; |
|
|
|
|
private final Gridfs gridfs = new Gridfs(); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Login user of the mongo server. Cannot be set with URI. |
|
|
|
|
@ -193,12 +191,24 @@ public class MongoProperties {
@@ -193,12 +191,24 @@ public class MongoProperties {
|
|
|
|
|
this.port = port; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Gridfs getGridfs() { |
|
|
|
|
return this.gridfs; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Return the GridFS database name. |
|
|
|
|
* @return the GridFS database name |
|
|
|
|
* @deprecated since 2.4.0 in favor of {@link Gridfs#getDatabase()} |
|
|
|
|
*/ |
|
|
|
|
@DeprecatedConfigurationProperty(replacement = "spring.data.mongodb.gridfs.database") |
|
|
|
|
@Deprecated |
|
|
|
|
public String getGridFsDatabase() { |
|
|
|
|
return this.gridFsDatabase; |
|
|
|
|
return this.gridfs.getDatabase(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Deprecated |
|
|
|
|
public void setGridFsDatabase(String gridFsDatabase) { |
|
|
|
|
this.gridFsDatabase = gridFsDatabase; |
|
|
|
|
this.gridfs.setDatabase(gridFsDatabase); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getMongoClientDatabase() { |
|
|
|
|
@ -216,4 +226,34 @@ public class MongoProperties {
@@ -216,4 +226,34 @@ public class MongoProperties {
|
|
|
|
|
this.autoIndexCreation = autoIndexCreation; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class Gridfs { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* GridFS database name. |
|
|
|
|
*/ |
|
|
|
|
private String database; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* GridFS bucket name. |
|
|
|
|
*/ |
|
|
|
|
private String bucket; |
|
|
|
|
|
|
|
|
|
public String getDatabase() { |
|
|
|
|
return this.database; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setDatabase(String database) { |
|
|
|
|
this.database = database; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getBucket() { |
|
|
|
|
return this.bucket; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setBucket(String bucket) { |
|
|
|
|
this.bucket = bucket; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|