Class ServerUtil


  • public class ServerUtil
    extends Object
    Version:
    0.9, 26/12/2012
    Author:
    Yuriy Zabrovarnyy, Yuriy Movchan
    • Method Detail

      • nowAsSeconds

        public static int nowAsSeconds()
      • calculateTtl

        public static int calculateTtl​(Integer expirationDateAsSeconds)
      • calculateTtl

        public static int calculateTtl​(Date creationDate,
                                       Date expirationDate)
      • asJsonSilently

        public static String asJsonSilently​(Object obj)
      • daemonThreadFactory

        public static ThreadFactory daemonThreadFactory()
      • cacheControl

        public static jakarta.ws.rs.core.CacheControl cacheControl​(boolean noStore)
      • cacheControl

        public static jakarta.ws.rs.core.CacheControl cacheControl​(boolean noStore,
                                                                   boolean noTransform)
      • cacheControlWithNoStoreTransformAndPrivate

        public static jakarta.ws.rs.core.CacheControl cacheControlWithNoStoreTransformAndPrivate()
      • createJsonMapper

        public static com.fasterxml.jackson.databind.ObjectMapper createJsonMapper()
      • jsonMapperWithWrapRoot

        public static com.fasterxml.jackson.databind.ObjectMapper jsonMapperWithWrapRoot()
      • jsonMapperWithUnwrapRoot

        public static com.fasterxml.jackson.databind.ObjectMapper jsonMapperWithUnwrapRoot()
      • toPrettyJson

        public static String toPrettyJson​(org.json.JSONObject jsonObject)
                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • getLdapManager

        public static io.jans.orm.PersistenceEntryManager getLdapManager()
      • getAttributeByName

        public static io.jans.orm.model.base.CustomAttribute getAttributeByName​(List<io.jans.orm.model.base.CustomAttribute> list,
                                                                                String attributeName)
      • getAttributeValueByName

        public static String getAttributeValueByName​(List<io.jans.orm.model.base.CustomAttribute> list,
                                                     String attributeName)
      • urlDecode

        public static String urlDecode​(String str)
      • convert

        public static io.jans.as.model.uma.UmaPermission convert​(io.jans.as.model.uma.persistence.UmaPermission permission,
                                                                 UmaScopeService umaScopeService)
      • getIpAddress

        public static String getIpAddress​(jakarta.servlet.http.HttpServletRequest httpRequest)
        Parameters:
        httpRequest - interface to provide request information for HTTP servlets.
        Returns:
        IP address of client
        See Also:
        Getting IP address of client
      • getRequestOrNull

        public static jakarta.servlet.http.HttpServletRequest getRequestOrNull()
        Safe retrieves http request from FacesContext
        Returns:
        http
      • dateToSeconds

        public static Integer dateToSeconds​(Date date)