Interface ExternalIdGenerator

    • Method Detail

      • generateNewExternalId

        @NotNull
        String generateNewExternalId​(@Nullable
                                     String parentExtId,
                                     @NotNull
                                     String name,
                                     @Nullable
                                     Set<String> excludeIds)
        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
        Parameters:
        parentExtId - the parent's external identifier (optional).
        name - the user string (name).
        excludeIds - 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
        String generateNewExternalId​(@Nullable
                                     String parentExtId,
                                     @NotNull
                                     String name,
                                     @Nullable
                                     Set<String> excludeIds,
                                     boolean adjustCase)
        Generates a new external id based on the given name and (optionally) parent external id.
        Parameters:
        parentExtId - the parent's external identifier (optional).
        name - the user string (name).
        excludeIds - 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
        String regenerateExternalId​(@Nullable
                                    String parentExtId,
                                    @NotNull
                                    String name,
                                    @NotNull
                                    String currentExternalId)
        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).
        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
        Since:
        8.1
      • externalIdSatisfiesConvention

        boolean externalIdSatisfiesConvention​(@NotNull
                                              String externalId,
                                              @NotNull
                                              String entityName,
                                              @NotNull
                                              String parentExtId)
        Returns true if provided external id satisfies convention used to generate new ids
        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