java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.authentication.utility.impl.NameSequenceNumberGenerator

public class NameSequenceNumberGenerator extends Object
A generator to generate a non-negative integer to be used with the IDs of both EndPoint and ExposedDestination when automatically creating them in InboundChannelConfiguration. The generated number is based on what is currently the highest number associated with either the IDs of EndPoint or ExposedDestination that follows a specific pattern. The IDs that are checked for creating the new number is of the format cc-iocode-{number}-metadata for EndPoint and cc-iocode-{number} for ExposedDestination. The iocode in the ID is the lower case Integration Object Code and number in the ID is a optional positive number.

Example: If a user creates an InboundChannelConfiguration with IO "ProductIOTest" for the first time and links a DestinationTarget with it, EndPoint: cc-productiotest-metadata, and ExposedDestination: cc-productiotest will be automatically created in the backend.

If the user links another DestinationTarget with the ICC, EndPoint: cc-productiotest-1-metadata, and ExposedDestination: cc-productiotest-1 will be automatically created with plus-1 integer in the backend.

  • Constructor Details

    • NameSequenceNumberGenerator

      public NameSequenceNumberGenerator(FlexibleSearchService flexibleSearchService)
  • Method Details

    • getGeneratedSequencedNumber

      @Nonnegative public BigInteger getGeneratedSequencedNumber(@NotNull @NotNull String ioCode)
      Provides a non-negative integer value that could be added to the IDs of both newly created EndPoint and ExposedDestination.The number returned is: plus 1 the highest number which is currently associated with either the IDs of EndPoint model or ExposedDestination model. Zero is returned when there is no number associated with the IDs of neither EndPoint model nor ExposedDestination model. The IDs that are checked before creating a new number is of the format cc-iocode-{number}-metadata for EndPoint and cc-iocode-{number} for ExposedDestination, where the iocode in the ID is the lower case Integration Object Code and number in the ID is a optional positive number.
      Parameters:
      ioCode - the code of the IntegrationObject for which InboundChannelConfiguration is created
      Returns:
      A non negative integer which can be different for subsequent calls with the same ioCode. The number generated is to be used in the same format as mentioned with the same iocode to avoid getting conflicts with other EndPoint or ExposedDestination IDs
    • getGeneratedNumber

      @Nonnegative @Deprecated(since="2205", forRemoval=true) public int getGeneratedNumber(@NotNull @NotNull String ioCode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provides a non-negative integer value that could be added to the IDs of both newly created EndPoint and ExposedDestination.The number returned is: plus 1 the highest number which is currently associated with either the IDs of EndPoint model or ExposedDestination model. Zero is returned when there is no number associated with the IDs of neither EndPoint model nor ExposedDestination model. The IDs that are checked before creating a new number is of the format cc-iocode-{number}-metadata for EndPoint and cc-iocode-{number} for ExposedDestination, where the iocode in the ID is the lower case Integration Object Code and number in the ID is a optional positive number. This method has the risk of integer overflow if an entity was previously saved with a very large number in its name. Please use getGeneratedSequenceNumber instead.
      Parameters:
      ioCode - the code of the IntegrationObject for which InboundChannelConfiguration is created
      Returns:
      A non negative integer which can be different for subsequent calls with the same ioCode. The number generated is to be used in the same format as mentioned with the same iocode to avoid getting conflicts with other EndPoint or ExposedDestination IDs