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 String
MISSING_ATTRIBUTE_CODE
static String
MISSING_ATTRIBUTE_MESSAGE
static String
TOKEN_DELIMITER
-
Constructor Summary
Constructors Constructor Description BaseResource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkNotEmpty(String attribute, String attributeName)
static <T> void
checkNotEmpty(List<T> list, String attributeName)
static void
checkNotNull(String[] attributes, String attributeName)
static void
checkNotNull(String attribute, String attributeName)
static void
checkNotNull(Map<String,String> attributeMap)
static <T> void
checkResourceNotNull(T resource, String objectName)
protected SearchRequest
createSearchRequest(String schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, int maximumRecCount)
static Throwable
findRootError(Throwable throwable)
protected static jakarta.ws.rs.core.Response
getBadRequestException(Object obj)
protected static jakarta.ws.rs.core.Response
getBadRequestException(String msg)
protected static jakarta.ws.rs.core.Response
getInternalServerException(String msg)
protected static jakarta.ws.rs.core.Response
getMissingAttributeError(String attributeName)
protected static jakarta.ws.rs.core.Response
getNotAcceptableException(String msg)
protected static jakarta.ws.rs.core.Response
getNotFoundError(String objectName)
static void
thorwBadRequestException(Object obj)
static void
thorwBadRequestException(String msg)
static void
thorwInternalServerException(String msg)
static void
thorwInternalServerException(Throwable throwable)
static void
throwMissingAttributeError(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
-
-
Method Detail
-
checkResourceNotNull
public static <T> void checkResourceNotNull(T resource, String objectName)
-
throwMissingAttributeError
public static void throwMissingAttributeError(String attributeName)
-
thorwBadRequestException
public static void thorwBadRequestException(String msg)
-
thorwBadRequestException
public static void thorwBadRequestException(Object obj)
-
thorwInternalServerException
public static void thorwInternalServerException(String msg)
-
thorwInternalServerException
public static void thorwInternalServerException(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 SearchRequest createSearchRequest(String schemas, String filter, String sortBy, String sortOrder, Integer startIndex, Integer count, String attrsList, String excludedAttrsList, int maximumRecCount)
-
-