Package lumis.portal.clock
Class ClockDaoJdbc
- java.lang.Object
-
- lumis.portal.clock.ClockDaoJdbc
-
-
Constructor Summary
Constructors Constructor Description ClockDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ClockConfig clockConfig, ITransaction transaction)
Add the clock.void
addOrUpdate(ClockConfig clockConfig, ITransaction transaction)
Add or update the clock.void
delete(java.lang.String clockId, ITransaction transaction)
Delete the clock.java.util.List<ClockConfig>
findRunningClocks(ITransaction transaction)
Get the running clocks.ClockConfig
get(java.lang.String clockId, ITransaction transaction)
Get the configuration of the clock.java.util.List<java.lang.String>
getClockIds(ITransaction transaction)
Get a list of ids of the clock.java.util.Collection<java.lang.String>
getClockIdsByServiceId(java.lang.String serviceId, ITransaction transaction)
Get a list of ids by passing the id of the service.java.util.Collection<ClockConfig>
getDisabledClocks(ITransaction transaction)
Get disabled clocksjava.util.List<java.lang.String>
getNextSchedules(ITransaction transaction)
Get next schedules.boolean
setClockRunning(java.lang.String clockId, boolean runningState, int maxRunTime, ITransaction transaction)
Set the running of the clock.protected void
setConfigData(ClockConfig loadedConfig, java.sql.ResultSet resultSet)
boolean
update(ClockConfig clockConfig, ITransaction transaction)
Update the clock.
-
-
-
Method Detail
-
getClockIds
public java.util.List<java.lang.String> getClockIds(ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Get a list of ids of the clock.- Specified by:
getClockIds
in interfaceIClockDao
- Returns:
- an array of Strings.
- Throws:
DaoException
PortalException
-
findRunningClocks
public java.util.List<ClockConfig> findRunningClocks(ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Get the running clocks.- Specified by:
findRunningClocks
in interfaceIClockDao
- Parameters:
transaction
- the current transaction.- Returns:
- a list of ClockConfig.
- Throws:
DaoException
PortalException
-
getNextSchedules
public java.util.List<java.lang.String> getNextSchedules(ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Get next schedules.- Specified by:
getNextSchedules
in interfaceIClockDao
- Returns:
- an array of Strings.
- Throws:
DaoException
PortalException
-
getClockIdsByServiceId
public java.util.Collection<java.lang.String> getClockIdsByServiceId(java.lang.String serviceId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Get a list of ids by passing the id of the service.- Specified by:
getClockIdsByServiceId
in interfaceIClockDao
- Returns:
- an array of Strings.
- Throws:
DaoException
PortalException
-
get
public ClockConfig get(java.lang.String clockId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Get the configuration of the clock.- Specified by:
get
in interfaceIClockDao
- Returns:
- a ClockConfig.
- Throws:
DaoException
PortalException
-
setConfigData
protected void setConfigData(ClockConfig loadedConfig, java.sql.ResultSet resultSet) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
add
public void add(ClockConfig clockConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Add the clock.- Specified by:
add
in interfaceIClockDao
- Throws:
DaoException
PortalException
-
update
public boolean update(ClockConfig clockConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Update the clock.- Specified by:
update
in interfaceIClockDao
- Returns:
- Throws:
DaoException
PortalException
-
addOrUpdate
public void addOrUpdate(ClockConfig clockConfig, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Add or update the clock. This method add the clock if it don't exist.- Specified by:
addOrUpdate
in interfaceIClockDao
- Throws:
DaoException
PortalException
-
delete
public void delete(java.lang.String clockId, ITransaction transaction) throws DaoException, PortalException
Description copied from interface:IClockDao
Delete the clock.- Specified by:
delete
in interfaceIClockDao
- Throws:
DaoException
PortalException
-
setClockRunning
public boolean setClockRunning(java.lang.String clockId, boolean runningState, int maxRunTime, ITransaction transaction) throws PortalException
Description copied from interface:IClockDao
Set the running of the clock.- Specified by:
setClockRunning
in interfaceIClockDao
- Returns:
- Throws:
DaoException
PortalException
-
getDisabledClocks
public java.util.Collection<ClockConfig> getDisabledClocks(ITransaction transaction) throws PortalException
Description copied from interface:IClockDao
Get disabled clocks- Specified by:
getDisabledClocks
in interfaceIClockDao
- Returns:
- Throws:
DaoException
PortalException
-
-