import org.iotivity.service.RcsPlatformException;
import org.iotivity.service.RcsResourceAttributes;
import org.iotivity.service.RcsValue;
-import org.iotivity.service.server.RcsResourceObject;
/**
*
/**
* This represents states of monitoring.
*
- * @see #startMonitoring()
+ * @see #startMonitoring(OnStateChangedListener)
* @see #getState()
* @see OnStateChangedListener
*
*/
public enum ResourceState {
+ /** Monitoring is not started. */
+ NONE,
+
+ /**
+ * Monitoring is started and checking state is in progress.
+ * This is the default state after startMonitoring.
+ */
+ REQUESTED,
+
+ /** The resource is alive. */
+ ALIVE,
- NONE, /** < Monitoring is not started. */
- REQUESTED, /**
- * < Monitoring is started and checking state is in progress.
- * This is the default state after startMonitoring.
- */
- ALIVE, /** < The resource is alive. */
- LOST_SIGNAL, /** < Failed to reach the resource. */
- DESTROYED /** < The resource is deleted. */
+ /** Failed to reach the resource. */
+ LOST_SIGNAL,
+
+ /** The resource is deleted. */
+ DESTROYED
}
/**
* @see #getCacheState()
*/
public enum CacheState {
+ /** Caching is not started. */
+ NONE,
+
+ /**
+ * Caching is started, but the data is not ready yet. This is
+ * the default state after startCaching.
+ */
+ UNREADY,
- NONE, /** < Caching is not started. */
- UNREADY, /**
- * < Caching is started, but the data is not ready yet. This is
- * the default state after startCaching.
- */
- READY, /** < The data is ready. */
- LOST_SIGNAL /** < Failed to reach the resource. */
+ /** The data is ready. */
+ READY,
+
+ /** Failed to reach the resource. */
+ LOST_SIGNAL
}
/**
* the updated attributes
*
*/
- public void onCacheUpdated(RcsResourceAttributes attributes);
+ public void onCacheUpdated(RcsResourceAttributes attributes, int eCode);
}
* @throws RcsDestroyedObjectException
* if the object is already destroyed
*
- * @see RcsResourceObject.Builder#setObservable(boolean)
+ * @see org.iotivity.service.server.RcsResourceObject.Builder#setObservable(boolean)
*/
public boolean isObservable() throws RcsException {
assertAlive();
* This will start data caching for the resource. Once caching started it
* will look for the data updation on the resource and updates the cache
* data accordingly.
- *
- * It is equivalent to calling startCaching(CacheUpdatedCallback) with null.
+ * <p>
+ * It is equivalent to calling {@link #startCaching(OnCacheUpdatedListener)}
+ * with null.
*
* @throws RcsDestroyedObjectException
* if the object is already destroyed
/**
* Returns whether cached data is available.
*
- * Cache will be available always once cache state had been READY even if
- * current state is LOST_SIGNAL.
+ * Cache will be available always once cache state had been
+ * {@link CacheState#READY} even if current state is
+ * {@link CacheState#LOST_SIGNAL} until stopped.
*
* @return true if cache data is available.
*
/**
* Returns the cached attributes.
- * This works only when cache is available.
+ * <p>
+ * Note that this works only when cache is available.
*
* @return the cached attributes.
*
/**
* Returns the cached value to which the specified key is mapped, or null if
- * RcsResourceAttributes contains no mapping for the key.
- *
- * This works only when cache is available.
+ * no mapping for the key.
+ * <p>
+ * Note that this works only when cache is available.
*
* @param key
* the key whose associated value is to be returned
}
/**
- * Sends a request for the resource attributes directly to the server.
+ * Sends a request for the resource attributes directly to the resource.
*
* @param listener
* the listener to receive the response
}
/**
- * Sends a set request with resource attributes to the server.
- *
+ * Sends a set request with resource attributes to the resource.
+ * <p>
* The SetRequest behavior depends on the server, whether updating its
* attributes or not.
*