コード例 #1
0
  /** @return input message configuration property list */
  @Override
  public List<Property> getInputMessageProperties() {

    List<Property> propertyList = new ArrayList<Property>();

    // set topic
    Property topicProperty = new Property(MQTTEventAdaptorConstants.ADAPTOR_MESSAGE_TOPIC);
    topicProperty.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_MESSAGE_TOPIC));
    topicProperty.setRequired(true);
    propertyList.add(topicProperty);

    // set clientId
    Property clientId = new Property(MQTTEventAdaptorConstants.ADAPTOR_MESSAGE_CLIENTID);
    clientId.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_MESSAGE_CLIENTID));
    clientId.setRequired(true);
    propertyList.add(clientId);

    return propertyList;
  }
コード例 #2
0
  /** @return input adaptor configuration property list */
  @Override
  public List<Property> getInputAdaptorProperties() {

    List<Property> propertyList = new ArrayList<Property>();
    // Broker Url
    Property brokerUrl = new Property(MQTTEventAdaptorConstants.ADAPTOR_CONF_URL);
    brokerUrl.setDisplayName(resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_URL));
    brokerUrl.setRequired(true);
    brokerUrl.setHint(resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_URL_HINT));
    propertyList.add(brokerUrl);

    // Broker Username
    Property userName = new Property(MQTTEventAdaptorConstants.ADAPTOR_CONF_USERNAME);
    userName.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_USERNAME));
    userName.setRequired(false);
    userName.setHint(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_USERNAME_HINT));
    propertyList.add(userName);

    // Broker Password
    Property password = new Property(MQTTEventAdaptorConstants.ADAPTOR_CONF_PASSWORD);
    password.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_PASSWORD));
    password.setRequired(false);
    password.setHint(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_PASSWORD_HINT));
    propertyList.add(password);

    // Broker clear session
    Property clearSession = new Property(MQTTEventAdaptorConstants.ADAPTOR_CONF_CLEAN_SESSION);
    clearSession.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_CLEAN_SESSION));
    clearSession.setRequired(false);
    clearSession.setOptions(new String[] {"true", "false"});
    clearSession.setDefaultValue("true");
    clearSession.setHint(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_CLEAN_SESSION_HINT));
    propertyList.add(clearSession);

    // Broker clear session
    Property keepAlive = new Property(MQTTEventAdaptorConstants.ADAPTOR_CONF_KEEP_ALIVE);
    keepAlive.setDisplayName(
        resourceBundle.getString(MQTTEventAdaptorConstants.ADAPTOR_CONF_KEEP_ALIVE));
    keepAlive.setRequired(false);
    propertyList.add(keepAlive);

    return propertyList;
  }