Package org.openmuc.jeebus.ship.node
Class ShipNode
- java.lang.Object
-
- org.openmuc.jeebus.ship.node.ShipNode
-
public class ShipNode extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description ShipNode(ShipNodeConfiguration nodeConfig, ConnectionHandler connHandler)sets up a SHIP node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClient(ShipClient client)voidautoAcceptMode()activates auto accept modebooleanconsumeAutoAccept()synchronized method to check if auto accept mode is running.ShipClientcreateClient(java.net.URI serverUri)ShipServercreateServer(int port, java.lang.String wssPath, boolean keepAlive)ClientConnectedCallBackgetClientConnectedCB()java.util.List<ShipClient>getClients()ConfigurationgetConfig()ConnectionHandlergetConnHandler()KeyManagementgetKm()java.util.List<ShipServer>getServers()ServiceRegistrygetServiceReg()booleanisAutoAccept()voidsetClient(java.util.List<ShipClient> clients)voidsetClientConnectedCB(ClientConnectedCallBack clientConnectedCB)voidsetConnHandler(ConnectionHandler connHandler)voidsetKm(KeyManagement km)voidsetServers(java.util.List<ShipServer> servers)voidsetServiceReg(ServiceRegistry serviceReg)voidstopAllClients()voidstopAllServers()
-
-
-
Constructor Detail
-
ShipNode
public ShipNode(ShipNodeConfiguration nodeConfig, ConnectionHandler connHandler)
sets up a SHIP node- Parameters:
nodeConfig- SHIP node configuration parametersconnHandler- connection handler to handle all interactions with SHIP peer
-
-
Method Detail
-
createClient
public ShipClient createClient(java.net.URI serverUri)
-
createServer
public ShipServer createServer(int port, java.lang.String wssPath, boolean keepAlive)
-
autoAcceptMode
public void autoAcceptMode()
activates auto accept mode
-
consumeAutoAccept
public boolean consumeAutoAccept()
synchronized method to check if auto accept mode is running. Cancels the timeout if it is and sets auto accept to false.- Returns:
trueif SHIP node was in auto accept mode, else returnsfalse
-
stopAllServers
public void stopAllServers()
-
stopAllClients
public void stopAllClients()
-
getServiceReg
public ServiceRegistry getServiceReg()
-
setServiceReg
public void setServiceReg(ServiceRegistry serviceReg)
-
getServers
public java.util.List<ShipServer> getServers()
-
setServers
public void setServers(java.util.List<ShipServer> servers)
-
getClients
public java.util.List<ShipClient> getClients()
-
setClient
public void setClient(java.util.List<ShipClient> clients)
-
addClient
public void addClient(ShipClient client)
-
getKm
public KeyManagement getKm()
-
setKm
public void setKm(KeyManagement km)
-
isAutoAccept
public boolean isAutoAccept()
-
getConfig
public Configuration getConfig()
-
getConnHandler
public ConnectionHandler getConnHandler()
-
setConnHandler
public void setConnHandler(ConnectionHandler connHandler)
-
getClientConnectedCB
public ClientConnectedCallBack getClientConnectedCB()
-
setClientConnectedCB
public void setClientConnectedCB(ClientConnectedCallBack clientConnectedCB)
-
-