public class SessionScheduler extends Object
Modifier and Type | Field and Description |
---|---|
static String |
QUARTZ_CONFIG_FILE_DEFAULT
Default Quartz configuration file.
|
Constructor and Description |
---|
SessionScheduler()
Initializes scheduler service with default configuration.
|
Modifier and Type | Method and Description |
---|---|
SessionScheduler |
addLogoutNotification(int interval)
Adds session logout notification interval.
|
int |
getConnectionRetriesInterval()
Returns the time interval between the logon attempts in case of a logon failure in milliseconds.
|
int |
getConnectionRetriesNumber()
Returns the number of logon attempts in case of a logon failure.
|
ListenerManager |
getListenerManager()
Returns listener manager to subscribe/unsubscribe from events.
|
Set<Integer> |
getLogoutNotifications()
Returns session logout notification intervals.
|
String |
getQuartzConfigFile()
Returns Quartz configuration file.
|
SessionScheduler |
register(Session session,
SchedulerSettings settings,
String scheduleId)
Registers acceptor session.
|
SessionScheduler |
register(Session session,
SchedulerSettings settings,
String scheduleId,
SessionConnection connection)
Registers session.
|
SessionScheduler |
register(Session session,
SchedulerSettings settings,
String scheduleId,
String connectionId)
Registers session.
|
SessionScheduler |
register(Session session,
SessionSchedule schedule,
SchedulerSettings settings,
String connectionId)
Registers session.
|
SessionScheduler |
register(Session session,
SessionSchedule schedule,
SessionConnection connection)
Registers session.
|
SessionScheduler |
registerAcceptor(Session session,
SessionSchedule schedule)
Registers acceptor session.
|
SessionScheduler |
removeAllLogoutNotification()
Removes all session logout notification intervals.
|
SessionScheduler |
removeLogoutNotification(int interval)
Removes session logout notification interval.
|
SessionScheduler |
setConnectionRetriesInterval(int connectionRetriesInterval)
Sets the time interval between the logon attempts in case of a logon failure in milliseconds.
|
SessionScheduler |
setConnectionRetriesNumber(int connectionRetriesNumber)
Sets the number of logon attempts in case of a logon failure.
|
SessionScheduler |
setQuartzConfigFile(String quartzConfigFile)
Sets Quartz configuration file.
|
SessionScheduler |
start()
Starts scheduler service.
|
SessionScheduler |
stop()
Stops scheduler service.
|
String |
toString() |
SessionScheduler |
unregister(Session session)
Un-registers session.
|
public static final String QUARTZ_CONFIG_FILE_DEFAULT
public SessionScheduler() throws SessionSchedulerException
SessionSchedulerException
- if creation failedpublic SessionScheduler start() throws SessionSchedulerException
SessionSchedulerException
- if start failedpublic SessionScheduler stop() throws SessionSchedulerException
SessionSchedulerException
- if stop failedpublic SessionScheduler registerAcceptor(Session session, SessionSchedule schedule) throws SessionSchedulerException
session
- FIX sessionschedule
- session scheduleSessionSchedulerException
- if scheduling failedpublic SessionScheduler register(Session session, SchedulerSettings settings, String scheduleId) throws SessionSchedulerException
session
- FIX sessionsettings
- scheduler settingsscheduleId
- schedule id in the scheduler settingsSessionSchedulerException
- if scheduling failedIllegalArgumentException
- if schedule with the scheduleId
is not found in the settingspublic SessionScheduler register(Session session, SchedulerSettings settings, String scheduleId, String connectionId) throws SessionSchedulerException
session
- FIX sessionsettings
- scheduler settingsscheduleId
- schedule id in the scheduler settingsconnectionId
- connection id in the scheduler settingsSessionSchedulerException
- if scheduling failedIllegalArgumentException
- if schedule with the scheduleId
is not found in the settings or
if connection with connectionId
is not found in the settingspublic SessionScheduler register(Session session, SessionSchedule schedule, SchedulerSettings settings, String connectionId) throws SessionSchedulerException
session
- FIX sessionschedule
- session schedulesettings
- scheduler settingsconnectionId
- connection id in the scheduler settingsSessionSchedulerException
- if scheduling failedIllegalArgumentException
- if connection with the connectionId
is not found in the settingspublic SessionScheduler register(Session session, SchedulerSettings settings, String scheduleId, SessionConnection connection) throws SessionSchedulerException
session
- FIX sessionsettings
- scheduler settingsscheduleId
- schedule id in the scheduler settingsconnection
- session connectionSessionSchedulerException
- if scheduling failedIllegalArgumentException
- if schedule with the scheduleId
is not found in the settingspublic SessionScheduler register(Session session, SessionSchedule schedule, SessionConnection connection) throws SessionSchedulerException
session
- FIX sessionschedule
- schedule for the given sessionconnection
- connection settings for the given sessionSessionSchedulerException
- if scheduling failedpublic SessionScheduler unregister(Session session) throws SessionSchedulerException
session
- FIX sessionSessionSchedulerException
- if un-register failedpublic Set<Integer> getLogoutNotifications()
public SessionScheduler addLogoutNotification(int interval)
interval
- session logout notification interval, in secondsIllegalArgumentException
- if (interval < 1)public SessionScheduler removeLogoutNotification(int interval)
interval
- session logout notification interval, in secondsIllegalArgumentException
- if (interval < 1)public SessionScheduler removeAllLogoutNotification()
public int getConnectionRetriesNumber()
public SessionScheduler setConnectionRetriesNumber(int connectionRetriesNumber)
connectionRetriesNumber
- number of logon attemptsIllegalArgumentException
- if 0 > connectionRetriesNumber
public int getConnectionRetriesInterval()
public SessionScheduler setConnectionRetriesInterval(int connectionRetriesInterval)
connectionRetriesInterval
- interval between the logon attemptsIllegalArgumentException
- if 0 >= connectionRetriesInterval
public String getQuartzConfigFile()
QUARTZ_CONFIG_FILE_DEFAULT
.public SessionScheduler setQuartzConfigFile(String quartzConfigFile)
QUARTZ_CONFIG_FILE_DEFAULT
.quartzConfigFile
- configuration fileNullPointerException
- if (configFile == null)public ListenerManager getListenerManager()
Copyright © 2005–2024 Onix Solutions. All rights reserved.