Package cern.dip.mock
Class MockDipPublication
- java.lang.Object
-
- cern.dip.implementation.FactoryProduct
-
- cern.dip.implementation.DipPublicationImpBase
-
- cern.dip.mock.MockDipPublication
-
- All Implemented Interfaces:
DipPublication
public class MockDipPublication extends DipPublicationImpBase
-
-
Field Summary
-
Fields inherited from class cern.dip.implementation.DipPublicationImpBase
name
-
Fields inherited from class cern.dip.implementation.FactoryProduct
destroyed
-
-
Constructor Summary
Constructors Constructor Description MockDipPublication(MockDipFactory factory, java.lang.String topicName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPublicationErrorHandler(DipPublicationErrorHandler handler)
protected DipFactory
getFactory()
java.lang.String
getTopicName()
Returns Name of the publication.void
send(DipData value, DipTimestamp timestamp)
Send complex data object.void
send(DipData value, DipTimestamp timestamp, int dipQuality, java.lang.String qualityReason)
Send complex data object with quality informationprotected void
sendData(DipData value, DipTimestamp timestamp)
protected void
setDestroyed()
Mark object as destoyed - will cause the C++ representation to be removedvoid
setQualityBad()
The quality of the last sent data is set to bad.void
setQualityBad(java.lang.String reason)
As setQualityBad() but enables the user to pass a string to the clients explaining why there is a problemvoid
setQualityUncertain()
The quality of the last sent data is set to uncertain.void
setQualityUncertain(java.lang.String reason)
As setQualityUncertain() but enables the user to pass a string to the clients explaining why there is a problem-
Methods inherited from class cern.dip.implementation.DipPublicationImpBase
send, send, send, send, send, send, send, send, send, send, send, send, send, send, send, send
-
Methods inherited from class cern.dip.implementation.FactoryProduct
isDestroyed, validate
-
-
-
-
Constructor Detail
-
MockDipPublication
public MockDipPublication(MockDipFactory factory, java.lang.String topicName)
-
-
Method Detail
-
getTopicName
public java.lang.String getTopicName()
Description copied from interface:DipPublication
Returns Name of the publication.- Specified by:
getTopicName
in interfaceDipPublication
- Overrides:
getTopicName
in classDipPublicationImpBase
-
getFactory
protected DipFactory getFactory()
- Specified by:
getFactory
in classDipPublicationImpBase
-
addPublicationErrorHandler
public void addPublicationErrorHandler(DipPublicationErrorHandler handler)
-
send
public void send(DipData value, DipTimestamp timestamp) throws DipException
Description copied from interface:DipPublication
Send complex data object.- Parameters:
value
- - data to be sent.timestamp
- - time data was obtained.- Throws:
DipException
-
send
public void send(DipData value, DipTimestamp timestamp, int dipQuality, java.lang.String qualityReason) throws DipException
Description copied from interface:DipPublication
Send complex data object with quality information- Parameters:
value
- - data to be sent.timestamp
- - time data was obtained.dipQuality
- - the quality of the dataqualityReason
- - the reason for the data quality- Throws:
DipException
-
setQualityBad
public void setQualityBad() throws DipException
Description copied from interface:DipPublication
The quality of the last sent data is set to bad. If this causes a change to the previous quality then the data (value, quality and timestamp) will be sent to all clients. This quality is to be used when the data obtained from the source for the publication is not valid. So instead of introducing bad data into DIP (and thus overwriting the last good value), the quality is set to bad, so still making the last good value available to clients who can make use of it.- Throws:
DipException
-
setQualityBad
public void setQualityBad(java.lang.String reason) throws DipException
Description copied from interface:DipPublication
As setQualityBad() but enables the user to pass a string to the clients explaining why there is a problem- Throws:
DipException
-
setQualityUncertain
public void setQualityUncertain() throws DipException
Description copied from interface:DipPublication
The quality of the last sent data is set to uncertain. If this causes a change to the previous quality then the data (value, quality and timestamp) will be sent to all clients. This quality is to be used when the data source for the publication is not reachable - thus we can not be certain if the value last sent is still valid.- Throws:
DipException
-
setQualityUncertain
public void setQualityUncertain(java.lang.String reason) throws DipException
Description copied from interface:DipPublication
As setQualityUncertain() but enables the user to pass a string to the clients explaining why there is a problem- Throws:
DipException
-
sendData
protected void sendData(DipData value, DipTimestamp timestamp) throws DipException
- Specified by:
sendData
in classDipPublicationImpBase
- Throws:
DipException
-
setDestroyed
protected void setDestroyed()
Description copied from class:FactoryProduct
Mark object as destoyed - will cause the C++ representation to be removed- Specified by:
setDestroyed
in classFactoryProduct
-
-