public class RestApiUtil extends Object
| Constructor and Description |
|---|
RestApiUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ErrorDTO |
getErrorDTO(org.wso2.carbon.auth.core.exception.ExceptionCodeHandler exceptionCodeHandler)
Returns an errorDTO based on a provided ExceptionCodeHandler
|
static ErrorDTO |
getInternalServerErrorDTO()
Returns an Internal Server Error DTO
|
static String |
getLoggedInUsername(org.wso2.msf4j.Request request)
Get the current logged in user's username
|
static Map<String,Integer> |
getPaginationParams(Integer offset,
Integer limit,
Integer total)
Returns the next/previous offset/limit parameters properly when current offset,
limit and size parameters are specified
|
public static String getLoggedInUsername(org.wso2.msf4j.Request request)
request - msf4j requestpublic static ErrorDTO getInternalServerErrorDTO()
public static ErrorDTO getErrorDTO(org.wso2.carbon.auth.core.exception.ExceptionCodeHandler exceptionCodeHandler)
exceptionCodeHandler - with mapped HTTP error detailspublic static Map<String,Integer> getPaginationParams(Integer offset, Integer limit, Integer total)
offset - current starting indexlimit - current max recordstotal - maximum index possibleCopyright © 2018 WSO2. All rights reserved.