@Override public void accept(UplinkRequestVisitor visitor) { visitor.visit(this); } }
/** * Creates a new <em>execute</em> request for a resource that does not require any parameters. * * @param path the path of the resource to execute * @exception InvalidRequestException if the path is not valid. */ public ExecuteRequest(String path) throws InvalidRequestException { this(newPath(path), null); }
@Override public void visit(ReadRequest request) { o.add("kind", "read"); if (request.getContentFormat() != null) o.add("contentFormat", request.getContentFormat().getCode()); } });
@Override public void visit(ObserveRequest request) { o.add("kind", "observe"); if (request.getContentFormat() != null) o.add("contentFormat", request.getContentFormat().getCode()); }
/** * Gets the client's network socket address. * * @return the source address from the client's most recent CoAP message. */ public InetSocketAddress getSocketAddress() { return identity.getPeerAddress(); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((contentFormat == null) ? 0 : contentFormat.hashCode()); result = prime * result + ((mode == null) ? 0 : mode.hashCode()); result = prime * result + ((node == null) ? 0 : node.hashCode()); return result; }
@Override public void accept(DownlinkRequestVisitor visitor) { visitor.visit(this); }
/** * Creates a request for observing future changes of a particular LWM2M node (object, object instance or resource). * * @param path the path to the LWM2M node to observe * @exception InvalidRequestException if the path is not valid. */ public ObserveRequest(String path) throws InvalidRequestException { this(null, newPath(path), null); }
/** * Creates a request for deleting object instances implemented by a client. (except the LwM2M Bootstrap-Server * Account and the Instance of the Device Object) * * @param path the path (could be a root path, an object path or an object instance path) * @exception InvalidRequestException if the path is not valid. */ public BootstrapDeleteRequest(String path) throws InvalidRequestException { this(newPath(path)); }
/** * Creates a request for deleting a particular object instance implemented by a client. * * @param path the path of the instance to delete * @exception InvalidRequestException if the path is not valid. */ public DeleteRequest(String path) throws InvalidRequestException { this(newPath(path)); }
/** * 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); }
/** * Create a request for discovering the attributes of a particular object/instance/resource targeted by a specific * path. * * @param path the path of the LWM2M node to discover * @exception InvalidRequestException if the path is not valid. */ public DiscoverRequest(String path) throws InvalidRequestException { this(newPath(path)); }
@Override public void accept(UplinkRequestVisitor visitor) { visitor.visit(this); } }
@Override public void accept(DownlinkRequestVisitor visitor) { visitor.visit(this); }
/** * Creates a new <em>execute</em> request for a resource accepting parameters encoded as plain text. * * @param path the path of the resource to execute * @param parameters the parameters * @exception InvalidRequestException if the path is not valid. */ public ExecuteRequest(String path, String parameters) throws InvalidRequestException { this(newPath(path), parameters); }
/** * Creates a request for observing future changes of a particular LWM2M node (object, object instance or resource). * * @param format the desired format for the response * @param path the path to the LWM2M node to observe * @exception InvalidRequestException if the path is not valid. */ public ObserveRequest(ContentFormat format, String path) throws InvalidRequestException { this(format, newPath(path), null); }
@Override public void accept(UplinkRequestVisitor visitor) { visitor.visit(this); } }
@Override public void accept(DownlinkRequestVisitor visitor) { visitor.visit(this); }