diff options
Diffstat (limited to 'jsonrpc/src/main/java/com/orbekk/same')
-rw-r--r-- | jsonrpc/src/main/java/com/orbekk/same/SameService.java | 6 | ||||
-rw-r--r-- | jsonrpc/src/main/java/com/orbekk/same/SameServiceImpl.java | 31 |
2 files changed, 37 insertions, 0 deletions
diff --git a/jsonrpc/src/main/java/com/orbekk/same/SameService.java b/jsonrpc/src/main/java/com/orbekk/same/SameService.java new file mode 100644 index 0000000..dccc1e9 --- /dev/null +++ b/jsonrpc/src/main/java/com/orbekk/same/SameService.java @@ -0,0 +1,6 @@ +package com.orbekk.same; + +public interface SameService { + void notifyNetwork(String networkName); + String participateNetwork(String networkName); +} diff --git a/jsonrpc/src/main/java/com/orbekk/same/SameServiceImpl.java b/jsonrpc/src/main/java/com/orbekk/same/SameServiceImpl.java new file mode 100644 index 0000000..56a0fa1 --- /dev/null +++ b/jsonrpc/src/main/java/com/orbekk/same/SameServiceImpl.java @@ -0,0 +1,31 @@ +package com.orbekk.same; + +import java.util.List; +import java.util.LinkedList; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SameServiceImpl implements SameService { + private Logger logger = LoggerFactory.getLogger(getClass()); + private List<String> participants = new LinkedList<String>(); + private String networkName; + + public SameServiceImpl(String networkName) { + this.networkName = networkName; + } + + @Override + public void notifyNetwork(String networkName) { + logger.info("Notification from network " + networkName); + } + + @Override + public String participateNetwork(String networkName) { + logger.info("Got participation request."); + if (networkName != this.networkName) { + logger.info("Network name mismatch."); + } + return "<Not implemented>"; + } +} |