RTArchivedSession


Inherits From:
NSObject
Declared In:
RTArchivedSession.h


Class Description

The RTArchivedSession class encapsulates the information necessary to open an RTSQLSession from a nib file. If the session source is set to RTSessionSource_Set (meaning it will be set programatically), then this object will always return nil for the session.


Symbolic Constants

RTSessionSource_Params  0
RTSessionSource_Prompt  1
RTSessionSource_Set  2
RTSessionSource_PasswordPrompt  3

Description:

These constants represent the various sessionSources an RTArchivedSession can create a session from: via parameters in Interface Builder, via prompting the user, or by being set programatically.


Method Types

- sessionSource
- setSessionSource:
- connectionPluginName
- setConnectionPluginName:
- connectionHost
- setConnectionHost:
- connectionPort
- setConnectionPort:
- connectionUserid
- setConnectionUserid:
- connectionPassword
- setConnectionPassword:
- connectionInitDatabase
- setConnectionInitDatabase:
- session
- setSession:
- delegate
- setDelegate:

Instance Methods

connectionHost

- (NSString*)connectionHost

For sessions specified in Interface Builder, returns the host the session will connect to.


connectionInitDatabase

- (NSString*)connectionInitDatabase

For sessions specified in Interface Builder, returns the name of the database the session will connect to.


connectionPassword

- (NSString*)connectionPassword

For sessions specified in Interface Builder, returns the password the session will connect with.


connectionPluginName

- (NSString*)connectionPluginName

For sessions specified in Interface Builder, returns the name of the database plugin used for the session.


connectionPort

- (UInt16)connectionPort

For sessions specified in Interface Builder, returns the port the session will connect to.


connectionUserid

- (NSString*)connectionUserid

For sessions specified in Interface Builder, returns the userid the session will connect with.


delegate

- (id)delegate

Returns the delegate object.


session

- (id<RTSQLSession>)session

Returns the session object held by this ArchivedSession. If one does not exist, it is opened. Rasies an RTFailedToCreateSessionException if fails to open the session or one was not specified.


sessionSource

- (SInt8)sessionSource

Returns a constant for the source of the session archived.


setConnectionHost:

- (void)setConnectionHost:(NSString*)str

For sessions specified in Interface Builder, sets the host the session will connect to.


setConnectionInitDatabase:

- (void)setConnectionInitDatabase:(NSString*)str

For sessions specified in Interface Builder, sets the name of the database the session will connect to.


setConnectionPassword:

- (void)setConnectionPassword:(NSString*)str

For sessions specified in Interface Builder, sets the password the session will connect with.


setConnectionPluginName:

- (void)setConnectionPluginName:(NSString*)str

For sessions specified in Interface Builder, sets the name of the database plugin used for the session.


setConnectionPort:

- (void)setConnectionPort:(UInt16)p

For sessions specified in Interface Builder, sets the port the session will connect to.


setConnectionUserid:

- (void)setConnectionUserid:(NSString*)str

For sessions specified in Interface Builder, sets the userid the session will connect with.


setDelegate:

- (void)setDelegate:(id)delegate

Sets the delegate object.


setSession:

- (void)setSession:(id)session

Sets the session object this archived session represents. Calling this method will result in an exception being raised unless the sessionSource is RTSessionSource_Set.


setSessionSource:

- (void)setSessionSource:(SInt8)val

Sets the source of the session archived.




Methods Implemented by the Delegate



archivedSession:failedToOpenSession:

- (BOOL)archivedSession:(RTArchivedSession *)session failedToOpenSession:(NSString*)reason

Message sent when the archived session fails to open an actual session. If the delegate returns YES, the archived session will try connecting again, up to a maximum of 3 times.


archivedSession:needsUserid:andPassword:

- (BOOL)archivedSession:(RTArchivedSession *)session needsUserid:(NSString**)useridPtr andPassword:(NSString**)passwordPtr

Message sent if the archived session has a sessionSource of RTSessionSource_PasswordPrompt. The delegate should set the userid and password pointers to point to a userid and password to use. If this message is not handled or returns NO, then the user will be prompted for the userid and password via a modal dialog.


didOpenConnection:

- (void)didOpenConnection:(RTArchivedSession *)archivedSession

Message sent when the connection has been opened. An ideal hook to remove a progress display.


willOpenConnection:

- (void)willOpenConnection:(RTArchivedSession *)archivedSession

Message sent when the connection is about to be opened. An ideal hook to display a progress dialog.


Copyright ©2006 by Runtime Labs, Inc.. All Rights Reserved.