Skip to content

Commit

Permalink
text update
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Koifman committed Oct 21, 2023
1 parent cdc8f80 commit d87e491
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions docs/pub-sub-events/raising-private-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ public class PrivateEvent {
public final String name;
public final long clientId;
public final SequenceEncoder arguments;

public PrivateEvent(String name, long clientId)
}
```
Here is a description of the <span class="datatype">PrivateEvent</span> members:
* <span class="field">uid</span> is the event ID used internally by the platform;
* <span class="field">name</span> is the name of the event, provided to the constructor when the class instance is created, and also specified in the event definition in the site structure;
* <span class="field">clientId</span> is the client ID taken from the client request earlier;
* <span class="field">arguments</span> is a field of type <span class="datatype">SequenceEncoder</span> provided by Softnet ASN.1 Codec. The data size in arguments is limited to 2 kilobytes;
* <span class="method">getEncoding</span> is a method that returns an ASN.1 DER encoding of data provided to arguments.
* <span class="method">PrivateEvent</span> is a constructor that takes the event name and the client ID;
* <span class="method">PrivateEvent</span> is a constructor that takes the event name and the client ID.

Finally, we'll look at an example of defining and raising a Private event. Let's say we have a Softnet service "WaterTempController" that controls the temperature of the water in a boiler. We also have a Java class with the same name that implements the service. The service allows you to remotely set the water temperature. To do this, it implements an RPC procedure that accepts the target temperature. Since the temperature cannot be set immediately, the procedure starts the requested process, writes the current temperature to the result parameter and completes. When the target temperature is set, the controller raises a Private event to notify the client.

Expand Down
6 changes: 2 additions & 4 deletions docs/pub-sub-events/raising-queueing-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ The parameter is of type <span class="datatype">QueueingEvent</span> with the fo
public class QueueingEvent {
public final String name;
public final SequenceEncoder arguments;

public QueueingEvent(String name)
}
```
Here is a description of the <span class="datatype">QueueingEvent</span> members:
* <span class="field">uid</span> is the event ID used internally by the platform. However, if you want to provide it to subscribed clients, you can add it to the <span class="field">arguments</span> field of the class;
* <span class="field">name</span> is the name of the event, provided to the constructor when the class instance is created, and also specified in the event definition in the site structure;
* <span class="field">arguments</span> is a field of type <span class="datatype">SequenceEncoder</span> provided by Softnet ASN.1 Codec. Accordingly, on the client side, events have an arguments field of type <span class="datatype">SequenceDecoder</span>. The data size in arguments is limited to 2 kilobytes;
* <span class="method">getEncoding</span> is a method that returns an ASN.1 DER encoding of data provided to arguments.
* <span class="method">QueueingEvent</span> is a constructor that takes the name of the event;
* <span class="method">QueueingEvent</span> is a constructor that takes the name of the event.

This section concludes with an example of defining and raising a Queueing event.
1. The following code defines "CriticalWaterTemperature" as a Queueing event using the second overload of the <span class="method">addQueueingEvent</span> method. It specifies the lifetime as 10 hours, the maximum queue size as 50, and the access rule denies guest clients:
Expand Down
6 changes: 2 additions & 4 deletions docs/pub-sub-events/raising-replacing-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ReplacingEvent {
public final String name;
public final SequenceEncoder arguments;
public final boolean isNull;

public ReplacingEvent(String name)
}
```
Expand All @@ -43,12 +43,10 @@ public class ReplacingNullEvent extends ReplacingEvent {
```

The next is a description of the <span class="datatype">ReplacingEvent</span> members:
* <span class="field">uid</span> is the event ID used internally by the platform. However, if you want to provide it to subscribed clients, you can add it to the arguments field of the class;
* <span class="field">name</span> is the name of the event, provided to the constructor when the class instance is created, and also specified in the event definition in the site structure;
* <span class="field">arguments</span> is a field of type <span class="datatype">SequenceEncoder</span> provided by Softnet ASN.1 Codec. The service can pass data organized in complex structures through this field to subscribers. Accordingly, on the client side, events have an arguments field of type <span class="datatype">SequenceDecoder</span>. The data size in arguments is limited to 2 kilobytes. Before raising an event, an application can check the size of data by calling the getSize method of <span class="datatype">SequenceEncoder</span>;
* <span class="field">isNull</span> indicates if the event is null-event. It is always false for <span class="datatype">ReplacingEvent</span> instances and true for <span class="datatype">ReplacingNullEvent</span> instances;
* <span class="method">ReplacingEvent</span> is a constructor that takes the name of the event;
* <span class="method">getEncoding</span> is a method that returns the ASN.1 DER encoding of data provided to arguments.
* <span class="method">ReplacingEvent</span> is a constructor that takes the name of the event.

To create a null-event, your application calls the <span class="datatype">ReplacingNullEvent</span> constructor with the name of the Replacing event as an argument. The arguments field of this object is null, that is, the null-event cannot have arguments.

Expand Down

0 comments on commit d87e491

Please sign in to comment.