import java.util.List;
/**
- * Contains the main entrance/functionality of the product. To set a custom configuration, the
- * implementer must make a call to OcPlatform.Configure before the first usage of a function in this
- * class.
+ * This class contains the main entrance/functionality of the product. To set a custom
+ * configuration, the implementer must make a call to OcPlatform.Configure before the first usage
+ * of a method in this class.
*/
public final class OcPlatform {
/**
* API for setting the configuration of the OcPlatform.
+ * <p>
* Note: Any calls made to this AFTER the first call to OcPlatform.Configure will have no affect
+ * </p>
*
* @param platformConfig platform configuration
*/
/**
* API for notifying base that resource's attributes have changed.
+ * <p>
+ * Note: This API is for server side only.
+ * </p>
*
* @param ocResourceHandle resource handle of the resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void notifyAllObservers(
OcResourceHandle ocResourceHandle) throws OcException {
/**
* API for notifying base that resource's attributes have changed.
+ * <p>
+ * Note: This API is for server side only.
+ * </p>
*
* @param ocResourceHandle resource handle of the resource
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public static void notifyAllObservers(
OcResourceHandle ocResourceHandle,
/**
* API for notifying only specific clients that resource's attributes have changed.
+ * <p>
+ * Note: This API is for server side only.
+ * </p>
*
* @param ocResourceHandle resource handle of the resource
* @param ocObservationIdList These set of ids are ones which which will be notified upon
* resource change.
* @param ocResourceResponse OcResourceResponse object used by app to fill the response for
* this resource change
- * @throws OcException
+ * @throws OcException if failure
*/
public static void notifyListOfObservers(
OcResourceHandle ocResourceHandle,
/**
* API for notifying only specific clients that resource's attributes have changed.
+ * <p>
+ * Note: This API is for server side only.
+ * </p>
*
* @param ocResourceHandle resource handle of the resource
* @param ocObservationIdList These set of ids are ones which which will be notified upon
* @param ocResourceResponse OcResourceResponse object used by app to fill the response for
* this resource change
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public static void notifyListOfObservers(
OcResourceHandle ocResourceHandle,
int qualityOfService) throws OcException;
/**
- * API for Service and Resource Discovery. NOTE: This API applies to client side only
+ * API for Service and Resource Discovery
+ * <p>
+ * Note: This API is for client side only.
+ * </p>
*
- * @param host Host IP Address of a service to direct resource discovery query.
+ * @param host Host Address of a service to direct resource discovery query.
* If empty, performs multicast resource discovery query
* @param resourceUri name of the resource. If null or empty, performs search for all
* resource names
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onResourceFoundListener Handles events, success states and failure states.
- * @throws OcException
+ * @throws OcException if failure
*/
public static void findResource(
String host,
OnResourceFoundListener onResourceFoundListener) throws OcException;
/**
- * API for Service and Resource Discovery. NOTE: This API applies to client side only
+ * API for Service and Resource Discovery.
+ * <p>
+ * Note: This API is for client side only.
+ * </p>
*
* @param host Host IP Address of a service to direct resource discovery query.
* If empty, performs multicast resource discovery query
* @param resourceUri name of the resource. If null or empty, performs search for all
* resource names
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onResourceFoundListener Handles events, success states and failure states.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public static void findResource(
String host,
*
* @param host Host IP Address. If null or empty, Multicast is performed.
* @param deviceUri Uri containing address to the virtual device
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onDeviceFoundListener Handles events, success states and failure states.
- * @throws OcException
+ * @throws OcException if failure
*/
public static void getDeviceInfo(
String host,
*
* @param host Host IP Address. If null or empty, Multicast is performed.
* @param deviceUri Uri containing address to the virtual device
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onDeviceFoundListener Handles events, success states and failure states.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public static void getDeviceInfo(
String host,
*
* @param host Host IP Address. If null or empty, Multicast is performed.
* @param platformUri Uri containing address to the platform
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onPlatformFoundListener Handles events, success states and failure states.
- * @throws OcException
+ * @throws OcException if failure
*/
public static void getPlatformInfo(
*
* @param host Host IP Address. If null or empty, Multicast is performed.
* @param platformUri Uri containing address to the platform
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param onPlatformFoundListener Handles events, success states and failure states.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public static void getPlatformInfo(
int qualityOfService) throws OcException;
/**
- * This API registers a resource with the server NOTE: This API applies to server side only.
+ * This API registers a resource with the server
+ * <P>
+ * Note: This API applies to server & client side.
+ * </P>
*
* @param ocResource The instance of OcResource with all data filled
* @return resource handle
- * @throws OcException
+ * @throws OcException if failure
*/
public static OcResourceHandle registerResource(
OcResource ocResource) throws OcException {
/**
* This API registers a resource with the server NOTE: This API applies to server side only.
- *
+ * <P>
+ * Note: This API applies to server side only.
+ * </P>
* @param resourceUri The URI of the resource. Example: "a/light"
* @param resourceTypeName The resource type. Example: "light"
* @param resourceInterface The resource interface (whether it is collection etc).
* @param entityHandler entity handler.
* @param resourcePropertySet indicates the property of the resource
* @return resource handle
- * @throws OcException
+ * @throws OcException if failure
*/
public static OcResourceHandle registerResource(
String resourceUri,
* Register Device Info
*
* @param ocDeviceInfo object containing all the device specific information
- * @throws OcException
+ * @throws OcException if failure
*/
public static void registerDeviceInfo(
OcDeviceInfo ocDeviceInfo) throws OcException {
* Register Platform Info
*
* @param ocPlatformInfo object containing all the platform specific information
- * @throws OcException
+ * @throws OcException if failure
*/
public static void registerPlatformInfo(
OcPlatformInfo ocPlatformInfo) throws OcException {
*
* @param ocResourceHandle This is the resource handle which we which to unregister from the
* server
- * @throws OcException
+ * @throws OcException if failure
*/
public static void unregisterResource(
OcResourceHandle ocResourceHandle) throws OcException {
*
* @param ocResourceCollectionHandle handle to the collection resource
* @param ocResourceHandle handle to resource to be added to the collection resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void bindResource(
OcResourceHandle ocResourceCollectionHandle,
* @param ocResourceCollectionHandle handle to the collection resource
* @param ocResourceHandleList reference to list of resource handles to be added to the
* collection resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void bindResources(
OcResourceHandle ocResourceCollectionHandle,
*
* @param ocResourceCollectionHandle handle to the collection resource
* @param ocResourceHandle resource handle to be unbound from the collection resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void unbindResource(
OcResourceHandle ocResourceCollectionHandle,
* @param ocResourceCollectionHandle Handle to the collection resource
* @param ocResourceHandleList List of resource handles to be unbound from the collection
* resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void unbindResources(
OcResourceHandle ocResourceCollectionHandle,
*
* @param ocResourceHandle handle to the resource
* @param resourceTypeName new typename to bind to the resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void bindTypeToResource(
OcResourceHandle ocResourceHandle,
*
* @param ocResourceHandle handle to the resource
* @param resourceInterfaceName new interface to bind to the resource
- * @throws OcException
+ * @throws OcException if failure
*/
public static void bindInterfaceToResource(
OcResourceHandle ocResourceHandle,
* Start Presence announcements.
*
* @param ttl time to live in seconds
- * @throws OcException
+ * @throws OcException if failure
*/
public static void startPresence(int ttl) throws OcException {
OcPlatform.initCheck();
/**
* Stop Presence announcements.
*
- * @throws OcException
+ * @throws OcException if failure
*/
public static void stopPresence() throws OcException {
OcPlatform.initCheck();
* Subscribes to a server's presence change events. By making this subscription, every time a
* server adds/removes/alters a resource, starts or is intentionally stopped
*
- * @param host The IP address/addressable name of the server to subscribe to
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
- * @param onPresenceListener listener that will receive notifications/subscription events
+ * @param host The IP address/addressable name of the server to subscribe to
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
+ * @param onPresenceListener listener that will receive notifications/subscription events
* @return a handle object that can be used to identify this subscription request. It can be
* used to unsubscribe from these events in the future
- * @throws OcException
+ * @throws OcException if failure
*/
public static OcPresenceHandle subscribePresence(
String host,
* Subscribes to a server's presence change events. By making this subscription, every time a
* server adds/removes/alters a resource, starts or is intentionally stopped
*
- * @param host The IP address/addressable name of the server to subscribe to
- * @param resourceType a resource type specified as a filter for subscription events.
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
- * @param onPresenceListener listener that will receive notifications/subscription events
+ * @param host The IP address/addressable name of the server to subscribe to
+ * @param resourceType a resource type specified as a filter for subscription events.
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
+ * @param onPresenceListener listener that will receive notifications/subscription events
* @return a handle object that can be used to identify this subscription request. It can be
* used to unsubscribe from these events in the future
- * @throws OcException
+ * @throws OcException if failure
*/
public static OcPresenceHandle subscribePresence(
String host,
*
* @param ocPresenceHandle the handle object provided by the subscribePresence call that
* identifies this subscription
- * @throws OcException
+ * @throws OcException if failure
*/
public static void unsubscribePresence(
OcPresenceHandle ocPresenceHandle) throws OcException {
* Additionally, you can only create this object if OcPlatform was initialized to be a Client
* or Client/Server.
*
- * @param host a string containing a resolvable host address of the server holding
- * the resource
- * @param uri the rest of the resource's URI that will permit messages to be
- * properly routed.
- * Example: /a/light
- * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
- * IPV6, ALL
- * @param isObservable a boolean containing whether the resource supports observation
- * @param resourceTypeList a collection of resource types implemented by the resource
- * @param interfaceList a collection of interfaces that the resource supports/implements
+ * @param host a string containing a resolvable host address of the server holding
+ * the resource
+ * @param uri the rest of the resource's URI that will permit messages to be
+ * properly routed.
+ * Example: /a/light
+ * @param connectivityTypeSet Set of types of connectivity. Example: IP
+ * @param isObservable a boolean containing whether the resource supports observation
+ * @param resourceTypeList a collection of resource types implemented by the resource
+ * @param interfaceList a collection of interfaces that the resource supports/implements
* @return new resource object
- * @throws OcException
+ * @throws OcException if failure
*/
public static OcResource constructResourceObject(
String host,
* Allows application entity handler to send response to an incoming request.
*
* @param ocResourceResponse resource response
- * @throws OcException
+ * @throws OcException if failure
*/
public static void sendResponse(OcResourceResponse ocResourceResponse)
throws OcException {
* @param onGetListener The event handler will be invoked with a map of attribute name and
* values. The event handler will also have the result from this Get
* operation This will have error codes
- * @throws OcException
+ * @throws OcException if failure
*/
public native void get(Map<String, String> queryParamsMap,
OnGetListener onGetListener) throws OcException;
* values. The event handler will also have the result from this Get
* operation This will have error codes
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public void get(Map<String, String> queryParamsMap,
OnGetListener onGetListener,
* @param onGetListener The event handler will be invoked with a map of attribute name and
* values. The event handler will also have the result from this Get
* operation This will have error codes
- * @throws OcException
+ * @throws OcException if failure
*/
public void get(String resourceType,
String resourceInterface,
* values. The event handler will also have the result from this Get
* operation This will have error codes
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public void get(String resourceType,
String resourceInterface,
* @param queryParamsMap Map which can have the query parameter name and value
* @param onPutListener event handler The event handler will be invoked with a map of attribute
* name and values.
- * @throws OcException
+ * @throws OcException if failure
*/
public native void put(OcRepresentation representation,
Map<String, String> queryParamsMap,
* @param onPutListener event handler The event handler will be invoked with a map of
* attribute name and values.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public void put(OcRepresentation ocRepresentation,
Map<String, String> queryParamsMap,
* @param queryParamsMap Map which can have the query parameter name and value
* @param onPutListener event handler The event handler will be invoked with a map of
* attribute name and values.
- * @throws OcException
+ * @throws OcException if failure
*/
public void put(String resourceType,
String resourceInterface,
* @param onPutListener event handler The event handler will be invoked with a map of
* attribute name and values.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public void put(String resourceType,
String resourceInterface,
* @param queryParamsMap Map which can have the query parameter name and value
* @param onPostListener event handler The event handler will be invoked with a map of
* attribute name and values.
- * @throws OcException
+ * @throws OcException if failure
*/
public native void post(OcRepresentation ocRepresentation,
Map<String, String> queryParamsMap,
* @param onPostListener event handler The event handler will be invoked with a map of
* attribute name and values.
* @param qualityOfService the quality of communication
- * @throws OcException
+ * @throws OcException if failure
*/
public void post(OcRepresentation ocRepresentation,
Map<String, String> queryParamsMap,
* @param queryParamsMap Map which can have the query parameter name and value
* @param onPostListener event handler The event handler will be invoked with a map of
* attribute name and values.
- * @throws OcException
+ * @throws OcException if failure
*/
public void post(String resourceType,
String resourceInterface,
/**
* Method to get a string representation of the resource's server ID.
- * * This is unique per- server independent on how it was discovered.
+ * <p>
+ * This is unique per- server independent on how it was discovered.
+ * </p>
*
* @return server ID
*/