Package cern.dip.implementation
Class DipPublicationImp
- java.lang.Object
-
- cern.dip.implementation.FactoryProduct
-
- cern.dip.implementation.DipPublicationImpBase
-
- cern.dip.implementation.DipPublicationImp
-
- All Implemented Interfaces:
DipPublication
public class DipPublicationImp extends DipPublicationImpBase
Wrapper for the C++ implementation of a DipPublication.
-
-
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 DipPublicationImp(DipFactory fact, java.lang.String topicName, DipPublicationErrorHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Remove C++ implementation if user forgot to call DipFactory.destroyPublicationprotected DipFactory
getFactory()
void
handleException(DipException ex)
Delegates to the error handler.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 data, DipTimestamp timestamp)
generic send data method used by all send data implementations.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
getTopicName, 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
-
DipPublicationImp
public DipPublicationImp(DipFactory fact, java.lang.String topicName, DipPublicationErrorHandler handler) throws DipException
- Throws:
DipException
-
-
Method Detail
-
getFactory
protected DipFactory getFactory()
- Specified by:
getFactory
in classDipPublicationImpBase
-
finalize
public void finalize()
Remove C++ implementation if user forgot to call DipFactory.destroyPublication- Overrides:
finalize
in classjava.lang.Object
-
sendData
protected void sendData(DipData data, DipTimestamp timestamp) throws DipException
generic send data method used by all send data implementations.- Specified by:
sendData
in classDipPublicationImpBase
- Throws:
DipException
-
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
-
handleException
public void handleException(DipException ex)
Delegates to the error handler. This is an entry point for the C++ implementation.
-
setDestroyed
protected void setDestroyed()
Mark object as destoyed - will cause the C++ representation to be removed- Specified by:
setDestroyed
in classFactoryProduct
-
-