Package org.apache.zookeeper
Class Login
- java.lang.Object
- 
- org.apache.zookeeper.Login
 
- 
 public class Login extends Object 
- 
- 
Field SummaryFields Modifier and Type Field Description CallbackHandlercallbackHandlerstatic StringMIN_TIME_BEFORE_RELOGIN_CONFIG_KEYstatic StringSYSTEM_USER
 - 
Constructor SummaryConstructors Constructor Description Login(String loginContextName, CallbackHandler callbackHandler, ZKConfig zkConfig)LoginThread constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLastLogin()Get the time of the last login (ticket initialization or last ticket renewal).StringgetLoginContextName()SubjectgetSubject()StringgetUserName()protected voidlogout()voidshutdown()protected voidsleepBeforeRetryFailedRefresh()voidstartThreadIfNeeded()
 
- 
- 
- 
Field Detail- 
SYSTEM_USERpublic static final String SYSTEM_USER 
 - 
callbackHandlerpublic CallbackHandler callbackHandler 
 - 
MIN_TIME_BEFORE_RELOGIN_CONFIG_KEYpublic static final String MIN_TIME_BEFORE_RELOGIN_CONFIG_KEY - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
Loginpublic Login(String loginContextName, CallbackHandler callbackHandler, ZKConfig zkConfig) throws LoginException LoginThread constructor. The constructor starts the thread used to periodically re-login to the Kerberos Ticket Granting Server.- Parameters:
- loginContextName- name of section in JAAS file that will be use to login. Passed as first param to javax.security.auth.login.LoginContext().
- callbackHandler- Passed as second param to javax.security.auth.login.LoginContext().
- zkConfig- client or server configurations
- Throws:
- LoginException- Thrown if authentication fails.
 
 
- 
 - 
Method Detail- 
startThreadIfNeededpublic void startThreadIfNeeded() 
 - 
shutdownpublic void shutdown() 
 - 
getSubjectpublic Subject getSubject() 
 - 
getUserNamepublic String getUserName() 
 - 
getLoginContextNamepublic String getLoginContextName() 
 - 
getLastLoginpublic long getLastLogin() Get the time of the last login (ticket initialization or last ticket renewal).- Returns:
- the number of milliseconds since epoch.
 
 - 
logoutprotected void logout() throws LoginException- Throws:
- LoginException
 
 - 
sleepBeforeRetryFailedRefreshprotected void sleepBeforeRetryFailedRefresh() throws InterruptedException- Throws:
- InterruptedException
 
 
- 
 
-