/** * 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)); }
/** * 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 an <b>Object Instance</b> using the TLV content format. * * @param mode the mode of the request : replace or update. * @param objectId the id of the object to write. * @param objectInstanceId the id of the object instance to write. * @param resources the list of resources to write. */ public WriteRequest(Mode mode, int objectId, int objectInstanceId, LwM2mResource... resources) { this(mode, ContentFormat.TLV, new LwM2mPath(objectId, objectInstanceId), new LwM2mObjectInstance(objectId, resources)); }
/** * 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)); }
/** * 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>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)); }
public static byte[] getPskKey(LwM2mObjectInstance securityInstance) { return (byte[]) securityInstance.getResource(SEC_SECRET_KEY).getValue(); }
/** * Request to write a <b> Date 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, Date value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newDateResource(resourceId, value)); }
/** * Request to write a <b> Objlnk Single-Instance Resource</b> using the given content format (TLV, JSON, TEXT). * * @exception InvalidRequestException if bad @{link ContentFormat} format was used. */ public WriteRequest(ContentFormat contentFormat, int objectId, int objectInstanceId, int resourceId, ObjectLink value) throws InvalidRequestException { this(Mode.REPLACE, contentFormat, new LwM2mPath(objectId, objectInstanceId, resourceId), LwM2mSingleResource.newObjectLinkResource(resourceId, value)); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((path == null) ? 0 : path.hashCode()); return result; }
/** * Request to write an <b>Object Instance</b> using the TLV content format. * * @param mode the mode of the request : replace or update. * @param objectId the id of the object to write. * @param objectInstanceId the id of the object instance to write. * @param resources the list of resources to write. */ public WriteRequest(Mode mode, int objectId, int objectInstanceId, Collection<LwM2mResource> resources) { this(mode, ContentFormat.TLV, new LwM2mPath(objectId, objectInstanceId), new LwM2mObjectInstance(objectId, resources)); }
/** * 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)); }
/** * Creates a request for discovering the resources implemented by a client for a particular object type. * * @param objectId the object type */ public DiscoverRequest(int objectId) { this(new LwM2mPath(objectId)); }
/** * Creates a request for discovering the attributes of a particular resource implemented by a client. * * @param objectId the object type * @param objectInstanceId the object instance * @param resourceId the resource */ public DiscoverRequest(int objectId, int objectInstanceId, int resourceId) { this(new LwM2mPath(objectId, objectInstanceId, resourceId)); }
/** * Creates a request for observing future changes of a particular object instance of 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 ObserveRequest(ContentFormat format, int objectId, int objectInstanceId) { this(format, new LwM2mPath(objectId, objectInstanceId), null); }
/** * 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)); }