public abstract class RestHandler extends RouteHandler
| Modifier and Type | Class and Description |
|---|---|
protected static class |
RestHandler.NameDescriptionWithId<T extends NameDescription> |
HTTP_DATE_FORMAT, HTTP_DATE_GMT_TIMEZONE| Constructor and Description |
|---|
RestHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
abortRequest(RestRequest req) |
protected static boolean |
authorised(RestRequest req,
Privilege.Type type,
String privilege) |
protected static void |
checkSystemPrivilege(RestRequest req,
Privilege.SystemPrivilege priv) |
static void |
completeChunkedTransfer(RestRequest req) |
protected static void |
completeOK(RestRequest restRequest) |
protected static void |
completeOK(RestRequest restRequest,
MediaType contentType,
io.netty.buffer.ByteBuf body) |
protected static <T extends com.google.protobuf.Message> |
completeOK(RestRequest restRequest,
T responseMsg) |
protected static void |
completeWithError(RestRequest req,
HttpException e)
write the error to the client and complete the request exceptionally
|
static <T extends com.google.protobuf.Message> |
sendMessageResponse(RestRequest restRequest,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg) |
protected static io.netty.channel.ChannelFuture |
sendRestError(RestRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
Throwable t) |
protected static AlarmServer |
verifyAlarmServer(Processor processor) |
protected static Algorithm |
verifyAlgorithm(RestRequest req,
XtceDb mdb,
String pathName) |
protected void |
verifyAuthorization(AuthenticationToken authToken,
Privilege.SystemPrivilege p) |
protected static void |
verifyAuthorization(AuthenticationToken authToken,
Privilege.Type type,
Collection<String> names) |
protected static void |
verifyAuthorization(AuthenticationToken authToken,
Privilege.Type type,
String... names) |
protected static YamcsManagement.ClientInfo |
verifyClient(RestRequest req,
int clientId) |
protected static MetaCommand |
verifyCommand(RestRequest req,
XtceDb mdb,
String pathName) |
protected static SequenceContainer |
verifyContainer(RestRequest req,
XtceDb mdb,
String pathName) |
protected static String |
verifyInstance(RestRequest req,
String instance) |
protected static YamcsManagement.LinkInfo |
verifyLink(RestRequest req,
String instance,
String linkName) |
protected static String |
verifyNamespace(RestRequest req,
XtceDb mdb,
String pathName) |
protected static Parameter |
verifyParameter(RestRequest req,
XtceDb mdb,
String pathName) |
protected static Yamcs.NamedObjectId |
verifyParameterId(RestRequest req,
XtceDb mdb,
String pathName) |
protected static RestHandler.NameDescriptionWithId<Parameter> |
verifyParameterWithId(RestRequest req,
XtceDb mdb,
String pathName) |
protected static Processor |
verifyProcessor(RestRequest req,
String instance,
String processorName) |
protected static SpaceSystem |
verifySpaceSystem(RestRequest req,
XtceDb mdb,
String pathName) |
protected static Stream |
verifyStream(RestRequest req,
YarchDatabaseInstance ydb,
String streamName) |
protected static TableDefinition |
verifyTable(RestRequest req,
YarchDatabaseInstance ydb,
String tableName) |
setDateAndCacheHeaders, setDateHeaderprotected static void completeOK(RestRequest restRequest)
protected static <T extends com.google.protobuf.Message> void completeOK(RestRequest restRequest, T responseMsg)
protected static void completeOK(RestRequest restRequest, MediaType contentType, io.netty.buffer.ByteBuf body)
public static <T extends com.google.protobuf.Message> io.netty.channel.ChannelFuture sendMessageResponse(RestRequest restRequest, io.netty.handler.codec.http.HttpResponseStatus status, T responseMsg)
protected static io.netty.channel.ChannelFuture sendRestError(RestRequest req, io.netty.handler.codec.http.HttpResponseStatus status, Throwable t)
protected static void completeWithError(RestRequest req, HttpException e)
req - e - protected static void abortRequest(RestRequest req)
protected static String verifyInstance(RestRequest req, String instance) throws NotFoundException
NotFoundExceptionprotected static YamcsManagement.LinkInfo verifyLink(RestRequest req, String instance, String linkName) throws NotFoundException
NotFoundExceptionprotected static YamcsManagement.ClientInfo verifyClient(RestRequest req, int clientId) throws NotFoundException
NotFoundExceptionprotected static Processor verifyProcessor(RestRequest req, String instance, String processorName) throws NotFoundException
NotFoundExceptionprotected static String verifyNamespace(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static SpaceSystem verifySpaceSystem(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static Yamcs.NamedObjectId verifyParameterId(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static Parameter verifyParameter(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static RestHandler.NameDescriptionWithId<Parameter> verifyParameterWithId(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static Stream verifyStream(RestRequest req, YarchDatabaseInstance ydb, String streamName) throws NotFoundException
NotFoundExceptionprotected static TableDefinition verifyTable(RestRequest req, YarchDatabaseInstance ydb, String tableName) throws NotFoundException
NotFoundExceptionprotected static MetaCommand verifyCommand(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static Algorithm verifyAlgorithm(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static SequenceContainer verifyContainer(RestRequest req, XtceDb mdb, String pathName) throws NotFoundException
NotFoundExceptionprotected static AlarmServer verifyAlarmServer(Processor processor) throws BadRequestException
BadRequestExceptionprotected static boolean authorised(RestRequest req, Privilege.Type type, String privilege)
public static void completeChunkedTransfer(RestRequest req)
protected static void checkSystemPrivilege(RestRequest req, Privilege.SystemPrivilege priv) throws HttpException
HttpExceptionprotected void verifyAuthorization(AuthenticationToken authToken, Privilege.SystemPrivilege p) throws ForbiddenException
ForbiddenExceptionprotected static void verifyAuthorization(AuthenticationToken authToken, Privilege.Type type, Collection<String> names) throws ForbiddenException
ForbiddenExceptionprotected static void verifyAuthorization(AuthenticationToken authToken, Privilege.Type type, String... names) throws ForbiddenException
ForbiddenExceptionCopyright © 2018 Space Applications Services. All rights reserved.