public class ControlBroker extends Object implements SharedObjectListener, Broker, MessageListener
Constructor and Description |
---|
ControlBroker(ModuleContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addNewPeer(SpaceDescriptor spaceDescriptor,
PeerCard peer) |
void |
buildSpace(SpaceCard spaceCard) |
void |
configureChannels(List<ChannelDescriptor> communicationChannels,
String peerName)
Only configures the communication channels by creating a list of channels
for the Communication Module
|
void |
configurePeeringChannel(ChannelDescriptor peeringChannel,
String peerName)
Configures the peering channel by configuring the SpaceModule and by
creating a new channel for the Communication Module
|
void |
destroySpace(SpaceCard spaceCard) |
List<SpaceCard> |
discoverSpace(Dictionary<String,String> filters) |
void |
dispose()
Release the resources
|
Map<PeerCard,Map<String,Serializable>> |
findMatchingPeers(Map<String,Serializable> filter,
int limit,
int timeout) |
String |
getBrokerName() |
PeerCard |
getmyPeerCard()
This method returns the PeerCard of the current MW instance
|
SpaceDescriptor |
getMySpaceDescriptor()
This method returns the SpaceDescriptor of my Space
|
List<String> |
getPeersAddress() |
void |
handleSendError(ChannelMessage message,
CommunicationConnectorException e)
Callback for error handling
|
boolean |
init() |
void |
installArtefactLocally(String serializedPart) |
void |
join(PeerCard spaceCoordinator,
SpaceCard spaceCard) |
void |
joinRequest(SpaceCard spaceCard,
PeerCard sender) |
void |
leaveRequest(SpaceDescriptor spaceDescriptor) |
void |
leaveSpace(PeerCard spaceCoordinator,
SpaceCard spaceCard) |
void |
messageReceived(ChannelMessage message)
Callback for the reception of messages
|
void |
newPeerAdded(SpaceCard spaceCard,
PeerCard peer) |
void |
newSpaceFound(Set<SpaceCard> spaceCards) |
void |
notifyRequestToInstallPart(UAPPCard mpaCard,
String partID,
UAPPPartStatus partStatus) |
void |
peerFound(PeerCard peer) |
void |
peerLost(PeerCard sender) |
void |
renewSpace(SpaceCard spaceCard) |
Map<String,Serializable> |
requestPeerAttributes(List<String> attributes,
PeerCard target,
int limit,
int timeout) |
void |
requestPeerCard(String peerAddress) |
void |
requestToInstallPart(byte[] partAsZip,
PeerCard target,
UAPPCard card)
This method allows to request the installation of an uApp part to a
target node
|
void |
requestToLeave(SpaceDescriptor spaceDescriptor) |
void |
requestToUninstallPart(PeerCard target,
UAPPCard card)
This method allows to request the installation of an uApp part to a
target node
|
void |
resetModule(List<ChannelDescriptor> channels) |
void |
sendConfigurationMessage(ConfigurationMessage cm)
Send a Configuration Message.
|
void |
sendMessage(BrokerMessage msg,
List<PeerCard> receivers)
Send a message.
|
void |
sharedObjectAdded(Object sharedObj,
Object removeHook) |
void |
sharedObjectRemoved(Object arg0) |
void |
signalSpaceStatus(SpaceStatus status,
SpaceDescriptor spaceDescriptor) |
void |
spaceJoined(SpaceDescriptor descriptor) |
BrokerMessage |
unmarshall(String message)
From String to Broker Message
|
public ControlBroker(ModuleContext context)
public List<SpaceCard> discoverSpace(Dictionary<String,String> filters)
public void buildSpace(SpaceCard spaceCard)
public void sharedObjectAdded(Object sharedObj, Object removeHook)
sharedObjectAdded
in interface SharedObjectListener
public void sharedObjectRemoved(Object arg0)
sharedObjectRemoved
in interface SharedObjectListener
public void leaveRequest(SpaceDescriptor spaceDescriptor)
public void requestToLeave(SpaceDescriptor spaceDescriptor)
public void peerLost(PeerCard sender)
public PeerCard getmyPeerCard()
public SpaceDescriptor getMySpaceDescriptor()
public void spaceJoined(SpaceDescriptor descriptor)
public void peerFound(PeerCard peer)
public void configureChannels(List<ChannelDescriptor> communicationChannels, String peerName)
communicationChannels
- public void configurePeeringChannel(ChannelDescriptor peeringChannel, String peerName)
peeringChannel
- public void resetModule(List<ChannelDescriptor> channels)
public void destroySpace(SpaceCard spaceCard)
public void addNewPeer(SpaceDescriptor spaceDescriptor, PeerCard peer)
public void requestToUninstallPart(PeerCard target, UAPPCard card)
target
- The node into which to install the partcard
- The reference information of the part of the application
within a service to installpublic void requestToInstallPart(byte[] partAsZip, PeerCard target, UAPPCard card)
partAsZip
- The part serialized as a String. The payload of the
DeployMessage has to be a stringtarget
- The node into which to install the partcard
- The reference information of the part of the application
within a service to installpublic void notifyRequestToInstallPart(UAPPCard mpaCard, String partID, UAPPPartStatus partStatus)
mpaCard
- partID
- peer
- The peer notifying the staus of the partpartStatus
- public String getBrokerName()
getBrokerName
in interface Broker
public void handleSendError(ChannelMessage message, CommunicationConnectorException e)
MessageListener
handleSendError
in interface MessageListener
public void messageReceived(ChannelMessage message)
MessageListener
messageReceived
in interface MessageListener
public void installArtefactLocally(String serializedPart)
public void requestPeerCard(String peerAddress)
public void dispose()
Broker
public void renewSpace(SpaceCard spaceCard)
public void signalSpaceStatus(SpaceStatus status, SpaceDescriptor spaceDescriptor)
public BrokerMessage unmarshall(String message)
Broker
unmarshall
in interface Broker
public Map<String,Serializable> requestPeerAttributes(List<String> attributes, PeerCard target, int limit, int timeout)
public Map<PeerCard,Map<String,Serializable>> findMatchingPeers(Map<String,Serializable> filter, int limit, int timeout)
public void sendConfigurationMessage(ConfigurationMessage cm)
cm
- public void sendMessage(BrokerMessage msg, List<PeerCard> receivers)
Copyright © 2018 universAAL Consortium. All rights reserved.