org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator Class Reference
Implements the base Name Enumerator.
More...
List of all members.
Detailed Description
Implements the base Name Enumerator.
Applications register name prefixes. Each prefix is explored until canceled by the application. This version supports enumeration with multiple responders (repositories and applications).
An application can have multiple enumerations active at the same time. For each prefix, the name enumerator will generate an Interest. Responses to the Interest will be in the form of Collections (by a NameEnumeratorResponder and repository implementations). Returned Collections will be parsed for the enumerated names and sent back to the application using the callback with the applicable prefix and an array of names in that namespace. The application is expected to handle duplicate names from multiple responses and should be able to handle names that are returned, but may not be available at this time (for example, /a.com/b/c.txt might have been enumerated but a.com content may not be available).
- See also:
- CCNFilterListener
-
CCNInterestListener
-
BasicNameEnumeratorListener
-
NameEnumerationResponse
Constructor & Destructor Documentation
Member Function Documentation
void org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.cancelEnumerationsWithPrefix |
( |
ContentName |
prefixToCancel |
) |
|
Method to cancel more than one prefix at a time.
This method will cancel all active Interests matching the prefix supplied. The matching NERequest objects are removed from the set of active registered prefixes and the corresponding Interests are canceled.
- Parameters:
-
boolean org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.cancelPrefix |
( |
ContentName |
prefix |
) |
|
Method to cancel active enumerations.
The active interests are retrieved from the corresponding NERequest object for the prefix. Each interest is canceled and the NERequest object is removed from the list of active enumerations.
- Parameters:
-
| prefix | ContentName to cancel enumeration |
- Returns:
- boolean Returns if the prefix is successfully canceled.
boolean org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.containsRegisteredName |
( |
ContentName |
name |
) |
|
Method to check if a name is already registered to be included in name enumeration responses for incoming Interests.
- Parameters:
-
| name | ContentName to check for in registered names for responses |
- Returns:
- boolean Returns true if the name is registered and false if not
NERequest org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.getCurrentRequest |
( |
ContentName |
n |
) |
[protected] |
Method to get the corresponding NERequest for a ContentName.
Returns null if no NERequest is found.
- Parameters:
-
| n | ContentName for the NERequest to be found. |
- Returns:
- NERequest NERequest instance with the supplied ContentName. Returns null if no NERequest exists.
NEResponse org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.getHandledResponse |
( |
ContentName |
n |
) |
[protected] |
Method to get the NEResponse object for a registered name.
Returns null if no matching NEResponse is found.
- Parameters:
-
| n | ContentName identifying a NEResponse |
- Returns:
- NEResponse Returns the NEResponse matching the name.
Callback for name enumeration responses.
The results contain CollectionObjects containing the names under a prefix. The collection objects are matched to registered prefixes and returned to the calling applications using their registered callback handlers. Each response can create a new Interest that is used to further enumerate the namespace. The implementation explicitly handles multiple name enumeration responders. The method may now create multiple interests to further enumerate the prefix. Please note that the current implementation will need to be updated if responseIDs are more than one component long.
- Parameters:
-
| c | ContentObject containing the ContentNames under a registered prefix |
| interest | The interest matching or triggering a name enumeration response |
- Returns:
- Interest Returns a new Interest to further enumerate or null to cancel the interest that matched these objects. This implementation returns null since new interests are created and expressed as the returned CollectionObjects are processed.
- See also:
- CollectionObject
-
CCNInterestHandler
Implements org.ccnx.ccn.CCNInterestListener.
boolean org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.handleInterest |
( |
Interest |
interest |
) |
|
Method for receiving Interests matching the namespace for answering name enumeration requests.
Incoming Interests are verified to have the name enumeration marker. The NEResponse matching the interest is found (if it already exists) and if new names have been registered under the prefix or if no matching NEResponse object is found, a name enumeration response is created.
- Parameters:
-
| interest | Interest object matching the namespace filter. |
- Returns:
- boolean
Implements org.ccnx.ccn.CCNFilterListener.
void org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.registerNameForResponses |
( |
ContentName |
name |
) |
|
Method to register a name to include in incoming name enumeration requests.
- Parameters:
-
| name | ContentName to register for name enumeration responses |
void org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.registerNameSpace |
( |
ContentName |
name |
) |
throws IOException |
Method to register a namespace for filtering incoming Interests.
- Parameters:
-
| name | ContentName to register for filtering incoming Interests |
- Exceptions:
-
- See also:
- CCNFilterListener
void org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.registerPrefix |
( |
ContentName |
prefix |
) |
throws IOException |
Method to register a prefix for name enumeration.
A NERequest and initial interest is created for new prefixes. Prefixes that are already registered return and do not impact the already active registration.
- Parameters:
-
| prefix | ContentName to enumerate |
- Exceptions:
-
void org.ccnx.ccn.profiles.nameenum.CCNNameEnumerator.updateHandledResponses |
( |
ContentName |
n |
) |
[protected] |
Method to set the dirty flag for NEResponse objects that are updated as new names are registered for responses.
- Parameters:
-
| n | New ContentName to be included in name enumeration responses |
The documentation for this class was generated from the following file:
- src/org/ccnx/ccn/profiles/nameenum/CCNNameEnumerator.java