Class GraphqlEndpoint

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.graphql.GraphqlEndpoint
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.ComponentAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@UriEndpoint(firstVersion="3.0.0", scheme="graphql", title="GraphQL", syntax="graphql:httpUri", category=API, producerOnly=true, lenientProperties=true) public class GraphqlEndpoint extends org.apache.camel.support.DefaultEndpoint
Send GraphQL queries and mutations to external systems.
  • Field Summary

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
    GraphqlEndpoint(String uri, org.apache.camel.Component component)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.Consumer
    createConsumer(org.apache.camel.Processor processor)
     
    org.apache.camel.Producer
     
    protected void
     
     
    org.apache.hc.client5.http.impl.classic.CloseableHttpClient
     
    org.apache.hc.client5.http.impl.classic.CloseableHttpClient
     
     
     
     
     
     
     
     
     
     
    org.apache.camel.util.json.JsonObject
     
     
    boolean
     
    void
    setAccessToken(String accessToken)
    The access token sent in the Authorization header.
    void
    setHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient)
     
    void
    setHttpUri(URI httpUri)
    The GraphQL server URI.
    void
    setJwtAuthorizationType(String jwtAuthorizationType)
    The JWT Authorization type.
    void
    setOperationName(String operationName)
    The query or mutation name.
    void
    setPassword(String password)
    The password for Basic authentication.
    void
    setProxyHost(String proxyHost)
    The proxy host in the format "hostname:port".
    void
    The query text.
    void
    setQueryFile(String queryFile)
    The query file name located in the classpath.
    void
    setQueryHeader(String queryHeader)
    The name of a header containing the GraphQL query.
    void
    setUsername(String username)
    The username for Basic authentication.
    void
    setVariables(org.apache.camel.util.json.JsonObject variables)
    The JsonObject instance containing the operation variables.
    void
    setVariablesHeader(String variablesHeader)
    The name of a header containing a JsonObject instance containing the operation variables.

    Methods inherited from class org.apache.camel.support.DefaultEndpoint

    configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.camel.ComponentAware

    getComponent

    Methods inherited from interface org.apache.camel.Endpoint

    getEndpointBaseUri, isSingletonProducer

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Constructor Details

    • GraphqlEndpoint

      public GraphqlEndpoint(String uri, org.apache.camel.Component component)
  • Method Details

    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • createProducer

      public org.apache.camel.Producer createProducer() throws Exception
      Throws:
      Exception
    • createConsumer

      public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
      Throws:
      Exception
    • getHttpclient

      public org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpclient()
    • getHttpUri

      public URI getHttpUri()
    • setHttpUri

      public void setHttpUri(URI httpUri)
      The GraphQL server URI.
    • getProxyHost

      public String getProxyHost()
    • setProxyHost

      public void setProxyHost(String proxyHost)
      The proxy host in the format "hostname:port".
    • getAccessToken

      public String getAccessToken()
    • setAccessToken

      public void setAccessToken(String accessToken)
      The access token sent in the Authorization header.
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
      The username for Basic authentication.
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
      The password for Basic authentication.
    • getQuery

      public String getQuery()
    • setJwtAuthorizationType

      public void setJwtAuthorizationType(String jwtAuthorizationType)
      The JWT Authorization type. Default is Bearer.
    • getJwtAuthorizationType

      public String getJwtAuthorizationType()
    • setQuery

      public void setQuery(String query)
      The query text.
    • getQueryFile

      public String getQueryFile()
    • setQueryFile

      public void setQueryFile(String queryFile)
      The query file name located in the classpath.
    • getOperationName

      public String getOperationName()
    • setOperationName

      public void setOperationName(String operationName)
      The query or mutation name.
    • getVariables

      public org.apache.camel.util.json.JsonObject getVariables()
    • setVariables

      public void setVariables(org.apache.camel.util.json.JsonObject variables)
      The JsonObject instance containing the operation variables.
    • getVariablesHeader

      public String getVariablesHeader()
    • setVariablesHeader

      public void setVariablesHeader(String variablesHeader)
      The name of a header containing a JsonObject instance containing the operation variables.
    • getQueryHeader

      public String getQueryHeader()
    • setQueryHeader

      public void setQueryHeader(String queryHeader)
      The name of a header containing the GraphQL query.
    • getHttpClient

      public org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient()
    • setHttpClient

      public void setHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient)
    • isLenientProperties

      public boolean isLenientProperties()
      Specified by:
      isLenientProperties in interface org.apache.camel.Endpoint
      Overrides:
      isLenientProperties in class org.apache.camel.support.DefaultEndpoint