Class DummyBlender

All Implemented Interfaces:
BlendingSender, RunningDaemon, TransportReceiver

public class DummyBlender extends Blender

This Dummy blender supports only plain blending without an offset.

  • Constructor Details

    • DummyBlender

      public DummyBlender(String section) throws IOException

      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 used
      identityStore - the identity store to be used (for decryption of headers)
      Throws:
      IOException - if anything fails :-D
  • Method Details

    • getBlendingAddress

      public String getBlendingAddress()
      Description copied from class: Blender

      Returns the address supported for blender.

      The address is specified by <transport><address>!<publickey>.

      Specified by:
      getBlendingAddress in class Blender
      Returns:
      The vortex adress.
    • blendMessageToBytes

      public byte[] blendMessageToBytes(BlendingSpec target, VortexMessage msg)
      Description copied from class: Blender

      Blends a VortexMessage into the apropriate text.

      Specified by:
      blendMessageToBytes in class Blender
      Parameters:
      target - the blending spec for the recipient
      msg - the message to be blended
      Returns:
      the blended message
    • unblendMessage

      public VortexMessage unblendMessage(byte[] blendedMessage)
      Description copied from class: Blender

      Extracts a vortexMessage from a blended message.

      Specified by:
      unblendMessage in class Blender
      Parameters:
      blendedMessage - the blended message
      Returns:
      the VortexMessage
    • blendMessage

      public boolean blendMessage(BlendingSpec target, VortexMessage msg)
      Description copied from class: Blender

      This method is called by the router layer to blend a message.

      Specified by:
      blendMessage in interface BlendingSender
      Specified by:
      blendMessage in class Blender
      msg - the message to be blended
      Returns:
      true if blended successfully and sent by the transport layer
    • gotMessage

      public boolean gotMessage(InputStream is)
      Description copied from interface: TransportReceiver

      This 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