public class MockDipFactory extends Object implements DipFactory
Modifier and Type | Field and Description |
---|---|
HashMap<String,Collection<MockDipSubscription>> |
m_publicationNameToSubscription |
HashMap<MockDipSubscription,DipSubscriptionListener> |
m_subscriptionToListener |
Constructor and Description |
---|
MockDipFactory() |
Modifier and Type | Method and Description |
---|---|
DipBrowser |
createDipBrowser()
Create a browser object with which the namespace of
DIP may be viewed.
|
DipData |
createDipData()
Creates a new DipData object.
|
DipPublication |
createDipPublication(String topicName,
DipPublicationErrorHandler handler)
Creates a new DipPublication object for the topic specified by topicName.
|
DipSubscription |
createDipSubscription(String topicName,
DipSubscriptionListener listener)
Creates a new DipSubscription object for the topic specified by topicName.
|
void |
destroyDipPublication(DipPublication publication)
Destroys DipPublication object previously created by createDipPublication().
|
void |
destroyDipSubscription(DipSubscription subscription)
Destroys DipSubscription object previously created by createDipSubscription().
|
int |
getTimeout()
Get the write and connection timeout to be used for DIP communication.
|
void |
onPublicationUpdate(DipPublication publication,
DipData value)
Use this method to programmatically cause on update on all registered subscription listeners.
|
void |
setDNSNode(String nodeName)
Specifies the DNS to be used for the DIP communication.
|
void |
setTimeout(int timeout)
Set the write and connection timeout to be used for DIP communication.
|
public HashMap<String,Collection<MockDipSubscription>> m_publicationNameToSubscription
public HashMap<MockDipSubscription,DipSubscriptionListener> m_subscriptionToListener
public void setDNSNode(String nodeName)
DipFactory
setDNSNode
in interface DipFactory
nodeName
- name of the DNS to be used.public void setTimeout(int timeout)
DipFactory
setTimeout
in interface DipFactory
timeout
- Timeout in seconds to be applied to new connections.public int getTimeout()
DipFactory
getTimeout
in interface DipFactory
public DipSubscription createDipSubscription(String topicName, DipSubscriptionListener listener) throws DipException
DipFactory
createDipSubscription
in interface DipFactory
topicName
- name of the subscription topiclistener
- is user object which implementsDipException
- if the subscription cannot be created.interface, used to receive data as well as the state of publication.
public DipPublication createDipPublication(String topicName, DipPublicationErrorHandler handler) throws DipException
DipFactory
createDipPublication
in interface DipFactory
topicName
- name of the subscription topic - must be uniquehandler
- - used for handling aysnch. DIP errors.DipException
- if the publication cannot be created.interface,
public void destroyDipSubscription(DipSubscription subscription) throws DipException
DipFactory
destroyDipSubscription
in interface DipFactory
DipException
- if the subscription is not found.public void destroyDipPublication(DipPublication publication) throws DipException
DipFactory
destroyDipPublication
in interface DipFactory
DipException
- if the subscription is not found.public DipData createDipData()
DipFactory
createDipData
in interface DipFactory
public DipBrowser createDipBrowser()
DipFactory
createDipBrowser
in interface DipFactory
public void onPublicationUpdate(DipPublication publication, DipData value)
publication
- The publication that was updated.value
- The DipData packet to send to all listeners.Copyright © 2008–2017 CERN. All rights reserved.