Search in sources :

Example 1 with ApiWrapper

use of com.symphony.api.bindings.ApiWrapper in project spring-bot by finos.

the class AbstractGenericInstanceFactory method buildApiWrappers.

/**
 * Override this method to change the wrappers used.  By default, this just returns the {@link StreamIDHelp}
 * wrapper, which you probably want to keep.
 */
protected List<ApiWrapper> buildApiWrappers(PodProperties pp, ID id, EndpointProperties ep) {
    List<ApiWrapper> out = new ArrayList<>();
    out.add(new StreamIDHelp());
    return out;
}
Also used : StreamIDHelp(com.symphony.api.bindings.StreamIDHelp) ArrayList(java.util.ArrayList) ApiWrapper(com.symphony.api.bindings.ApiWrapper)

Example 2 with ApiWrapper

use of com.symphony.api.bindings.ApiWrapper in project spring-bot by finos.

the class AbstractGenericInstanceFactory method createApiBuilder.

/**
 * Override this method to configure your own ApiBuilder implementation.
 */
protected ConfigurableApiBuilder createApiBuilder(PodProperties pp, EndpointProperties ep, ID id, TrustManager[] trustManagers, String apiName, ApiWrapper... extra) throws Exception {
    if (ep == null) {
        LOG.warn("symphony.apis[{}].{} not set: could cause NPE when doing get{}Api()", pp.getId(), apiName.toLowerCase(), StringUtils.capitalize(apiName));
        return null;
    }
    List<ApiWrapper> wrappers = buildApiWrappers(pp, id, ep);
    Arrays.stream(extra).forEach(w -> wrappers.add(w));
    ApiWrapper[] wrapperArray = wrappers.stream().toArray(s -> new ApiWrapper[s]);
    ConfigurableApiBuilder ab = apiBuilderFactory.getObject();
    ep.configure(ab, wrapperArray, getIdentity(id), trustManagers);
    return ab;
}
Also used : ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder) ApiWrapper(com.symphony.api.bindings.ApiWrapper)

Example 3 with ApiWrapper

use of com.symphony.api.bindings.ApiWrapper in project spring-bot by finos.

the class DefaultOboInstanceFactory method buildApiWrappers.

@Override
protected List<ApiWrapper> buildApiWrappers(PodProperties pp, OboIdentity id, EndpointProperties ep) {
    List<ApiWrapper> out = super.buildApiWrappers(pp, id, ep);
    out.add(new MetricsApiWrapper(mr, pp, id.getTheApp().getCommonName() + "/" + id.getOboUserId(), ep.getUrl()));
    return out;
}
Also used : MetricsApiWrapper(org.finos.symphony.toolkit.spring.api.factories.MetricsApiWrapper) MetricsApiWrapper(org.finos.symphony.toolkit.spring.api.factories.MetricsApiWrapper) ApiWrapper(com.symphony.api.bindings.ApiWrapper)

Aggregations

ApiWrapper (com.symphony.api.bindings.ApiWrapper)3 ConfigurableApiBuilder (com.symphony.api.bindings.ConfigurableApiBuilder)1 StreamIDHelp (com.symphony.api.bindings.StreamIDHelp)1 ArrayList (java.util.ArrayList)1 MetricsApiWrapper (org.finos.symphony.toolkit.spring.api.factories.MetricsApiWrapper)1