@Path("/")
public final class RootResourceDiscoveryServiceImpl implements RootResourceDiscoveryService {
- private final Response xrdData = Response.status(Status.OK)
- .entity("<?xml version='1.0' encoding='UTF-8'?>\n"
- + "<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>\n"
- + " <Link rel='restconf' href='/" + RestconfConstants.BASE_URI_PATTERN + "'/>\n"
- + "</XRD>")
- .build();
- private final Response jsonData = Response.status(Status.OK)
- .entity("{\n"
- + " \"links\" :\n"
- + " {\n"
- + " \"rel\" : \"restconf\",\n"
- + " \"href\" : \"/" + RestconfConstants.BASE_URI_PATTERN + "/\"\n"
- + " }\n"
- + "}")
- .build();
@Override
public Response readXrdData() {
- return xrdData;
+ return Response.status(Status.OK)
+ .entity("<?xml version='1.0' encoding='UTF-8'?>\n"
+ + "<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>\n"
+ + " <Link rel='restconf' href='/" + RestconfConstants.BASE_URI_PATTERN + "'/>\n"
+ + "</XRD>")
+ .build();
}
@Override
public Response readJsonData() {
- return jsonData;
+ return Response.status(Status.OK)
+ .entity("{\n"
+ + " \"links\" :\n"
+ + " {\n"
+ + " \"rel\" : \"restconf\",\n"
+ + " \"href\" : \"/" + RestconfConstants.BASE_URI_PATTERN + "/\"\n"
+ + " }\n"
+ + "}")
+ .build();
}
}