Project JXTA

net.jxta.impl.pipe
Class PipeServiceImpl

java.lang.Object
  extended by net.jxta.impl.pipe.PipeServiceImpl
All Implemented Interfaces:
EventListener, PipeResolver.Listener, PipeService, Module, Service

public class PipeServiceImpl
extends Object
implements PipeService, PipeResolver.Listener

A JXTA PipeService implementation which implements the standard JXTA Pipe Resolver Protocol (PRP).

This class provides implementation for Unicast, unicast secure and (indirectly) propagate pipes.

See Also:
PipeService, InputPipe, OutputPipe, Message, PipeAdvertisement, PipeResolverMessage, JXTA Protocols Specification : Pipe Binding Protocol

Field Summary
(package private) static long VERIFYINTERVAL
          the interval at which we verify that a pipe is still resolved at a remote peer.
 
Fields inherited from interface net.jxta.pipe.PipeService
PropagateType, UnicastSecureType, UnicastType
 
Fields inherited from interface net.jxta.platform.Module
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK
 
Constructor Summary
PipeServiceImpl()
          Default Constructor (don't delete)
 
Method Summary
 InputPipe createInputPipe(PipeAdvertisement adv)
          
 InputPipe createInputPipe(PipeAdvertisement adv, PipeMsgListener listener)
          
 Message createMessage()
          
 OutputPipe createOutputPipe(PipeAdvertisement adv, Enumeration resolvablePeers, long timeout)
          
 OutputPipe createOutputPipe(PipeAdvertisement pipeAdv, long timeout)
          
 void createOutputPipe(PipeAdvertisement pipeAdv, OutputPipeListener listener)
          
 OutputPipe createOutputPipe(PipeAdvertisement pipeAdv, PeerID peerid, long timeout)
          
 void createOutputPipe(PipeAdvertisement pipeAdv, PeerID peerid, OutputPipeListener listener)
          
 OutputPipe createOutputPipe(PipeAdvertisement adv, Set resolvablePeers, long timeout)
          
 void createOutputPipe(PipeAdvertisement pipeAdv, Set resolvablePeers, OutputPipeListener listener)
          
 Advertisement getImplAdvertisement()
          
 Service getInterface()
          

We create only a single interface object and return it over and over again.

 void init(PeerGroup pg, ID assignedID, Advertisement impl)
          
 boolean pipeNAKEvent(PipeResolver.Event e)
          A NAK Event was received for this pipe

We don't do anything with NAKs (yet)

 boolean pipeResolveEvent(PipeResolver.Event e)
          Pipe Resolve Event
 OutputPipeListener removeOutputPipeListener(String opID, OutputPipeListener listener)
          
 int startApp(String[] args)
          

Currently this service does not expect arguments.

 void stopApp()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERIFYINTERVAL

static final long VERIFYINTERVAL
the interval at which we verify that a pipe is still resolved at a remote peer.

See Also:
Constant Field Values
Constructor Detail

PipeServiceImpl

public PipeServiceImpl()
Default Constructor (don't delete)

Method Detail

getInterface

public Service getInterface()

We create only a single interface object and return it over and over again.

Specified by:
getInterface in interface Service

getImplAdvertisement

public Advertisement getImplAdvertisement()

Specified by:
getImplAdvertisement in interface Service

init

public void init(PeerGroup pg,
                 ID assignedID,
                 Advertisement impl)

Specified by:
init in interface Module

startApp

public int startApp(String[] args)

Currently this service does not expect arguments.

Specified by:
startApp in interface Module

stopApp

public void stopApp()

Specified by:
stopApp in interface Module

createInputPipe

public InputPipe createInputPipe(PipeAdvertisement adv)
                          throws IOException

Specified by:
createInputPipe in interface PipeService
Throws:
IOException

createInputPipe

public InputPipe createInputPipe(PipeAdvertisement adv,
                                 PipeMsgListener listener)
                          throws IOException

Specified by:
createInputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public OutputPipe createOutputPipe(PipeAdvertisement pipeAdv,
                                   long timeout)
                            throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public OutputPipe createOutputPipe(PipeAdvertisement pipeAdv,
                                   PeerID peerid,
                                   long timeout)
                            throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public OutputPipe createOutputPipe(PipeAdvertisement adv,
                                   Enumeration resolvablePeers,
                                   long timeout)
                            throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public OutputPipe createOutputPipe(PipeAdvertisement adv,
                                   Set resolvablePeers,
                                   long timeout)
                            throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public void createOutputPipe(PipeAdvertisement pipeAdv,
                             OutputPipeListener listener)
                      throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public void createOutputPipe(PipeAdvertisement pipeAdv,
                             PeerID peerid,
                             OutputPipeListener listener)
                      throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createOutputPipe

public void createOutputPipe(PipeAdvertisement pipeAdv,
                             Set resolvablePeers,
                             OutputPipeListener listener)
                      throws IOException

Specified by:
createOutputPipe in interface PipeService
Throws:
IOException

createMessage

public Message createMessage()

Specified by:
createMessage in interface PipeService

removeOutputPipeListener

public OutputPipeListener removeOutputPipeListener(String opID,
                                                   OutputPipeListener listener)

Specified by:
removeOutputPipeListener in interface PipeService

pipeResolveEvent

public boolean pipeResolveEvent(PipeResolver.Event e)
Pipe Resolve Event

Specified by:
pipeResolveEvent in interface PipeResolver.Listener
Returns:
true if the event was handled otherwise false

pipeNAKEvent

public boolean pipeNAKEvent(PipeResolver.Event e)
A NAK Event was received for this pipe

We don't do anything with NAKs (yet)

Specified by:
pipeNAKEvent in interface PipeResolver.Listener
Returns:
true if the event was handled otherwise false

JXTA J2SE