Package net.messagevortex.blender
Class DummyBlender
java.lang.Object
net.messagevortex.AbstractDaemon
net.messagevortex.blender.Blender
net.messagevortex.blender.DummyBlender
- All Implemented Interfaces:
BlendingSender,RunningDaemon,TransportReceiver
This Dummy blender supports only plain blending without an offset.
-
Constructor Summary
ConstructorsConstructorDescriptionDummyBlender(String section) A dummy blender implementation.DummyBlender(String identity, BlendingReceiver router, IdentityStore identityStore) Creates a passthru blender which abstracts a local transport media. -
Method Summary
Modifier and TypeMethodDescriptionbooleanblendMessage(BlendingSpec target, VortexMessage msg) This method is called by the router layer to blend a message.byte[]blendMessageToBytes(BlendingSpec target, VortexMessage msg) Blends a VortexMessage into the apropriate text.Returns the address supported for blender.booleanThis Method is called by the TransportSender layer if a possible vmessage has arrived.unblendMessage(byte[] blendedMessage) Extracts a vortexMessage from a blended message.Methods inherited from class net.messagevortex.blender.Blender
getTransportSender, getVerifier, setBlenderReceiver, setIncomingMessageListener, setTransportSender, setVerifierMethods inherited from class net.messagevortex.AbstractDaemon
shutdownDaemon, startDaemon, stopDaemonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.messagevortex.RunningDaemon
shutdownDaemon, startDaemon, stopDaemon
-
Constructor Details
-
DummyBlender
A dummy blender implementation.
- Parameters:
section- the config foile section to be used to configure- Throws:
IOException- if anything fails :-D
-
DummyBlender
public DummyBlender(String identity, BlendingReceiver router, IdentityStore identityStore) throws IOException Creates a passthru blender which abstracts a local transport media.
- Parameters:
identity- the identity (receiver/sender address)router- the router layer to be usedidentityStore- the identity store to be used (for decryption of headers)- Throws:
IOException- if anything fails :-D
-
-
Method Details
-
getBlendingAddress
Description copied from class:BlenderReturns the address supported for blender.
The address is specified by <transport><address>!<publickey>.
- Specified by:
getBlendingAddressin classBlender- Returns:
- The vortex adress.
-
blendMessageToBytes
Description copied from class:BlenderBlends a VortexMessage into the apropriate text.
- Specified by:
blendMessageToBytesin classBlender- Parameters:
target- the blending spec for the recipientmsg- the message to be blended- Returns:
- the blended message
-
unblendMessage
Description copied from class:BlenderExtracts a vortexMessage from a blended message.
- Specified by:
unblendMessagein classBlender- Parameters:
blendedMessage- the blended message- Returns:
- the VortexMessage
-
blendMessage
Description copied from class:BlenderThis method is called by the router layer to blend a message.
- Specified by:
blendMessagein interfaceBlendingSender- Specified by:
blendMessagein classBlendermsg- the message to be blended- Returns:
- true if blended successfully and sent by the transport layer
-
gotMessage
Description copied from interface:TransportReceiverThis Method is called by the TransportSender layer if a possible vmessage has arrived.
The message (if any) is decoded, verified and (if successful) passed on to the router layer in a separate thread (@see IncommingMessageRouterListener).
- Parameters:
is- the InputStream containing a possible message- Returns:
- true if message got accepted
-