C# Class Raven.Database.Plugins.AbstractPutTrigger

Inheritance: IRequiresDocumentDatabaseInitialization
Mostra file Open project: nhsevidence/ravendb

Public Methods

Method Description
AfterCommit ( string key, RavenJObject document, RavenJObject metadata, System.Guid etag ) : void

Allow the trigger to perform any logic _after_ the transaction was committed. For example, by notifying interested parties.

This method SHOULD NOT modify either the document or the metadata

AfterPut ( string key, RavenJObject document, RavenJObject metadata, System.Guid etag, TransactionInformation transactionInformation ) : void

Allow the trigger to perform any logic after the document was put but still in the same transaction as the put

Any call to the provided DocumentDatabase instance will be done under the same transaction as the PUT operation.

AllowPut ( string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation ) : Raven.Database.Plugins.VetoResult

Ask the trigger whatever the PUT should be vetoed. If the trigger vote to veto the PUT, it needs to provide a human readable explanation why the PUT was rejected.

This method SHOULD NOT modify either the document or the metadata.

Initialize ( ) : void
Initialize ( DocumentDatabase database ) : void
OnPut ( string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation ) : void

Allow the trigger to perform any logic just before the document is saved to disk. Any modifications the trigger makes to the document or the metadata will be persisted to disk.

If the trigger need to access the previous state of the document, the trigger should implement IRequiresDocumentDatabaseInitialization and use the provided DocumentDatabase instance to Get it. The returned result would be the old document (if it exists) or null. Any call to the provided DocumentDatabase instance will be done under the same transaction as the PUT operation.

Method Details

AfterCommit() public method

Allow the trigger to perform any logic _after_ the transaction was committed. For example, by notifying interested parties.
This method SHOULD NOT modify either the document or the metadata
public AfterCommit ( string key, RavenJObject document, RavenJObject metadata, System.Guid etag ) : void
key string The document key
document RavenJObject The document that was put into Raven
metadata RavenJObject The document metadata
etag System.Guid The etag of the just put document
return void

AfterPut() public method

Allow the trigger to perform any logic after the document was put but still in the same transaction as the put
Any call to the provided DocumentDatabase instance will be done under the same transaction as the PUT operation.
public AfterPut ( string key, RavenJObject document, RavenJObject metadata, System.Guid etag, TransactionInformation transactionInformation ) : void
key string The document key
document RavenJObject The new document about to be put into Raven
metadata RavenJObject The new document metadata
etag System.Guid The etag of the just put document
transactionInformation TransactionInformation The current transaction, if it exists
return void

AllowPut() public method

Ask the trigger whatever the PUT should be vetoed. If the trigger vote to veto the PUT, it needs to provide a human readable explanation why the PUT was rejected.
This method SHOULD NOT modify either the document or the metadata.
public AllowPut ( string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation ) : Raven.Database.Plugins.VetoResult
key string The document key
document RavenJObject The new document about to be put into Raven
metadata RavenJObject The new document metadata
transactionInformation TransactionInformation The current transaction, if it exists
return Raven.Database.Plugins.VetoResult

Initialize() public method

public Initialize ( ) : void
return void

Initialize() public method

public Initialize ( DocumentDatabase database ) : void
database DocumentDatabase
return void

OnPut() public method

Allow the trigger to perform any logic just before the document is saved to disk. Any modifications the trigger makes to the document or the metadata will be persisted to disk.
If the trigger need to access the previous state of the document, the trigger should implement IRequiresDocumentDatabaseInitialization and use the provided DocumentDatabase instance to Get it. The returned result would be the old document (if it exists) or null. Any call to the provided DocumentDatabase instance will be done under the same transaction as the PUT operation.
public OnPut ( string key, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation ) : void
key string The document key
document RavenJObject The new document about to be put into Raven
metadata RavenJObject The new document metadata
transactionInformation TransactionInformation The current transaction, if it exists
return void