/** * Creates a request for reading all instances of a particular object from a client. * * @param format the desired format for the response (TLV or JSON) * @param objectId the object ID of the resource */ public ReadRequest(ContentFormat format, int objectId) { this(format, new LwM2mPath(objectId)); }
/** * Creates a request for reading a specific resource from a client. * * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID * @param resourceId the (individual) resource's ID */ public ReadRequest(int objectId, int objectInstanceId, int resourceId) { this(null, new LwM2mPath(objectId, objectInstanceId, resourceId)); }
/** * Creates a request for reading a specific resource from a client. * * @param format the desired format for the response (TLV, JSON, TEXT or OPAQUE) * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID * @param resourceId the (individual) resource's ID */ public ReadRequest(ContentFormat format, int objectId, int objectInstanceId, int resourceId) { this(format, new LwM2mPath(objectId, objectInstanceId, resourceId)); }
/** * Creates a new <em>execute</em> request for a resource that does not require any parameters. * * @param objectId the resource's object ID * @param objectInstanceId the resource's object instance ID * @param resourceId the resource's ID */ public ExecuteRequest(int objectId, int objectInstanceId, int resourceId) { this(new LwM2mPath(objectId, objectInstanceId, resourceId), null); }
/** * Creates a request for observing future changes of all instances of a particular object of a client. * * @param objectId the object ID of the resource */ public ObserveRequest(int objectId) { this(null, new LwM2mPath(objectId), null); }
/** * Creates a request for observing future changes of a particular object instance of a client. * * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID */ public ObserveRequest(int objectId, int objectInstanceId) { this(null, new LwM2mPath(objectId, objectInstanceId), null); }
/** * Creates a request for observing future changes of a specific resource of a client. * * @param format the desired format for the response (TLV, JSON, TEXT or OPAQUE) * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID * @param resourceId the (individual) resource's ID */ public ObserveRequest(ContentFormat format, int objectId, int objectInstanceId, int resourceId) { this(format, new LwM2mPath(objectId, objectInstanceId, resourceId), null); }
/** * Create a request for reading an object/instance/resource targeted by a specific path. * * @param format the desired format for the response * @param path the path to the LWM2M node to read * @throws IllegalArgumentException if the target path is not valid */ public ReadRequest(ContentFormat format, String path) { this(format, new LwM2mPath(path)); }
/** * Creates a request for discovering the resources implemented by a client for a particular object instance. * * @param objectId the object type * @param objectInstanceId the object instance */ public DiscoverRequest(int objectId, int objectInstanceId) { this(new LwM2mPath(objectId, objectInstanceId)); }
/** * Creates a request for deleting a particular object instance implemented by a client. (except the LwM2M * Bootstrap-Server Account and the Instance of the Device Object) * * @param objectId the object type * @param objectInstanceId the object instance */ public BootstrapDeleteRequest(int objectId, int objectInstanceId) { this(new LwM2mPath(objectId, objectInstanceId)); }
/** * Creates a request for reading a particular object instance from a client. * * @param format the desired format for the response (TLV or JSON) * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID */ public ReadRequest(ContentFormat format, int objectId, int objectInstanceId) { this(format, new LwM2mPath(objectId, objectInstanceId)); }
/** * Creates a request for observing future changes of all instances of a particular object of a client. * * @param format the desired format for the response (TLV or JSON) * @param objectId the object ID of the resource */ public ObserveRequest(ContentFormat format, int objectId) { this(format, new LwM2mPath(objectId), null); }
/** * Creates a request for observing future changes of a specific resource of a client. * * @param objectId the object ID of the resource * @param objectInstanceId the object instance ID * @param resourceId the (individual) resource's ID */ public ObserveRequest(int objectId, int objectInstanceId, int resourceId) { this(null, new LwM2mPath(objectId, objectInstanceId, resourceId), null); }
/** * Creates a request for deleting all instances of a particular object implemented by a client. (except the LwM2M * Bootstrap-Server Account and the Instance of the Device Object) * * @param objectId the object Id */ public BootstrapDeleteRequest(int objectId) { this(new LwM2mPath(objectId)); }
/** * Request to write a <b>Integer Single-Instance Resource</b> using the given content format (TEXT, TLV, JSON). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, long value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newIntegerResource(resourceId, value)); }
/** * Request to write a <b>String Single-Instance Resource</b> using the given content format (TEXT, TLV, JSON). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, String value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newStringResource(resourceId, value)); }
/** * Request to write a <b>Boolean Single-Instance Resource</b> using the given content format (TEXT, TLV, JSON). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, boolean value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newBooleanResource(resourceId, value)); }
/** * Request to write a <b> Float Single-Instance Resource</b> using the given content format (TEXT, TLV, JSON). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, double value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newFloatResource(resourceId, value)); }
/** * Request to write a <b> Binary Single-Instance Resource</b> using the given content format (OPAQUE, TLV, JSON). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, byte[] value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newBinaryResource(resourceId, value)); }
/** * @param path the end of the new path * @return a new path which is the concatenation of this path and the given one in parameter. */ public LwM2mPath append(String path) { LwM2mPath pathToAdd = new LwM2mPath(path); if (isRoot()) { return pathToAdd; } else { return new LwM2mPath(this.toString() + pathToAdd.toString()); } }