blob: c221d7c1d7fced2eb096a6b81ff8b5af26b9c057 [file] [log] [blame]
Andrew Brown2f1fdbf2015-01-21 10:52:29 -08001/*
2 * File name: ControlResponse.java
3 *
4 * Purpose: Represent a ControlResponse, a Data packet sent in response to a
5 * ControlCommand to the NFD, see http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
6 *
7 * © Copyright Intel Corporation. All rights reserved.
8 * Intel Corporation, 2200 Mission College Boulevard,
9 * Santa Clara, CA 95052-8119, USA
10 */
11package com.intel.jndn.management;
12
13import java.util.List;
14import net.named_data.jndn.ControlParameters;
15import net.named_data.jndn.Data;
16import net.named_data.jndn.encoding.EncodingException;
17
18/**
19 *
20 * @author Andrew Brown <andrew.brown@intel.com>
21 */
22public class ControlResponse {
23 public int StatusCode;
24 public String StatusText;
25 public List<ControlParameters> Body;
26
27 /**
28 * Decode input as a ControlResponse in NDN-TLV and set the fields of the
29 * new object
30 *
31 * @param data
32 * @return
33 */
34 public static ControlResponse decode(Data data) throws EncodingException{
35 ControlResponseDecoder decoder = new ControlResponseDecoder();
36 ControlResponse response = new ControlResponse();
37 decoder.decodeControlResponse(response, data.getContent().buf());
38 return response;
39 }
40}