use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class SampleDbConnectionManager method createDbConnection.
private static Connection createDbConnection(String dbType) {
final Properties props = new Properties();
Account account = AccountsDirectory.getInstance().get(dbType);
props.setProperty("user", account.getProperty("user"));
props.setProperty("password", account.getProperty("password"));
String dbUrl = account.getProperties().get("url");
log.debug("DB endpoint URL: *{}*", dbUrl);
try {
return DriverManager.getConnection(dbUrl, props);
} catch (SQLException e) {
fail("Error creating DB connection.", e);
}
return null;
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class MqttUtils method createReceiver.
public MqttClient createReceiver(String clientName, String topic) throws MqttException {
MqttClient sampleClient = new MqttClient(BROKER, clientName, new MemoryPersistence());
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setCleanSession(false);
Account account = AccountsDirectory.getInstance().get(Account.Name.MQTT);
connOpts.setUserName(account.getProperties().get("userName"));
connOpts.setPassword(account.getProperties().get("password").toCharArray());
sampleClient.connect(connOpts);
sampleClient.subscribe(topic, 1);
sampleClient.setCallback(new Receiver(clientName));
return sampleClient;
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class FhirClientManager method initProperties.
private void initProperties() {
Account account = AccountsDirectory.getInstance().get(Account.Name.FHIR);
Map<String, String> properties = new HashMap<>();
account.getProperties().forEach((key, value) -> properties.put(key.toLowerCase(), value));
fhirPodName = properties.get("host");
fhirRemotePort = Integer.parseInt(properties.get("port"));
fhirServerLocalUrl = "http://localhost:" + fhirLocalPort + "/baseDstu3";
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class WildFlyS2i method createODataV4Account.
public void createODataV4Account(boolean https) {
Account oData = new Account();
oData.setService("OData");
Map<String, String> properties = new HashMap<>();
String serviceUri;
String key;
if (https) {
serviceUri = "https://services.odata.org/TripPinRESTierService/";
key = "odataHttps";
} else {
serviceUri = ODataUtils.getOpenshiftService();
key = "odata V4";
}
properties.put("serviceUri", serviceUri);
oData.setProperties(properties);
AccountsDirectory.getInstance().addAccount(key, oData);
log.info("Created new Account: {}", key);
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class SNSUtils method getTopicArn.
/**
* Gets the ARN of the given topic.
*
* @param topic topic name
* @return topic ARN
*/
public static String getTopicArn(String topic) {
final Account sqs = AccountsDirectory.getInstance().get(Account.Name.AWS);
final String region = sqs.getProperty("region").toLowerCase().replaceAll("_", "-");
final String accountId = sqs.getProperty("accountId");
return String.format("arn:aws:sns:%s:%s:%s", region, accountId, topic);
}
Aggregations