Package org.epics.gpclient
Class GPClient
- java.lang.Object
-
- org.epics.gpclient.GPClient
-
public class GPClient extends Object
The default instance for the gpclient.- Author:
- carcassi
-
-
Constructor Summary
Constructors Constructor Description GPClient()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> ReadCollector<R,R>
cacheLastValue(Class<R> readType)
Keep only the latest value from the channel.static Expression<org.epics.vtype.VType,Object>
channel(String channelName)
A channel that readsVType
s caching the latest value.static <R> Expression<R,Object>
channel(String channelName, ReadCollector<?,R> readCollector)
A channel that reads the given data type with the given strategy.static <R,W>
Expression<R,W>channel(String channelName, ReadCollector<?,R> readCollector, WriteCollector<W> writeCollector)
A channel that reads and writes the given data types with the given strategy.static CollectorExpression<org.epics.vtype.VType,org.epics.vtype.VType,Object>
collector()
An expression that allows to directly send/receive values to/from PVReaders/PVWriters.static <R,C>
CollectorExpression<R,C,Object>collector(ReadCollector<C,R> readCollector)
An expression that allows to directly send/receive values to/from PVReaders/PVWriters.static <R,C,W>
CollectorExpression<R,C,W>collector(ReadCollector<C,R> readCollector, WriteCollector<W> writeCollector)
An expression that allows to directly send/receive values to/from PVReaders/PVWriters.static GPClientInstance
defaultInstance()
The default instance of the general purpose client.static <R> ReadCollector<R,List<R>>
queueAllValues(Class<R> readType)
Return all the values queued from the last update.static PVReaderConfiguration<org.epics.vtype.VType>
read(String channelName)
Reads the channel with the given name, asking forVType
values.static <R> PVReaderConfiguration<R>
read(Expression<R,?> expression)
Reads the given expression.static PVConfiguration<org.epics.vtype.VType,Object>
readAndWrite(String channelName)
Reads and writes the channel with the given name, asking forVType
values.static <R,W>
PVConfiguration<R,W>readAndWrite(Expression<R,W> expression)
Reads and writes the given expression.static Future<org.epics.vtype.VType>
readOnce(String channelName)
Reads the value of the given expression, asking forVType
values.static <R> Future<R>
readOnce(Expression<R,?> expression)
Reads the value of the given expression.static <W> WriteCollector<W>
writeType(Class<W> writeType)
A write buffer for the the given type.
-
-
-
Method Detail
-
readOnce
public static Future<org.epics.vtype.VType> readOnce(String channelName)
Reads the value of the given expression, asking forVType
values.- Parameters:
channelName
- the name of the channel- Returns:
- the future value
-
readOnce
public static <R> Future<R> readOnce(Expression<R,?> expression)
Reads the value of the given expression.- Type Parameters:
R
- the read type- Parameters:
expression
- the expression to read- Returns:
- the future value
-
read
public static PVReaderConfiguration<org.epics.vtype.VType> read(String channelName)
Reads the channel with the given name, asking forVType
values.- Parameters:
channelName
- the name of the channel- Returns:
- the configuration options
-
read
public static <R> PVReaderConfiguration<R> read(Expression<R,?> expression)
Reads the given expression.- Type Parameters:
R
- the read type- Parameters:
expression
- the expression to read- Returns:
- the configuration options
-
readAndWrite
public static PVConfiguration<org.epics.vtype.VType,Object> readAndWrite(String channelName)
Reads and writes the channel with the given name, asking forVType
values.- Parameters:
channelName
- the name of the channel- Returns:
- the configuration options
-
readAndWrite
public static <R,W> PVConfiguration<R,W> readAndWrite(Expression<R,W> expression)
Reads and writes the given expression.- Type Parameters:
R
- the read typeW
- the write type- Parameters:
expression
- the expression to read and write- Returns:
- the configuration options
-
cacheLastValue
public static <R> ReadCollector<R,R> cacheLastValue(Class<R> readType)
Keep only the latest value from the channel.In case of data bursts (i.e. data coming in at rate faster than the reader can handle) this strategy will skip the notification in between, but always notify on the last value.
- Type Parameters:
R
- the type to read- Parameters:
readType
- the type to read- Returns:
- the caching strategy
-
queueAllValues
public static <R> ReadCollector<R,List<R>> queueAllValues(Class<R> readType)
Return all the values queued from the last update.In case of data bursts (i.e. data coming in at rate faster than the reader can handle) this strategy will combine the notifications and return all the values.
- Type Parameters:
R
- the type to read- Parameters:
readType
- the type to read- Returns:
- the caching strategy
-
writeType
public static <W> WriteCollector<W> writeType(Class<W> writeType)
A write buffer for the the given type.- Type Parameters:
W
- the type to write- Parameters:
writeType
- the type to write- Returns:
- the caching strategy
-
channel
public static <R,W> Expression<R,W> channel(String channelName, ReadCollector<?,R> readCollector, WriteCollector<W> writeCollector)
A channel that reads and writes the given data types with the given strategy.- Type Parameters:
R
- the type to readW
- the type to write- Parameters:
channelName
- the name of the channelreadCollector
- the read bufferwriteCollector
- the write buffer- Returns:
- a new channel expression
-
channel
public static <R> Expression<R,Object> channel(String channelName, ReadCollector<?,R> readCollector)
A channel that reads the given data type with the given strategy.- Type Parameters:
R
- the type to read- Parameters:
channelName
- the name of the channelreadCollector
- the read buffer- Returns:
- a new channel expression
-
channel
public static Expression<org.epics.vtype.VType,Object> channel(String channelName)
A channel that readsVType
s caching the latest value.- Parameters:
channelName
- the name of the channel- Returns:
- a new channel expression
-
collector
public static <R,C,W> CollectorExpression<R,C,W> collector(ReadCollector<C,R> readCollector, WriteCollector<W> writeCollector)
An expression that allows to directly send/receive values to/from PVReaders/PVWriters. This can be used for testing purpose or to integrate data models that do not fit datasources or services.- Type Parameters:
R
- the type to readC
- the type to collectW
- the type to write- Parameters:
readCollector
- the read bufferwriteCollector
- the write buffer- Returns:
- a new collector expression
-
collector
public static <R,C> CollectorExpression<R,C,Object> collector(ReadCollector<C,R> readCollector)
An expression that allows to directly send/receive values to/from PVReaders/PVWriters. This can be used for testing purpose or to integrate data models that do not fit datasources or services.- Type Parameters:
R
- the type to readC
- the type to collect- Parameters:
readCollector
- the read buffer- Returns:
- a new collector expression
-
collector
public static CollectorExpression<org.epics.vtype.VType,org.epics.vtype.VType,Object> collector()
An expression that allows to directly send/receive values to/from PVReaders/PVWriters. This can be used for testing purpose or to integrate data models that do not fit datasources or services.- Returns:
- a new collector expression
-
defaultInstance
public static GPClientInstance defaultInstance()
The default instance of the general purpose client.- Returns:
- the default instance
-
-