Trigger Class

public class Trigger
extends Resource

Represents a trigger in the Azure Cosmos DB database service.

Azure Cosmos DB supports pre and post triggers defined in JavaScript to be executed on creates, updates and deletes. For additional details, refer to the server-side JavaScript API documentation.

Constructor Summary

Constructor Description
Trigger()

Constructor.

Trigger(String jsonString)

Constructor.

Trigger(JSONObject jsonObject)

Constructor.

Method Summary

Modifier and Type Method and Description
java.lang.String getBody()

Get the body of the trigger.

TriggerOperation getTriggerOperation()

Get the operation type of the trigger.

TriggerType getTriggerType()

Get the type of the trigger.

void setBody(String body)

Set the body of the trigger.

void setTriggerOperation(TriggerOperation triggerOperation)

Set the operation type of the trigger.

void setTriggerType(TriggerType triggerType)

Set the type of the resource.

Methods inherited from JsonSerializable

Methods inherited from Resource

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

Trigger

public Trigger()

Constructor.

Trigger

public Trigger(String jsonString)

Constructor.

Parameters:

jsonString - the json string that represents the trigger.

Trigger

public Trigger(JSONObject jsonObject)

Constructor.

Parameters:

jsonObject - the json object that represents the trigger.

Method Details

getBody

public String getBody()

Get the body of the trigger.

Returns:

the body of the trigger.

getTriggerOperation

public TriggerOperation getTriggerOperation()

Get the operation type of the trigger.

Returns:

the trigger operation.

getTriggerType

public TriggerType getTriggerType()

Get the type of the trigger.

Returns:

the trigger type.

setBody

public void setBody(String body)

Set the body of the trigger.

Parameters:

body - the body of the trigger.

setTriggerOperation

public void setTriggerOperation(TriggerOperation triggerOperation)

Set the operation type of the trigger.

Parameters:

triggerOperation - the trigger operation.

setTriggerType

public void setTriggerType(TriggerType triggerType)

Set the type of the resource.

Parameters:

triggerType - the trigger type.

Applies to