Interface ClarityAPIInternal

All Known Implementing Classes:
ClarityAPIImpl

public interface ClarityAPIInternal
Interface to the Clarity API for internal use, mostly by the cache.

This interface provides the methods required for internal control of the API from aspects that surround the API.

Since:
2.24.9
See Also:
  • Method Details

    • getStatefulOverride

      StatefulOverride getStatefulOverride()
      Helper method for the cache, this method returns whether the next call on the current thread will need to fetch stateful entities in a special way or not.
      Returns:
      The rule for the next call to the API for stateful entities. Will return null if there is no override.
    • cancelStatefulOverride

      void cancelStatefulOverride(String calledMethod)
      Undoes the effects of ClarityAPI.overrideStateful(StatefulOverride) after a call to ensure subsequent calls will respect the state parameter for stateful entities. Called by the wrapping aspect after any public method to make sure the behaviour is reset.
      Parameters:
      calledMethod - The name of the method that caused this to be called. This is provided by the surrounding join point. It is not important and only used for debug logging.
      See Also:
    • getQueryResultsClassForEntity

      <E extends Locatable, BH extends Batch<? extends LimsLink<E>>> Class<BH> getQueryResultsClassForEntity(Class<E> entityClass)
      Get the class that holds a list of links for the given entity when returned from a list or search operation.

      For example, this is the Artifacts class for the Artifact entity.

      Type Parameters:
      E - The type of the entity.
      BH - The type of the object that holds the list of links to these entities.
      Parameters:
      entityClass - The class of the entity.
      Returns:
      The list of links class for the given class of entity.
      Throws:
      IllegalArgumentException - if entityClass has no associated list of links class.