org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile Class Reference

The ServiceDiscovery protocol aids in finding data about local (same-machine) and nearby (network neighborhood) services. More...

Inheritance diagram for org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile:

org.ccnx.ccn.profiles.CCNProfile

List of all members.

Static Public Member Functions

static final ContentName localhostScopeName ()
static ContentName localServiceName (String service)
static String getLocalServiceName (ContentName nameWithServicePrefix)
static ArrayList< ContentObjectgetLocalServiceKeys (String service, long timeout, CCNHandle handle) throws IOException
 We want to get a list of local implementors of this service and their keys; until the timeout.
static PublicKeyObject getLocalServiceKey (String service, long timeout, CCNHandle handle) throws IOException
 Query for local service keys when we believe there is only a single instance of a service.
static void publishLocalServiceKey (String service, PublisherPublicKeyDigest serviceKey, KeyManager keyManager) throws InvalidKeyException, IOException

Static Public Attributes

static final String STRING_LOCALHOST = "localhost"
static final CommandMarker LOCALHOST_SCOPE
static final CommandMarker SERVICE_NAME_COMPONENT_MARKER
static final int SCOPE_COMPONENT = 0
static final int SERVICE_MARKER_COMPONENT = 1
static final int SERVICE_NAME_COMPONENT = 3
static final String CCND_SERVICE_NAME = "ccnd"
static final String REPOSITORY_SERVICE_NAME = "repository"


Detailed Description

The ServiceDiscovery protocol aids in finding data about local (same-machine) and nearby (network neighborhood) services.

We start by retrieving service keys, using: /C1.M.S.localhost/C1.M.SRV/<servicename>/KEY/ and getting as an answer an encoded, self-signed key published under the KeyProfile.keyName() of that service's key under that prefix.


Member Function Documentation

static ArrayList<ContentObject> org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile.getLocalServiceKeys ( String  service,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

We want to get a list of local implementors of this service and their keys; until the timeout.

We use excludes to get all of them within the timeout. We get whole keys because they're usually a single object, so there is no reason not to load them. Rather than decoding them all, though, we just hand back the CO to the caller to decide what to do.

Start by taking a timeout to use as the inter-response interval; if we haven't heard anything in that long, we stop.

Parameters:
service 
serviceKey 
keyManager 
Exceptions:
IOException 

static PublicKeyObject org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile.getLocalServiceKey ( String  service,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

Query for local service keys when we believe there is only a single instance of a service.

Returns as soon as it gets a first response, or on timeout.

Parameters:
service 
timeout 
handle 
Returns:
Exceptions:
IOException 


Member Data Documentation

final CommandMarker org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile.LOCALHOST_SCOPE [static]

Initial value:

                CommandMarker.commandMarker(CommandMarker.COMMAND_MARKER_SCOPE, STRING_LOCALHOST)

final CommandMarker org.ccnx.ccn.profiles.context.ServiceDiscoveryProfile.SERVICE_NAME_COMPONENT_MARKER [static]

Initial value:

 
                CommandMarker.commandMarker(CommandMarker.MARKER_NAMESPACE, "SRV")


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:45:03 2012 for Content-Centric Networking in Java by  doxygen 1.5.6