Class DelegatedCollectionShardingOptions

    • Constructor Detail

      • DelegatedCollectionShardingOptions

        public DelegatedCollectionShardingOptions​(CompositeShardingOptions compositeShardingOptions)
    • Method Detail

      • resolveDatabaseName

        public String resolveDatabaseName​(String databaseName,
                                          String hint)
        Description copied from class: ShardingOptions
        Provides default implementation to resolve the actual database name from the base name and the hint. By default, the database name is resolved in the following format {databaseName}{separator}{hint}

        For example, if the database name is TEST_DATABASE with the database hint set to 2, the resolved database name will be TEST_DATABASE_2.

        This can be overridden by a class to provide different way to format the database name and hint.

        Overrides:
        resolveDatabaseName in class ShardingOptions
        Parameters:
        databaseName - Base database Name
        hint - hint
        Returns:
        the resolved database name based on the implementation provided in the method.
      • resolveCollectionName

        public String resolveCollectionName​(String collectionName,
                                            String hint)
        Description copied from class: ShardingOptions
        Provides default implementation to resolve the actual collection name from the base name and the hint. By default, the collection name is resolved in the following format {collectionName}{separator}{hint}

        For example, if the base collection name is TEST_COLLECTION, then the resolved collection name when the hint is set to 1 will be TEST_COLLECTION_1

        This can be overridden by the subclasses to provide custom formatting.

        Overrides:
        resolveCollectionName in class ShardingOptions
        Parameters:
        collectionName - Base collection Name
        hint - hint
        Returns:
        the resolved collection name based on the implementation provided in the method.
      • validateCollectionHint

        public boolean validateCollectionHint​(String collectionName,
                                              String hint)
        Description copied from class: ShardingOptions
        Validate if a particular hint is valid for the sharding options or not.
        Overrides:
        validateCollectionHint in class CollectionShardingOptions
        Parameters:
        collectionName - Base Collection Name
        hint - hint
        Returns:
        true if the hint passed is valid
      • validateDatabaseHint

        public boolean validateDatabaseHint​(String databaseName,
                                            String hint)
        Description copied from class: ShardingOptions
        Validate if a particular hint is valid for the sharding options or not.
        Overrides:
        validateDatabaseHint in class ShardingOptions
        Parameters:
        databaseName - Base Database Name
        hint - hint
        Returns:
        true if the hint passed is valid