Initial merge-commit of the OIC code. Should successfully do discovery for single...
[platform/upstream/iotivity.git] / csdk / android / OCLib / src / com / oc / OCResourceResultHandler.java
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5
6 package com.oc;
7
8 import java.io.Serializable;
9
10 /**
11  * 
12  * When a request or command is issued to a resource, an OCResourceResultHandler object must be
13  * passed as a parameter to handle the callback(s).
14  * 
15  */
16 public interface OCResourceResultHandler extends Serializable {
17   /**
18    * 
19    * The OC service calls this repeatedly until completed() or failed() is called.
20    * 
21    * @param serviceURI - The URI of the reporting service.
22    * @param resources - The list of resources found on the remote service.
23    */
24   void onResourcesFound(String serviceURI, OCResource[] resources);
25
26   /**
27    * Called after all of the found resource(s) are reported.
28    */
29   void onCompleted();
30
31   /**
32    * Called if a failure occurred. No resources will be reported after this callback.
33    * 
34    * @param throwable - The error that caused this callback sequence to fail.
35    */
36   void onFailed(Throwable throwable);
37 }