Class ScheduledFIXServer
- All Implemented Interfaces:
com.epam.fixengine.manager.ConfiguredSessionListener
- Direct Known Subclasses:
ScheduledSSLFIXServer
-
Field Summary
Fields inherited from class com.epam.fixengine.FIXServer
configuration, servers
-
Constructor Summary
ConstructorsConstructorDescriptionCreate instance of server that allow connection by default after server start if it was not denied by schedule.ScheduledFIXServer
(boolean allowNonScheduledSession) Create instance of server.ScheduledFIXServer
(boolean allowNonScheduledSession, TimeZone timeZone) Create instance of server.ScheduledFIXServer
(com.epam.fixengine.configuration.Configuration config) ScheduledFIXServer
(com.epam.fixengine.configuration.Configuration config, boolean allowNonScheduledSession) ScheduledFIXServer
(com.epam.fixengine.configuration.Configuration config, boolean allowNonScheduledSession, TimeZone timeZone) Create instance of server.ScheduledFIXServer
(com.epam.fixengine.configuration.Configuration config, TimeZone timeZone) ScheduledFIXServer
(TimeZone timeZone) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Allow all incoming connection by default.void
Cancel scheduled tasks for allow/deny connection.void
Cancel all scheduled tasks for specified session and allow default connection behaviour for it.void
Deny all incoming connection by default.protected void
protected void
void
descheduleSession
(SessionParameters params) protected void
protected void
void
scheduleAllowSessions
(String cronExpr) Schedule time to allow all incoming connection by default.void
scheduleDenySessions
(String cronExpr) Schedule time to deny all incoming connection by default.void
scheduleSession
(SessionParameters params, String startCronExpr, String stopCronExpr) void
scheduleSessionStart
(String cronExpr, SessionParameters params) Schedule the start of period when incoming connections for specified session are allowed.void
scheduleSessionStop
(String cronExpr, SessionParameters params) Schedule the end of period when incoming connections for specified session are allowed.void
setListener
(FIXServerListener listener) Sets listener.void
setServerSchedule
(String allowCronExpr, String denyCronExpr) void
startSession
(SessionParameters params) Allow connection to specified session manually.void
stop()
Stops the server.void
stopSession
(SessionParameters params) Stop specified session and deny connection manually.Methods inherited from class com.epam.fixengine.FIXServer
addServer, addServerStatusListener, clearServers, closePort, createServer, deleteServer, getAcceptorStrategy, getConfigPath, getConfiguredServerSocketFactory, getNic, getOpenPorts, getPorts, getRegisterAcceptorSession, getServer, getTransportFactory, handleAutoClose, isStarted, onAddSession, onRemoveSession, openPort, openPort, openPort, openPort, registerAcceptorSession, registerConfiguredSessions, removeServerStatusListener, setConfigPath, setConnectionValidator, setIncomingConnectionExecutor, setLoginWaitTimeout, setNic, setPort, setPorts, setPorts, setServer, start, stopAndDeleteServer, unregisterAcceptorSession, validateBeforeRegistration
-
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
-
ScheduledFIXServer
-
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
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
Description copied from class:FIXServer
Sets listener.- Overrides:
setListener
in classFIXServer
- Parameters:
listener
- - user specified listener
-
scheduleSessionStart
Schedule the start of period when incoming connections for specified session are allowed.- Parameters:
cronExpr
- CRON expressionparams
- session details
-
descheduleSessionStart
-
startSession
Allow connection to specified session manually.- Parameters:
params
- session details
-
scheduleSessionStop
Schedule the end of period when incoming connections for specified session are allowed.- Parameters:
cronExpr
- CRON expressionparams
- session details
-
stop
Description copied from class:FIXServer
Stops the server.- Overrides:
stop
in classFIXServer
- Throws:
IOException
- if stop was unsuccessful
-
descheduleSessionStop
-
stopSession
Stop specified session and deny connection manually.- Parameters:
params
- session details
-
scheduleSession
-
descheduleSession
-
cancelSessionSchedule
Cancel all scheduled tasks for specified session and allow default connection behaviour for it.- Parameters:
params
- session details
-
scheduleAllowSessions
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
-
scheduleDenySessions
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().
-