Package com.yahoo.jrt.slobrok.api
Interface IMirror
- All Known Implementing Classes:
Mirror
public interface IMirror
Defines an interface for the name server lookup.
- Author:
- Simon Thoresen Hult
-
Method Summary
Modifier and TypeMethodDescriptionObtain all the services matching a given pattern.int
updates()
Obtain the number of updates seen by this mirror.
-
Method Details
-
lookup
Obtain all the services matching a given pattern. The pattern is matched against all service names in the local mirror repository. A service name may contain '/' as a separator token. A pattern may contain '*' to match anything up to the next '/' (or the end of the name). This means that the pattern 'foo/*/baz' would match the service names 'foo/bar/baz' and 'foo/xyz/baz'. The pattern 'foo/b*' would match 'foo/bar', but neither 'foo/xyz' nor 'foo/bar/baz'. The pattern 'a*b' will never match anything. As a special case, a pattern can end in '**' to match the rest of a name including '/' separators.- Parameters:
pattern
- The pattern used for matching- Returns:
- a list of all matching services, with corresponding connect specs
-
updates
int updates()Obtain the number of updates seen by this mirror. The value may wrap, but will never become 0 again. This can be used for name lookup optimization, because the results returned by lookup() will never change unless this number also changes.- Returns:
- number of slobrok updates seen
-