Class BaseExternalIdGenerator

    • Constructor Detail

      • BaseExternalIdGenerator

        public BaseExternalIdGenerator()
    • Method Detail

      • isExternalIdOccupied

        protected abstract boolean isExternalIdOccupied​(@NotNull
                                                        String newExtId)
      • generateNewExternalId

        @NotNull
        public String generateNewExternalId​(@Nullable
                                            String parentExtId,
                                            @NotNull
                                            String name,
                                            @Nullable
                                            Set<String> excludeAdditionalIds)
        Description copied from interface: ExternalIdGenerator
        Generates a new external id based on the given name and (optionally) parent external id. May adjust the case of the name part of the id to comply with external id conventions
        Specified by:
        generateNewExternalId in interface ExternalIdGenerator
        Parameters:
        parentExtId - the parent's external identifier (optional).
        name - the user string (name).
        excludeAdditionalIds - an additional set of ids that are already used (i.e. the result should not be one of them). The current assigned external ids are excluded by default.
        Returns:
        new external id
      • generateNewExternalId

        @NotNull
        public String generateNewExternalId​(@Nullable
                                            String parentExtId,
                                            @NotNull
                                            String name,
                                            @Nullable
                                            Set<String> excludeAdditionalIds,
                                            boolean adjustCase)
        Description copied from interface: ExternalIdGenerator
        Generates a new external id based on the given name and (optionally) parent external id.
        Specified by:
        generateNewExternalId in interface ExternalIdGenerator
        Parameters:
        parentExtId - the parent's external identifier (optional).
        name - the user string (name).
        excludeAdditionalIds - an additional set of ids that are already used (i.e. the result should not be one of them). The current assigned external ids are excluded by default.
        adjustCase - If true, the method is allowed to adjust the case of the name part of the external id
        Returns:
        new external id
      • regenerateExternalId

        @NotNull
        public String regenerateExternalId​(@Nullable
                                           String parentExtId,
                                           @NotNull
                                           String name,
                                           @NotNull
                                           String currentExternalId)
        Description copied from interface: ExternalIdGenerator
        Regenerates an external id based on the given name and (optionally) parent external id. The current external id is not taken into account, so the result can be the current id (but with another case).
        Specified by:
        regenerateExternalId in interface ExternalIdGenerator
        Parameters:
        parentExtId - the parent's external identifier (optional).
        name - the user string (name).
        currentExternalId - the external id an object currently has
        Returns:
        new external id
      • externalIdSatisfiesConvention

        public boolean externalIdSatisfiesConvention​(@NotNull
                                                     String externalId,
                                                     @NotNull
                                                     String entityName,
                                                     @NotNull
                                                     String parentExtId)
        Description copied from interface: ExternalIdGenerator
        Returns true if provided external id satisfies convention used to generate new ids
        Specified by:
        externalIdSatisfiesConvention in interface ExternalIdGenerator
        Parameters:
        externalId - external ids to check
        entityName - name of the entity whose external id is to be verified
        parentExtId - parent external id
        Returns:
        see above