2011-04-25 19:47:56 +02:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Initial
|
|
|
|
* Developer's Public License Version 1.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed AS IS,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing rights
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Alex Peshkov
|
|
|
|
* for the Firebird Open Source RDBMS project.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011 Alex Peshkov <peshkoff@mail.ru>
|
|
|
|
* and all contributors signed below.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef JRD_ENGINE_INTERFACE_H
|
|
|
|
#define JRD_ENGINE_INTERFACE_H
|
|
|
|
|
2011-06-02 17:57:08 +02:00
|
|
|
#include "firebird/Provider.h"
|
2011-04-25 19:47:56 +02:00
|
|
|
#include "../common/classes/ImplementHelper.h"
|
|
|
|
#include "../common/StatementMetadata.h"
|
|
|
|
#include "../common/classes/RefCounted.h"
|
|
|
|
|
2013-04-04 15:17:57 +02:00
|
|
|
#define CURRENT_ENGINE "Engine12"
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
namespace Jrd {
|
|
|
|
|
|
|
|
// Engine objects used by interface objects
|
|
|
|
class blb;
|
|
|
|
class jrd_tra;
|
|
|
|
class dsql_req;
|
|
|
|
class JrdStatement;
|
2014-06-10 09:13:34 +02:00
|
|
|
class StableAttachmentPart;
|
2011-04-25 19:47:56 +02:00
|
|
|
class Attachment;
|
|
|
|
class Service;
|
|
|
|
|
|
|
|
// forward declarations
|
2013-02-17 13:08:53 +01:00
|
|
|
class JStatement;
|
2011-04-25 19:47:56 +02:00
|
|
|
class JAttachment;
|
|
|
|
class JProvider;
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JBlob FB_FINAL : public Firebird::RefCntIface<Firebird::IBlob, FB_BLOB_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IBlob implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG getInfo(Firebird::IStatus* status,
|
|
|
|
unsigned int itemsLength, const unsigned char* items,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
2014-08-27 11:24:30 +02:00
|
|
|
virtual int FB_CARG getSegment(Firebird::IStatus* status, unsigned int length, void* buffer,
|
|
|
|
unsigned int* segmentLength);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual void FB_CARG putSegment(Firebird::IStatus* status, unsigned int length, const void* buffer);
|
|
|
|
virtual void FB_CARG cancel(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG close(Firebird::IStatus* status);
|
|
|
|
virtual int FB_CARG seek(Firebird::IStatus* status, int mode, int offset); // returns position
|
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JBlob(blb* handle, StableAttachmentPart* sa);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
2013-08-16 14:44:10 +02:00
|
|
|
blb* getHandle() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return blob;
|
|
|
|
}
|
|
|
|
|
2014-08-15 15:08:25 +02:00
|
|
|
void clearHandle()
|
|
|
|
{
|
|
|
|
blob = NULL;
|
|
|
|
}
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
private:
|
|
|
|
blb* blob;
|
2014-06-10 09:13:34 +02:00
|
|
|
Firebird::RefPtr<StableAttachmentPart> sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JTransaction FB_FINAL : public Firebird::RefCntIface<Firebird::ITransaction, FB_TRANSACTION_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// ITransaction implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG getInfo(Firebird::IStatus* status,
|
|
|
|
unsigned int itemsLength, const unsigned char* items,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
|
|
|
virtual void FB_CARG prepare(Firebird::IStatus* status,
|
|
|
|
unsigned int msg_length = 0, const unsigned char* message = 0);
|
|
|
|
virtual void FB_CARG commit(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG commitRetaining(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG rollback(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG rollbackRetaining(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG disconnect(Firebird::IStatus* status);
|
2011-05-19 13:38:38 +02:00
|
|
|
virtual Firebird::ITransaction* FB_CARG join(Firebird::IStatus* status, Firebird::ITransaction* transaction);
|
|
|
|
virtual JTransaction* FB_CARG validate(Firebird::IStatus* status, Firebird::IAttachment* testAtt);
|
|
|
|
virtual JTransaction* FB_CARG enterDtc(Firebird::IStatus* status);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JTransaction(jrd_tra* handle, StableAttachmentPart* sa);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2013-08-16 14:44:10 +02:00
|
|
|
jrd_tra* getHandle() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return transaction;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setHandle(jrd_tra* handle)
|
|
|
|
{
|
|
|
|
transaction = handle;
|
|
|
|
}
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
transaction = NULL;
|
|
|
|
release();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
jrd_tra* transaction;
|
2014-06-10 09:13:34 +02:00
|
|
|
Firebird::RefPtr<StableAttachmentPart> sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
JTransaction(JTransaction* from);
|
2011-05-19 13:38:38 +02:00
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JResultSet FB_FINAL : public Firebird::RefCntIface<Firebird::IResultSet, FB_RESULTSET_VERSION>
|
2013-02-17 13:08:53 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IResultSet implementation
|
|
|
|
virtual int FB_CARG release();
|
2014-08-27 11:24:30 +02:00
|
|
|
virtual int FB_CARG fetchNext(Firebird::IStatus* status, void* message);
|
|
|
|
virtual int FB_CARG fetchPrior(Firebird::IStatus* status, void* message);
|
|
|
|
virtual int FB_CARG fetchFirst(Firebird::IStatus* status, void* message);
|
|
|
|
virtual int FB_CARG fetchLast(Firebird::IStatus* status, void* message);
|
|
|
|
virtual int FB_CARG fetchAbsolute(Firebird::IStatus* status, unsigned int position, void* message);
|
|
|
|
virtual int FB_CARG fetchRelative(Firebird::IStatus* status, int offset, void* message);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual FB_BOOLEAN FB_CARG isEof(Firebird::IStatus* status);
|
2013-04-13 09:11:58 +02:00
|
|
|
virtual FB_BOOLEAN FB_CARG isBof(Firebird::IStatus* status);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual Firebird::IMessageMetadata* FB_CARG getMetadata(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG close(Firebird::IStatus* status);
|
2014-04-18 14:08:17 +02:00
|
|
|
virtual void FB_CARG setDelayedOutputFormat(Firebird::IStatus* status, Firebird::IMessageMetadata* format);
|
2013-02-17 13:08:53 +01:00
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JResultSet(JStatement* aStatement);
|
2013-02-17 13:08:53 +01:00
|
|
|
|
|
|
|
JStatement* getStatement()
|
|
|
|
{
|
|
|
|
return statement;
|
|
|
|
}
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment();
|
2013-02-17 13:08:53 +01:00
|
|
|
|
|
|
|
// Change after adding separate handle for cursor in dsql
|
2013-08-16 14:44:10 +02:00
|
|
|
dsql_req* getHandle() throw();
|
2013-02-17 13:08:53 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Firebird::RefPtr<JStatement> statement;
|
|
|
|
bool eof;
|
|
|
|
|
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JStatement FB_FINAL : public Firebird::RefCntIface<Firebird::IStatement, FB_STATEMENT_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IStatement implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG getInfo(Firebird::IStatus* status,
|
|
|
|
unsigned int itemsLength, const unsigned char* items,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual void FB_CARG free(Firebird::IStatus* status);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual ISC_UINT64 FB_CARG getAffectedRecords(Firebird::IStatus* userStatus);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual Firebird::IMessageMetadata* FB_CARG getOutputMetadata(Firebird::IStatus* userStatus);
|
|
|
|
virtual Firebird::IMessageMetadata* FB_CARG getInputMetadata(Firebird::IStatus* userStatus);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual unsigned FB_CARG getType(Firebird::IStatus* status);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual const char* FB_CARG getPlan(Firebird::IStatus* status, FB_BOOLEAN detailed);
|
2014-04-08 15:45:21 +02:00
|
|
|
virtual Firebird::ITransaction* FB_CARG execute(Firebird::IStatus* status,
|
2013-02-26 04:42:19 +01:00
|
|
|
Firebird::ITransaction* transaction, Firebird::IMessageMetadata* inMetadata, void* inBuffer,
|
|
|
|
Firebird::IMessageMetadata* outMetadata, void* outBuffer);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual JResultSet* FB_CARG openCursor(Firebird::IStatus* status,
|
2013-02-26 04:42:19 +01:00
|
|
|
Firebird::ITransaction* transaction, Firebird::IMessageMetadata* inMetadata, void* inBuffer,
|
|
|
|
Firebird::IMessageMetadata* outMetadata);
|
2014-07-31 13:43:38 +02:00
|
|
|
virtual void FB_CARG setCursorName(Firebird::IStatus* status, const char* name);
|
2013-02-19 12:20:49 +01:00
|
|
|
virtual unsigned FB_CARG getFlags(Firebird::IStatus* status);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JStatement(dsql_req* handle, StableAttachmentPart* sa, Firebird::Array<UCHAR>& meta);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
2013-08-16 14:44:10 +02:00
|
|
|
dsql_req* getHandle() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return statement;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
dsql_req* statement;
|
2014-06-10 09:13:34 +02:00
|
|
|
Firebird::RefPtr<StableAttachmentPart> sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
Firebird::StatementMetadata metadata;
|
|
|
|
|
2013-02-17 13:08:53 +01:00
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
2011-04-25 19:47:56 +02:00
|
|
|
};
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
inline StableAttachmentPart* JResultSet::getAttachment()
|
2013-02-17 13:08:53 +01:00
|
|
|
{
|
|
|
|
return statement->getAttachment();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Change after adding separate handle for cursor in dsql
|
2013-08-16 14:44:10 +02:00
|
|
|
inline dsql_req* JResultSet::getHandle() throw()
|
2013-02-17 13:08:53 +01:00
|
|
|
{
|
|
|
|
return statement->getHandle();
|
|
|
|
}
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JRequest FB_FINAL : public Firebird::RefCntIface<Firebird::IRequest, FB_REQUEST_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IRequest implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG receive(Firebird::IStatus* status, int level, unsigned int msg_type,
|
|
|
|
unsigned int length, unsigned char* message);
|
|
|
|
virtual void FB_CARG send(Firebird::IStatus* status, int level, unsigned int msg_type,
|
|
|
|
unsigned int length, const unsigned char* message);
|
|
|
|
virtual void FB_CARG getInfo(Firebird::IStatus* status, int level,
|
|
|
|
unsigned int itemsLength, const unsigned char* items,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
|
|
|
virtual void FB_CARG start(Firebird::IStatus* status, Firebird::ITransaction* tra, int level);
|
|
|
|
virtual void FB_CARG startAndSend(Firebird::IStatus* status, Firebird::ITransaction* tra, int level, unsigned int msg_type,
|
|
|
|
unsigned int length, const unsigned char* message);
|
|
|
|
virtual void FB_CARG unwind(Firebird::IStatus* status, int level);
|
|
|
|
virtual void FB_CARG free(Firebird::IStatus* status);
|
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JRequest(JrdStatement* handle, StableAttachmentPart* sa);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
2013-08-16 14:44:10 +02:00
|
|
|
JrdStatement* getHandle() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return rq;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
JrdStatement* rq;
|
2014-06-10 09:13:34 +02:00
|
|
|
Firebird::RefPtr<StableAttachmentPart> sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JEvents FB_FINAL : public Firebird::RefCntIface<Firebird::IEvents, FB_EVENTS_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IEvents implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG cancel(Firebird::IStatus* status);
|
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
JEvents(int aId, StableAttachmentPart* sa, Firebird::IEventCallback* aCallback);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2013-08-16 14:44:10 +02:00
|
|
|
JEvents* getHandle() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return sAtt;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int id;
|
2014-06-10 09:13:34 +02:00
|
|
|
Firebird::RefPtr<StableAttachmentPart> sAtt;
|
2013-11-18 13:20:23 +01:00
|
|
|
Firebird::RefPtr<Firebird::IEventCallback> callback;
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
class JAttachment FB_FINAL : public Firebird::RefCntIface<Firebird::IAttachment, FB_ATTACHMENT_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IAttachment implementation
|
|
|
|
virtual int FB_CARG release();
|
2014-06-10 09:13:34 +02:00
|
|
|
virtual void FB_CARG addRef();
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual void FB_CARG getInfo(Firebird::IStatus* status,
|
|
|
|
unsigned int itemsLength, const unsigned char* items,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
2011-05-07 21:52:44 +02:00
|
|
|
virtual JTransaction* FB_CARG startTransaction(Firebird::IStatus* status,
|
|
|
|
unsigned int tpbLength, const unsigned char* tpb);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual JTransaction* FB_CARG reconnectTransaction(Firebird::IStatus* status, unsigned int length, const unsigned char* id);
|
|
|
|
virtual JRequest* FB_CARG compileRequest(Firebird::IStatus* status, unsigned int blr_length, const unsigned char* blr);
|
|
|
|
virtual void FB_CARG transactRequest(Firebird::IStatus* status, Firebird::ITransaction* transaction,
|
|
|
|
unsigned int blr_length, const unsigned char* blr,
|
|
|
|
unsigned int in_msg_length, const unsigned char* in_msg,
|
|
|
|
unsigned int out_msg_length, unsigned char* out_msg);
|
|
|
|
virtual JBlob* FB_CARG createBlob(Firebird::IStatus* status, Firebird::ITransaction* transaction,
|
|
|
|
ISC_QUAD* id, unsigned int bpbLength = 0, const unsigned char* bpb = 0);
|
|
|
|
virtual JBlob* FB_CARG openBlob(Firebird::IStatus* status, Firebird::ITransaction* transaction,
|
|
|
|
ISC_QUAD* id, unsigned int bpbLength = 0, const unsigned char* bpb = 0);
|
|
|
|
virtual int FB_CARG getSlice(Firebird::IStatus* status, Firebird::ITransaction* transaction, ISC_QUAD* id,
|
|
|
|
unsigned int sdl_length, const unsigned char* sdl,
|
|
|
|
unsigned int param_length, const unsigned char* param,
|
|
|
|
int sliceLength, unsigned char* slice);
|
|
|
|
virtual void FB_CARG putSlice(Firebird::IStatus* status, Firebird::ITransaction* transaction, ISC_QUAD* id,
|
|
|
|
unsigned int sdl_length, const unsigned char* sdl,
|
|
|
|
unsigned int param_length, const unsigned char* param,
|
|
|
|
int sliceLength, unsigned char* slice);
|
2012-06-26 15:43:26 +02:00
|
|
|
virtual void FB_CARG executeDyn(Firebird::IStatus* status, Firebird::ITransaction* transaction, unsigned int length,
|
2011-04-25 19:47:56 +02:00
|
|
|
const unsigned char* dyn);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual JStatement* FB_CARG prepare(Firebird::IStatus* status, Firebird::ITransaction* tra,
|
|
|
|
unsigned int stmtLength, const char* sqlStmt, unsigned int dialect, unsigned int flags);
|
|
|
|
virtual Firebird::ITransaction* FB_CARG execute(Firebird::IStatus* status,
|
|
|
|
Firebird::ITransaction* transaction, unsigned int stmtLength, const char* sqlStmt,
|
2013-02-26 04:42:19 +01:00
|
|
|
unsigned int dialect, Firebird::IMessageMetadata* inMetadata, void* inBuffer,
|
|
|
|
Firebird::IMessageMetadata* outMetadata, void* outBuffer);
|
2013-02-17 13:08:53 +01:00
|
|
|
virtual Firebird::IResultSet* FB_CARG openCursor(Firebird::IStatus* status,
|
|
|
|
Firebird::ITransaction* transaction, unsigned int stmtLength, const char* sqlStmt,
|
2013-02-26 04:42:19 +01:00
|
|
|
unsigned int dialect, Firebird::IMessageMetadata* inMetadata, void* inBuffer,
|
2014-07-31 13:43:38 +02:00
|
|
|
Firebird::IMessageMetadata* outMetadata, const char* cursorName);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual JEvents* FB_CARG queEvents(Firebird::IStatus* status, Firebird::IEventCallback* callback,
|
|
|
|
unsigned int length, const unsigned char* events);
|
|
|
|
virtual void FB_CARG cancelOperation(Firebird::IStatus* status, int option);
|
|
|
|
virtual void FB_CARG ping(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG detach(Firebird::IStatus* status);
|
2012-06-26 15:43:26 +02:00
|
|
|
virtual void FB_CARG dropDatabase(Firebird::IStatus* status);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
public:
|
2014-06-10 09:13:34 +02:00
|
|
|
explicit JAttachment(StableAttachmentPart* js);
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getStable() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
return att;
|
|
|
|
}
|
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
Attachment* getHandle() throw();
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* getAttachment() throw()
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
2014-06-10 09:13:34 +02:00
|
|
|
return att;
|
2011-04-25 19:47:56 +02:00
|
|
|
}
|
|
|
|
|
2011-05-19 13:38:38 +02:00
|
|
|
JTransaction* getTransactionInterface(Firebird::IStatus* status, Firebird::ITransaction* tra);
|
|
|
|
jrd_tra* getEngineTransaction(Firebird::IStatus* status, Firebird::ITransaction* tra);
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
private:
|
2014-06-10 09:13:34 +02:00
|
|
|
StableAttachmentPart* att;
|
2011-04-25 19:47:56 +02:00
|
|
|
|
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JService FB_FINAL : public Firebird::RefCntIface<Firebird::IService, FB_SERVICE_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// IService implementation
|
|
|
|
virtual int FB_CARG release();
|
|
|
|
virtual void FB_CARG detach(Firebird::IStatus* status);
|
|
|
|
virtual void FB_CARG query(Firebird::IStatus* status,
|
|
|
|
unsigned int sendLength, const unsigned char* sendItems,
|
|
|
|
unsigned int receiveLength, const unsigned char* receiveItems,
|
|
|
|
unsigned int bufferLength, unsigned char* buffer);
|
|
|
|
virtual void FB_CARG start(Firebird::IStatus* status,
|
|
|
|
unsigned int spbLength, const unsigned char* spb);
|
|
|
|
|
|
|
|
public:
|
2011-06-24 08:34:16 +02:00
|
|
|
explicit JService(Service* handle);
|
2014-04-25 12:59:34 +02:00
|
|
|
Firebird::Mutex mutex;
|
2011-04-25 19:47:56 +02:00
|
|
|
Service* svc;
|
|
|
|
|
2014-04-25 12:59:34 +02:00
|
|
|
private:
|
2011-04-25 19:47:56 +02:00
|
|
|
void freeEngineData(Firebird::IStatus* status);
|
|
|
|
};
|
|
|
|
|
2013-11-18 13:20:23 +01:00
|
|
|
class JProvider FB_FINAL : public Firebird::StdPlugin<Firebird::IProvider, FB_PROVIDER_VERSION>
|
2011-04-25 19:47:56 +02:00
|
|
|
{
|
|
|
|
public:
|
2013-11-14 17:16:24 +01:00
|
|
|
explicit JProvider(Firebird::IPluginConfig* pConf)
|
|
|
|
: cryptCallback(NULL), pluginConfig(pConf)
|
2011-04-26 03:00:33 +02:00
|
|
|
{
|
|
|
|
}
|
2011-04-25 19:47:56 +02:00
|
|
|
|
2011-05-11 19:42:44 +02:00
|
|
|
static Firebird::RefPtr<JProvider> getInstance()
|
|
|
|
{
|
|
|
|
Firebird::RefPtr<JProvider> p(new JProvider(NULL));
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
// IProvider implementation
|
2011-05-07 21:52:44 +02:00
|
|
|
virtual JAttachment* FB_CARG attachDatabase(Firebird::IStatus* status, const char* fileName,
|
|
|
|
unsigned int dpbLength, const unsigned char* dpb);
|
|
|
|
virtual JAttachment* FB_CARG createDatabase(Firebird::IStatus* status, const char* fileName,
|
|
|
|
unsigned int dpbLength, const unsigned char* dpb);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual JService* FB_CARG attachServiceManager(Firebird::IStatus* status, const char* service,
|
2011-04-26 03:00:33 +02:00
|
|
|
unsigned int spbLength, const unsigned char* spb);
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual void FB_CARG shutdown(Firebird::IStatus* status, unsigned int timeout, const int reason);
|
2012-05-31 18:53:42 +02:00
|
|
|
virtual void FB_CARG setDbCryptCallback(Firebird::IStatus* status,
|
|
|
|
Firebird::ICryptKeyCallback* cryptCallback);
|
|
|
|
|
2011-04-25 19:47:56 +02:00
|
|
|
virtual int FB_CARG release();
|
2012-05-31 18:53:42 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Firebird::ICryptKeyCallback* cryptCallback;
|
2013-11-14 17:16:24 +01:00
|
|
|
Firebird::IPluginConfig* pluginConfig;
|
2011-04-25 19:47:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Jrd
|
|
|
|
|
|
|
|
#endif // JRD_ENGINE_INTERFACE_H
|