Class RestGatewayLink
- java.lang.Object
-
- io.apiman.manager.api.gateway.rest.RestGatewayLink
-
- All Implemented Interfaces:
IGatewayLink
public class RestGatewayLink extends Object implements IGatewayLink
An implementation of a Gateway Link that uses the Gateway's simple REST API to publish APIs.- Author:
- eric.wittmann@redhat.com
-
-
Constructor Summary
Constructors Constructor Description RestGatewayLink(GatewayBean gateway)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close down the gateway link when it's no longer needed.protected voidconfigureBasicAuth(org.apache.http.HttpRequest request)Configures BASIC authentication for the request.ApiEndpointgetApiEndpoint(String organizationId, String apiId, String version)Gets the api endpoint from the gateway.protected GatewayClientgetClient()RestGatewayConfigBeangetConfig()GatewayEndpointgetGatewayEndpoint()Gets the gateway endpoint from the gatewaySystemStatusgetStatus()Gets the current status of the gateway.IPolicyProbeResponseprobe(String orgId, String apiId, String apiVersion, int idx)IPolicyProbeResponseprobe(String orgId, String apiId, String apiVersion, int idx, String apiKey, String rawPayload)voidpublishApi(Api api)Publishes a newApi.voidregisterClient(Client client)Registers a newClient.voidretireApi(Api api)Retires (removes) aApifrom the registry.voidsetConfig(RestGatewayConfigBean config)voidunregisterClient(Client client)Removes anClientfrom the registry.
-
-
-
Constructor Detail
-
RestGatewayLink
public RestGatewayLink(GatewayBean gateway)
Constructor.- Parameters:
gateway- the gateway
-
-
Method Detail
-
close
public void close()
Description copied from interface:IGatewayLinkClose down the gateway link when it's no longer needed.- Specified by:
closein interfaceIGatewayLink- See Also:
IGatewayLink.close()
-
getStatus
public SystemStatus getStatus() throws GatewayAuthenticationException
Description copied from interface:IGatewayLinkGets the current status of the gateway.- Specified by:
getStatusin interfaceIGatewayLink- Returns:
- the system status
- Throws:
GatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.getStatus()
-
getGatewayEndpoint
public GatewayEndpoint getGatewayEndpoint() throws GatewayAuthenticationException
Description copied from interface:IGatewayLinkGets the gateway endpoint from the gateway- Specified by:
getGatewayEndpointin interfaceIGatewayLink- Returns:
- the gateway endpoint
- Throws:
GatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.getGatewayEndpoint()
-
getApiEndpoint
public ApiEndpoint getApiEndpoint(String organizationId, String apiId, String version) throws GatewayAuthenticationException
Description copied from interface:IGatewayLinkGets the api endpoint from the gateway.- Specified by:
getApiEndpointin interfaceIGatewayLink- Parameters:
organizationId- the org idapiId- the api idversion- the version- Returns:
- the api endpoint
- Throws:
GatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.getApiEndpoint(java.lang.String, java.lang.String, java.lang.String)
-
publishApi
public void publishApi(Api api) throws PublishingException, GatewayAuthenticationException
Description copied from interface:IGatewayLinkPublishes a newApi.- Specified by:
publishApiin interfaceIGatewayLink- Parameters:
api- the api being published- Throws:
PublishingException- when unable to publish apiGatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.publishApi(io.apiman.gateway.engine.beans.Api)
-
retireApi
public void retireApi(Api api) throws PublishingException, GatewayAuthenticationException
Description copied from interface:IGatewayLinkRetires (removes) aApifrom the registry.- Specified by:
retireApiin interfaceIGatewayLink- Parameters:
api- the api to retire/remove- Throws:
PublishingException- when unable to retire apiGatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.retireApi(io.apiman.gateway.engine.beans.Api)
-
registerClient
public void registerClient(Client client) throws RegistrationException, GatewayAuthenticationException
Description copied from interface:IGatewayLinkRegisters a newClient. An client is ultimately a collection of contracts to managed apis.- Specified by:
registerClientin interfaceIGatewayLink- Parameters:
client- the client being registered- Throws:
RegistrationException- when unable to register clientGatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.registerClient(io.apiman.gateway.engine.beans.Client)
-
unregisterClient
public void unregisterClient(Client client) throws RegistrationException, GatewayAuthenticationException
Description copied from interface:IGatewayLinkRemoves anClientfrom the registry.- Specified by:
unregisterClientin interfaceIGatewayLink- Parameters:
client- the client to remove- Throws:
RegistrationException- when unable to registerGatewayAuthenticationException- when unable to authenticate with gateway- See Also:
IGatewayLink.unregisterClient(io.apiman.gateway.engine.beans.Client)
-
probe
public IPolicyProbeResponse probe(String orgId, String apiId, String apiVersion, int idx) throws RegistrationException, GatewayAuthenticationException
-
probe
public IPolicyProbeResponse probe(String orgId, String apiId, String apiVersion, int idx, String apiKey, String rawPayload) throws RegistrationException, GatewayAuthenticationException
- Specified by:
probein interfaceIGatewayLink- Throws:
RegistrationExceptionGatewayAuthenticationException
-
configureBasicAuth
protected void configureBasicAuth(org.apache.http.HttpRequest request)
Configures BASIC authentication for the request.- Parameters:
request-
-
getClient
protected GatewayClient getClient()
- Returns:
- the gateway client
-
getConfig
public RestGatewayConfigBean getConfig()
- Returns:
- the config
-
setConfig
public void setConfig(RestGatewayConfigBean config)
- Parameters:
config- the config to set
-
-