Package org.forgerock.am.iot
Class ThingsResource
- java.lang.Object
-
- org.forgerock.am.iot.ThingsResource
-
- All Implemented Interfaces:
CollectionResourceProvider
public class ThingsResource extends Object implements CollectionResourceProvider
ThingsResource handles REST calls made to the things endpoint. It provides access to a thing's identity attributes and actions that can be performed on the thing. Note that this endpoint is not annotated with API description as it is not a supported endpoint and therefore should not be part of the API documentation or Amster.
-
-
Constructor Summary
Constructors Constructor Description ThingsResource(org.forgerock.openam.core.CoreWrapper coreWrapper, IotServiceConfig iotServiceConfig, Map<String,org.forgerock.am.iot.ThingsActionHandler> actionHandlers)
Create a new instance of the ThingsResource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<ActionResponse,ResourceException>
actionInstance(Context context, String id, ActionRequest request)
Performs the providedaction
against a resource within the collection.Promise<ResourceResponse,ResourceException>
readInstance(Context context, String id, ReadRequest request)
Reads
an existing resource within the collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.json.resource.CollectionResourceProvider
actionCollection, createInstance, deleteInstance, patchInstance, queryCollection, updateInstance
-
-
-
-
Constructor Detail
-
ThingsResource
@Inject public ThingsResource(org.forgerock.openam.core.CoreWrapper coreWrapper, IotServiceConfig iotServiceConfig, @Named("ThingsActionHandlers") Map<String,org.forgerock.am.iot.ThingsActionHandler> actionHandlers)
Create a new instance of the ThingsResource.- Parameters:
coreWrapper
- wrapper for abstracting core AM functionality.iotServiceConfig
- interface for accessing IoT service configuration in a given realm.actionHandlerFactory
- theThingsActionHandler
used for handling CREST actions.
-
-
Method Detail
-
actionInstance
public Promise<ActionResponse,ResourceException> actionInstance(Context context, String id, ActionRequest request)
Description copied from interface:CollectionResourceProvider
Performs the providedaction
against a resource within the collection.- Specified by:
actionInstance
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.id
- The ID of the targeted resource within the collection.request
- The action request.- Returns:
- A
Promise
containing the result of the operation. - See Also:
RequestHandler.handleAction(Context, ActionRequest)
-
readInstance
public Promise<ResourceResponse,ResourceException> readInstance(Context context, String id, ReadRequest request)
Description copied from interface:CollectionResourceProvider
Reads
an existing resource within the collection.- Specified by:
readInstance
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.id
- The ID of the targeted resource within the collection.request
- The read request.- Returns:
- A
Promise
containing the result of the operation. - See Also:
RequestHandler.handleRead(Context, ReadRequest)
-
-