2 * //******************************************************************
4 * // Copyright 2015 Intel Corporation.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 package org.iotivity.base;
25 import org.iotivity.ca.CaInterface;
27 import java.util.EnumSet;
28 import java.util.Iterator;
29 import java.util.List;
32 * Contains the main entrance/functionality of the product. To set a custom configuration, the
33 * implementer must make a call to OcPlatform.Configure before the first usage of a function in this
36 public final class OcPlatform {
39 System.loadLibrary("oc_logger");
40 System.loadLibrary("octbstack");
41 System.loadLibrary("connectivity_abstraction");
42 System.loadLibrary("oc");
43 System.loadLibrary("ocstack-jni");
49 public static final String DEFAULT_INTERFACE = "oic.if.baseline";
52 * Used in discovering (GET) links to other resources of a collection
54 public static final String LINK_INTERFACE = "oic.if.ll";
57 * Used in GET, PUT, POST, DELETE methods on links to other resources of a collection
59 public static final String BATCH_INTERFACE = "oic.if.b";
62 * Used in GET, PUT, POST methods on links to other remote resources of a group
64 public static final String GROUP_INTERFACE = "oic.mi.grp";
66 public static final String WELL_KNOWN_QUERY = "224.0.1.187:5683/oic/res";
67 public static final String MULTICAST_PREFIX = "224.0.1.187:5683";
68 public static final String MULTICAST_IP = "224.0.1.187";
69 public static final int MULTICAST_PORT = 5683;
70 public static final int DEFAULT_PRESENCE_TTL = 60;
71 public static final String DEVICE_URI = "/oic/d";
72 public static final String PRESENCE_URI = "/oic/ad";
74 private static volatile boolean sIsPlatformInitialized = false;
76 private OcPlatform() {
80 * API for setting the configuration of the OcPlatform.
81 * Note: Any calls made to this AFTER the first call to OcPlatform.Configure will have no affect
83 * @param platformConfig platform configuration
85 public synchronized static void Configure(PlatformConfig platformConfig) {
86 if (!sIsPlatformInitialized) {
87 CaInterface.initialize(platformConfig.getContext());
90 platformConfig.getServiceType().getValue(),
91 platformConfig.getModeType().getValue(),
92 platformConfig.getIpAddress(),
93 platformConfig.getPort(),
94 platformConfig.getQualityOfService().getValue()
97 sIsPlatformInitialized = true;
101 private static native void configure(int serviceType,
105 int qualityOfService);
108 * API for notifying base that resource's attributes have changed.
110 * @param ocResourceHandle resource handle of the resource
111 * @throws OcException
113 public static void notifyAllObservers(
114 OcResourceHandle ocResourceHandle) throws OcException {
115 OcPlatform.initCheck();
116 OcPlatform.notifyAllObservers0(ocResourceHandle);
119 private static native void notifyAllObservers0(
120 OcResourceHandle ocResourceHandle) throws OcException;
123 * API for notifying base that resource's attributes have changed.
125 * @param ocResourceHandle resource handle of the resource
126 * @param qualityOfService the quality of communication
127 * @throws OcException
129 public static void notifyAllObservers(
130 OcResourceHandle ocResourceHandle,
131 QualityOfService qualityOfService) throws OcException {
132 OcPlatform.initCheck();
133 OcPlatform.notifyAllObservers1(ocResourceHandle, qualityOfService.getValue());
136 private static native void notifyAllObservers1(
137 OcResourceHandle ocResourceHandle,
138 int qualityOfService) throws OcException;
141 * API for notifying only specific clients that resource's attributes have changed.
143 * @param ocResourceHandle resource handle of the resource
144 * @param ocObservationIdList These set of ids are ones which which will be notified upon
146 * @param ocResourceResponse OcResourceResponse object used by app to fill the response for
147 * this resource change
148 * @throws OcException
150 public static void notifyListOfObservers(
151 OcResourceHandle ocResourceHandle,
152 List<Byte> ocObservationIdList,
153 OcResourceResponse ocResourceResponse) throws OcException {
154 OcPlatform.initCheck();
156 byte[] idArr = new byte[ocObservationIdList.size()];
157 Iterator<Byte> it = ocObservationIdList.iterator();
159 while (it.hasNext()) {
160 idArr[i++] = (byte) it.next();
163 OcPlatform.notifyListOfObservers2(
169 private static native void notifyListOfObservers2(
170 OcResourceHandle ocResourceHandle,
171 byte[] ocObservationIdArray,
172 OcResourceResponse ocResourceResponse) throws OcException;
175 * API for notifying only specific clients that resource's attributes have changed.
177 * @param ocResourceHandle resource handle of the resource
178 * @param ocObservationIdList These set of ids are ones which which will be notified upon
180 * @param ocResourceResponse OcResourceResponse object used by app to fill the response for
181 * this resource change
182 * @param qualityOfService the quality of communication
183 * @throws OcException
185 public static void notifyListOfObservers(
186 OcResourceHandle ocResourceHandle,
187 List<Byte> ocObservationIdList,
188 OcResourceResponse ocResourceResponse,
189 QualityOfService qualityOfService) throws OcException {
190 OcPlatform.initCheck();
192 byte[] idArr = new byte[ocObservationIdList.size()];
193 Iterator<Byte> it = ocObservationIdList.iterator();
195 while (it.hasNext()) {
196 idArr[i++] = (byte) it.next();
199 OcPlatform.notifyListOfObservers3(
203 qualityOfService.getValue()
207 private static native void notifyListOfObservers3(
208 OcResourceHandle ocResourceHandle,
209 byte[] ocObservationIdArray,
210 OcResourceResponse ocResourceResponse,
211 int qualityOfService) throws OcException;
214 * API for Service and Resource Discovery. NOTE: This API applies to client side only
216 * @param host Host IP Address of a service to direct resource discovery query.
217 * If empty, performs multicast resource discovery query
218 * @param resourceUri name of the resource. If null or empty, performs search for all
220 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
222 * @param onResourceFoundListener Handles events, success states and failure states.
223 * @throws OcException
225 public static void findResource(
228 OcConnectivityType connectivityType,
229 OnResourceFoundListener onResourceFoundListener) throws OcException {
230 OcPlatform.initCheck();
231 OcPlatform.findResource0(
234 connectivityType.getValue(),
235 onResourceFoundListener
239 private static native void findResource0(
242 int connectivityType,
243 OnResourceFoundListener onResourceFoundListener) throws OcException;
246 * API for Service and Resource Discovery. NOTE: This API applies to client side only
248 * @param host Host IP Address of a service to direct resource discovery query.
249 * If empty, performs multicast resource discovery query
250 * @param resourceUri name of the resource. If null or empty, performs search for all
252 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
254 * @param onResourceFoundListener Handles events, success states and failure states.
255 * @param qualityOfService the quality of communication
256 * @throws OcException
258 public static void findResource(
261 OcConnectivityType connectivityType,
262 OnResourceFoundListener onResourceFoundListener,
263 QualityOfService qualityOfService) throws OcException {
264 OcPlatform.initCheck();
265 OcPlatform.findResource1(host,
267 connectivityType.getValue(),
268 onResourceFoundListener,
269 qualityOfService.getValue()
273 private static native void findResource1(
276 int connectivityType,
277 OnResourceFoundListener onResourceFoundListener,
278 int qualityOfService) throws OcException;
281 * API for Device Discovery
283 * @param host Host IP Address. If null or empty, Multicast is performed.
284 * @param deviceUri Uri containing address to the virtual device
285 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
287 * @param onDeviceFoundListener Handles events, success states and failure states.
288 * @throws OcException
290 public static void getDeviceInfo(
293 OcConnectivityType connectivityType,
294 OnDeviceFoundListener onDeviceFoundListener) throws OcException {
295 OcPlatform.initCheck();
296 OcPlatform.getDeviceInfo0(
299 connectivityType.getValue(),
300 onDeviceFoundListener
304 private static native void getDeviceInfo0(
307 int connectivityType,
308 OnDeviceFoundListener onDeviceFoundListener) throws OcException;
311 * API for Device Discovery
313 * @param host Host IP Address. If null or empty, Multicast is performed.
314 * @param deviceUri Uri containing address to the virtual device
315 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
317 * @param onDeviceFoundListener Handles events, success states and failure states.
318 * @param qualityOfService the quality of communication
319 * @throws OcException
321 public static void getDeviceInfo(
324 OcConnectivityType connectivityType,
325 OnDeviceFoundListener onDeviceFoundListener,
326 QualityOfService qualityOfService) throws OcException {
327 OcPlatform.initCheck();
328 OcPlatform.getDeviceInfo1(
331 connectivityType.getValue(),
332 onDeviceFoundListener,
333 qualityOfService.getValue()
337 private static native void getDeviceInfo1(
340 int connectivityType,
341 OnDeviceFoundListener onDeviceFoundListener,
342 int qualityOfService) throws OcException;
345 * API for Platform Discovery
347 * @param host Host IP Address. If null or empty, Multicast is performed.
348 * @param platformUri Uri containing address to the platform
349 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
351 * @param onPlatformFoundListener Handles events, success states and failure states.
352 * @throws OcException
355 public static void getPlatformInfo(
358 OcConnectivityType connectivityType,
359 OnPlatformFoundListener onPlatformFoundListener) throws OcException {
360 OcPlatform.initCheck();
361 OcPlatform.getPlatformInfo0(
364 connectivityType.getValue(),
365 onPlatformFoundListener
369 private static native void getPlatformInfo0(
372 int connectivityType,
373 OnPlatformFoundListener onPlatformInfoFoundListener) throws OcException;
376 * API for Platform Discovery
378 * @param host Host IP Address. If null or empty, Multicast is performed.
379 * @param platformUri Uri containing address to the platform
380 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
382 * @param onPlatformFoundListener Handles events, success states and failure states.
383 * @param qualityOfService the quality of communication
384 * @throws OcException
387 public static void getPlatformInfo(
390 OcConnectivityType connectivityType,
391 OnPlatformFoundListener onPlatformFoundListener,
392 QualityOfService qualityOfService) throws OcException {
393 OcPlatform.initCheck();
394 OcPlatform.getPlatformInfo1(
397 connectivityType.getValue(),
398 onPlatformFoundListener,
399 qualityOfService.getValue()
403 private static native void getPlatformInfo1(
406 int connectivityType,
407 OnPlatformFoundListener onPlatformFoundListener,
408 int qualityOfService) throws OcException;
411 * This API registers a resource with the server NOTE: This API applies to server side only.
413 * @param ocResource The instance of OcResource with all data filled
414 * @return resource handle
415 * @throws OcException
417 public static OcResourceHandle registerResource(
418 OcResource ocResource) throws OcException {
419 OcPlatform.initCheck();
420 return OcPlatform.registerResource0(ocResource);
423 private static native OcResourceHandle registerResource0(
424 OcResource ocResource) throws OcException;
427 * This API registers a resource with the server NOTE: This API applies to server side only.
429 * @param resourceUri The URI of the resource. Example: "a/light"
430 * @param resourceTypeName The resource type. Example: "light"
431 * @param resourceInterface The resource interface (whether it is collection etc).
432 * @param entityHandler entity handler.
433 * @param resourcePropertySet indicates the property of the resource
434 * @return resource handle
435 * @throws OcException
437 public static OcResourceHandle registerResource(
439 String resourceTypeName,
440 String resourceInterface,
441 EntityHandler entityHandler,
442 EnumSet<ResourceProperty> resourcePropertySet) throws OcException {
443 OcPlatform.initCheck();
447 for (ResourceProperty prop : ResourceProperty.values()) {
448 if (resourcePropertySet.contains(prop))
449 resProperty |= prop.getValue();
452 return OcPlatform.registerResource1(resourceUri,
459 private static native OcResourceHandle registerResource1(
461 String resourceTypeName,
462 String resourceInterface,
463 EntityHandler entityHandler,
464 int resourceProperty) throws OcException;
467 * Register Device Info
469 * @param ocDeviceInfo object containing all the device specific information
470 * @throws OcException
472 public static void registerDeviceInfo(
473 OcDeviceInfo ocDeviceInfo) throws OcException {
474 OcPlatform.initCheck();
475 OcPlatform.registerDeviceInfo0(
476 ocDeviceInfo.getDeviceName()
480 private static native void registerDeviceInfo0(
482 ) throws OcException;
485 * Register Platform Info
487 * @param ocPlatformInfo object containing all the platform specific information
488 * @throws OcException
490 public static void registerPlatformInfo(
491 OcPlatformInfo ocPlatformInfo) throws OcException {
492 OcPlatform.initCheck();
493 OcPlatform.registerPlatformInfo0(
494 ocPlatformInfo.getPlatformID(),
495 ocPlatformInfo.getManufacturerName(),
496 ocPlatformInfo.getManufacturerUrl(),
497 ocPlatformInfo.getModelNumber(),
498 ocPlatformInfo.getDateOfManufacture(),
499 ocPlatformInfo.getPlatformVersion(),
500 ocPlatformInfo.getOperatingSystemVersion(),
501 ocPlatformInfo.getHardwareVersion(),
502 ocPlatformInfo.getFirmwareVersion(),
503 ocPlatformInfo.getSupportUrl(),
504 ocPlatformInfo.getSystemTime()
508 private static native void registerPlatformInfo0(
509 String platformId, String manufacturerName, String manufacturerUrl,
510 String modelNumber, String dateOfManufacture, String platformVersion,
511 String operatingSystemVersion, String hardwareVersion, String firmwareVersion,
512 String supportUrl, String systemTime
513 ) throws OcException;
516 * This API unregisters a resource with the server NOTE: This API applies to server side only.
518 * @param ocResourceHandle This is the resource handle which we which to unregister from the
520 * @throws OcException
522 public static void unregisterResource(
523 OcResourceHandle ocResourceHandle) throws OcException {
524 OcPlatform.initCheck();
525 OcPlatform.unregisterResource0(ocResourceHandle);
528 private static native void unregisterResource0(
529 OcResourceHandle ocResourceHandle) throws OcException;
533 * Add a resource to a collection resource
535 * @param ocResourceCollectionHandle handle to the collection resource
536 * @param ocResourceHandle handle to resource to be added to the collection resource
537 * @throws OcException
539 public static void bindResource(
540 OcResourceHandle ocResourceCollectionHandle,
541 OcResourceHandle ocResourceHandle) throws OcException {
542 OcPlatform.initCheck();
543 OcPlatform.bindResource0(ocResourceCollectionHandle, ocResourceHandle);
546 private static native void bindResource0(
547 OcResourceHandle ocResourceCollectionHandle,
548 OcResourceHandle ocResourceHandle) throws OcException;
551 * Add multiple resources to a collection resource.
553 * @param ocResourceCollectionHandle handle to the collection resource
554 * @param ocResourceHandleList reference to list of resource handles to be added to the
555 * collection resource
556 * @throws OcException
558 public static void bindResources(
559 OcResourceHandle ocResourceCollectionHandle,
560 List<OcResourceHandle> ocResourceHandleList) throws OcException {
561 OcPlatform.initCheck();
562 OcPlatform.bindResources0(
563 ocResourceCollectionHandle,
564 ocResourceHandleList.toArray(
565 new OcResourceHandle[ocResourceHandleList.size()])
569 private static native void bindResources0(
570 OcResourceHandle ocResourceCollectionHandle,
571 OcResourceHandle[] ocResourceHandleArray) throws OcException;
574 * Unbind a resource from a collection resource.
576 * @param ocResourceCollectionHandle handle to the collection resource
577 * @param ocResourceHandle resource handle to be unbound from the collection resource
578 * @throws OcException
580 public static void unbindResource(
581 OcResourceHandle ocResourceCollectionHandle,
582 OcResourceHandle ocResourceHandle) throws OcException {
583 OcPlatform.initCheck();
584 OcPlatform.unbindResource0(ocResourceCollectionHandle, ocResourceHandle);
587 private static native void unbindResource0(
588 OcResourceHandle ocResourceCollectionHandle,
589 OcResourceHandle ocResourceHandle) throws OcException;
592 * Unbind resources from a collection resource.
594 * @param ocResourceCollectionHandle Handle to the collection resource
595 * @param ocResourceHandleList List of resource handles to be unbound from the collection
597 * @throws OcException
599 public static void unbindResources(
600 OcResourceHandle ocResourceCollectionHandle,
601 List<OcResourceHandle> ocResourceHandleList) throws OcException {
602 OcPlatform.initCheck();
603 OcPlatform.unbindResources0(
604 ocResourceCollectionHandle,
605 ocResourceHandleList.toArray(
606 new OcResourceHandle[ocResourceHandleList.size()])
610 private static native void unbindResources0(
611 OcResourceHandle ocResourceCollectionHandle,
612 OcResourceHandle[] ocResourceHandleArray) throws OcException;
615 * Binds a type to a particular resource
617 * @param ocResourceHandle handle to the resource
618 * @param resourceTypeName new typename to bind to the resource
619 * @throws OcException
621 public static void bindTypeToResource(
622 OcResourceHandle ocResourceHandle,
623 String resourceTypeName) throws OcException {
624 OcPlatform.initCheck();
625 OcPlatform.bindTypeToResource0(ocResourceHandle, resourceTypeName);
628 private static native void bindTypeToResource0(
629 OcResourceHandle ocResourceHandle,
630 String resourceTypeName) throws OcException;
633 * Binds an interface to a particular resource
635 * @param ocResourceHandle handle to the resource
636 * @param resourceInterfaceName new interface to bind to the resource
637 * @throws OcException
639 public static void bindInterfaceToResource(
640 OcResourceHandle ocResourceHandle,
641 String resourceInterfaceName) throws OcException {
642 OcPlatform.initCheck();
643 OcPlatform.bindInterfaceToResource0(ocResourceHandle, resourceInterfaceName);
646 private static native void bindInterfaceToResource0(
647 OcResourceHandle ocResourceHandle,
648 String resourceInterfaceName) throws OcException;
651 * Start Presence announcements.
653 * @param ttl time to live in seconds
654 * @throws OcException
656 public static void startPresence(int ttl) throws OcException {
657 OcPlatform.initCheck();
658 OcPlatform.startPresence0(ttl);
661 private static native void startPresence0(int ttl) throws OcException;
664 * Stop Presence announcements.
666 * @throws OcException
668 public static void stopPresence() throws OcException {
669 OcPlatform.initCheck();
670 OcPlatform.stopPresence0();
673 private static native void stopPresence0() throws OcException;
676 * Subscribes to a server's presence change events. By making this subscription, every time a
677 * server adds/removes/alters a resource, starts or is intentionally stopped
679 * @param host The IP address/addressable name of the server to subscribe to
680 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
682 * @param onPresenceListener listener that will receive notifications/subscription events
683 * @return a handle object that can be used to identify this subscription request. It can be
684 * used to unsubscribe from these events in the future
685 * @throws OcException
687 public static OcPresenceHandle subscribePresence(
689 OcConnectivityType connectivityType,
690 OnPresenceListener onPresenceListener) throws OcException {
691 OcPlatform.initCheck();
692 return OcPlatform.subscribePresence0(
694 connectivityType.getValue(),
699 private static native OcPresenceHandle subscribePresence0(
701 int connectivityType,
702 OnPresenceListener onPresenceListener) throws OcException;
705 * Subscribes to a server's presence change events. By making this subscription, every time a
706 * server adds/removes/alters a resource, starts or is intentionally stopped
708 * @param host The IP address/addressable name of the server to subscribe to
709 * @param resourceType a resource type specified as a filter for subscription events.
710 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
712 * @param onPresenceListener listener that will receive notifications/subscription events
713 * @return a handle object that can be used to identify this subscription request. It can be
714 * used to unsubscribe from these events in the future
715 * @throws OcException
717 public static OcPresenceHandle subscribePresence(
720 OcConnectivityType connectivityType,
721 OnPresenceListener onPresenceListener) throws OcException {
722 OcPlatform.initCheck();
723 return OcPlatform.subscribePresence1(
726 connectivityType.getValue(),
730 private static native OcPresenceHandle subscribePresence1(
733 int connectivityType,
734 OnPresenceListener onPresenceListener) throws OcException;
737 * Unsubscribes from a previously subscribed server's presence events. Note that you may for
738 * a short time still receive events from the server since it may take time for the
739 * unsubscribe to take effect.
741 * @param ocPresenceHandle the handle object provided by the subscribePresence call that
742 * identifies this subscription
743 * @throws OcException
745 public static void unsubscribePresence(
746 OcPresenceHandle ocPresenceHandle) throws OcException {
747 OcPlatform.initCheck();
748 OcPlatform.unsubscribePresence0(ocPresenceHandle);
751 private static native void unsubscribePresence0(
752 OcPresenceHandle ocPresenceHandle) throws OcException;
755 * Creates a resource proxy object so that get/put/observe functionality can be used without
756 * discovering the object in advance. Note that the consumer of this method needs to provide
757 * all of the details required to correctly contact and observe the object. If the consumer
758 * lacks any of this information, they should discover the resource object normally.
759 * Additionally, you can only create this object if OcPlatform was initialized to be a Client
762 * @param host a string containing a resolvable host address of the server holding
764 * @param uri the rest of the resource's URI that will permit messages to be
767 * @param connectivityType a type of connectivity indicating the interface. Example: IPV4,
769 * @param isObservable a boolean containing whether the resource supports observation
770 * @param resourceTypeList a collection of resource types implemented by the resource
771 * @param interfaceList a collection of interfaces that the resource supports/implements
772 * @return new resource object
773 * @throws OcException
775 public static OcResource constructResourceObject(
778 OcConnectivityType connectivityType,
779 boolean isObservable,
780 List<String> resourceTypeList,
781 List<String> interfaceList) throws OcException {
782 OcPlatform.initCheck();
783 return OcPlatform.constructResourceObject0(
786 connectivityType.getValue(),
788 resourceTypeList.toArray(new String[resourceTypeList.size()]),
789 interfaceList.toArray(new String[interfaceList.size()])
793 private static native OcResource constructResourceObject0(
796 int connectivityType,
797 boolean isObservable,
798 String[] resourceTypes,
799 String[] interfaces) throws OcException;
802 * Allows application entity handler to send response to an incoming request.
804 * @param ocResourceResponse resource response
805 * @throws OcException
807 public static void sendResponse(OcResourceResponse ocResourceResponse)
809 OcPlatform.initCheck();
810 OcPlatform.sendResponse0(ocResourceResponse);
813 private static native void sendResponse0(OcResourceResponse ocResourceResponse)
817 * An OnResourceFoundListener can be registered via the OcPlatform.findResource call.
818 * Event listeners are notified asynchronously
820 public interface OnResourceFoundListener {
821 public void onResourceFound(OcResource resource);
825 * An OnDeviceFoundListener can be registered via the OcPlatform.getDeviceInfo call.
826 * Event listeners are notified asynchronously
828 public interface OnDeviceFoundListener {
829 public void onDeviceFound(OcRepresentation ocRepresentation);
833 * An OnPlatformFoundListener can be registered via the OcPlatform.getPlatformInfo call.
834 * Event listeners are notified asynchronously
836 public interface OnPlatformFoundListener {
837 public void onPlatformFound(OcRepresentation ocRepresentation);
841 * An OnPresenceListener can be registered via the OcPlatform.subscribePresence call.
842 * Event listeners are notified asynchronously
844 public interface OnPresenceListener {
845 public void onPresence(OcPresenceStatus ocPresenceStatus, int nonce, String hostAddress);
849 * An EntityHandler can be registered via the OcPlatform.registerResource call.
850 * Event listeners are notified asynchronously
852 public interface EntityHandler {
853 public EntityHandlerResult handleEntity(OcResourceRequest ocResourceRequest);
856 private static void initCheck() {
857 if (!sIsPlatformInitialized) {
858 throw new IllegalStateException("OcPlatform must be configured by making a call to " +
859 "OcPlatform.Configure before any other API calls are permitted");