Package com.adaptris.google.cloud.pubsub
Class GoogleCloudPubSubConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.google.cloud.pubsub.GoogleCloudPubSubConnection
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
@ComponentProfile(summary="Enables a connection to Google pubsub messaging", tag="connections,gcloud,messaging") public class GoogleCloudPubSubConnection extends AdaptrisConnectionImp
In the adapter configuration file this class is aliased as google-cloud-pubsub-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description GoogleCloudPubSubConnection()
GoogleCloudPubSubConnection(ChannelProvider channelProvider)
GoogleCloudPubSubConnection(ChannelProvider channelProvider, CredentialsProvider credentialsProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeConnection()
com.google.cloud.pubsub.v1.Subscriber
createSubscriber(com.google.pubsub.v1.ProjectSubscriptionName subscription, com.google.cloud.pubsub.v1.MessageReceiver receiver)
com.google.pubsub.v1.ProjectSubscriptionName
createSubscription(ConsumeConfig config)
void
deleteSubscription(ConsumeConfig config)
ChannelProvider
getChannelProvider()
com.adaptris.google.cloud.pubsub.ConnectionConfig.ConnectionState
getConnectionState()
CredentialsProvider
getCredentialsProvider()
FlowControlProvider
getFlowControlProvider()
com.google.api.gax.rpc.TransportChannelProvider
getGoogleChannelProvider()
com.google.api.gax.core.CredentialsProvider
getGoogleCredentialsProvider()
java.lang.String
getProjectName()
com.google.cloud.pubsub.v1.SubscriptionAdminClient
getSubscriptionAdminClient()
com.google.cloud.pubsub.v1.TopicAdminClient
getTopicAdminClient()
protected void
initConnection()
protected void
prepareConnection()
void
setChannelProvider(ChannelProvider channelProvider)
void
setCredentialsProvider(CredentialsProvider credentialsProvider)
void
setFlowControlProvider(FlowControlProvider flowControlProvider)
void
setProjectName(java.lang.String projectName)
void
setSubscriptionAdminClientProvider(SubscriptionAdminClientProvider subscriptionAdminClientProvider)
void
setTopicAdminClientProvider(TopicAdminClientProvider topicAdminClientProvider)
protected void
startConnection()
protected void
stopConnection()
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Constructor Detail
-
GoogleCloudPubSubConnection
public GoogleCloudPubSubConnection()
-
GoogleCloudPubSubConnection
public GoogleCloudPubSubConnection(ChannelProvider channelProvider)
-
GoogleCloudPubSubConnection
public GoogleCloudPubSubConnection(ChannelProvider channelProvider, CredentialsProvider credentialsProvider)
-
-
Method Detail
-
prepareConnection
protected void prepareConnection() throws CoreException
- Specified by:
prepareConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
createSubscription
public com.google.pubsub.v1.ProjectSubscriptionName createSubscription(ConsumeConfig config) throws CoreException
- Throws:
CoreException
-
deleteSubscription
public void deleteSubscription(ConsumeConfig config) throws CoreException
- Throws:
CoreException
-
createSubscriber
public com.google.cloud.pubsub.v1.Subscriber createSubscriber(com.google.pubsub.v1.ProjectSubscriptionName subscription, com.google.cloud.pubsub.v1.MessageReceiver receiver)
-
getProjectName
public java.lang.String getProjectName()
-
setProjectName
public void setProjectName(java.lang.String projectName)
-
initConnection
protected void initConnection() throws CoreException
- Specified by:
initConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
startConnection
protected void startConnection() throws CoreException
- Specified by:
startConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnection
in classAdaptrisConnectionImp
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnection
in classAdaptrisConnectionImp
-
getCredentialsProvider
public CredentialsProvider getCredentialsProvider()
-
setCredentialsProvider
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
-
getGoogleCredentialsProvider
public com.google.api.gax.core.CredentialsProvider getGoogleCredentialsProvider()
-
getFlowControlProvider
public FlowControlProvider getFlowControlProvider()
-
setFlowControlProvider
public void setFlowControlProvider(FlowControlProvider flowControlProvider)
-
getChannelProvider
public ChannelProvider getChannelProvider()
-
setChannelProvider
public void setChannelProvider(ChannelProvider channelProvider)
-
getGoogleChannelProvider
public com.google.api.gax.rpc.TransportChannelProvider getGoogleChannelProvider()
-
getConnectionState
public com.adaptris.google.cloud.pubsub.ConnectionConfig.ConnectionState getConnectionState()
-
setSubscriptionAdminClientProvider
public void setSubscriptionAdminClientProvider(SubscriptionAdminClientProvider subscriptionAdminClientProvider)
-
setTopicAdminClientProvider
public void setTopicAdminClientProvider(TopicAdminClientProvider topicAdminClientProvider)
-
getSubscriptionAdminClient
public com.google.cloud.pubsub.v1.SubscriptionAdminClient getSubscriptionAdminClient()
-
getTopicAdminClient
public com.google.cloud.pubsub.v1.TopicAdminClient getTopicAdminClient()
-
-