Search in sources :

Example 1 with ListResourceWrapper

use of ca.corefacility.bioinformatics.irida.model.remote.resource.ListResourceWrapper in project irida by phac-nml.

the class RemoteRepositoryImpl method list.

/**
 * {@inheritDoc}
 */
@Override
public List<Type> list(String uri, RemoteAPI remoteAPI) {
    OAuthTokenRestTemplate restTemplate = new OAuthTokenRestTemplate(tokenService, remoteAPI);
    ResponseEntity<ListResourceWrapper<Type>> exchange = restTemplate.exchange(uri, HttpMethod.GET, HttpEntity.EMPTY, listTypeReference);
    List<Type> resources = exchange.getBody().getResource().getResources();
    for (Type r : resources) {
        r = setRemoteStatus(r, remoteAPI);
    }
    return resources;
}
Also used : ListResourceWrapper(ca.corefacility.bioinformatics.irida.model.remote.resource.ListResourceWrapper) OAuthTokenRestTemplate(ca.corefacility.bioinformatics.irida.repositories.remote.resttemplate.OAuthTokenRestTemplate)

Aggregations

ListResourceWrapper (ca.corefacility.bioinformatics.irida.model.remote.resource.ListResourceWrapper)1 OAuthTokenRestTemplate (ca.corefacility.bioinformatics.irida.repositories.remote.resttemplate.OAuthTokenRestTemplate)1