Package io.jans.configapi.core.rest
Class BaseResource
- java.lang.Object
-
- io.jans.configapi.core.rest.BaseResource
-
public class BaseResource extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringFIELD_VALUE_SEPARATORstatic StringMISSING_ATTRIBUTE_CODEstatic StringMISSING_ATTRIBUTE_MESSAGEstatic StringTOKEN_DELIMITER
-
Constructor Summary
Constructors Constructor Description BaseResource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckNotEmpty(String attribute, String attributeName)static <T> voidcheckNotEmpty(List<T> list, String attributeName)static voidcheckNotNull(String[] attributes, String attributeName)static voidcheckNotNull(String attribute, String attributeName)static voidcheckNotNull(Map<String,String> attributeMap)static <T> voidcheckResourceNotNull(T resource, String objectName)protected io.jans.model.SearchRequestcreateSearchRequest(String schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, int maximumRecCount, String fieldValuePair, Class<?> entityClass)static ThrowablefindRootError(Throwable throwable)protected static jakarta.ws.rs.core.ResponsegetBadRequestException(Object obj)protected static jakarta.ws.rs.core.ResponsegetBadRequestException(String msg)jakarta.ws.rs.core.HttpHeadersgetHttpHeaders()jakarta.servlet.http.HttpServletRequestgetHttpRequest()protected static jakarta.ws.rs.core.ResponsegetInternalServerException(String msg)protected static jakarta.ws.rs.core.ResponsegetMissingAttributeError(String attributeName)protected static jakarta.ws.rs.core.ResponsegetNotAcceptableException(String msg)protected static jakarta.ws.rs.core.ResponsegetNotFoundError(String objectName)jakarta.ws.rs.core.UriInfogetUriInfo()static voidthrowBadRequestException(Object obj)static voidthrowBadRequestException(String msg)static voidthrowInternalServerException(String msg)static voidthrowInternalServerException(Throwable throwable)static voidthrowMissingAttributeError(String attributeName)
-
-
-
Field Detail
-
MISSING_ATTRIBUTE_CODE
public static final String MISSING_ATTRIBUTE_CODE
- See Also:
- Constant Field Values
-
MISSING_ATTRIBUTE_MESSAGE
public static final String MISSING_ATTRIBUTE_MESSAGE
- See Also:
- Constant Field Values
-
TOKEN_DELIMITER
public static final String TOKEN_DELIMITER
- See Also:
- Constant Field Values
-
FIELD_VALUE_SEPARATOR
public static final String FIELD_VALUE_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUriInfo
public jakarta.ws.rs.core.UriInfo getUriInfo()
-
getHttpRequest
public jakarta.servlet.http.HttpServletRequest getHttpRequest()
-
getHttpHeaders
public jakarta.ws.rs.core.HttpHeaders getHttpHeaders()
-
checkResourceNotNull
public static <T> void checkResourceNotNull(T resource, String objectName)
-
throwMissingAttributeError
public static void throwMissingAttributeError(String attributeName)
-
throwBadRequestException
public static void throwBadRequestException(String msg)
-
throwBadRequestException
public static void throwBadRequestException(Object obj)
-
throwInternalServerException
public static void throwInternalServerException(String msg)
-
throwInternalServerException
public static void throwInternalServerException(Throwable throwable)
-
getMissingAttributeError
protected static jakarta.ws.rs.core.Response getMissingAttributeError(String attributeName)
- Parameters:
attributeName-- Returns:
-
getNotFoundError
protected static jakarta.ws.rs.core.Response getNotFoundError(String objectName)
-
getNotAcceptableException
protected static jakarta.ws.rs.core.Response getNotAcceptableException(String msg)
-
getBadRequestException
protected static jakarta.ws.rs.core.Response getBadRequestException(String msg)
-
getBadRequestException
protected static jakarta.ws.rs.core.Response getBadRequestException(Object obj)
-
getInternalServerException
protected static jakarta.ws.rs.core.Response getInternalServerException(String msg)
-
createSearchRequest
protected io.jans.model.SearchRequest createSearchRequest(String schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, int maximumRecCount, String fieldValuePair, Class<?> entityClass)
-
-