use of com.symphony.api.id.SymphonyIdentity in project spring-bot by finos.
the class SymphonyBuildReporter method prepareApi.
private SymphonyMessageSender prepareApi(MavenProject project) throws IOException {
String identityJson = getProjectPropertyStrict(project, SYMPHONY_REPORTER_IDENTITY);
SymphonyIdentity identity = new ObjectMapper().readValue(identityJson, SymphonyIdentity.class);
String trustStoreJks = getProjectProperty(project, SYMPHONY_REPORTER_TRUST_STORE_JKS);
String proxiesRaw = getProjectProperty(project, SYMPHONY_REPORTER_PROXIES);
List<String> proxies;
if (StringUtils.isEmpty(proxiesRaw)) {
proxies = Collections.singletonList(null);
} else {
proxies = Arrays.stream(proxiesRaw.split(",")).filter(s -> !s.isEmpty()).map(x -> NONE_PROXY.equals(x) ? null : x).collect(Collectors.toList());
}
String podUrl = getProjectPropertyStrict(project, SYMPHONY_REPORTER_POD_URL);
String agentUrl = getProjectPropertyStrict(project, SYMPHONY_REPORTER_AGENT_URL);
String sessionauthUrl = getProjectProperty(project, SYMPHONY_REPORTER_SESSIONAUTH_URL);
String keyauthUrl = getProjectProperty(project, SYMPHONY_REPORTER_KEYAUTH_URL);
String relayUrl = getProjectProperty(project, SYMPHONY_REPORTER_RELAY_URL);
String loginUrl = getProjectProperty(project, SYMPHONY_REPORTER_LOGIN_URL);
ProxyingWrapper pod = new ProxyingWrapper(trustStoreJks, proxies, podUrl, identity, LOG);
ProxyingWrapper agent = new ProxyingWrapper(trustStoreJks, proxies, agentUrl, identity, LOG);
ProxyingWrapper session = sessionauthUrl == null ? null : new ProxyingWrapper(trustStoreJks, proxies, sessionauthUrl, identity, LOG);
ProxyingWrapper key = keyauthUrl == null ? null : new ProxyingWrapper(trustStoreJks, proxies, keyauthUrl, identity, LOG);
ProxyingWrapper relay = relayUrl == null ? null : new ProxyingWrapper(trustStoreJks, proxies, relayUrl, identity, LOG);
ProxyingWrapper login = loginUrl == null ? null : new ProxyingWrapper(trustStoreJks, proxies, loginUrl, identity, LOG);
return new SymphonyMessageSender(pod, agent, session, key, relay, login, identity);
}
use of com.symphony.api.id.SymphonyIdentity in project spring-bot by finos.
the class KoreAIBridgeFactoryImpl method symphonyAPIInstance.
public ApiInstance symphonyAPIInstance(KoreAIInstanceProperties props) {
try {
SymphonyIdentity symphonyBotIdentity = IdentityProperties.instantiateIdentityFromDetails(rl, props.getSymphonyBot(), om);
TrustManager[] tms = tmf == null ? null : tmf.getTrustManagers();
ApiInstance apiInstance = apiInstanceFactory.createApiInstance(symphonyBotIdentity, podProperties, tms);
LOG.info("Constructed API Factory for {} ", props.getName());
return apiInstance;
} catch (Exception e) {
LOG.error("Couldn't create API instance for {} ", props.getName());
throw new UnsupportedOperationException("Couldn't get api instance: ", e);
}
}
Aggregations