Package com.netscape.cms.servlet.base
Class PKIService
java.lang.Object
com.netscape.cms.servlet.base.PKIService
- Direct Known Subclasses:
AccountService
,FeatureService
,InfoService
,LoginService
,SecurityDomainService
,SelfTestService
,SubsystemService
,SystemConfigService
Base class for CMS RESTful resources
- Author:
- alee
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Path
static final int
static final int
protected javax.ws.rs.core.HttpHeaders
static org.slf4j.Logger
static List<javax.ws.rs.core.MediaType>
static final int
protected javax.ws.rs.core.Request
protected javax.servlet.ServletContext
protected javax.servlet.http.HttpServletRequest
protected javax.ws.rs.core.UriInfo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
createCreatedResponse
(Object entity, URI link) javax.ws.rs.core.Response
javax.ws.rs.core.Response
javax.ws.rs.core.Response
createOKResponse
(Object entity) static String
static String
getLocale
(javax.ws.rs.core.HttpHeaders headers) Get the values of the fields annotated with @FormParam.javax.ws.rs.core.MediaType
static javax.ws.rs.core.MediaType
getResponseFormat
(javax.ws.rs.core.HttpHeaders headers) static boolean
Marshall response object with custom mapping if available.static javax.ws.rs.core.MediaType
resolveFormat
(List<javax.ws.rs.core.MediaType> formats) Find a match from a list of candidate media types (which may be wildcards) against the default list of valid media types.static javax.ws.rs.core.MediaType
resolveFormat
(List<javax.ws.rs.core.MediaType> candidates, List<javax.ws.rs.core.MediaType> validTypes) Find a match from a list of candidate media types (which may be wildcards) against a list of valid media types.static javax.ws.rs.core.MediaType
resolveFormat
(javax.ws.rs.core.MediaType format) Return a match for a candidate media type (which may be a wildcard) against the default list of valid media types.static javax.ws.rs.core.MediaType
resolveFormat
(javax.ws.rs.core.MediaType candidate, List<javax.ws.rs.core.MediaType> validTypes) Return a match for a candidate media type (which may be a wildcard) against a list of valid media types.javax.ws.rs.core.Response
sendConditionalGetResponse
(int ctime, Object entity, javax.ws.rs.core.Request request) <T> T
unmarshall
(Object request, Class<T> clazz) Unmarshall request object with custom mapping if available.
-
Field Details
-
logger
public static org.slf4j.Logger logger -
DEFAULT_LONG_CACHE_LIFETIME
public static final int DEFAULT_LONG_CACHE_LIFETIME- See Also:
-
MESSAGE_FORMATS
-
MIN_FILTER_LENGTH
public static final int MIN_FILTER_LENGTH- See Also:
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE- See Also:
-
uriInfo
@Context protected javax.ws.rs.core.UriInfo uriInfo -
headers
@Context protected javax.ws.rs.core.HttpHeaders headers -
request
@Context protected javax.ws.rs.core.Request request -
servletRequest
@Context protected javax.servlet.http.HttpServletRequest servletRequest -
servletContext
@Context protected javax.servlet.ServletContext servletContext -
bannerFile
-
-
Constructor Details
-
PKIService
public PKIService()
-
-
Method Details
-
getInstanceDir
-
isBannerEnabled
public static boolean isBannerEnabled() -
getBanner
- Throws:
IOException
-
resolveFormat
public static javax.ws.rs.core.MediaType resolveFormat(javax.ws.rs.core.MediaType format) Return a match for a candidate media type (which may be a wildcard) against the default list of valid media types.- Returns:
- the matching MediaType or null if no match
-
resolveFormat
public static javax.ws.rs.core.MediaType resolveFormat(javax.ws.rs.core.MediaType candidate, List<javax.ws.rs.core.MediaType> validTypes) Return a match for a candidate media type (which may be a wildcard) against a list of valid media types.- Returns:
- the matching MediaType or null if no match
-
resolveFormat
Find a match from a list of candidate media types (which may be wildcards) against the default list of valid media types. Candidates are checked in list order. Quality values ("q" parameter) are ignored.- Returns:
- the matching MediaType or null if no match
-
resolveFormat
public static javax.ws.rs.core.MediaType resolveFormat(List<javax.ws.rs.core.MediaType> candidates, List<javax.ws.rs.core.MediaType> validTypes) Find a match from a list of candidate media types (which may be wildcards) against a list of valid media types. Candidates are checked in list order. Quality values ("q" parameter) are ignored.- Returns:
- the matching MediaType or null if no match
-
getResponseFormat
public static javax.ws.rs.core.MediaType getResponseFormat(javax.ws.rs.core.HttpHeaders headers) -
getResponseFormat
public javax.ws.rs.core.MediaType getResponseFormat() -
createOKResponse
public javax.ws.rs.core.Response createOKResponse() -
marshall
Marshall response object with custom mapping if available. This method is called for by all services. It will use custom mapping if available. -
unmarshall
Unmarshall request object with custom mapping if available. -
createOKResponse
-
createCreatedResponse
-
createNoContentResponse
public javax.ws.rs.core.Response createNoContentResponse() -
sendConditionalGetResponse
public javax.ws.rs.core.Response sendConditionalGetResponse(int ctime, Object entity, javax.ws.rs.core.Request request) -
getLocale
-
getParams
Get the values of the fields annotated with @FormParam.
-