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 |
---|---|
void |
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 seconds.
|
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.
|
void |
register(Session session,
SchedulerSettings settings,
String scheduleId,
SessionConnection connection)
Registers session.
|
void |
register(Session session,
SchedulerSettings settings,
String scheduleId,
String connectionId)
Registers session.
|
void |
register(Session session,
SessionSchedule schedule,
SchedulerSettings settings,
String connectionId)
Registers session.
|
void |
register(Session session,
SessionSchedule schedule,
SessionConnection connection)
Registers session.
|
void |
removeAllLogoutNotification()
Removes all session logout notification intervals.
|
void |
removeLogoutNotification(int interval)
Removes session logout notification interval.
|
void |
setConnectionRetriesInterval(int connectionRetriesInterval)
Sets the time interval between the logon attempts in case of a logon failure in seconds.
|
void |
setConnectionRetriesNumber(int connectionRetriesNumber)
Sets the number of logon attempts in case of a logon failure.
|
void |
setQuartzConfigFile(String quartzConfigFile)
Sets Quartz configuration file.
|
void |
start()
Starts scheduler service.
|
void |
stop()
Stops scheduler service.
|
String |
toString() |
void |
unregister(Session session)
Un-registers session.
|
public static final String QUARTZ_CONFIG_FILE_DEFAULT
public SessionScheduler()
public void start() throws SessionSchedulerException
SessionSchedulerException
- if start failedpublic void stop() throws SessionSchedulerException
SessionSchedulerException
- if stop failedpublic void 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 void 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 void 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 void 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 void unregister(Session session) throws SessionSchedulerException
session
- FIX sessionSessionSchedulerException
- if un-register failedpublic Set<Integer> getLogoutNotifications()
public void addLogoutNotification(int interval)
interval
- session logout notification interval, in secondsIllegalArgumentException
- if (interval < 1)
public void removeLogoutNotification(int interval)
interval
- session logout notification interval, in secondsIllegalArgumentException
- if (interval < 1)
public void removeAllLogoutNotification()
public int getConnectionRetriesNumber()
public void setConnectionRetriesNumber(int connectionRetriesNumber)
connectionRetriesNumber
- number of logon attemptsIllegalArgumentException
- if 0 > connectionRetriesNumber
public int getConnectionRetriesInterval()
public void setConnectionRetriesInterval(int connectionRetriesInterval)
connectionRetriesInterval
- interval between the logon attemptsIllegalArgumentException
- if 0 >= connectionRetriesInterval
public String getQuartzConfigFile()
QUARTZ_CONFIG_FILE_DEFAULT
.public void setQuartzConfigFile(String quartzConfigFile)
QUARTZ_CONFIG_FILE_DEFAULT
.quartzConfigFile
- configuration fileNullPointerException
- if (configFile == null)
public ListenerManager getListenerManager()
Copyright © 2005–2024 Onix Solutions. All rights reserved.