|
|
@ -38,11 +38,7 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<String> getSupportedMessageFormats() {
|
|
|
|
public List<String> getSupportedMessageFormats() {
|
|
|
|
List<String> supportInputMessageTypes = new ArrayList<String>();
|
|
|
|
List<String> supportInputMessageTypes = new ArrayList<String>();
|
|
|
|
|
|
|
|
|
|
|
|
supportInputMessageTypes.add(MessageType.TEXT);
|
|
|
|
|
|
|
|
supportInputMessageTypes.add(MessageType.JSON);
|
|
|
|
supportInputMessageTypes.add(MessageType.JSON);
|
|
|
|
supportInputMessageTypes.add(MessageType.XML);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return supportInputMessageTypes;
|
|
|
|
return supportInputMessageTypes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -52,28 +48,23 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
|
|
|
|
|
|
|
|
// set topic
|
|
|
|
// set topic
|
|
|
|
Property topicProperty = new Property(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC);
|
|
|
|
Property topicProperty = new Property(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC);
|
|
|
|
topicProperty.setDisplayName(
|
|
|
|
topicProperty.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC));
|
|
|
|
|
|
|
|
topicProperty.setRequired(true);
|
|
|
|
topicProperty.setRequired(true);
|
|
|
|
topicProperty.setHint(
|
|
|
|
topicProperty.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC_HINT));
|
|
|
|
|
|
|
|
propertyList.add(topicProperty);
|
|
|
|
propertyList.add(topicProperty);
|
|
|
|
|
|
|
|
|
|
|
|
//Broker Url
|
|
|
|
//Broker Url
|
|
|
|
Property brokerUrl = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_URL);
|
|
|
|
Property brokerUrl = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_URL);
|
|
|
|
brokerUrl.setDisplayName(
|
|
|
|
brokerUrl.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_URL));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_URL));
|
|
|
|
|
|
|
|
brokerUrl.setRequired(true);
|
|
|
|
brokerUrl.setRequired(true);
|
|
|
|
brokerUrl.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_URL_HINT));
|
|
|
|
brokerUrl.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_URL_HINT));
|
|
|
|
propertyList.add(brokerUrl);
|
|
|
|
propertyList.add(brokerUrl);
|
|
|
|
|
|
|
|
|
|
|
|
//DCR endpoint details
|
|
|
|
//DCR endpoint details
|
|
|
|
Property dcrUrl = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL);
|
|
|
|
Property dcrUrl = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL);
|
|
|
|
dcrUrl.setDisplayName(
|
|
|
|
dcrUrl.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL));
|
|
|
|
|
|
|
|
dcrUrl.setRequired(false);
|
|
|
|
dcrUrl.setRequired(false);
|
|
|
|
dcrUrl.setHint(
|
|
|
|
dcrUrl.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_DCR_URL_HINT));
|
|
|
|
|
|
|
|
propertyList.add(dcrUrl);
|
|
|
|
propertyList.add(dcrUrl);
|
|
|
|
|
|
|
|
|
|
|
|
//Content Validator details
|
|
|
|
//Content Validator details
|
|
|
@ -83,7 +74,6 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
contentValidator.setRequired(false);
|
|
|
|
contentValidator.setRequired(false);
|
|
|
|
contentValidator.setHint(
|
|
|
|
contentValidator.setHint(
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_CLASSNAME_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_CLASSNAME_HINT));
|
|
|
|
propertyList.add(contentValidator);
|
|
|
|
|
|
|
|
contentValidator.setDefaultValue(Constants.DEFAULT);
|
|
|
|
contentValidator.setDefaultValue(Constants.DEFAULT);
|
|
|
|
propertyList.add(contentValidator);
|
|
|
|
propertyList.add(contentValidator);
|
|
|
|
|
|
|
|
|
|
|
@ -94,7 +84,6 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
contentValidatorParams.setRequired(false);
|
|
|
|
contentValidatorParams.setRequired(false);
|
|
|
|
contentValidatorParams.setHint(
|
|
|
|
contentValidatorParams.setHint(
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_PARAMS_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CONTENT_VALIDATOR_PARAMS_HINT));
|
|
|
|
propertyList.add(contentValidatorParams);
|
|
|
|
|
|
|
|
contentValidatorParams.setDefaultValue(Constants.MQTT_CONTENT_VALIDATION_DEFAULT_PARAMETERS);
|
|
|
|
contentValidatorParams.setDefaultValue(Constants.MQTT_CONTENT_VALIDATION_DEFAULT_PARAMETERS);
|
|
|
|
propertyList.add(contentValidatorParams);
|
|
|
|
propertyList.add(contentValidatorParams);
|
|
|
|
|
|
|
|
|
|
|
@ -103,9 +92,7 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
userName.setDisplayName(
|
|
|
|
userName.setDisplayName(
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_USERNAME));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_USERNAME));
|
|
|
|
userName.setRequired(false);
|
|
|
|
userName.setRequired(false);
|
|
|
|
userName.setHint(
|
|
|
|
userName.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_USERNAME_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_USERNAME_HINT));
|
|
|
|
|
|
|
|
propertyList.add(userName);
|
|
|
|
|
|
|
|
propertyList.add(userName);
|
|
|
|
propertyList.add(userName);
|
|
|
|
|
|
|
|
|
|
|
|
//Broker Required Scopes.
|
|
|
|
//Broker Required Scopes.
|
|
|
@ -113,28 +100,23 @@ public class MQTTEventAdapterFactory extends InputEventAdapterFactory {
|
|
|
|
scopes.setDisplayName(
|
|
|
|
scopes.setDisplayName(
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_SCOPES));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_SCOPES));
|
|
|
|
scopes.setRequired(false);
|
|
|
|
scopes.setRequired(false);
|
|
|
|
scopes.setHint(
|
|
|
|
scopes.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_SCOPES_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_SCOPES_HINT));
|
|
|
|
|
|
|
|
propertyList.add(scopes);
|
|
|
|
propertyList.add(scopes);
|
|
|
|
|
|
|
|
|
|
|
|
//Broker clear session
|
|
|
|
//Broker clear session
|
|
|
|
Property clearSession = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION);
|
|
|
|
Property clearSession = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION);
|
|
|
|
clearSession.setDisplayName(
|
|
|
|
clearSession.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION));
|
|
|
|
|
|
|
|
clearSession.setRequired(false);
|
|
|
|
clearSession.setRequired(false);
|
|
|
|
clearSession.setOptions(new String[]{"true", "false"});
|
|
|
|
clearSession.setOptions(new String[]{"true", "false"});
|
|
|
|
clearSession.setDefaultValue("true");
|
|
|
|
clearSession.setDefaultValue("true");
|
|
|
|
clearSession.setHint(
|
|
|
|
clearSession.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLEAN_SESSION_HINT));
|
|
|
|
|
|
|
|
propertyList.add(clearSession);
|
|
|
|
propertyList.add(clearSession);
|
|
|
|
|
|
|
|
|
|
|
|
// set clientId
|
|
|
|
// set clientId
|
|
|
|
Property clientId = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID);
|
|
|
|
Property clientId = new Property(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID);
|
|
|
|
clientId.setDisplayName(
|
|
|
|
clientId.setDisplayName(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID));
|
|
|
|
|
|
|
|
clientId.setRequired(false);
|
|
|
|
clientId.setRequired(false);
|
|
|
|
clientId.setHint(
|
|
|
|
clientId.setHint(resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID_HINT));
|
|
|
|
resourceBundle.getString(MQTTEventAdapterConstants.ADAPTER_CONF_CLIENTID_HINT));
|
|
|
|
|
|
|
|
propertyList.add(clientId);
|
|
|
|
propertyList.add(clientId);
|
|
|
|
|
|
|
|
|
|
|
|
return propertyList;
|
|
|
|
return propertyList;
|
|
|
|