Class BaseClientRequestHandler

  • All Implemented Interfaces:
    IClientRequestHandler
    Direct Known Subclasses:
    SignUpAssistantComponent

    public abstract class BaseClientRequestHandler
    extends java.lang.Object
    implements IClientRequestHandler
    Using the new SFSExtension base class allows extension developers to register separate request handlers for each possible client request. This allows better code organization and maintainability. By extending the BaseClientRequestHandler class the developer has direct access to the useful parent class' methods such as send(), trace() etc...
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ISFSApi getApi()
      Get a reference to the main server side API
      protected org.slf4j.Logger getLogger()
      Obtain a direct reference to the Extension's logger
      SFSExtension getParentExtension()
      Obtain a reference to the parent extension.
      protected void send​(java.lang.String cmdName, ISFSObject params, User recipient)
      Send a response back to a User
      protected void send​(java.lang.String cmdName, ISFSObject params, User recipient, boolean useUDP)
      Send a response back to a User
      protected void send​(java.lang.String cmdName, ISFSObject params, java.util.List<User> recipients)
      Broadcast a response back to multiple Users
      protected void send​(java.lang.String cmdName, ISFSObject params, java.util.List<User> recipients, boolean useUDP)
      Broadcast a response back to multiple Users
      void setParentExtension​(SFSExtension ext)
      protected void trace​(ExtensionLogLevel level, java.lang.Object... args)
      Trace a message to the console and log files using the specified logging level
      protected void trace​(java.lang.Object... args)
      Traces a message to the console and log files using the Logger INFO level
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseClientRequestHandler

        public BaseClientRequestHandler()
    • Method Detail

      • getApi

        protected ISFSApi getApi()
        Get a reference to the main server side API
        Returns:
        the server side API object
      • send

        protected void send​(java.lang.String cmdName,
                            ISFSObject params,
                            User recipient)
        Send a response back to a User
        Parameters:
        cmdName - name of the "command" (or action id)
        params - the parameters
        recipient - the recipient User
      • send

        protected void send​(java.lang.String cmdName,
                            ISFSObject params,
                            java.util.List<User> recipients)
        Broadcast a response back to multiple Users
        Parameters:
        cmdName - name of the "command" (or action id)
        params - the parameters
        recipients - a list of recipients
      • send

        protected void send​(java.lang.String cmdName,
                            ISFSObject params,
                            User recipient,
                            boolean useUDP)
        Send a response back to a User
        Parameters:
        cmdName - name of the "command" (or action id)
        params - the parameters
        recipient - the recipient User
        useUDP - if true the message will be sent as an UDP packet (default == TCP)
      • send

        protected void send​(java.lang.String cmdName,
                            ISFSObject params,
                            java.util.List<User> recipients,
                            boolean useUDP)
        Broadcast a response back to multiple Users
        Parameters:
        cmdName - name of the "command" (or action id)
        params - the parameters
        recipients - a list of recipients
        useUDP - if true the message will be sent as an UDP packet (default == TCP)
      • trace

        protected void trace​(java.lang.Object... args)
        Traces a message to the console and log files using the Logger INFO level
        Parameters:
        args - any number of strings/object to trace
      • trace

        protected void trace​(ExtensionLogLevel level,
                             java.lang.Object... args)
        Trace a message to the console and log files using the specified logging level
        Parameters:
        level - the logging level
        args - any number of object to trace
      • getLogger

        protected org.slf4j.Logger getLogger()
        Obtain a direct reference to the Extension's logger
        Returns:
        the logger object.