Skip to content

Commit

Permalink
Actility: support custom webhook url
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-cz committed Jul 2, 2024
1 parent 7be5a6e commit 1443725
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package lora.ns.actility;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

import java.math.BigDecimal;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;

import javax.net.ssl.HostnameVerifier;
Expand Down Expand Up @@ -274,6 +277,13 @@ public void configureRoutings(String url, String tenant, String login, String pa
}
}

@Override
public Optional<String> getCustomRoutingBaseUrl() {
return isNotBlank(properties.getProperty("webhook-url")) ?
Optional.of(properties.getProperty("webhook-url")) :
super.getCustomRoutingBaseUrl();
}

@Override
public void removeRoutings() {
// Don't remove the connections, update them
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
package lora.ns.actility;

import java.util.LinkedList;
import java.util.List;

import lora.ns.connector.LNSConnectorWizardStep;
import lora.ns.connector.PropertyDescription;
import lora.ns.connector.PropertyDescription.PropertyType;

public class ConnectorWizardStep1 implements LNSConnectorWizardStep {

protected LinkedList<PropertyDescription> propertyDescriptions = new LinkedList<>();
{
propertyDescriptions.add(new PropertyDescription("url", "URL", true, null, null, null, null, null, null, null,
PropertyType.TEXT, false));
propertyDescriptions.add(new PropertyDescription("username", "Username", true, null, null, null, null, null,
null, null, PropertyType.TEXT, false));
propertyDescriptions.add(new PropertyDescription("password", "Password", true, null, null, null, null, null,
null, null, PropertyType.PASSWORD, true));
propertyDescriptions.add(new PropertyDescription("domain", "Domain", false, null, null, null, null, null, null,
null, PropertyType.TEXT, false));
propertyDescriptions.add(new PropertyDescription("group", "Group", false, null, null, null, null, null, null,
null, PropertyType.TEXT, false));
}
protected List<PropertyDescription> propertyDescriptions = List.of(
PropertyDescription.text("url", "URL", true),
PropertyDescription.text("username", "Username", true),
PropertyDescription.password("password", "Password"),
PropertyDescription.text("domain", "Domain", false),
PropertyDescription.text("group", "Group", false),
PropertyDescription.text("webhook-url", "Webhook URL", false));

@Override
public String getName() {
Expand Down

0 comments on commit 1443725

Please sign in to comment.