- All Superinterfaces:
AutoCloseable
,ExceptionListenable
,FbAttachment
- All Known Subinterfaces:
FbWireService
- All Known Implementing Classes:
AbstractFbService
,AbstractFbWireService
,V10Service
Connection handle to a service.
All methods defined in this interface are required to notify all SQLException
thrown from the methods
defined in this interface, and those exceptions notified by all ExceptionListenable
implementations created
from them.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addServiceListener
(ServiceListener listener) Adds aServiceListener
instance to this database.Creates an emptyServiceParameterBuffer
.int
byte[]
getServiceInfo
(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int maxBufferLength) Performs a service info request (service query.<T> T
getServiceInfo
(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<T> infoProcessor) Request service info (service query).void
removeServiceListener
(ServiceListener listener) Removes aServiceListener
instance from this database.void
startServiceAction
(ServiceRequestBuffer serviceRequestBuffer) Starts a service action.Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListener
Methods inherited from interface org.firebirdsql.gds.ng.FbAttachment
attach, close, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, isAttached, isLockedByCurrentThread, setNetworkTimeout, withLock
-
Method Details
-
getHandle
int getHandle()- Specified by:
getHandle
in interfaceFbAttachment
- Returns:
- The service handle value
-
getServiceInfo
<T> T getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<T> infoProcessor) throws SQLException Request service info (service query).- Parameters:
serviceParameterBuffer
- Service parametersserviceRequestBuffer
- Service request infobufferLength
- Response buffer length to useinfoProcessor
- Implementation ofInfoProcessor
to transform the info response- Returns:
- Transformed info response of type T
- Throws:
SQLException
- For errors retrieving or transforming the response.
-
getServiceInfo
byte[] getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int maxBufferLength) throws SQLException Performs a service info request (service query.- Parameters:
serviceParameterBuffer
- Service parameters (can be null)serviceRequestBuffer
- Service request infomaxBufferLength
- Maximum response buffer length to use- Returns:
- The response buffer (note: length is the actual length of the response, not
maxBufferLength
- Throws:
SQLException
- For errors retrieving the information.
-
startServiceAction
Starts a service action.- Parameters:
serviceRequestBuffer
- Service action request details- Throws:
SQLException
- For errors starting the service action.
-
createServiceParameterBuffer
ServiceParameterBuffer createServiceParameterBuffer()Creates an emptyServiceParameterBuffer
.Attach expects a service parameter buffer to have the version as the first item. This needs to be added explicitly.
- Returns:
- Service
-
createServiceRequestBuffer
ServiceRequestBuffer createServiceRequestBuffer()- Returns:
- An empty service request buffer
-
addServiceListener
Adds aServiceListener
instance to this database.- Parameters:
listener
- Database listener
-
removeServiceListener
Removes aServiceListener
instance from this database.- Parameters:
listener
- Database Listener
-