|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.server.repository.publisher.EventPublisher
public class EventPublisher
This class manages a connection to a publish/subscribe broker cloud. Nodes use an event publisher to handle server reconnects, message overflow, and to share a single connection across plugins.
| Field Summary | |
|---|---|
static int |
QUEUE_SIZE_DEFAULT
The default number of events to queue for publication before discarding old messages. |
| Constructor Summary | |
|---|---|
EventPublisher(ModelServiceApi modelServiceApi,
java.util.Properties properties)
Create a new EventPublisher |
|
| Method Summary | |
|---|---|
void |
close()
Close the service |
void |
disconnect()
Disconnect the event publisher from the JMS server |
void |
flushQueue()
Flush the contents of the publish queue |
boolean |
getIsStarted()
Return if the event publisher was started |
java.lang.String |
getJmsHost()
Get the JMS hostname |
java.lang.String |
getJmsJndiConnectionFactory()
Get the JNDI name of the Connection Factory |
java.lang.String |
getJmsJndiUpdateQueueName()
Get the JNDI name of the UpdateQueue |
java.lang.String |
getJmsPassword()
Get the JMS password |
int |
getJmsPort()
Get the JMS port |
java.lang.String |
getJmsProviderClass()
Get the name of the JmsProvider class |
java.lang.String |
getJmsUpdateQueueName()
Get the name of the UpdateQueue |
java.lang.String |
getJmsUser()
Get the JMS user name |
int |
getMaxQueueSize()
Get the current size of the event publication queue. |
boolean |
getPublishUpdateEvents()
Determine if the service is set to publish update events |
javax.jms.Destination |
getQueue(java.lang.String topicName)
Get or create a Destination for given topicName |
int |
getQueueSize()
Get the number of message on the publish queue |
void |
onException(javax.jms.JMSException exception)
|
void |
publish(java.util.Map<java.lang.String,java.lang.Object> properties,
byte[] bytes)
Publish the specified properties as a new event. |
void |
registerMBean(javax.management.MBeanServer mbs,
javax.management.ObjectName parentObjectName)
Register the service with the server's jmx server |
void |
setJmsHost(java.lang.String host)
Set the JMS host name |
void |
setJmsJndiConnectionFactoryName(java.lang.String jndiConnectionFactoryName)
Set the JNDI name of the connection factory |
void |
setJmsJndiUpdateQueueName(java.lang.String jndiUpdateQueueName)
Set the JNDI name of the UpdateQueue |
void |
setJmsPassword(java.lang.String password)
Set the JMS password |
void |
setJmsPort(int port)
Set the JMS port |
void |
setJmsProviderClass(java.lang.String providerClass)
Set the class name of the JMS Provider |
void |
setJmsUpdateQueueName(java.lang.String updateQueue)
Set the name of the Update Queue |
void |
setJmsUser(java.lang.String name)
Set the JMS user name |
void |
setMaxQueueSize(int queueSize)
Set the max size of the publish queue |
void |
setPublishUpdateEvents(boolean publishUpdateEvents)
Set if the service is set to publish update events |
void |
setQueueSize(int size)
Sets the size of the event publication queue. |
void |
start()
Start publishing events. |
void |
stop()
Stop the service |
void |
updateComplete(UpdateResults results,
RepositoryConnection repositoryConnection)
Handles the updateComplete event. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int QUEUE_SIZE_DEFAULT
| Constructor Detail |
|---|
public EventPublisher(ModelServiceApi modelServiceApi,
java.util.Properties properties)
modelServiceApi - ModelServiceApi to get ContainerConnectionPoolproperties - Configuration properties| Method Detail |
|---|
public void start()
start in interface IServerServicestart in interface IServerServiceMBean
public void stop()
throws AnzoException
IServerService
stop in interface IServerServicestop in interface IServerServiceMBeanAnzoException
public void close()
throws AnzoException
IServerService
close in interface IServerServiceAnzoException
public javax.jms.Destination getQueue(java.lang.String topicName)
throws javax.jms.JMSException
topicName - TopicName for Destination to retrieve
javax.jms.JMSExceptionpublic void disconnect()
public int getMaxQueueSize()
getMaxQueueSize in interface EventPublisherMBeanpublic boolean getIsStarted()
getIsStarted in interface IServerServicegetIsStarted in interface IServerServiceMBeantrue if the event publisher is started.public void onException(javax.jms.JMSException exception)
onException in interface javax.jms.ExceptionListener
public void publish(java.util.Map<java.lang.String,java.lang.Object> properties,
byte[] bytes)
properties - map of Stringproperty name to one of the supported JMS property value types.bytes - byte data for message body
public void setQueueSize(int size)
throws java.lang.IllegalArgumentException
size - new queue size.
java.lang.IllegalArgumentException - if size is less than one.
public void updateComplete(UpdateResults results,
RepositoryConnection repositoryConnection)
throws AnzoException
UpdateResultListener
updateComplete in interface UpdateResultListenerresults - Final state and other useful details of statements added/updated/removed during a update call.repositoryConnection - The repository graph the update was run against.
AnzoException
public void registerMBean(javax.management.MBeanServer mbs,
javax.management.ObjectName parentObjectName)
IServerService
registerMBean in interface IServerServicembs - the jmx serverparentObjectName - the name under which this object will be registeredpublic void flushQueue()
EventPublisherMBean
flushQueue in interface EventPublisherMBeanpublic java.lang.String getJmsJndiConnectionFactory()
EventPublisherMBean
getJmsJndiConnectionFactory in interface EventPublisherMBeanpublic java.lang.String getJmsJndiUpdateQueueName()
EventPublisherMBean
getJmsJndiUpdateQueueName in interface EventPublisherMBeanpublic java.lang.String getJmsPassword()
EventPublisherMBean
getJmsPassword in interface EventPublisherMBeanpublic java.lang.String getJmsProviderClass()
EventPublisherMBean
getJmsProviderClass in interface EventPublisherMBeanpublic java.lang.String getJmsUpdateQueueName()
EventPublisherMBean
getJmsUpdateQueueName in interface EventPublisherMBeanpublic java.lang.String getJmsUser()
EventPublisherMBean
getJmsUser in interface EventPublisherMBeanpublic boolean getPublishUpdateEvents()
EventPublisherMBean
getPublishUpdateEvents in interface EventPublisherMBeanpublic int getQueueSize()
EventPublisherMBean
getQueueSize in interface EventPublisherMBeanpublic void setJmsJndiConnectionFactoryName(java.lang.String jndiConnectionFactoryName)
EventPublisherMBean
setJmsJndiConnectionFactoryName in interface EventPublisherMBeanjndiConnectionFactoryName - the JNDI name of the connection factorypublic void setJmsJndiUpdateQueueName(java.lang.String jndiUpdateQueueName)
EventPublisherMBean
setJmsJndiUpdateQueueName in interface EventPublisherMBeanjndiUpdateQueueName - the JNDI name of the UpdateQueuepublic void setJmsPassword(java.lang.String password)
EventPublisherMBean
setJmsPassword in interface EventPublisherMBeanpassword - the JMS passwordpublic void setJmsProviderClass(java.lang.String providerClass)
EventPublisherMBean
setJmsProviderClass in interface EventPublisherMBeanproviderClass - the class name of the JMS Providerpublic void setJmsUpdateQueueName(java.lang.String updateQueue)
EventPublisherMBean
setJmsUpdateQueueName in interface EventPublisherMBeanupdateQueue - the name of the Update Queuepublic void setJmsUser(java.lang.String name)
EventPublisherMBean
setJmsUser in interface EventPublisherMBeanname - the JMS user namepublic void setMaxQueueSize(int queueSize)
EventPublisherMBean
setMaxQueueSize in interface EventPublisherMBeanqueueSize - max size of the publish queuepublic void setPublishUpdateEvents(boolean publishUpdateEvents)
EventPublisherMBean
setPublishUpdateEvents in interface EventPublisherMBeanpublishUpdateEvents - if the service is set to publish update eventspublic java.lang.String getJmsHost()
EventPublisherMBean
getJmsHost in interface EventPublisherMBeanpublic int getJmsPort()
EventPublisherMBean
getJmsPort in interface EventPublisherMBeanpublic void setJmsHost(java.lang.String host)
EventPublisherMBean
setJmsHost in interface EventPublisherMBeanhost - the JMS host namepublic void setJmsPort(int port)
EventPublisherMBean
setJmsPort in interface EventPublisherMBeanport - the JMS port
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||