org.netbeans.lib.collab
Interface SASLClientProvider


public interface SASLClientProvider

A SASL client provider allows for extending the IM server to support custom SASL protocols. These are created from SASLClientProviderFactory for the required mechanism.

Author:
Mridul Muralidharan

Method Summary
 void close()
          Always called after the provider's use has completed.
 void init()
          Called before 'using' this instance of the provider so that it can initialise itself.
 void process(SASLData data)
          The whole SASL auth process is encapsulated within this method.
 void setLoginName(java.lang.String loginName)
          If there was a loginName specified , it will be passed on to the provider using this method , else null will be passed.
 void setPassword(java.lang.String password)
          If there was a password specified , it will be passed on to the provider using this method , else null will be passed.
 void setServer(java.lang.String server)
          Set's the server (or domain) to which the user wants to log into.
 

Method Detail

setLoginName

public void setLoginName(java.lang.String loginName)
If there was a loginName specified , it will be passed on to the provider using this method , else null will be passed.


setPassword

public void setPassword(java.lang.String password)
If there was a password specified , it will be passed on to the provider using this method , else null will be passed.


setServer

public void setServer(java.lang.String server)
Set's the server (or domain) to which the user wants to log into.


init

public void init()
          throws SASLProviderException
Called before 'using' this instance of the provider so that it can initialise itself. Invocation of this method indicates that there will be subsequent calls to SASLClientProvider#process

Throws:
SASLProviderException

process

public void process(SASLData data)
             throws SASLProviderException
The whole SASL auth process is encapsulated within this method. There will be a series of challenges passed on to the provider which were issued by the server. The client provider will evaluate them and pass an appropriate response. Not all the challenges need to have a payload data associated in the SASLData, like the initial SASLData#START state ,etc. The client should respond back with a SASLData which which are one of : START (for the initial request) , RESPONSE , ABORT , FAILURE or SUCCESS (when server responds with SUCCESS). If a status of FAILURE or ABORT is passed to the provider as part of the request then it indicates that the authentication has been denied/failed at the server side. Similarly, the provider can return a status of FAILURE to indicate client side authentication error.

Throws:
SASLProviderException - This will result in sending a Abort SASL packet to the server and the authentication process will fail.

close

public void close()
Always called after the provider's use has completed. For every sucessful init() there will be a call to close() This will be called irrespective of whether auth suceeds or fails. This hook can be used to cleanup any resources in use by the provider.