ConnectionInfo is a simple plain old Java object (POJO) that holds all data required to create or configure a connection to a third-party system.
Note:
ConnectionInfo is not the actual connection, or scripting object, but rather the data that represents the object.
public class ConnectionInfo { /* * Name of the connection */ private String name; /* * ID of the connection - can be String, UUID or whatever type you find suitable. */ private final Sid id; /* * Service URI of the third party system */ private String uri; private String subscriptionId; private String keystoreLocation; /* * Sensitive data - the keystore password */ private String keystorePassword; /* * Some binary content - in this case we save a keystore */ private byte[] keystoreContent; /* * Verify that each ConnectionInfo has an ID. */ public ConnectionInfo() { this.id = Sid.unique(); } /* * Verify that each ConnectionInfo has an ID. */ public ConnectionInfo(Sid id) { super(); this.id = id; } /* * Getters and setters */ public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getSubscriptionId() { return subscriptionId; } public void setSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; } public String getKeystoreLocation() { return keystoreLocation; } public void setKeystoreLocation(String keystoreLocation) { this.keystoreLocation = keystoreLocation; } public String getKeystorePassword() { return keystorePassword; } public void setKeystorePassword(String keystorePassword) { this.keystorePassword = keystorePassword; } public Sid getId() { return id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public byte[] getKeystoreContent() { return keystoreContent; } public void setKeystoreContent(byte[] keystoreContent) { this.keystoreContent = keystoreContent; } /* * It is always a good idea to expose the fields of that object for logging and debugging purposes. * Do not print the password. */ @Override public String toString() { return "ConnectionInfo [name=" + name + ", id=" + id + ", uri=" + uri + ", subscriptionId=" + subscriptionId + ", keystoreLocation=" + keystoreLocation + "]"; } }