Search in sources :

Example 1 with PodInfo

use of org.finos.symphony.toolkit.spring.app.pods.info.PodInfo in project spring-bot by finos.

the class TokenManagingOboApiInstanceFactory method getPodProperties.

public PodProperties getPodProperties(String companyId) {
    if (podPropertiesList != null) {
        // pod.
        if (companyId == null) {
            return podPropertiesList.get(0);
        }
        // find matching pod/company id
        for (PodProperties podProperties : podPropertiesList) {
            if (companyId.equals(podProperties.getId())) {
                return podProperties;
            }
        }
    }
    if ((ps != null) && (converter != null)) {
        PodInfo pi = ps.getPodInfo(companyId);
        PodProperties out = converter.convert(pi);
        if (out != null) {
            return out;
        }
    }
    throw new IllegalArgumentException("Couldn't find pod properties for company ID: " + companyId + ". Maybe set this in application.yml");
}
Also used : PodInfo(org.finos.symphony.toolkit.spring.app.pods.info.PodInfo) PodProperties(org.finos.symphony.toolkit.spring.api.properties.PodProperties)

Example 2 with PodInfo

use of org.finos.symphony.toolkit.spring.app.pods.info.PodInfo in project spring-bot by finos.

the class PodInfoStoreTokenStrategy method getPodApi.

@Override
protected PodApi getPodApi(Map<String, Object> claims) throws Exception {
    String companyId = getCompanyId(claims);
    PodInfo pi = getPodProperties(companyId);
    if (pi == null) {
        return null;
    }
    ApiBuilder ab = setupApiBuilder(pi, pi.getPayload().getPodUrl());
    return ab.getApi(PodApi.class);
}
Also used : PodInfo(org.finos.symphony.toolkit.spring.app.pods.info.PodInfo) ApiBuilder(com.symphony.api.bindings.ApiBuilder) ConfigurableApiBuilder(com.symphony.api.bindings.ConfigurableApiBuilder)

Aggregations

PodInfo (org.finos.symphony.toolkit.spring.app.pods.info.PodInfo)2 ApiBuilder (com.symphony.api.bindings.ApiBuilder)1 ConfigurableApiBuilder (com.symphony.api.bindings.ConfigurableApiBuilder)1 PodProperties (org.finos.symphony.toolkit.spring.api.properties.PodProperties)1