Class SecurityTokenService

  • All Implemented Interfaces:
    ISecurityTokenService

    public class SecurityTokenService
    extends java.lang.Object
    implements ISecurityTokenService
    This class provides a security service for getting and verify tokens
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MARK_TOKEN  
      static java.lang.String PARAMETER_TOKEN  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ISecurityTokenService getInstance()
      Returns the instance of the singleton
      java.lang.String getToken​(javax.servlet.http.HttpServletRequest request, java.lang.String strAction)
      return a security token
      boolean validate​(javax.servlet.http.HttpServletRequest request, java.lang.String strAction)
      verify if the request contains the securiy token
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static ISecurityTokenService getInstance()
        Returns the instance of the singleton
        Returns:
        The instance of the singleton
      • getToken

        public java.lang.String getToken​(javax.servlet.http.HttpServletRequest request,
                                         java.lang.String strAction)
        return a security token
        Specified by:
        getToken in interface ISecurityTokenService
        Parameters:
        request - The Http request
        strAction - the action type
        Returns:
        a security token
      • validate

        public boolean validate​(javax.servlet.http.HttpServletRequest request,
                                java.lang.String strAction)
        verify if the request contains the securiy token
        Specified by:
        validate in interface ISecurityTokenService
        Parameters:
        request - The Http request
        strAction - the action type
        Returns:
        true if the request contains the security token associated to the action type