Class PlayerAuthenticationService

Object
PlayerAuthenticationService

public class PlayerAuthenticationService extends Object
  • Constructor Details

    • PlayerAuthenticationService

      public PlayerAuthenticationService()
  • Method Details

    • getEntityManager

      protected EntityManager getEntityManager()
      Returns the entity manager of JPA. This is defined in build/web/WEB-INF/classes/META-INF/persistence.xml.
      Returns:
      EntityManager
    • authenticate

      public User authenticate(String name, SecurityContext context)
      This method should be called to verify that the target of a certain action is indeed a proper authenticated user.
      Parameters:
      name - the name to identify the person
      Returns:
      the User identified by the name.
      Throws:
      WebApplicationException - NOT_FOUND, if the user is either not found or is not a proper user. BAD_REQUEST if an unexpected exception crops up or provided info is really not proper. UNAUTHORIZED if session passwords do not match.
    • authenticateGuildMaster

      public User authenticateGuildMaster(String name, SecurityContext context)
      Authenticates a guildmaster.
      Parameters:
      name - the name to identify the person
      Returns:
      WebApplicationException NOT_FOUND if you are not the member of a guild UNAUTHORIZED if you are not the guild master of your guild.
    • getPlayerName

      public String getPlayerName(SecurityContext context)
      Provides the player who is logged in during this session.
      Returns:
      name of the player
    • logoff

      public void logoff(HttpServletRequest requestContext)
    • setEntityManager

      public void setEntityManager(EntityManager em)