|
jboss-sasl 1.0.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.sasl.util.AbstractSaslParticipant
public abstract class AbstractSaslParticipant
A common base class for SASL participants.
Field Summary | |
---|---|
static byte[] |
NO_BYTES
An empty byte array. |
Constructor Summary | |
---|---|
protected |
AbstractSaslParticipant(String mechanismName,
String protocol,
String serverName,
CallbackHandler callbackHandler)
Construct a new instance. |
Method Summary | |
---|---|
void |
dispose()
Dispose of this participant. |
protected CallbackHandler |
getCallbackHandler()
Get the configured authentication callback handler. |
SaslStateContext |
getContext()
Get the current negotiation state context. |
String |
getMechanismName()
Get the name of this mechanism. |
Object |
getNegotiatedProperty(String propName)
Get a property negotiated between this participant and the other. |
protected String |
getProtocol()
Get the protocol name. |
protected String |
getServerName()
Get the server name. |
protected SaslWrapper |
getWrapper()
Get the current configured SASL wrapper, if any. |
protected void |
handleCallbacks(Callback... callbacks)
Handle callbacks, wrapping exceptions as needed (including unsupported callbacks). |
boolean |
isComplete()
Determine whether the authentication exchange has completed. |
protected void |
setWrapper(SaslWrapper wrapper)
Set the current configured SASL wrapper, if any. |
protected void |
tryHandleCallbacks(Callback... callbacks)
Handle callbacks, wrapping exceptions as needed. |
byte[] |
unwrap(byte[] incoming,
int offset,
int len)
Unwraps a byte array received from the other participant. |
byte[] |
wrap(byte[] outgoing,
int offset,
int len)
Wraps a byte array to be sent to the other participant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] NO_BYTES
Constructor Detail |
---|
protected AbstractSaslParticipant(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler)
mechanismName
- the name of the defined mechanismprotocol
- the protocolserverName
- the server namecallbackHandler
- the callback handlerMethod Detail |
---|
protected void handleCallbacks(Callback... callbacks) throws SaslException
callbacks
- the callbacks to handle
SaslException
- if a callback failedprotected void tryHandleCallbacks(Callback... callbacks) throws SaslException, UnsupportedCallbackException
callbacks
- the callbacks to handle
SaslException
- if a callback failed
UnsupportedCallbackException
- if a callback isn't supportedpublic String getMechanismName()
protected String getProtocol()
protected String getServerName()
protected CallbackHandler getCallbackHandler()
protected SaslWrapper getWrapper()
null
if none is configuredpublic SaslStateContext getContext()
protected void setWrapper(SaslWrapper wrapper)
wrapper
- the SASL wrapper, or null
to disable wrappingpublic byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
outgoing
- a non-null
byte array containing the bytes to encodeoffset
- the first byte to encodelen
- the number of bytes to use
null
byte array containing the encoded bytes
SaslException
- if wrapping fails
IllegalStateException
- if wrapping is not configuredpublic byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
incoming
- a non-null
byte array containing the bytes to decodeoffset
- the first byte to decodelen
- the number of bytes to use
null
byte array containing the decoded bytes
SaslException
- if wrapping fails
IllegalStateException
- if wrapping is not configuredpublic boolean isComplete()
true
if the exchange has completedpublic Object getNegotiatedProperty(String propName)
propName
- the property name
null
if not definedpublic void dispose() throws SaslException
SaslException
- if disposal failed
|
jboss-sasl 1.0.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |