C# 클래스 Raven.Database.Plugins.AbstractPutTrigger

상속: IRequiresDocumentDatabaseInitialization
파일 보기 프로젝트 열기: nhsevidence/ravendb

공개 메소드들

메소드 설명
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.

메소드 상세

AfterCommit() 공개 메소드

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
리턴 void

AfterPut() 공개 메소드

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
리턴 void

AllowPut() 공개 메소드

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
리턴 Raven.Database.Plugins.VetoResult

Initialize() 공개 메소드

public Initialize ( ) : void
리턴 void

Initialize() 공개 메소드

public Initialize ( DocumentDatabase database ) : void
database DocumentDatabase
리턴 void

OnPut() 공개 메소드

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
리턴 void