Package net.messagevortex.blender
Class InitialRecipesBlender
java.lang.Object
net.messagevortex.AbstractDaemon
net.messagevortex.blender.Blender
net.messagevortex.blender.InitialRecipesBlender
- All Implemented Interfaces:
BlendingSender,RunningDaemon,TransportReceiver
-
Constructor Summary
ConstructorsConstructorDescriptionInitialRecipesBlender(String section) An initial blender implementation based on anonymity recipes.InitialRecipesBlender(String identity, BlendingReceiver router, IdentityStore identityStore, Accountant acc) 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.intsetAnonymitySetSize(int newSize) Sets the size of the anonymity set.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
-
InitialRecipesBlender
An initial blender implementation based on anonymity recipes.
- Parameters:
section- the config foile section to be used to configure- Throws:
IOException- if anything fails :-D
-
InitialRecipesBlender
public InitialRecipesBlender(String identity, BlendingReceiver router, IdentityStore identityStore, Accountant acc) 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)acc- the accountant to be used- Throws:
IOException- if anything fails :-D
-
-
Method Details
-
setAnonymitySetSize
public int setAnonymitySetSize(int newSize) Sets the size of the anonymity set.
- Parameters:
newSize- the new size of the set to be used- Returns:
- the previously set size
-
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
-