org.epics.pvmanager
Class DataRecipe

java.lang.Object
  extended by org.epics.pvmanager.DataRecipe

public class DataRecipe
extends java.lang.Object

Represents all the information necessary to connect to a DataSource. It represents the contact between PVManager and the DataSource.

Author:
carcassi

Constructor Summary
DataRecipe()
          Creates an empty data recipe.
DataRecipe(ExceptionHandler exceptionHandler)
           
 
Method Summary
 java.util.Collection<ChannelRecipe> getChannelRecipes()
           
 java.util.Map<Collector<?>,java.util.Map<java.lang.String,ValueCache>> getChannelsPerCollectors()
          Returns all channels that need to be connected, organized by the collector that needs them.
 java.util.Map<java.lang.String,ValueCache<java.lang.Boolean>> getConnectionCaches()
           
 Collector<java.lang.Boolean> getConnectionCollector()
           
 ExceptionHandler getExceptionHandler()
          Returns the exception handler to be used for this PV.
 DataRecipe includeCollector(Collector<?> collector, java.util.Map<java.lang.String,ValueCache> caches)
          Creates a new recipe by adding the new collector and the new caches.
 DataRecipe includeRecipe(DataRecipe dataRecipe)
          Creates a new recipe by adding the given recipe to this one.
 DataRecipe withExceptionHandler(ExceptionHandler handler)
          Creates a new data recipe with the given handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRecipe

public DataRecipe()
Creates an empty data recipe.


DataRecipe

public DataRecipe(ExceptionHandler exceptionHandler)
Method Detail

includeCollector

public DataRecipe includeCollector(Collector<?> collector,
                                   java.util.Map<java.lang.String,ValueCache> caches)
Creates a new recipe by adding the new collector and the new caches.

Note: this method should be only used for testing as it does not scale.

Parameters:
collector - the new collector
caches - the caches that the collector depends on
Returns:
the new recipe

includeRecipe

public DataRecipe includeRecipe(DataRecipe dataRecipe)
Creates a new recipe by adding the given recipe to this one.

Note: this method should be only used for testing as it does not scale.

Parameters:
dataRecipe - the recipe to include
Returns:
the new recipe

getChannelsPerCollectors

public java.util.Map<Collector<?>,java.util.Map<java.lang.String,ValueCache>> getChannelsPerCollectors()
Returns all channels that need to be connected, organized by the collector that needs them.

Every time there is a new value, the data source will need to lock the collector, put the values in the value cache relative for each channel, and notify the collector.

Returns:
a map with all the channels organized by collector.

getExceptionHandler

public ExceptionHandler getExceptionHandler()
Returns the exception handler to be used for this PV.

Returns:
the exception handler

withExceptionHandler

public DataRecipe withExceptionHandler(ExceptionHandler handler)
Creates a new data recipe with the given handler.

Parameters:
handler - a new exception handler
Returns:
a new data recipe

getConnectionCollector

public Collector<java.lang.Boolean> getConnectionCollector()

getConnectionCaches

public java.util.Map<java.lang.String,ValueCache<java.lang.Boolean>> getConnectionCaches()

getChannelRecipes

public java.util.Collection<ChannelRecipe> getChannelRecipes()