public class AALSpaceModuleImpl extends Object implements AALSpaceModule, MessageListener, SharedObjectListener, ServiceListener, Broker
Constructor and Description |
---|
AALSpaceModuleImpl(ModuleContext context) |
Modifier and Type | Method and Description |
---|---|
void |
aalSpaceLost(AALSpaceCard spaceCard)
Called when an AALSpace has been destroyed
|
void |
addPeer(AALSpaceDescriptor spaceDescriptor,
PeerCard newPeer)
This method allows to add a new Peer to the AALSpace.
|
void |
announceNewPeer(AALSpaceCard spaceCard,
PeerCard peerCard)
This method propagates the event of new PeerAdded to the whole AALSpace
|
void |
configureAALSpaceChannel()
This method configures the channel used in order to send/receive AAL
Space messages
|
void |
destroyAALSpace(AALSpaceCard spaceCard)
Destroy an AAL Space
|
void |
dispose()
Routine in order to release resources
|
List<AALSpaceCard> |
getAALSpaces()
This method fetches a list of AALSpaces without any filter
|
List<AALSpaceCard> |
getAALSpaces(Dictionary<String,String> filters)
This method fetches a list of AALSpaces according to a filter
|
String |
getBrokerName() |
String |
getDescription() |
String |
getName() |
List<String> |
getPeersAddress()
This method fetches the list of peer address joining to the same AAL
Space
|
String |
getProvider() |
String |
getVersion() |
void |
handleSendError(ChannelMessage message,
CommunicationConnectorException exception)
Callback for error handling
|
boolean |
init()
This method configures the AALSpaceModule: -to obtain the reference to
all the DiscoveryConnector present in the fw -to obtain the reference to
the CommunicationModdule -to obtain the reference to the ControlBroker
|
void |
joinAALSpace(PeerCard spaceCoordinator,
AALSpaceCard spaceCard)
This method allows to join to an existing AALSpace
|
void |
leaveAALSpace(PeerCard spaceCoordinator,
AALSpaceCard spaceCard)
This method allows to leave an AALSpace
|
void |
loadConfigurations(Dictionary configurations) |
void |
messageFromSpace(AALSpaceMessage message,
PeerCard sender)
This method is called as soon as an AALSpaceMessage has been received
|
void |
messageReceived(ChannelMessage message)
Callback for the reception of messages
|
void |
newAALSpace(AALSpaceCard aalSpaceCard)
This method creates a new AALSpace
|
void |
newAALSpacesFound(Set<AALSpaceCard> spaceCards)
Called when a new AALSpace has been found
|
void |
renewAALSpace(AALSpaceCard spaceCard)
This method renews the AALSpace
|
void |
requestPeerCard(AALSpaceDescriptor spaceDescriptor,
String peerAddress)
This method allows to send a request for the PeerCard of the peer with
the specified address
|
void |
requestToLeave(AALSpaceDescriptor spaceDescriptor)
This method announces to all the peers to leave the AAL space
|
void |
sharedObjectAdded(Object arg0,
Object arg1) |
void |
sharedObjectRemoved(Object arg0) |
BrokerMessage |
unmarshall(String message)
From String to Broker Message
|
public AALSpaceModuleImpl(ModuleContext context)
public boolean init()
public List<AALSpaceCard> getAALSpaces()
AALSpaceModule
getAALSpaces
in interface AALSpaceModule
public List<AALSpaceCard> getAALSpaces(Dictionary<String,String> filters) throws AALSpaceModuleException
AALSpaceModule
getAALSpaces
in interface AALSpaceModule
filters
- A set of key, value pairs for filtering the AAL SpacesAALSpaceModuleException
public void newAALSpace(AALSpaceCard aalSpaceCard) throws AALSpaceModuleException
AALSpaceModule
newAALSpace
in interface AALSpaceModule
AALSpaceModuleException
public String getDescription()
getDescription
in interface Module
public String getProvider()
getProvider
in interface Module
public String getVersion()
getVersion
in interface Module
public void loadConfigurations(Dictionary configurations)
loadConfigurations
in interface Module
public void leaveAALSpace(PeerCard spaceCoordinator, AALSpaceCard spaceCard)
AALSpaceModule
leaveAALSpace
in interface AALSpaceModule
public void requestToLeave(AALSpaceDescriptor spaceDescriptor)
AALSpaceModule
requestToLeave
in interface AALSpaceModule
public void requestPeerCard(AALSpaceDescriptor spaceDescriptor, String peerAddress)
AALSpaceModule
requestPeerCard
in interface AALSpaceModule
spaceDescriptor
- the AAL Space descriptorpeerAddress
- the address of the peerpublic void newAALSpacesFound(Set<AALSpaceCard> spaceCards)
ServiceListener
newAALSpacesFound
in interface ServiceListener
public void joinAALSpace(PeerCard spaceCoordinator, AALSpaceCard spaceCard)
AALSpaceModule
joinAALSpace
in interface AALSpaceModule
spaceCoordinator
- The PeerCard of the AALSpace coordinator to which to sent the
requestpublic void addPeer(AALSpaceDescriptor spaceDescriptor, PeerCard newPeer)
AALSpaceModule
addPeer
in interface AALSpaceModule
newPeer
- The Peer to add to the AALSpacepublic void announceNewPeer(AALSpaceCard spaceCard, PeerCard peerCard)
AALSpaceModule
announceNewPeer
in interface AALSpaceModule
peerCard
- The new peer addedpublic void messageFromSpace(AALSpaceMessage message, PeerCard sender) throws AALSpaceModuleException
AALSpaceModule
messageFromSpace
in interface AALSpaceModule
AALSpaceModuleException
public void configureAALSpaceChannel()
AALSpaceModule
configureAALSpaceChannel
in interface AALSpaceModule
public void messageReceived(ChannelMessage message)
MessageListener
messageReceived
in interface MessageListener
public void handleSendError(ChannelMessage message, CommunicationConnectorException exception) throws AALSpaceModuleException
MessageListener
handleSendError
in interface MessageListener
AALSpaceModuleException
public void destroyAALSpace(AALSpaceCard spaceCard)
AALSpaceModule
destroyAALSpace
in interface AALSpaceModule
public void aalSpaceLost(AALSpaceCard spaceCard)
ServiceListener
aalSpaceLost
in interface ServiceListener
spaceCard
- Information about the AALSpacepublic void sharedObjectAdded(Object arg0, Object arg1)
sharedObjectAdded
in interface SharedObjectListener
public void sharedObjectRemoved(Object arg0)
sharedObjectRemoved
in interface SharedObjectListener
public String getBrokerName()
getBrokerName
in interface Broker
public void dispose()
Module
public List<String> getPeersAddress()
AALSpaceModule
getPeersAddress
in interface AALSpaceModule
public void renewAALSpace(AALSpaceCard spaceCard)
AALSpaceModule
renewAALSpace
in interface AALSpaceModule
public BrokerMessage unmarshall(String message)
Broker
unmarshall
in interface Broker
Copyright © 2015 universAAL Consortium. All Rights Reserved.