XGAuthenticator

Inherits from:
Declared In:

Overview

An XGAuthenticator class is used by the XGConnection class to perform authentication of the connection.

Discussion

The XGAuthenticator class is created by an Xgrid client using the users credentials and then set on an XGConnection object. The authenticator starts in the Unauthenticated state, and then enters the Authenticating state when the connection is ready to be authenticated. If the authentication is successful the authenticator enters the Authenticated state. If the authentication is unsucessful the authenticator enters the Failed state.

This is an abstract class. Subclasses must override the specifed methods.



Methods

-beginAuthentication:

Called once the authentication channel has been opened and the reply to the piggyback has been received.

-delegate

Returns the delegate of the receiver.

-error

Returns the error of the receiver.

-failWithError:

Causes the authenticator to fail and sets the error.

-finishAuthentication

Called once the authentication has completed sucessfully.

-piggyback

Returns the piggyback message to be sent when opening the authentication channel.

+profileURI

Returns the profileURI of the authentication channel.

-receiveData:

Called everytime data arrives on the authentication channel.

-sendData:

Sends the data on the authentication channel.

-setDelegate:

Sets the delegate of the receiver.

-state

Returns the state of the receiver.


beginAuthentication:


Called once the authentication channel has been opened and the reply to the piggyback has been received.

- (void)beginAuthentication:(NSString *)piggybackReply; 
Parameters
piggybackReply

The reply to the piggyback.


delegate


Returns the delegate of the receiver.

- (id)delegate; 
Return Value

The delegate of the receiver.


error


Returns the error of the receiver.

- (NSError *)error; 
Return Value

The error of the receiver.

Discussion

The error is set if the authenticator enters the Failed state.


failWithError:


Causes the authenticator to fail and sets the error.

- (void)failWithError:(NSError *)error; 
Parameters
error

The error that caused the failure.


finishAuthentication


Called once the authentication has completed sucessfully.

- (void)finishAuthentication; 


piggyback


Returns the piggyback message to be sent when opening the authentication channel.

- (NSString *)piggyback; 
Return Value

The piggyback to be sent.


profileURI


Returns the profileURI of the authentication channel.

+ (NSString *)profileURI; 
Return Value

The profileURI.


receiveData:


Called everytime data arrives on the authentication channel.

- (void)receiveData:(NSData *)data; 
Parameters
data

The received data.


sendData:


Sends the data on the authentication channel.

- (void)sendData:(NSData *)data; 
Parameters
data

The data to send.


setDelegate:


Sets the delegate of the receiver.

- (void)setDelegate:(id)delegate; 
Discussion

The delegate is not retained. If the delegate implements any of the methods in the XGAuthenticatorDelegate protocol then it will receive callbacks when connection events occur, prior to the notification of key-value observers.


state


Returns the state of the receiver.

- (XGAuthenticatorState)state; 
Return Value

The state of the receiver.

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-08-12