|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.ri.gateway.communicator.service.impl.GatewayCommunicatorImpl
public class GatewayCommunicatorImpl
AALSpace Gateway Communicator implementation. Registers one OSGi service to be used by ImportExportManager, one HTTP service for communication with other communicators. Uses ImportExportManager's OSGi service for request/response delegation.
Field Summary |
---|
Fields inherited from interface org.universAAL.ri.gateway.communicator.service.GatewayCommunicator |
---|
ALIAS_PREFIX, EXPORT_SECURITY_CONSTRAINT_ALLOW, EXPORT_SECURITY_CONSTRAINT_DENY, HASH_KEY, IMPORT_SECURITY_CONSTRAINT_ALLOW, IMPORT_SECURITY_CONSTRAINT_DENY, LOCAL_SOCKET_PORT, REMOTE_GATEWAYS_PROP |
Constructor Summary | |
---|---|
GatewayCommunicatorImpl()
Initializes the worker with given ImportExportManager reference. |
Method Summary | |
---|---|
void |
addRemoteGateway(GatewayAddress gwAddrToAdd)
|
void |
addRemoteGateways(Collection<GatewayAddress> gwAddressesToAdd)
|
void |
handleMessage(InputStream in,
OutputStream out)
|
void |
removeRemoteGateway(GatewayAddress gwAddrToDelete)
|
void |
sendContextEvent(Message message)
|
void |
sendContextEvent(Message message,
URL[] to)
Sends a context event to other AALSpace Gateway Communicators listening at given URL. |
void |
sendImportRefresh(Message message)
|
void |
sendImportRefresh(Message message,
URL[] to)
|
void |
sendImportRemoval(Message message)
|
void |
sendImportRemoval(Message message,
URL[] to)
|
Message |
sendImportRequest(Message message)
|
Message[] |
sendImportRequest(Message message,
URL[] to)
|
Message[] |
sendServiceRequest(Message message)
|
Message[] |
sendServiceRequest(Message message,
long timeout)
|
Message |
sendServiceRequest(Message message,
URL to)
|
Message[] |
sendServiceRequest(Message message,
URL[] to)
Sends a service request to another AALSpace Gateway Communicator listening at given URL, waits for the response and returns it. |
Message[] |
sendServiceRequest(Message message,
URL[] to,
long timeout)
Sends a service request to another AALSpace Gateway Communicator listening at given URL, waits for the response and returns it if arrived before timing out. |
void |
sendServiceRequestAsync(Message message,
URL returnTo,
URL to,
ResponseCallback callback)
Sends a service request to another AALSpace Gateway Communicator listening at given URL, registers callback which will be notified once the response arrives. |
void |
sendUIRequest(Message message)
|
void |
sendUIRequest(Message message,
URL[] to)
Sends a ui call to other AALSpace Gateway Communicators listening at given URL. |
void |
sendUIResponse(Message message)
|
void |
sendUIResponse(Message message,
URL[] to)
Sends a ui response to other AALSpace Gateway Communicators listening at given URL. |
void |
setManagers(ImportManager importManager,
ExportManager exportManager)
|
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GatewayCommunicatorImpl() throws Exception
space
- ImportExportManager reference for request/response delegation
Exception
Method Detail |
---|
public void addRemoteGateway(GatewayAddress gwAddrToAdd)
public void removeRemoteGateway(GatewayAddress gwAddrToDelete)
public void addRemoteGateways(Collection<GatewayAddress> gwAddressesToAdd)
public void setManagers(ImportManager importManager, ExportManager exportManager)
public void sendContextEvent(Message message, URL[] to)
sendContextEvent
in interface GatewayCommunicator
message
- context event to be sentto
- a list of URLs of remote communicators to which the event
should be deliveredpublic void sendUIRequest(Message message, URL[] to)
sendUIRequest
in interface GatewayCommunicator
message
- context event to be sentto
- a list of URLs of remote communicators to which the event
should be deliveredpublic void sendUIResponse(Message message, URL[] to)
sendUIResponse
in interface GatewayCommunicator
message
- ui responseto
- a list of URLs of remote communicators to which the event
should be deliveredpublic Message[] sendServiceRequest(Message message, URL[] to)
sendServiceRequest
in interface GatewayCommunicator
message
- request massage to be sent to the remote communicatorto
- remote communicator's URL
public Message sendServiceRequest(Message message, URL to)
public Message[] sendServiceRequest(Message message, URL[] to, long timeout) throws TimeoutException
sendServiceRequest
in interface GatewayCommunicator
message
- request massage to be sent to the remote communicatorto
- remote communicator's URLtimeout
- time in milliseconds to wait for the response
TimeoutException
- when timed outpublic void sendServiceRequestAsync(Message message, URL returnTo, URL to, ResponseCallback callback)
sendServiceRequestAsync
in interface GatewayCommunicator
message
- request massage to be sent to the remote communicatorreturnTo
- local communicator's URL to send back the response toto
- remote communicator's URLcallback
- callback which will be notified once the response arrivespublic Message[] sendImportRequest(Message message, URL[] to)
sendImportRequest
in interface GatewayCommunicator
public void sendImportRefresh(Message message, URL[] to)
sendImportRefresh
in interface GatewayCommunicator
public void sendImportRemoval(Message message, URL[] to)
sendImportRemoval
in interface GatewayCommunicator
public Message[] sendServiceRequest(Message message)
sendServiceRequest
in interface GatewayCommunicator
public Message[] sendServiceRequest(Message message, long timeout) throws TimeoutException
sendServiceRequest
in interface GatewayCommunicator
TimeoutException
public void sendContextEvent(Message message)
sendContextEvent
in interface GatewayCommunicator
public void sendUIResponse(Message message)
sendUIResponse
in interface GatewayCommunicator
public void sendUIRequest(Message message)
sendUIRequest
in interface GatewayCommunicator
public Message sendImportRequest(Message message)
sendImportRequest
in interface GatewayCommunicator
public void sendImportRefresh(Message message)
sendImportRefresh
in interface GatewayCommunicator
public void sendImportRemoval(Message message)
sendImportRemoval
in interface GatewayCommunicator
public void handleMessage(InputStream in, OutputStream out)
handleMessage
in interface GatewayCommunicator
public void stop()
stop
in interface GatewayCommunicator
public void start() throws Exception
start
in interface GatewayCommunicator
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |