mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Make stream persisting optional
At the moment of creating a stream it will be persisted by default. This was made a optional choice by using a query flag through this commit.
This commit is contained in:
parent
35b03d387c
commit
bed68289b5
@ -123,6 +123,7 @@ public interface DeviceEventManagementService {
|
|||||||
Response deployDeviceTypeEventDefinition(@ApiParam(name = "type", value = "The device type, such as android, ios," +
|
Response deployDeviceTypeEventDefinition(@ApiParam(name = "type", value = "The device type, such as android, ios," +
|
||||||
" and windows.", required = false)
|
" and windows.", required = false)
|
||||||
@PathParam("type")String deviceType,
|
@PathParam("type")String deviceType,
|
||||||
|
@QueryParam("skipPersist")boolean skipPersist,
|
||||||
@ApiParam(name = "deviceTypeEvent", value = "Add the data to complete " +
|
@ApiParam(name = "deviceTypeEvent", value = "Add the data to complete " +
|
||||||
"the DeviceTypeEvent object.", required = true)
|
"the DeviceTypeEvent object.", required = true)
|
||||||
@Valid DeviceTypeEvent deviceTypeEvent);
|
@Valid DeviceTypeEvent deviceTypeEvent);
|
||||||
|
|||||||
@ -192,6 +192,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
@Path("/{type}")
|
@Path("/{type}")
|
||||||
@Override
|
@Override
|
||||||
public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
|
public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType,
|
||||||
|
@QueryParam("skipPersist") boolean skipPersist,
|
||||||
@Valid DeviceTypeEvent deviceTypeEvent) {
|
@Valid DeviceTypeEvent deviceTypeEvent) {
|
||||||
TransportType transportType = deviceTypeEvent.getTransportType();
|
TransportType transportType = deviceTypeEvent.getTransportType();
|
||||||
EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
|
EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList();
|
||||||
@ -208,7 +209,9 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION;
|
String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION;
|
||||||
publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
|
publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes);
|
||||||
publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, deviceType);
|
publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, deviceType);
|
||||||
publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
|
if (!skipPersist) {
|
||||||
|
publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes);
|
||||||
|
}
|
||||||
publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType);
|
publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType);
|
||||||
try {
|
try {
|
||||||
PrivilegedCarbonContext.startTenantFlow();
|
PrivilegedCarbonContext.startTenantFlow();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user