public class RMQConnection extends Object implements com.rabbitmq.client.ShutdownListener, RMQChannelListener, RMQConnectionNotifier
コンストラクタと説明 |
---|
RMQConnection(String serviceUri,
String userName,
hudson.util.Secret userPassword)
Creates instance with specified parameter.
|
RMQConnection(String serviceUri,
String userName,
hudson.util.Secret userPassword,
long watchdogPeriod)
Creates instance with specified parameter.
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
addRMQConnectionListener(RMQConnectionListener rmqConnectionListener)
|
void |
close()
Close connection.
|
com.rabbitmq.client.Channel |
createPureChannel()
Create pure channel.
|
boolean |
equals(Object obj) |
com.rabbitmq.client.Connection |
getConnection()
Gets connection.
|
boolean |
getConsumeChannelStatus(String queueName)
Gets status of channel binds specified queue.
|
Collection<ConsumeRMQChannel> |
getConsumeRMQChannels()
Gets the list of ConsumeRMQChannels.
|
Collection<PublishRMQChannel> |
getPublishRMQChannels()
Gets the list of PublishRMQChannels.
|
Collection<AbstractRMQChannel> |
getRMQChannels()
Gets the list of RMQChannels.
|
String |
getServiceUri()
Gets URI for RabbitMQ service.
|
String |
getUserName()
Gets URI for RabbitMQ service.
|
hudson.util.Secret |
getUserPassword()
Gets URI for RabbitMQ service.
|
int |
hashCode() |
boolean |
isOpen()
Gets if connection is established.
|
boolean |
isOpenRMQConnection()
Gets whether actual RabbitMQ connection is opened.
|
void |
notifyOnCloseCompleted()
Notify OnCloseCompleted event.
|
void |
notifyOnOpen()
Notify OnOpen event.
|
void |
notifyRMQConnectionListeners(RMQConnectionEvent event)
Notify event for
RMQConnection . |
void |
onCloseCompleted(AbstractRMQChannel rmqChannel)
Calls when close process for channel is completed.
|
void |
onOpen(AbstractRMQChannel rmqChannel)
Calls when channel is opend.
|
void |
open()
Open connection.
|
void |
removeRMQConnectionListener(RMQConnectionListener rmqConnectionListener)
Removes
RMQConnectionListener . |
void |
shutdownCompleted(com.rabbitmq.client.ShutdownSignalException shutdownSignalException) |
void |
updateChannels(Collection<RabbitmqConsumeItem> consumeItems)
Updates each channels.
|
void |
updatePublishChannel()
Update publish channel.
|
public RMQConnection(String serviceUri, String userName, hudson.util.Secret userPassword)
serviceUri
- the URI for RabbitMQ service.userName
- the name of user.userPassword
- the password of user.public RMQConnection(String serviceUri, String userName, hudson.util.Secret userPassword, long watchdogPeriod)
serviceUri
- the URI for RabbitMQ service.userName
- the name of user.userPassword
- the password of user.watchdogPeriod
- the period of watchdog in seconds.public com.rabbitmq.client.Connection getConnection()
public com.rabbitmq.client.Channel createPureChannel()
public String getServiceUri()
public String getUserName()
public hudson.util.Secret getUserPassword()
public Collection<AbstractRMQChannel> getRMQChannels()
public Collection<ConsumeRMQChannel> getConsumeRMQChannels()
public Collection<PublishRMQChannel> getPublishRMQChannels()
public boolean getConsumeChannelStatus(String queueName)
queueName
- the queue name.public void open() throws IOException
IOException
- thow if connection cannot be opend.public void close() throws IOException
IOException
- throws if something error.public boolean isOpen()
public void updateChannels(Collection<RabbitmqConsumeItem> consumeItems)
consumeItems
- the list of consume items.public void updatePublishChannel()
public void onOpen(AbstractRMQChannel rmqChannel)
onOpen
インタフェース内 RMQChannelListener
rmqChannel
- the channel.public void onCloseCompleted(AbstractRMQChannel rmqChannel)
onCloseCompleted
インタフェース内 RMQChannelListener
rmqChannel
- the channel.public void addRMQConnectionListener(RMQConnectionListener rmqConnectionListener)
addRMQConnectionListener
インタフェース内 RMQConnectionNotifier
rmqConnectionListener
- the connection listener.public void removeRMQConnectionListener(RMQConnectionListener rmqConnectionListener)
RMQConnectionListener
.removeRMQConnectionListener
インタフェース内 RMQConnectionNotifier
rmqConnectionListener
- the connection listener.public boolean isOpenRMQConnection()
isOpenRMQConnection
インタフェース内 RMQConnectionNotifier
public void notifyRMQConnectionListeners(RMQConnectionEvent event)
RMQConnection
.notifyRMQConnectionListeners
インタフェース内 RMQConnectionNotifier
event
- the event for connection.public void notifyOnCloseCompleted()
public void notifyOnOpen()
public void shutdownCompleted(com.rabbitmq.client.ShutdownSignalException shutdownSignalException)
shutdownCompleted
インタフェース内 com.rabbitmq.client.ShutdownListener
shutdownSignalException
- the exception.Copyright © 2016–2018. All rights reserved.