public class RestSwaggerUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ASSERT |
static int |
MAX_LIMIT_PER_PAGE |
static java.lang.String |
PROPERTY_REST_GRACE_PERIOD
Environment variable for the grace period.
|
Modifier and Type | Method and Description |
---|---|
static JSONObject |
docToJson(org.w3c.dom.Document doc)
convert the xml document to a json object
|
static java.lang.Object |
findPluginForClassname(DBObject obj)
Generate the plugin object from the supplied class name
|
static ReadOnlyDataSource |
getStandardReadDS(WebClient client,
RestDefinition restDefinition) |
static org.w3c.dom.Document |
jsonToXML(WebClient client,
JSONArray array) |
static org.w3c.dom.Document |
jsonToXML(WebClient client,
JSONObject json) |
static ContentType[] |
listProducedTypes(RestDefinition rd,
Method method)
list the produced Types.
|
static Method[] |
listSupportedMethods(RestDefinition rd)
list the supported methods.
|
static java.util.TimeZone |
magicTZ(DBMagicNumber magic) |
static java.util.Date |
makeCheckDate()
The date to use for checking if this service has expired.
|
static java.util.Date |
makeCheckDateWithGracePeriod(VirtualDB layer)
get grace period ms
|
static int |
makeLimit(WebClient client) |
static int |
makeOffset(WebClient client) |
static void |
sendErrorMessageJSON(HttpServletResponse response,
RestExceptionResponse e) |
static void |
sendErrorMessageJSON(HttpServletResponse response,
Status status,
java.lang.String message,
int subCode) |
static void |
sendErrorMessageJSON(HttpServletResponse response,
Status status,
java.lang.String message,
int subCode,
java.util.ArrayList<ExceptionResponse> list,
java.lang.String name) |
static void |
sendErrorMessageXML(HttpServletResponse response,
Status status,
java.lang.String message,
int subCode) |
public static final boolean ASSERT
public static final int MAX_LIMIT_PER_PAGE
public static final java.lang.String PROPERTY_REST_GRACE_PERIOD
@Nonnull @CheckReturnValue public static java.util.Date makeCheckDate()
@Nonnull @CheckReturnValue public static java.util.Date makeCheckDateWithGracePeriod(@Nonnull VirtualDB layer) throws RestExceptionResponse
layer
- the layer to check.RestExceptionResponse
- could not calculate grace period.@Nullable @CheckReturnValue public static java.lang.Object findPluginForClassname(DBObject obj) throws ExceptionResponse
obj
- the definition or transformExceptionResponse
- a serious problem@Nonnull @CheckReturnValue public static Method[] listSupportedMethods(@Nonnull RestDefinition rd) throws java.lang.Exception
rd
- the definitionjava.lang.Exception
@Nonnull @CheckReturnValue public static ContentType[] listProducedTypes(@Nonnull RestDefinition rd, @Nullable Method method) throws ExceptionResponse
rd
- the definitionmethod
- the method to handle.ExceptionResponse
@CheckReturnValue @Nonnegative public static int makeOffset(@Nonnull WebClient client) throws ExceptionResponse
ExceptionResponse
@CheckReturnValue @Nonnegative public static int makeLimit(@Nonnull WebClient client) throws ExceptionResponse
ExceptionResponse
@Nonnull @CheckReturnValue public static org.w3c.dom.Document jsonToXML(@Nonnull WebClient client, @Nonnull JSONObject json) throws java.lang.Exception
java.lang.Exception
@Nonnull @CheckReturnValue public static org.w3c.dom.Document jsonToXML(@Nonnull WebClient client, @Nonnull JSONArray array) throws java.lang.Exception
java.lang.Exception
public static void sendErrorMessageJSON(@Nonnull HttpServletResponse response, @Nonnull RestExceptionResponse e) throws java.io.IOException
java.io.IOException
public static void sendErrorMessageJSON(@Nonnull HttpServletResponse response, @Nonnull Status status, @Nonnull java.lang.String message, int subCode) throws java.io.IOException
java.io.IOException
public static void sendErrorMessageJSON(@Nonnull HttpServletResponse response, @Nonnull Status status, @Nonnull java.lang.String message, int subCode, @Nullable java.util.ArrayList<ExceptionResponse> list, @Nullable java.lang.String name) throws java.io.IOException
java.io.IOException
public static void sendErrorMessageXML(@Nonnull HttpServletResponse response, @Nonnull Status status, @Nonnull java.lang.String message, int subCode) throws java.io.IOException
response
- status
- message
- subCode
- java.io.IOException
@Nonnull @CheckReturnValue public static ReadOnlyDataSource getStandardReadDS(@Nonnull WebClient client, @Nonnull RestDefinition restDefinition) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public static java.util.TimeZone magicTZ(@Nonnull DBMagicNumber magic)
public static JSONObject docToJson(org.w3c.dom.Document doc)
doc
- the documentstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.