p2ps.imp.endpoint.UDP
Class UDPResolver

java.lang.Object
  extended byp2ps.imp.endpoint.AbstractEndpointResolver
      extended byp2ps.imp.endpoint.UDP.UDPResolver
All Implemented Interfaces:
EndpointMessageListener, EndpointResolver, PipeSchemes, UDPEndpointSchemes

public class UDPResolver
extends AbstractEndpointResolver
implements PipeSchemes, UDPEndpointSchemes

The resolver for socket using UDP

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
 
Fields inherited from interface p2ps.pipe.PipeSchemes
P2PS_DISCOVERY, P2PS_MULTICAST, P2PS_SECURE, P2PS_STANDARD
 
Fields inherited from interface p2ps.imp.endpoint.UDP.UDPEndpointSchemes
UDP_MULTICAST, UDP_STANDARD
 
Constructor Summary
UDPResolver()
          Create a UDPResolver that uses the standard UDP_STANDARD
 
Method Summary
 Endpoint connectOutputEndpoint(java.net.URI uri, SecurityContext remotecontext)
          Connects an endpoint to output to the specified address
 Endpoint createInputEndpoint(java.lang.String pipeid, java.lang.String scheme)
          Create a endpoint for the specified input pipe
 Endpoint createInputEndpoint(java.lang.String pipeid, java.net.URI uri)
          Create a endpoint for the specified input pipe bound the specified endpoint address
 java.lang.String[] getEndpointSchemes()
           
 java.lang.String[] getPipeSchemes()
           
protected  Endpoint initResolverSocket()
          Initialize and return an endpoint for receive EndpointQueries (or null if EndpointQueries not handled)
 
Methods inherited from class p2ps.imp.endpoint.AbstractEndpointResolver
dataMessageReceived, getAdvertisement, getGroupIDs, getMessageProtocolHandlerFactory, getPeer, getPeerID, getPipeID, getResolverEndpoints, getResolverEndpointURI, getResolverEndpointURIs, getResolverForPeerIDs, handleEndpointQuery, init, isEndpointScheme, isPipeScheme, isSchemeInputEnabled, isSchemeOutputEnabled, registerEndpoint, resolveEndpoint, setSchemeEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPResolver

public UDPResolver()
Create a UDPResolver that uses the standard UDP_STANDARD

Method Detail

initResolverSocket

protected Endpoint initResolverSocket()
                               throws java.io.IOException
Description copied from class: AbstractEndpointResolver
Initialize and return an endpoint for receive EndpointQueries (or null if EndpointQueries not handled)

Specified by:
initResolverSocket in class AbstractEndpointResolver
Throws:
java.io.IOException

getEndpointSchemes

public java.lang.String[] getEndpointSchemes()
Specified by:
getEndpointSchemes in interface EndpointResolver
Returns:
an array of the endpoint schemes handled by this resolver. An endpoint scheme is one from which a concrete endpoint can be created by this resolver without using endpoint resolution.

getPipeSchemes

public java.lang.String[] getPipeSchemes()
Specified by:
getPipeSchemes in interface EndpointResolver
Returns:
an array of the pipe schemes handled by this resolver. A pipe scheme is one from which a pipe can be created using endpoint resolution (if required).

createInputEndpoint

public Endpoint createInputEndpoint(java.lang.String pipeid,
                                    java.lang.String scheme)
                             throws java.io.IOException
Create a endpoint for the specified input pipe

Specified by:
createInputEndpoint in interface EndpointResolver
Throws:
java.io.IOException

createInputEndpoint

public Endpoint createInputEndpoint(java.lang.String pipeid,
                                    java.net.URI uri)
                             throws java.io.IOException
Create a endpoint for the specified input pipe bound the specified endpoint address

Specified by:
createInputEndpoint in interface EndpointResolver
Throws:
java.io.IOException

connectOutputEndpoint

public Endpoint connectOutputEndpoint(java.net.URI uri,
                                      SecurityContext remotecontext)
                               throws java.io.IOException
Connects an endpoint to output to the specified address

Specified by:
connectOutputEndpoint in interface EndpointResolver
Throws:
java.io.IOException