org.firebirdsql.management

Class FBServiceManager

Implemented Interfaces:
ServiceManager
Known Direct Subclasses:
FBBackupManager, FBMaintenanceManager, FBStatisticsManager, FBUserManager

public class FBServiceManager
extends java.lang.Object
implements ServiceManager

An implementation of the basic Firebird Service API functionality.
Author:
Roman Rokytskyy

Field Summary

static int
BUFFER_SIZE

Constructor Summary

FBServiceManager()
Create a new instance of FBServiceManager based on the default GDSType.
FBServiceManager(String gdsType)
Create a new instance of FBServiceManager based on a given GDSType.
FBServiceManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of FBServiceManager based on a given GDSType.

Method Summary

IscSvcHandle
attachServiceManager(GDS gds)
protected ServiceRequestBuffer
createRequestBuffer(int operation, int options)
Build up a request buffer for the specified operation.
void
detachServiceManager(GDS gds, IscSvcHandle handle)
protected void
executeServicesOperation(ServiceRequestBuffer srb)
Execute a Services API operation in the database.
String
getDatabase()
Returns the database path for the connection to the service manager.
GDS
getGds()
Get GDS implementation depending on the type specified during instantiation.
String
getHost()
OutputStream
getLogger()
String
getPassword()
int
getPort()
String
getServiceName()
String
getUser()
Get name of the user that performs the operation.
void
queueService(GDS gds, IscSvcHandle handle)
void
setDatabase(String database)
Sets the database path for the connection to the service manager.
void
setHost(String host)
void
setLogger(OutputStream logger)
void
setPassword(String password)
void
setPort(int port)
void
setUser(String user)
Set the name of the user that performs the operation.

Field Details

BUFFER_SIZE

public static final int BUFFER_SIZE
Field Value:
1024

Constructor Details

FBServiceManager

protected FBServiceManager()
Create a new instance of FBServiceManager based on the default GDSType.

FBServiceManager

protected FBServiceManager(String gdsType)
Create a new instance of FBServiceManager based on a given GDSType.
Parameters:
gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE

FBServiceManager

protected FBServiceManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of FBServiceManager based on a given GDSType.
Parameters:
gdsType - The GDS implementation type to use

Method Details

attachServiceManager

public IscSvcHandle attachServiceManager(GDS gds)
            throws GDSException

createRequestBuffer

protected ServiceRequestBuffer createRequestBuffer(int operation,
                                                   int options)
Build up a request buffer for the specified operation.
Parameters:
operation - The isc_action_svc_* operation
options - The options bitmask for the request buffer

detachServiceManager

public void detachServiceManager(GDS gds,
                                 IscSvcHandle handle)
            throws GDSException

executeServicesOperation

protected void executeServicesOperation(ServiceRequestBuffer srb)
            throws FBSQLException
Execute a Services API operation in the database. All output from the operation is sent to this ServiceManager's logger.
Parameters:
srb - The buffer containing the task request
Throws:
FBSQLException - if a database access error occurs or incorrect parameters are supplied

getDatabase

public String getDatabase()
Returns the database path for the connection to the service manager.
Specified by:
getDatabase in interface ServiceManager
Returns:
the database path for the connection to the service manager.

getGds

public GDS getGds()
Get GDS implementation depending on the type specified during instantiation.
Returns:
instance of GDS.

getHost

public String getHost()
Specified by:
getHost in interface ServiceManager
Returns:
Returns the host.

getLogger

public OutputStream getLogger()
Specified by:
getLogger in interface ServiceManager
Returns:
Returns the out.

getPassword

public String getPassword()
Specified by:
getPassword in interface ServiceManager
Returns:
Returns the password.

getPort

public int getPort()
Specified by:
getPort in interface ServiceManager
Returns:
Returns the port.

getServiceName

public String getServiceName()

getUser

public String getUser()
Get name of the user that performs the operation.
Specified by:
getUser in interface ServiceManager
Returns:
name of the user that performs the operation.

queueService

public void queueService(GDS gds,
                         IscSvcHandle handle)
            throws GDSException,
                   FBSQLException,
                   IOException

setDatabase

public void setDatabase(String database)
Sets the database path for the connection to the service manager.
Specified by:
setDatabase in interface ServiceManager
Parameters:
database - path for the connection to the service manager.

setHost

public void setHost(String host)
Specified by:
setHost in interface ServiceManager
Parameters:
host - The host to set.

setLogger

public void setLogger(OutputStream logger)
Specified by:
setLogger in interface ServiceManager
Parameters:
logger - The out to set.

setPassword

public void setPassword(String password)
Specified by:
setPassword in interface ServiceManager
Parameters:
password - The password to set.

setPort

public void setPort(int port)
Specified by:
setPort in interface ServiceManager
Parameters:
port - The port to set.

setUser

public void setUser(String user)
Set the name of the user that performs the operation.
Specified by:
setUser in interface ServiceManager
Parameters:
user - name of the user.

Copyright B) 2001 David Jencks and other authors. All rights reserved.