| package io.v.v23.discovery; |
| |
| import java.util.List; |
| |
| import io.v.impl.google.lib.discovery.ScanHandler; |
| import io.v.v23.context.VContext; |
| import io.v.v23.security.BlessingPattern; |
| |
| /** |
| * An interface that exposes the Vanadium Discovery Api. |
| */ |
| public interface VDiscovery { |
| interface DoneCallback { |
| /** |
| * Called when the advertisement or scan finishes. |
| */ |
| void done(); |
| } |
| |
| interface UpdateCallback { |
| /** |
| * Called when a new update for a Service that matches the scan query. |
| * @param update |
| */ |
| void handleUpdate(Update update); |
| } |
| |
| void advertise(VContext ctx, Service service, List<BlessingPattern> patterns, DoneCallback cb); |
| |
| void scan(VContext ctx, String query, UpdateCallback updateCb); |
| } |