Package com.example.consumer1
Class Consumer
- java.lang.Object
-
- com.example.consumer1.Consumer
-
public class Consumer extends Object
This is an example consumer which matchesProviderin functionalityThis consumer executes the following steps and prints whether each step was successful 1. discovery of device with specific endpoint 2. connect to device with specific endpoint 3. read mdib of provider 4. subscribe metrics, alerts, waveforms 5. check that least one patient context exists 6. check that at least one location context exists 7. check that the metric (see above) changes within 30 seconds at least 5 times 8. check that the alert condition (see above)change within 30 seconds at least 5 times 9. execute operations (Activate, SetString, SetValue) as specified and check that result is “finished”
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.somda.sdc.dpws.client.ClientgetClient()SdcRemoteDevicesConnectorgetConnector()static voidmain(String[] args)static org.apache.commons.cli.CommandLineparseCommandLineArgs(String[] args)Parse command line arguments for epr address and network interfaceprotected voidshutDown()protected voidstartUp()
-
-
-
Constructor Detail
-
Consumer
public Consumer(@Nullable String adapterName) throws SocketException, UnknownHostExceptionCreates an SDC Consumer instance.- Parameters:
adapterName- Optional adapter name to bind to, otherwise localhost default interface is chosen- Throws:
SocketException- if network adapter couldn't be boundUnknownHostException- if localhost couldn't be determined
-
-
Method Detail
-
getClient
public org.somda.sdc.dpws.client.Client getClient()
-
getConnector
public SdcRemoteDevicesConnector getConnector()
-
startUp
protected void startUp() throws SocketException- Throws:
SocketException
-
shutDown
protected void shutDown()
-
parseCommandLineArgs
public static org.apache.commons.cli.CommandLine parseCommandLineArgs(String[] args)
Parse command line arguments for epr address and network interface- Parameters:
args- array of arguments, as passed to main- Returns:
- instance of parsed command line arguments
-
main
public static void main(String[] args) throws SocketException, UnknownHostException, org.somda.sdc.dpws.soap.interception.InterceptorException, org.somda.sdc.dpws.soap.exception.TransportException, InterruptedException
- Throws:
SocketExceptionUnknownHostExceptionorg.somda.sdc.dpws.soap.interception.InterceptorExceptionorg.somda.sdc.dpws.soap.exception.TransportExceptionInterruptedException
-
-