Class KerberosConnection.RenewalTask

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    KerberosConnection

    static class KerberosConnection.RenewalTask
    extends java.lang.Object
    implements java.lang.Runnable
    Runnable for performing Kerberos renewals.
    • Constructor Summary

      Constructors 
      Constructor Description
      RenewalTask​(KerberosConnection utilInstance, javax.security.auth.login.LoginContext context, javax.security.auth.Subject subject, javax.security.auth.login.Configuration conf, long renewalPeriod)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void asyncStop()  
      (package private) void renew()
      Logout and log back in with the Kerberos identity.
      void run()  
      (package private) boolean shouldRenew​(long start, long end, long now)
      Computes whether or not the ticket should be renewed based on the lifetime of the ticket and the current time.
      (package private) void waitForNextCheck​(long renewalPeriod)
      Wait the given amount of time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RENEWAL_LOG

        private static final org.slf4j.Logger RENEWAL_LOG
      • context

        private javax.security.auth.login.LoginContext context
      • subject

        private javax.security.auth.Subject subject
      • conf

        private final javax.security.auth.login.Configuration conf
      • renewalPeriod

        private final long renewalPeriod
      • keepRunning

        private final java.util.concurrent.atomic.AtomicBoolean keepRunning
    • Constructor Detail

      • RenewalTask

        RenewalTask​(KerberosConnection utilInstance,
                    javax.security.auth.login.LoginContext context,
                    javax.security.auth.Subject subject,
                    javax.security.auth.login.Configuration conf,
                    long renewalPeriod)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • shouldRenew

        boolean shouldRenew​(long start,
                            long end,
                            long now)
        Computes whether or not the ticket should be renewed based on the lifetime of the ticket and the current time.
        Parameters:
        start - The start time of the ticket's validity in millis
        end - The end time of the ticket's validity in millis
        now - Milliseconds since the epoch
        Returns:
        True if renewal should occur, false otherwise
      • renew

        void renew()
        Logout and log back in with the Kerberos identity.
      • waitForNextCheck

        void waitForNextCheck​(long renewalPeriod)
        Wait the given amount of time.
        Parameters:
        renewalPeriod - The number of milliseconds to wait
      • asyncStop

        void asyncStop()