Interface LaunchIdLock

    • Field Detail

      • MAX_WAIT_TIME_DISCREPANCY

        static final float MAX_WAIT_TIME_DISCREPANCY
        See Also:
        Constant Field Values
    • Method Detail

      • obtainLaunchUuid

        @Nullable
        java.lang.String obtainLaunchUuid​(@Nonnull
                                          java.lang.String instanceUuid)
        Returns a Launch UUID for many clients.
        Parameters:
        instanceUuid - a Client instance UUID, which will be used to identify a Client and a Launch. If it the first one UUID passed to the method it will be returned to every other client instance.
        Returns:
        either instanceUuid, if the process managed obtain the lock and become the primary Launch, either the primary Launch UUID, or null in case of execution errors
      • updateInstanceUuid

        void updateInstanceUuid​(@Nonnull
                                java.lang.String instanceUuid)
        Update self UUID in a lock, means that the Client still executing its Launch.
        Parameters:
        instanceUuid - instanceUuid a Client instance UUID
      • finishInstanceUuid

        void finishInstanceUuid​(@Nonnull
                                java.lang.String instanceUuid)
        Remove self UUID from a lock, means that a Client finished its Launch.
        Parameters:
        instanceUuid - a Client instance UUID
      • getLiveInstanceUuids

        @Nonnull
        default java.util.Collection<java.lang.String> getLiveInstanceUuids()
        Return all instance UUIDs which are still running.
        Returns:
        a collection of live instance UUIDs