FrontBase Documentation |
Backtrack: Welcome! 6. Original Documentation 6.7. FBAccess API |
Updated:
20-Nov-2000
prev next Table of Contents |
This class is available by including FBAccess/FBExecHandler.h.
Connection management: + handlerForHost:
+ handlerForThisHost
+ errorMessage
+ FBExecBroadcastNotification
+ disconnect
+ setClientType:
Broadcast messages: + setIgnoreBroadcasts:
+ ignoreBroadcasts
- setIgnoreBroadcasts:
- ignoreBroadcasts
Database information: - availableDatabases
- statusForDatabaseNamed:
- portNumberForDatabaseNamed:
+ compactDatabaseName:Managing databases: - startDatabaseNamed:
- createDatabaseNamed:
- deleteDatabaseNamed:
- killDatabaseNamed:extracting information: - hostInfo
- errorMessage
- disconnect
- sendCommandToExec:
Class Methods
compactDatabaseName:
+ (NSString *) compactDatabaseName:(NSString *) dbName
Remove "/usr/FrontBase/Databases/" and ".fb"
disconnect
+ (void) disconnect
Disconnect all handlers (most likely as part of terminating).
FBExecBroadcastNotification
+ (NSString *) FBExecBroadcastNotification
Use this when adding observers for broadcast messages
errorMessage
+ (NSString *) errorMessage
errorMessage may provide an explanation for why a handlerForThisHost: failed, i.e. nil was returned.
handlerForHost:
+ (FBExecHandler *) handlerForHost:(NSString *) hostName
A connection to an FBExec on a given host is provided via a so-called handler object (FBExecHandler). Connection/handlers are cached and need not be retained nor released. If the connection cannot get established, nil is returned. A subsequent call to +errorMessage will return an error message.
handlerForThisHost
+ (FBExecHandler *) handlerForThisHost
Invokes handlerForHost: with the current host.
ignoreBroadcasts
+ (BOOL) ignoreBroadcasts
setClientType:
+ (void) setClientType:(FBExecClientType) type
Each connection to a FBExec will register itself with its type (and other information) with the FBExec. Be sure to call +setClientType: before any handler is created, unless FBUnknownType will suffice for you.
setIgnoreBroadcasts:
+ (void) setIgnoreBroadcasts:(BOOL) ignore
Instance Methods
availableDatabases
- (NSDictionary *) availableDatabases
Available databases on the given host and their current status (as an NSString, i.e. -intValue should be used to get the actual status).
createDatabaseNamed:
- (BOOL) createDatabaseNamed:(NSString *) dbName
Create a database from scratch.
deleteDatabaseNamed:
- (BOOL) deleteDatabaseNamed:(NSString *) dbName
disconnect
- (void) disconnect
Disconnect the handler from the FBExec.
errorMessage
- (NSString *) errorMessage
If any method failed, -errorMessage will typically provide an explanation.
hostInfo
- (NSHost *) hostInfo
Identical to [NSHost hostWithName:hostName], where hostName is as given to +handlerForHost:.
ignoreBroadcasts
- (BOOL) ignoreBroadcasts
killDatabaseNamed:
- (BOOL) killDatabaseNamed:(NSString *) dbName
Kill (unconditionally) the given database. This is supposed be to the last resort. The preferred way is to send stopDatabase via an FSDatabaseConnection instance.
portNumberForDatabaseNamed:
- (unsigned) portNumberForDatabaseNamed:(NSString *) dbName
The port number to use when connecting to the database.
sendCommandToExec:
- (NSString *) sendCommandToExec:(NSString *) cmd
Send a command to the FBExec and get a response. If the response indicates an error, the reply will be nil and a subsequent call to -errorMessage will return the message. If everything is OK, the actual reply is returned. For commands that do not generate a response per se, "OK" is returned.
setIgnoreBroadcasts:
- (void) setIgnoreBroadcasts:(BOOL) ignore
startDatabaseNamed:
- (BOOL) startDatabaseNamed:(NSString *) dbName
Start an existing database.
statusForDatabaseNamed:
- (FBDatabaseStatus) statusForDatabaseNamed:(NSString *) dbName
The current status of the given database.
If you have feedback or questions on this document, please send e-mail to doc-feedback@frontbase.com. Please reference the section number and topic. Thanks!!
©2000 FrontBase, Inc. All rights reserved.