JXTA

net.jxta.impl.pipe
Class SecureOutputPipe

java.lang.Object
  extended by net.jxta.impl.pipe.NonBlockingOutputPipe
      extended by net.jxta.impl.pipe.SecureOutputPipe
All Implemented Interfaces:
Runnable, EventListener, PipeResolver.Listener, OutputPipe

 class SecureOutputPipe
extends NonBlockingOutputPipe

This class implements the Secure non blocking Output Pipe


Nested Class Summary
 
Nested classes/interfaces inherited from class net.jxta.impl.pipe.NonBlockingOutputPipe
NonBlockingOutputPipe.WorkerState
 
Constructor Summary
SecureOutputPipe(PeerGroup group, PipeResolver resolver, PipeAdvertisement pipeAdv, ID destPeer, Set<? extends ID> peers)
           
 
Method Summary
protected  EndpointAddress mkAddress(ID destPeer, ID pipeID)
          Convenience method for constructing a peer endpoint address from its peer id
 boolean send(Message msg)
          Send a message through the pipe

WARNING: The message object used when sending a pipe message should not be reused or modified after the OutputPipe.send(Message) call is made.

 
Methods inherited from class net.jxta.impl.pipe.NonBlockingOutputPipe
close, finalize, getAdvertisement, getName, getPipeID, getType, isClosed, pipeNAKEvent, pipeResolveEvent, run
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureOutputPipe

public SecureOutputPipe(PeerGroup group,
                        PipeResolver resolver,
                        PipeAdvertisement pipeAdv,
                        ID destPeer,
                        Set<? extends ID> peers)
                 throws IOException
Throws:
IOException
Method Detail

send

public boolean send(Message msg)
             throws IOException
Send a message through the pipe

WARNING: The message object used when sending a pipe message should not be reused or modified after the OutputPipe.send(Message) call is made. Concurrent modification of messages will produce unexpected result.

We can't fail to send a message. Secure pipes are expected to be reliable and ordered.

Specified by:
send in interface OutputPipe
Overrides:
send in class NonBlockingOutputPipe
Parameters:
msg - is the PipeMessage to be sent.
Returns:
boolean true if the message has been sent otherwise false. false. is commonly returned for non-error related congestion, meaning that you should be able to send the message after waiting some amount of time.
Throws:
IOException - output pipe error

mkAddress

protected EndpointAddress mkAddress(ID destPeer,
                                    ID pipeID)
Convenience method for constructing a peer endpoint address from its peer id

Overrides:
mkAddress in class NonBlockingOutputPipe
Parameters:
destPeer - the desitnation peer
pipeID - the pipe to put in the param field.
Returns:
the pipe endpoint address.

JXSE