use of io.syndesis.qe.accounts.Account in project syndesis-qe by syndesisio.
the class ConnectionsGeneralSteps method createTwitterConnection.
@Given("^create the TW connection using \"([^\"]*)\" template")
public void createTwitterConnection(String twitterTemplate) {
final Connector twitterConnector = connectorsEndpoint.get("twitter");
final Account twitterAccount = accountsDirectory.getAccount(twitterTemplate).get();
log.info("Template name: {}", twitterTemplate);
final Connection twitterConnection = new Connection.Builder().connector(twitterConnector).connectorId(getConnectorId(twitterConnector)).id(RestConstants.getInstance().getTWITTER_CONNECTION_ID()).name("New Fuse QE twitter listen").configuredProperties(TestUtils.map("accessToken", twitterAccount.getProperty("accessToken"), "accessTokenSecret", twitterAccount.getProperty("accessTokenSecret"), "consumerKey", twitterAccount.getProperty("consumerKey"), "consumerSecret", twitterAccount.getProperty("consumerSecret"))).icon("fa-twitter").tags(Arrays.asList("twitter")).build();
log.info("Creating twitter connection {}", twitterConnection.getName());
connectionsEndpoint.create(twitterConnection);
}
use of io.syndesis.qe.accounts.Account in project syndesis-qe by syndesisio.
the class ConnectionsGeneralSteps method createFtpConnection.
@Given("^create the FTP connection using \"([^\"]*)\" template")
public void createFtpConnection(String ftpTemplate) {
connectionsEndpoint.list().forEach(c -> log.info(c.getName()));
final Connector ftpConnector = connectorsEndpoint.get("ftp");
final Account ftpAccount = accountsDirectory.getAccount(ftpTemplate).get();
log.info("Template name: {}", ftpTemplate);
final Connection ftpConnection = new Connection.Builder().connector(ftpConnector).connectorId(getConnectorId(ftpConnector)).id(RestConstants.getInstance().getFTP_CONNECTION_ID()).name("New Fuse QE FTP").configuredProperties(TestUtils.map(// "disconnect", ftpAccount.getProperty("disconnect"),
"host", ftpAccount.getProperty("host"), // "password", ftpAccount.getProperty("password"),
"port", ftpAccount.getProperty("port"))).icon("fa-ftp").tags(Arrays.asList("ftp")).build();
log.info("Creating ftp connection {}", ftpConnection.getName());
connectionsEndpoint.create(ftpConnection);
}
use of io.syndesis.qe.accounts.Account in project syndesis-qe by syndesisio.
the class ConnectionsGeneralSteps method createSalesforceConnection.
@Given("^create SF connection")
public void createSalesforceConnection() {
final Account salesforceAccount = accountsDirectory.getAccount("salesforce").get();
final Connector salesforceConnector = connectorsEndpoint.get("salesforce");
final Connection salesforceConnection = new Connection.Builder().connector(salesforceConnector).connectorId(getConnectorId(salesforceConnector)).id(RestConstants.getInstance().getSALESFORCE_CONNECTION_ID()).icon("fa-puzzle-piece").name("New Fuse QE salesforce").configuredProperties(TestUtils.map("clientId", salesforceAccount.getProperty("clientId"), "clientSecret", salesforceAccount.getProperty("clientSecret"), "loginUrl", salesforceAccount.getProperty("loginUrl"), "userName", salesforceAccount.getProperty("userName"), "password", salesforceAccount.getProperty("password"))).tags(Arrays.asList("salesforce")).build();
log.info("Creating salesforce connection {}", salesforceConnection.getName());
connectionsEndpoint.create(salesforceConnection);
}
use of io.syndesis.qe.accounts.Account in project syndesis-qe by syndesisio.
the class AmqTemplate method addAccounts.
private static void addAccounts() {
Account openwireAccount = new Account();
Map<String, String> openwireAccountParameters = new HashMap<>();
openwireAccountParameters.put("username", "amq");
openwireAccountParameters.put("password", "topSecret");
openwireAccountParameters.put("brokerUrl", "tcp://broker-amq:61616");
// openwireAccountParameters.put("clientID", UUID.randomUUID().toString());
openwireAccount.setService("amq");
openwireAccount.setProperties(openwireAccountParameters);
Account amqpAccount = new Account();
Map<String, String> amqpAccountParameters = new HashMap<>();
amqpAccountParameters.put("username", "amq");
amqpAccountParameters.put("password", "topSecret");
amqpAccountParameters.put("connectionUri", "amqp://broker-amq:5672");
amqpAccountParameters.put("clientID", UUID.randomUUID().toString());
amqpAccountParameters.put("skipCertificateCheck", "Disable");
amqpAccountParameters.put("brokerCertificate", "");
amqpAccountParameters.put("clientCertificate", "");
amqpAccount.setService("amqp");
amqpAccount.setProperties(amqpAccountParameters);
AccountsDirectory.getInstance().addAccount("AMQ", openwireAccount);
AccountsDirectory.getInstance().addAccount("AMQP", amqpAccount);
}
use of io.syndesis.qe.accounts.Account in project syndesis-qe by syndesisio.
the class DropBoxUtils method getClient.
private DbxClientV2 getClient() throws DbxException {
if (this.client == null) {
Optional<Account> optional = AccountsDirectory.getInstance().getAccount("QE Dropbox");
if (optional.isPresent()) {
DbxRequestConfig config = new DbxRequestConfig(optional.get().getProperty("clientIdentifier"));
this.client = new DbxClientV2(config, optional.get().getProperty("accessToken"));
} else {
log.error("Unable to create DropBox client - credentials not found.");
throw new IllegalArgumentException("DropBox credentials were not found.");
}
log.debug("DropBox client created, logged as: " + client.users().getCurrentAccount());
} else {
log.debug("DropBox client was already created, returning existing instance");
}
return this.client;
}
Aggregations