public abstract class AbstractUserAuth extends AbstractLoggingBean implements UserAuth
Modifier and Type | Field and Description |
---|---|
private ClientSession |
clientSession |
private java.lang.String |
name |
private java.lang.String |
service |
log
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Modifier | Constructor and Description |
---|---|
protected |
AbstractUserAuth(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called to release any allocated resources
|
ClientSession |
getClientSession() |
java.lang.String |
getName() |
java.lang.String |
getService() |
ClientSession |
getSession() |
void |
init(ClientSession session,
java.lang.String service) |
boolean |
process(Buffer buffer) |
protected abstract boolean |
processAuthDataRequest(ClientSession session,
java.lang.String service,
Buffer buffer) |
protected abstract boolean |
sendAuthDataRequest(ClientSession session,
java.lang.String service) |
java.lang.String |
toString() |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
private final java.lang.String name
private ClientSession clientSession
private java.lang.String service
public ClientSession getClientSession()
getClientSession
in interface ClientSessionHolder
ClientSession
usedpublic ClientSession getSession()
getSession
in interface UserAuthInstance<ClientSession>
null
if
the instance has not been initialized yetpublic final java.lang.String getName()
getName
in interface NamedResource
public java.lang.String getService()
public void init(ClientSession session, java.lang.String service) throws java.lang.Exception
init
in interface UserAuth
session
- The ClientSession
service
- The requesting service namejava.lang.Exception
- If failed to initialize the mechanismpublic boolean process(Buffer buffer) throws java.lang.Exception
process
in interface UserAuth
buffer
- The Buffer
to process - null
if not a response buffer, i.e., the underlying
authentication mechanism should initiate whatever challenge/response mechanism is requiredtrue
if request handled - false
if the next authentication mechanism should be
usedjava.lang.Exception
- If failed to process the requestprotected abstract boolean sendAuthDataRequest(ClientSession session, java.lang.String service) throws java.lang.Exception
java.lang.Exception
protected abstract boolean processAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
java.lang.Exception
public void destroy()
UserAuth
public java.lang.String toString()
toString
in class java.lang.Object