/** * Creates a request for creating an instance of a particular object using the default TLV content format.<br> * If the path is an object path, the instance id will be chosen by the client and accessible in the CreateResponse. * To choose instance id at server side, the path must be an object instance path. * * @param path the target path (object or object instance) * @param resources the resource values for the new instance * @exception InvalidRequestException if the target path is not valid. */ public CreateRequest(String path, LwM2mResource... resources) throws InvalidRequestException { this(null, newPath(path), null, resources); }
/** * Creates a request for creating an instance of a particular object.<br> * If the path is an object path, the instance id will be chosen by the client and accessible in the CreateResponse. * To choose instance id at server side, the path must be an object instance path. * * @param contentFormat the payload format (TLV or JSON) * @param path the target path (object or object instance) * @param resources the resource values for the new instance * @exception InvalidRequestException if parameters are invalid. */ public CreateRequest(ContentFormat contentFormat, String path, LwM2mResource... resources) throws InvalidRequestException { this(contentFormat, newPath(path), null, resources); }
/** * Creates a request for creating an instance of a particular object.<br> * If the path is an object path, the instance id will be chosen by the client and accessible in the CreateResponse. * To choose instance id at server side, the path must be an object instance path. * * @param path the target path (object or object instance) * @param instance the object instance * @exception InvalidRequestException if the target path is not valid. */ public CreateRequest(String path, LwM2mObjectInstance instance) throws InvalidRequestException { this(null, newPath(path), instance.getId(), instance.getResources().values().toArray((new LwM2mResource[instance.getResources().size()]))); }
/** * Creates a request for creating an instance of a particular object.<br> * If the path is an object path, the instance id will be chosen by the client and accessible in the CreateResponse. * To choose instance id at server side, the path must be an object instance path. * * @param contentFormat the payload format (TLV or JSON) * @param path the target path (object or object instance) * @param instance the object instance * @exception InvalidRequestException if parameters are invalid. */ public CreateRequest(ContentFormat contentFormat, String path, LwM2mObjectInstance instance) throws InvalidRequestException { this(contentFormat, newPath(path), instance.getId(), instance.getResources().values().toArray((new LwM2mResource[instance.getResources().size()]))); }