Static Public Member Functions | |
static final ContentName | localhostScopeName () |
static ContentName | localServiceName (String service) |
static String | getLocalServiceName (ContentName nameWithServicePrefix) |
static ArrayList< ContentObject > | getLocalServiceKeys (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" |
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.
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.
service | ||
serviceKey | ||
keyManager |
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.
service | ||
timeout | ||
handle |
IOException |
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")