Class: AbstractResourceHandler

x2node-ws-resources~ AbstractResourceHandler

Abstract parent for standard resource web wervice endpoint handlers.

new AbstractResourceHandler(ds, dboFactory, rsrcPath [, options])

Create new handler.
Parameters:
Name Type Argument Description
ds module:x2node-dbos.DataSource Data source.
dboFactory module:x2node-dbos~DBOFactory DBO factory.
rsrcPath string Resource path specification.
options Object <optional>
Options.

Members


_dboFactory :module:x2node-dbos~DBOFactory

The DBO factory.
Type:

_log :function

Debug logger.
Type:
  • function

_options :Object

Options. Always present, always has sections for the methods.
Type:
  • Object

_recordTypeDesc :module:x2node-records~RecordTypeDescriptor

Record type descriptor.
Type:

_recordTypeName :string

Record type name.
Type:
  • string

_recordTypes :module:x2node-records~RecordTypesLibrary

Record types library.
Type:

_txFactory :module:x2node-dbos~TxFactory

The transaction factory.
Type:

Type Definitions


transactionPhase(tx, txCtx [, result])

Transaction phase function.
Parameters:
Name Type Argument Description
tx module:x2node-dbos~Transaction The active transaction.
txCtx module:x2node-ws-resources~TransactionContext Transaction context.
result * <optional>
Resolved result of the previous phase.
Returns:
Phase result promise. If resolved, the transaction proceeds to the next phase. The last phase's result is the handler response. If rejected, no subsequent phases are executed, the transaction is rolled back (unless explicitely committed by the phase) and the handler call is rejected with the phase's rejection object.
Type
Promise