java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.dao.SmartIdGenerator

public class SmartIdGenerator extends Object
Allows to generate ids in bunches. Usually, generates more ids than required and stored them in memory. It allows to avoid contacting the DB again for the consecutive requests. Cached ids for different generators are stored independently.
Since:
9.0.0
  • Field Details

    • TIMEOUT_LOCK_MINUTES

      public static final int TIMEOUT_LOCK_MINUTES
      Ids should be retrieved immediately. If ids cannot be retrieved in 10 min, it makes sense to throw an exception and fail the job, so the system can heal itself.
      See Also:
  • Constructor Details

    • SmartIdGenerator

      public SmartIdGenerator(RestoreDao restoreDao)
  • Method Details

    • generateIds

      public Collection<Object> generateIds(org.hibernate.id.IdentifierGenerator identifierGenerator, Object fakeObject, int numberOfIdsToGenerate)