Top Description Methods
org.osgi.service.onem2m

public Interface ServiceLayer

Annotations
@ProviderType
Imports
java.util.List, org.osgi.annotation.versioning.ProviderType, org.osgi.service.onem2m.dto.FilterCriteriaDTO, .NotificationDTO, .RequestPrimitiveDTO, .ResourceDTO, .ResponsePrimitiveDTO, org.osgi.util.promise.Promise

Primary Interface for an oneM2M application entity to send request and get response to/from other oneM2M entity.

It contains low level API and high level API. The only low level method is request() and other methods are categorized as high level API.

Method Summary

Modifier and TypeMethod and Description
public Promise<ResourceDTO>

Returns:

Promise of created resource
create
(String
URI for parent resource of the resource being created.
uri
,
ResourceDTO
resource data
resource
)

create resource

The create() method is a method to create new resource under specified uri.

public Promise<Boolean>

Returns:

promise of execution status
delete
(String
target URI for deleting resource
uri
)

delete resource

delete resource on the URI specified by uri argument.

public Promise<List<String>>

Returns:

list of URIs matching the condition specified in fc
discovery
(String
URI for resource tree to start the search
uri
,
FilterCriteriaDTO
filter criteria selecting resources
fc
)

find resources with filter condition specified in fc argument.

public Promise<List<String>>

Returns:

list of URIs matching the condition specified in fc
discovery
(String
URI for resource tree to start the search
uri
,
FilterCriteriaDTO
filter criteria
fc
,
RequestPrimitiveDTO.DesiredIdentifierResultType
Discovery Result Type (structured/unstructured)
drt
)

find resources with filter condition specified in fc argument.

public Promise<Boolean>

Returns:

Promise of notification execution status
notify
(String
uri of destination
uri
,
NotificationDTO
content of notification
notification
)

send notification

public Promise<ResponsePrimitiveDTO>

Returns:

promise of ResponseDTO.
request
(RequestPrimitiveDTO
request primitive
request
)

send a request and receive response.

public Promise<ResourceDTO>

Returns:

retrieved resource data
retrieve
(String
URI for retrieving resource
uri
)

retrieve resource

retrieve resource on URI specified by uri argument.

public Promise<ResourceDTO>

Returns:

retrieved resource data
retrieve
(String
URI for retrieving resource
uri
,
List<String>
names of the target attribute
targetAttributes
)

retrieve resource with selected attributes.

public Promise<ResourceDTO>

Returns:

updated resource
update
(String
URI for updating resource
uri
,
ResourceDTO
data resource
resource
)

update resource

The update() method is a method to update resource on the URI specified by uri argument.

Method Detail

createback to summary
public Promise<ResourceDTO> create(String uri, ResourceDTO resource)

create resource

The create() method is a method to create new resource under specified uri. The second argument resource is expression of resource to be generated. The resourceType field of the resourceDTO must be assigned. For other fields depends on resource type. Section 7.4 of TS-00004 specifies the optionalities of the fields.

Parameters
uri:String

URI for parent resource of the resource being created.

resource:ResourceDTO

resource data

Returns:Promise<ResourceDTO>

Promise of created resource

deleteback to summary
public Promise<Boolean> delete(String uri)

delete resource

delete resource on the URI specified by uri argument.

Parameters
uri:String

target URI for deleting resource

Returns:Promise<Boolean>

promise of execution status

discoveryback to summary
public Promise<List<String>> discovery(String uri, FilterCriteriaDTO fc)

find resources with filter condition specified in fc argument.

Discovery Result Type is kept as blank and default value of target CSE is used for the parameter.

Parameters
uri:String

URI for resource tree to start the search

fc:FilterCriteriaDTO

filter criteria selecting resources

Returns:Promise<List<String>>

list of URIs matching the condition specified in fc

discoveryback to summary
public Promise<List<String>> discovery(String uri, FilterCriteriaDTO fc, RequestPrimitiveDTO.DesiredIdentifierResultType drt)

find resources with filter condition specified in fc argument.

With this method application can specify desired identifier in result

Parameters
uri:String

URI for resource tree to start the search

fc:FilterCriteriaDTO

filter criteria

drt:RequestPrimitiveDTO.DesiredIdentifierResultType

Discovery Result Type (structured/unstructured)

Returns:Promise<List<String>>

list of URIs matching the condition specified in fc

notifyback to summary
public Promise<Boolean> notify(String uri, NotificationDTO notification)

send notification

Parameters
uri:String

uri of destination

notification:NotificationDTO

content of notification

Returns:Promise<Boolean>

Promise of notification execution status

requestback to summary
public Promise<ResponsePrimitiveDTO> request(RequestPrimitiveDTO request)

send a request and receive response.

This method allows very raw data type access and it enables all possible message exchanges among oneM2M entities. This is called the low level API. This method allows all possible operation of oneM2M. For the return type, OSGi Promise is used for allowing synchronous and asynchronous calling manner.

Parameters
request:RequestPrimitiveDTO

request primitive

Returns:Promise<ResponsePrimitiveDTO>

promise of ResponseDTO.

retrieveback to summary
public Promise<ResourceDTO> retrieve(String uri)

retrieve resource

retrieve resource on URI specified by uri argument. This method retrieve all attributes of the resource.

Parameters
uri:String

URI for retrieving resource

Returns:Promise<ResourceDTO>

retrieved resource data

retrieveback to summary
public Promise<ResourceDTO> retrieve(String uri, List<String> targetAttributes)

retrieve resource with selected attributes.

retrieve resource on URI specified by uri argument. This method retrieve selected attributes by targetAttributes argument. The retrieve() methods are methods to retrieve resource on URI specified by uri argument.

Parameters
uri:String

URI for retrieving resource

targetAttributes:List<String>

names of the target attribute

Returns:Promise<ResourceDTO>

retrieved resource data

updateback to summary
public Promise<ResourceDTO> update(String uri, ResourceDTO resource)

update resource

The update() method is a method to update resource on the URI specified by uri argument. The resource argument holds attributes to be updated. Attributes not to be updated shall not included in the argument.

Parameters
uri:String

URI for updating resource

resource:ResourceDTO

data resource

Returns:Promise<ResourceDTO>

updated resource