Class ScheduledFIXServer

java.lang.Object
com.epam.fixengine.FIXServer
com.epam.fixengine.scheduler.ScheduledFIXServer
All Implemented Interfaces:
com.epam.fixengine.manager.ConfiguredSessionListener
Direct Known Subclasses:
ScheduledSSLFIXServer

public class ScheduledFIXServer extends FIXServer
FIXServer implementation that support scheduling of allow/deny policies for incoming connections.
  • Constructor Details

    • ScheduledFIXServer

      public ScheduledFIXServer()
      Create instance of server that allow connection by default after server start if it was not denied by schedule.
    • ScheduledFIXServer

      public ScheduledFIXServer(com.epam.fixengine.configuration.Configuration config)
    • ScheduledFIXServer

      public ScheduledFIXServer(TimeZone timeZone)
    • ScheduledFIXServer

      public ScheduledFIXServer(com.epam.fixengine.configuration.Configuration config, TimeZone timeZone)
    • ScheduledFIXServer

      public ScheduledFIXServer(boolean allowNonScheduledSession)
      Create instance of server.
      Parameters:
      allowNonScheduledSession - false means that allowed only scheduled connection after server start. All rest are denied by default.
    • ScheduledFIXServer

      public ScheduledFIXServer(com.epam.fixengine.configuration.Configuration config, boolean allowNonScheduledSession)
    • ScheduledFIXServer

      public ScheduledFIXServer(boolean allowNonScheduledSession, TimeZone timeZone)
      Create instance of server.
      Parameters:
      allowNonScheduledSession - false means that allowed only scheduled connection after server start. All rest are denied by default.
    • ScheduledFIXServer

      public ScheduledFIXServer(com.epam.fixengine.configuration.Configuration config, boolean allowNonScheduledSession, TimeZone timeZone)
      Create instance of server.
      Parameters:
      allowNonScheduledSession - false means that allowed only scheduled connection after server start. All rest are denied by default.
  • Method Details

    • setListener

      public void setListener(FIXServerListener listener)
      Description copied from class: FIXServer
      Sets listener.
      Overrides:
      setListener in class FIXServer
      Parameters:
      listener - - user specified listener
    • scheduleSessionStart

      public void scheduleSessionStart(String cronExpr, SessionParameters params)
      Schedule the start of period when incoming connections for specified session are allowed.
      Parameters:
      cronExpr - CRON expression
      params - session details
    • descheduleSessionStart

      protected void descheduleSessionStart(SessionParameters params)
    • startSession

      public void startSession(SessionParameters params)
      Allow connection to specified session manually.
      Parameters:
      params - session details
    • scheduleSessionStop

      public void scheduleSessionStop(String cronExpr, SessionParameters params)
      Schedule the end of period when incoming connections for specified session are allowed.
      Parameters:
      cronExpr - CRON expression
      params - session details
    • stop

      public void stop() throws IOException
      Description copied from class: FIXServer
      Stops the server.
      Overrides:
      stop in class FIXServer
      Throws:
      IOException - if stop was unsuccessful
    • descheduleSessionStop

      protected void descheduleSessionStop(SessionParameters params)
    • stopSession

      public void stopSession(SessionParameters params)
      Stop specified session and deny connection manually.
      Parameters:
      params - session details
    • scheduleSession

      public void scheduleSession(SessionParameters params, String startCronExpr, String stopCronExpr)
    • descheduleSession

      public void descheduleSession(SessionParameters params)
    • cancelSessionSchedule

      public void cancelSessionSchedule(SessionParameters params)
      Cancel all scheduled tasks for specified session and allow default connection behaviour for it.
      Parameters:
      params - session details
    • scheduleAllowSessions

      public void scheduleAllowSessions(String cronExpr)
      Schedule time to allow all incoming connection by default.

      Note: default policy not applied for sessions which were started/stoped via methods startSession()/stopSession() or were scheduled by methods scheduleSessionStart()/scheduleSessionStop().

      Parameters:
      cronExpr - CRON expression
    • descheduleAllowSessions

      protected void descheduleAllowSessions()
    • setServerSchedule

      public void setServerSchedule(String allowCronExpr, String denyCronExpr)
    • scheduleDenySessions

      public void scheduleDenySessions(String cronExpr)
      Schedule time to deny all incoming connection by default. After specified time new connection will be rejected automatically and session will not be passed to instance of FIXServerListener.

      Note: default policy not applied for sessions which were started/stoped via methods startSession()/stopSession() or were scheduled by methods scheduleSessionStart()/scheduleSessionStop().

      Parameters:
      cronExpr - CRON expression
    • descheduleDenySessions

      protected void descheduleDenySessions()
    • cancelServerSchedule

      public void cancelServerSchedule()
      Cancel scheduled tasks for allow/deny connection.
    • allowSessions

      public void allowSessions()
      Allow all incoming connection by default.

      Note: default policy not applied for sessions which were started/stoped via methods startSession()/stopSession() or were scheduled by methods scheduleSessionStart()/scheduleSessionStop().

    • denySessions

      public void denySessions()
      Deny all incoming connection by default.

      Note: default policy not applied for sessions which were started/stoped via methods startSession()/stopSession() or were scheduled by methods scheduleSessionStart()/scheduleSessionStop().