All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opentext.ia.sdk.sip.SequentialDssIdSupplier Maven / Gradle / Ivy

There is a newer version: 12.8.4
Show newest version
/*
 * Copyright (c) 2016-2017 by OpenText Corporation. All Rights Reserved.
 */
package com.opentext.ia.sdk.sip;


/**
 * Generate Data Submission Session (DSS) IDs from a prefix and an increasing counter.
 */
public class SequentialDssIdSupplier extends PrefixDssIdSupplier {

  private long counter;

  /**
   * Create an instance that starts at 1.
   * @param prefix The prefix for all generated DSS IDs
   */
  public SequentialDssIdSupplier(String prefix) {
    this(prefix, 1);
  }

  /**
   * Create an instance.
   * @param prefix The prefix for all generated DSS IDs
   * @param counter Where to start counting
   */
  public SequentialDssIdSupplier(String prefix, long counter) {
    super(prefix);
    this.counter = counter;
  }

  @Override
  protected String postfix() {
    return Long.toString(counter++);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy