TrimbleCloud.Events
TrimbleCloud.Events
Contents
- CommonEvent
- ConnectionClosedException
- ConsumeEvent
- ConsumerException
- EventsBatch
- EventsClient
- EventsClientConfig
- EventsClientConfigValidator
- IEventsClient
- IMetric
- BatchSize(batchSize)
- ConsumerAckResponseTime(responseTime)
- IncrementAckReceived()
- IncrementBatchExpired()
- IncrementBatchesProduced()
- IncrementBatchesResent()
- IncrementBatchesSent()
- IncrementError()
- IncrementEventsConsumed()
- IncrementEventsProduced()
- IncrementSeverDisconnect()
- PublishedQueuedTime(queuedTime)
- IServiceException
- KafkaResponse
- MetricRecorder
- PublishEvent
- PublisherException
- Response
- ServerRequest
- ServiceException
- ServiceResponse
- ValidationException
- WebSocketClient
- WebSocketClientState
- Workflow
CommonEvent type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a common event in the system.
AdditionalFields property
Summary
Gets or sets additional fields associated with the event.
ClientID property
Summary
Gets or sets the client ID associated with the event.
ConnectionID property
Summary
Gets or sets the connection ID associated with the event.
ConsumedQueuedTime property
Summary
Gets or sets the time when the event was queued for consumption.
ConsumedTime property
Summary
Gets or sets the time when the event was consumed.
Event property
Summary
Gets or sets the name of the event.
EventVersion property
Summary
Gets or sets the version of the event.
JWTToken property
Summary
Gets or sets the JWT token associated with the event.
Namespace property
Summary
Gets or sets the namespace of the event.
ProductKey property
Summary
Gets or sets the unique key of the Event Product.
PublishedQueuedTime property
Summary
Gets or sets the time when the event was queued for publishing.
PublishedTime property
Summary
Gets or sets the time when the event was published.
ConnectionClosedException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that is thrown when a connection is closed.
#ctor(message) constructor
Summary
Initializes a new instance of the ConnectionClosedException class with the specified error message.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
ConsumeEvent type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an event that is consumed by a consumer.
CreationTime property
Summary
Gets or sets the creation time of the consumed event.
ModelVersion property
Summary
Gets or sets the model version of the consumed event.
VisibilityTimeout property
Summary
Gets or sets the visibility timeout of the consumed event.
Remarks
A period of time to prevent the consumer from receiving and processing the message. Minimum value = 3 seconds. Maximum value = 60 minutes.
ShallowCopy() method
Summary
Creates a shallow copy of the ConsumeEvent object.
Returns
A shallow copy of the ConsumeEvent object.
Parameters
This method has no parameters.
ConsumerException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that occurs during event consumption by a consumer.
#ctor(message) constructor
Summary
Initializes a new instance of the ConsumerException class with the specified error message.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
#ctor(message,consumeEvent) constructor
Summary
Initializes a new instance of the ConsumerException class with the specified error message and consumed event.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
| consumeEvent | TrimbleCloud.Events.Model.ConsumeEvent | The consumed event associated with the exception. |
ConsumeEvent property
Summary
Gets the consumed event associated with the exception.
EventsBatch type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a batch of events.
CreationTime property
Summary
Gets or sets the creation time of the events batch.
Events property
Summary
Gets or sets the list of events.
ID property
Summary
Gets or sets the ID of the events batch.
ModelVersion property
Summary
Gets or sets the model version.
PublishedTime property
Summary
Gets or sets the published time of the events batch.
QueueTime property
Summary
Gets or sets the queue time of the events batch.
RetryCount property
Summary
Gets or sets the number of times the event batch has been retried.
ShallowCopy() method
Summary
Creates a shallow copy of the events batch.
Returns
A new instance of the EventsBatch class with a shallow copy of the events.
Parameters
This method has no parameters.
EventsClient type
Namespace
TrimbleCloud.Events
Summary
Represents a client for interacting with the Events Service.
#ctor() constructor
Summary
Private constructor constructor used internally
Parameters
This constructor has no parameters.
#ctor() constructor
Summary
Default constructor
Parameters
This constructor has no parameters.
#ctor() constructor
Summary
Constructor used for unit testing
Parameters
This constructor has no parameters.
Active property
Summary
Return whether the Events Service connection is active.
Returns
Whether the Events Service connection is active or not.
Connection property
Summary
Gets the connection status of the EventsClient.
ConnectionStatus property
Summary
Return the status of Events Service connection.
Returns
The status of the Events Service connection.
Acknowledge(acknowledgmentId) method
Summary
Method to explicitly acknowledge the message using acknowledgmentId
Parameters
| Name | Type | Description |
|---|---|---|
| acknowledgmentId | System.String | Acknowledgment Id of the response |
CloseAsync() method
Summary
Private function to close connection by stopping batcher, publisher and web socket connection Specified whether to wait for connection
Parameters
This method has no parameters.
CloseAsync() method
Summary
Closes the connection to the events service asynchronously.
Returns
A task representing the asynchronous operation. The task result contains a list of published events.
Parameters
This method has no parameters.
OnCallBack() method
Summary
Invoke callback function on message, acknowledgement and exception
Parameters
This method has no parameters.
OnMessage() method
Summary
Process websocket message on receive
Parameters
This method has no parameters.
Poll(consumeEvent) method
Summary
Polls for events to consume.
Parameters
| Name | Type | Description |
|---|---|---|
| consumeEvent | TrimbleCloud.Events.Model.ConsumeEvent | The consume event configuration. |
PublishMessage(publishEvent) method
Summary
Publishes a message to the server.
Parameters
| Name | Type | Description |
|---|---|---|
| publishEvent | TrimbleCloud.Events.Model.PublishEvent | The event to be published. |
Exceptions
| Name | Description |
|---|---|
| TrimbleCloud.Events.Model.ConnectionClosedException | Thrown when the client is already closed. |
| TrimbleCloud.Events.Model.PublisherException | Thrown when batching is disabled. |
SetWebSocket() method
Summary
Setup callback methods for web socket client and start connection
Parameters
This method has no parameters.
SetupWorkflow() method
Summary
Setup publisher and batcher based on Wokflow
Parameters
This method has no parameters.
EventsClientConfig type
Namespace
TrimbleCloud.Events
Summary
Config required to create Events Client
AckRetry property
Summary
Gets or sets the number of times to retry sending an acknowledgement.
AckWaitMS property
Summary
Gets or sets the wait time in milliseconds for acknowledging events.
AuthUrl property
Summary
Gets or sets the Trimble Identity Token URL for authentication.
BatchBufferMS property
Summary
Gets or sets the batch buffer time in milliseconds.
BatchBufferSize property
Summary
Gets or sets the batch buffer size.
BatchExpiryMS property
Summary
Gets or sets the batch expiry time in milliseconds.
ClientAcknowledge property
Summary
Gets or sets a value indicating whether the client acknowledges the events.
ClientID property
Summary
Gets or sets the client ID.
ClientSecret property
Summary
Gets or sets the client secret used for authentication.
ConnectionRetry property
Summary
Gets or sets the number of times the connection should be retried in case of failure.
EnableBatch property
Summary
Gets or sets a value indicating whether batch processing is enabled.
Endpoint property
Summary
Gets or sets the endpoint URI for the events client.
Logger property
Summary
Gets or sets the logger used for logging events.
MetricRegistry property
Summary
Gets or sets the metric registry for tracking metrics.
TidScope property
Summary
Gets or sets the TID scope.
Workflow property
Summary
Gets or sets the workflow associated with the events client configuration.
EventsClientConfigValidator type
Namespace
TrimbleCloud.Events
Summary
Validates the configuration for the EventsClient.
IEventsClient type
Namespace
TrimbleCloud.Events
Summary
Represents a client for interacting with events in the Trimble Cloud.
Active property
Summary
Gets a value indicating whether the client is active.
Connection property
Summary
Gets a value indicating whether the client is connected to the server.
ConnectionStatus property
Summary
Gets the current connection status of the WebSocket client.
Acknowledge(acknowledgmentId) method
Summary
Acknowledges the receipt of an event with the specified acknowledgment ID.
Parameters
| Name | Type | Description |
|---|---|---|
| acknowledgmentId | System.String | The ID of the event to be acknowledged. |
CloseAsync() method
Summary
Closes the connection to the server and returns a list of published events that were not acknowledged.
Returns
A task representing the asynchronous operation.
Parameters
This method has no parameters.
Poll(consumeEvent) method
Summary
Starts polling for events from the server and consumes them using the specified event consumer.
Parameters
| Name | Type | Description |
|---|---|---|
| consumeEvent | TrimbleCloud.Events.Model.ConsumeEvent | The event consumer that will process the received events. |
PublishMessage(publishEvent) method
Summary
Publishes a message to the server.
Parameters
| Name | Type | Description |
|---|---|---|
| publishEvent | TrimbleCloud.Events.Model.PublishEvent | The event to be published. |
Send(batch) method
Summary
Sends a batch of events to the server.
Parameters
| Name | Type | Description |
|---|---|---|
| batch | TrimbleCloud.Events.Model.EventsBatch | The batch of events to be sent. |
IMetric type
Namespace
TrimbleCloud.Events.Service
Summary
IMetric interface for metric collection. Use this to configure the metric collector client for publishing real-time metrics if needed.
BatchSize(batchSize) method
Summary
Sets total Batch size
Parameters
| Name | Type | Description |
|---|---|---|
| batchSize | System.Int32 |
ConsumerAckResponseTime(responseTime) method
Summary
Sets Consumer Ack Response time
Parameters
| Name | Type | Description |
|---|---|---|
| responseTime | System.Double |
IncrementAckReceived() method
Summary
Increments the Ack received by 1
Parameters
This method has no parameters.
IncrementBatchExpired() method
Summary
Increment the batch expired by 1
Parameters
This method has no parameters.
IncrementBatchesProduced() method
Summary
Increments the batch produced by 1
Parameters
This method has no parameters.
IncrementBatchesResent() method
Summary
Increments the batch resent by 1
Parameters
This method has no parameters.
IncrementBatchesSent() method
Summary
Increments the batch sent by 1
Parameters
This method has no parameters.
IncrementError() method
Summary
Increments error occurred by 1
Parameters
This method has no parameters.
IncrementEventsConsumed() method
Summary
Increments event consumed by 1
Parameters
This method has no parameters.
IncrementEventsProduced() method
Summary
Increments event produced by 1
Parameters
This method has no parameters.
IncrementSeverDisconnect() method
Summary
Increments if any server disconnect by 1
Parameters
This method has no parameters.
PublishedQueuedTime(queuedTime) method
Summary
Sets event published queued time
Parameters
| Name | Type | Description |
|---|---|---|
| queuedTime | System.Double |
IServiceException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that occurs in a service.
Message property
Summary
Gets the error message associated with the exception.
KafkaResponse type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a response from Kafka.
AcknowledgmentId property
Summary
Gets or sets the acknowledgment ID.
EntityId property
Summary
Gets or sets the entity ID.
Message property
Summary
Gets or sets the message.
MetricRecorder type
Namespace
TrimbleCloud.Events.Model
Summary
Represents the available metric recorders.
PublishEvent type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a publish event in the system.
EntityID property
Summary
Gets or sets the ID of the entity.
Feedback property
Summary
Gets or sets the feedback for the event.
ID property
Summary
Gets or sets the ID of the event.
Payload property
Summary
Gets or sets the payload of the event.
TopicName property
Summary
Gets or sets the name of the topic.
ShallowCopy() method
Summary
Creates a shallow copy of the PublishEvent instance.
Returns
A shallow copy of the PublishEvent instance.
Parameters
This method has no parameters.
PublisherException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that occurs during publishing events.
#ctor(message) constructor
Summary
Initializes a new instance of the PublisherException class with the specified error message.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
#ctor(message,batch) constructor
Summary
Initializes a new instance of the PublisherException class with the specified error message and events batch.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
| batch | TrimbleCloud.Events.Model.EventsBatch | The batch of events associated with the exception. |
Batch property
Summary
Gets the batch of events associated with the exception.
Response type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a response object.
ServiceException property
Summary
Gets or sets the service exception.
ServiceResponse property
Summary
Gets or sets the service response.
ServerRequest type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a server request.
Data property
Summary
Gets or sets the data for the server request.
Type property
Summary
Gets or sets the type of the server request.
ServiceException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that occurs in the service layer.
#ctor(message) constructor
Summary
Initializes a new instance of the ServiceException class with a specified error message.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
Message property
Summary
Gets the error message that describes the current exception.
ServiceResponse type
Namespace
TrimbleCloud.Events.Model
Summary
Represents a service response.
AcknowledgmentId property
Summary
Gets or sets the acknowledgment ID of the response.
ClientId property
Summary
Gets or sets the client ID.
ConnId property
Summary
Gets or sets the connection ID.
ConsumerGroupId property
Summary
Gets or sets the consumer group ID.
ConsumerRequest property
Summary
Represents a consumer request for an event.
ErrorMessage property
Summary
Gets or sets the error message.
ResponseMessages property
Summary
Gets or sets the list of received response messages.
ResponseType property
Summary
Gets or sets the response type.
UUID property
Summary
Gets or sets the UUID.
ValidationException type
Namespace
TrimbleCloud.Events.Model
Summary
Represents an exception that occurs when there is a validation error in the service.
#ctor(message) constructor
Summary
Initializes a new instance of the ValidationException class with the specified error message.
Parameters
| Name | Type | Description |
|---|---|---|
| message | System.String | The error message that explains the reason for the exception. |
WebSocketClient type
Namespace
TrimbleCloud.Events.Service
#ctor() constructor
Summary
Constructor used for unit testing
Parameters
This constructor has no parameters.
WebSocketClientState type
Namespace
TrimbleCloud.Events.Model
Summary
Represents the state of a WebSocket client.
Workflow type
Namespace
TrimbleCloud.Events.Model
Summary
Represents the workflow type.