Search in sources :

Example 1 with GatewayEndpointSummaryBean

use of io.apiman.manager.api.beans.summary.GatewayEndpointSummaryBean in project apiman by apiman.

the class GatewayResourceImpl method getGatewayEndpoint.

/**
 * @see IGatewayResource#getGatewayEndpoint(java.lang.String)
 */
public GatewayEndpointSummaryBean getGatewayEndpoint(String gatewayId) throws GatewayNotFoundException {
    // No permission check is needed
    try {
        GatewayBean gateway = storage.getGateway(gatewayId);
        if (gateway == null) {
            throw ExceptionFactory.gatewayNotFoundException(gatewayId);
        } else {
            // $NON-NLS-1$
            LOGGER.debug(String.format("Got endpoint summary: %s", gateway));
        }
        IGatewayLink link = gatewayLinkFactory.create(gateway);
        GatewayEndpoint endpoint = link.getGatewayEndpoint();
        GatewayEndpointSummaryBean gatewayEndpoint = new GatewayEndpointSummaryBean();
        gatewayEndpoint.setEndpoint(endpoint.getEndpoint());
        return gatewayEndpoint;
    } catch (AbstractRestException e) {
        throw e;
    } catch (Exception e) {
        throw new SystemErrorException(e);
    }
}
Also used : SystemErrorException(io.apiman.manager.api.rest.exceptions.SystemErrorException) GatewayEndpointSummaryBean(io.apiman.manager.api.beans.summary.GatewayEndpointSummaryBean) NewGatewayBean(io.apiman.manager.api.beans.gateways.NewGatewayBean) GatewayBean(io.apiman.manager.api.beans.gateways.GatewayBean) UpdateGatewayBean(io.apiman.manager.api.beans.gateways.UpdateGatewayBean) GatewayEndpoint(io.apiman.gateway.engine.beans.GatewayEndpoint) AbstractRestException(io.apiman.manager.api.rest.exceptions.AbstractRestException) IGatewayLink(io.apiman.manager.api.gateway.IGatewayLink) GatewayAuthenticationException(io.apiman.manager.api.gateway.GatewayAuthenticationException) AbstractRestException(io.apiman.manager.api.rest.exceptions.AbstractRestException) StorageException(io.apiman.manager.api.core.exceptions.StorageException) GatewayNotFoundException(io.apiman.manager.api.rest.exceptions.GatewayNotFoundException) SystemErrorException(io.apiman.manager.api.rest.exceptions.SystemErrorException) GatewayAlreadyExistsException(io.apiman.manager.api.rest.exceptions.GatewayAlreadyExistsException) NotAuthorizedException(io.apiman.manager.api.rest.exceptions.NotAuthorizedException)

Aggregations

GatewayEndpoint (io.apiman.gateway.engine.beans.GatewayEndpoint)1 GatewayBean (io.apiman.manager.api.beans.gateways.GatewayBean)1 NewGatewayBean (io.apiman.manager.api.beans.gateways.NewGatewayBean)1 UpdateGatewayBean (io.apiman.manager.api.beans.gateways.UpdateGatewayBean)1 GatewayEndpointSummaryBean (io.apiman.manager.api.beans.summary.GatewayEndpointSummaryBean)1 StorageException (io.apiman.manager.api.core.exceptions.StorageException)1 GatewayAuthenticationException (io.apiman.manager.api.gateway.GatewayAuthenticationException)1 IGatewayLink (io.apiman.manager.api.gateway.IGatewayLink)1 AbstractRestException (io.apiman.manager.api.rest.exceptions.AbstractRestException)1 GatewayAlreadyExistsException (io.apiman.manager.api.rest.exceptions.GatewayAlreadyExistsException)1 GatewayNotFoundException (io.apiman.manager.api.rest.exceptions.GatewayNotFoundException)1 NotAuthorizedException (io.apiman.manager.api.rest.exceptions.NotAuthorizedException)1 SystemErrorException (io.apiman.manager.api.rest.exceptions.SystemErrorException)1