Package io.debezium.connector.mongodb
Class CollectionId
java.lang.Object
io.debezium.connector.mongodb.CollectionId
- All Implemented Interfaces:
DataCollectionId
A simple identifier for collections in a replica set.
- Author:
- Randall Hauch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionId(String replicaSetName, String dbName, String collectionName) Create a new collection identifier. -
Method Summary
Modifier and TypeMethodDescriptiondbName()Get the name of the database in which the collection exists.booleaninthashCode()name()Get the name of the collection.Get the namespace of this collection, which is comprised of thedatabase nameandcollection name.static CollectionIdParse the supplied<replicaset_name>.<database_name>.<collection_name>string.static CollectionIdParse the supplied<database_name>.<collection_name>string.Get the name of the replica set in which the collection (and database) exist.toString()
-
Field Details
-
replicaSetName
-
dbName
-
name
-
-
Constructor Details
-
CollectionId
Create a new collection identifier.- Parameters:
replicaSetName- the name of the replica set; may not be nulldbName- the name of the database; may not be nullcollectionName- the name of the collection; may not be null
-
-
Method Details
-
parse
Parse the supplied<replicaset_name>.<database_name>.<collection_name>string. Thecollection_namecan also contain dots in its value.- Parameters:
str- the string representation of the collection identifier; may not be null- Returns:
- the collection ID, or null if it could not be parsed
-
parse
Parse the supplied<database_name>.<collection_name>string. Thecollection_namecan also contain dots in its value.- Parameters:
replicaSetName- the name of replica; may not be nullstr- the string representation of the collection identifier; may not be null- Returns:
- the collection ID, or null if it could not be parsed
-
name
Get the name of the collection.- Returns:
- the collection's name; never null
-
dbName
Get the name of the database in which the collection exists.- Returns:
- the database name; never null
-
replicaSetName
Get the name of the replica set in which the collection (and database) exist.- Returns:
- the replica set name; never null
-
identifier
- Specified by:
identifierin interfaceDataCollectionId
-
hashCode
public int hashCode() -
equals
-
namespace
Get the namespace of this collection, which is comprised of thedatabase nameandcollection name.- Returns:
- the namespace for this collection; never null
-
toString
-