@@ -90,25 +90,30 @@ public List<ServiceModel> getServices() {
9090 .serviceDefinition (Constants .SERVICE_DEF_ORCHESTRATION )
9191 .version (DynamicServiceOrchestrationConstants .VERSION_ORCHESTRATION )
9292 .metadata (DynamicServiceOrchestrationConstants .METADATA_KEY_ORCHESTRATION_STRATEGY , DynamicServiceOrchestrationConstants .METADATA_VALUE_ORCHESTRATION_STRATEGY )
93+ .metadata (Constants .METADATA_KEY_UNRESTRICTED_DISCOVERY , true )
9394 .serviceInterface (getHttpServiceInterfaceForOrchestration ())
95+ .serviceInterface (getMqttServiceInterfaceForOrchestration ())
9496 .build ();
9597
9698 final ServiceModel orchestrationPushManagement = new ServiceModel .Builder ()
9799 .serviceDefinition (Constants .SERVICE_DEF_ORCHESTRATION_PUSH_MANAGEMENT )
98100 .version (DynamicServiceOrchestrationConstants .VERSION_ORCHESTRATION_PUSH_MANAGEMENT )
99101 .serviceInterface (getHttpServiceInterfaceForOrchestrationPushManagement ())
102+ .serviceInterface (getMqttServiceInterfaceForOrchestrationPushManagement ())
100103 .build ();
101104
102105 final ServiceModel orchestrationLockManagement = new ServiceModel .Builder ()
103106 .serviceDefinition (Constants .SERVICE_DEF_ORCHESTRATION_LOCK_MANAGEMENT )
104107 .version (DynamicServiceOrchestrationConstants .VERSION_ORCHESTRATION_PUSH_MANAGEMENT )
105108 .serviceInterface (getHttpServiceInterfaceForOrchestrationLockManagement ())
109+ .serviceInterface (getMqttServiceInterfaceForOrchestrationLockManagement ())
106110 .build ();
107111
108112 final ServiceModel orchestrationHistoryManagement = new ServiceModel .Builder ()
109113 .serviceDefinition (Constants .SERVICE_DEF_ORCHESTRATION_HISTORY_MANAGEMENT )
110114 .version (DynamicServiceOrchestrationConstants .VERSION_ORCHESTRATION_HISTORY_MANAGEMENT )
111115 .serviceInterface (getHttpServiceInterfaceForOrchestrationHistoryManagement ())
116+ .serviceInterface (getMqttServiceInterfaceForOrchestrationHistoryManagement ())
112117 .build ();
113118
114119 return List .of (generalManagement , orchestration , orchestrationPushManagement , orchestrationLockManagement , orchestrationHistoryManagement );
@@ -351,4 +356,56 @@ private InterfaceModel getMqttServiceInterfaceForGeneralManagement() {
351356 .operations (Set .of (Constants .SERVICE_OP_GET_LOG , Constants .SERVICE_OP_GET_CONFIG ))
352357 .build ();
353358 }
359+
360+ //-------------------------------------------------------------------------------------------------
361+ private InterfaceModel getMqttServiceInterfaceForOrchestration () {
362+ if (!isMqttApiEnabled ()) {
363+ return null ;
364+ }
365+
366+ final String templateName = getSslProperties ().isSslEnabled () ? Constants .GENERIC_MQTTS_INTERFACE_TEMPLATE_NAME : Constants .GENERIC_MQTT_INTERFACE_TEMPLATE_NAME ;
367+ return new MqttInterfaceModel .Builder (templateName , getMqttBrokerAddress (), getMqttBrokerPort ())
368+ .baseTopic (DynamicServiceOrchestrationConstants .MQTT_API_ORCHESTRATION_BASE_TOPIC )
369+ .operations (Set .of (Constants .SERVICE_OP_ORCHESTRATION_PULL , Constants .SERVICE_OP_ORCHESTRATION_SUBSCRIBE , Constants .SERVICE_OP_ORCHESTRATION_UNSUBSCRIBE ))
370+ .build ();
371+ }
372+
373+ //-------------------------------------------------------------------------------------------------
374+ private InterfaceModel getMqttServiceInterfaceForOrchestrationPushManagement () {
375+ if (!isMqttApiEnabled ()) {
376+ return null ;
377+ }
378+
379+ final String templateName = getSslProperties ().isSslEnabled () ? Constants .GENERIC_MQTTS_INTERFACE_TEMPLATE_NAME : Constants .GENERIC_MQTT_INTERFACE_TEMPLATE_NAME ;
380+ return new MqttInterfaceModel .Builder (templateName , getMqttBrokerAddress (), getMqttBrokerPort ())
381+ .baseTopic (DynamicServiceOrchestrationConstants .MQTT_API_ORCHESTRATION_PUSH_MANAGEMENT_BASE_TOPIC )
382+ .operations (Set .of (Constants .SERVICE_OP_ORCHESTRATION_SUBSCRIBE , Constants .SERVICE_OP_ORCHESTRATION_TRIGGER , Constants .SERVICE_OP_ORCHESTRATION_UNSUBSCRIBE , Constants .SERVICE_OP_ORCHESTRATION_QUERY ))
383+ .build ();
384+ }
385+
386+ //-------------------------------------------------------------------------------------------------
387+ private InterfaceModel getMqttServiceInterfaceForOrchestrationLockManagement () {
388+ if (!isMqttApiEnabled ()) {
389+ return null ;
390+ }
391+
392+ final String templateName = getSslProperties ().isSslEnabled () ? Constants .GENERIC_MQTTS_INTERFACE_TEMPLATE_NAME : Constants .GENERIC_MQTT_INTERFACE_TEMPLATE_NAME ;
393+ return new MqttInterfaceModel .Builder (templateName , getMqttBrokerAddress (), getMqttBrokerPort ())
394+ .baseTopic (DynamicServiceOrchestrationConstants .MQTT_API_ORCHESTRATION_LOCK_MANAGEMENT_BASE_TOPIC )
395+ .operations (Set .of (Constants .SERVICE_OP_ORCHESTRATION_CREATE , Constants .SERVICE_OP_ORCHESTRATION_QUERY , Constants .SERVICE_OP_ORCHESTRATION_REMOVE ))
396+ .build ();
397+ }
398+
399+ //-------------------------------------------------------------------------------------------------
400+ private InterfaceModel getMqttServiceInterfaceForOrchestrationHistoryManagement () {
401+ if (!isMqttApiEnabled ()) {
402+ return null ;
403+ }
404+
405+ final String templateName = getSslProperties ().isSslEnabled () ? Constants .GENERIC_MQTTS_INTERFACE_TEMPLATE_NAME : Constants .GENERIC_MQTT_INTERFACE_TEMPLATE_NAME ;
406+ return new MqttInterfaceModel .Builder (templateName , getMqttBrokerAddress (), getMqttBrokerPort ())
407+ .baseTopic (DynamicServiceOrchestrationConstants .MQTT_API_ORCHESTRATION_HISTORY_MANAGEMENT_BASE_TOPIC )
408+ .operations (Set .of (Constants .SERVICE_OP_ORCHESTRATION_QUERY ))
409+ .build ();
410+ }
354411}
0 commit comments