lumis.portal.clock
Class ClockManager

Package class diagram package ClockManager
java.lang.Object
  extended by lumis.portal.clock.ClockManager
All Implemented Interfaces:
IClockManager

public class ClockManager
extends Object
implements IClockManager

Since:
4.0.0

Constructor Summary
ClockManager()
           
 
Method Summary
 String add(SessionConfig sessionConfig, ClockConfig clockConfig, ITransaction transaction)
          Add a clock.
 void addOrUpdate(SessionConfig sessionConfig, ClockConfig clockConfig, ITransaction transaction)
          Update the configuration of a clock.
 void checkSchedule(SessionConfig sessionConfig, ITransaction transaction)
          This method is called at regular intervals by the framework.
 void delete(SessionConfig sessionConfig, String clockId, ITransaction transaction)
          Delete a clock.
 void disable(SessionConfig sessionConfig, String clockId, ITransaction transaction)
          Set the "False" value to the enable property of a clock.
 void enable(SessionConfig sessionConfig, String clockId, ITransaction transaction)
          Set the "True" value to the enable property of a clock.
 void executeSchedule(ClockConfig clockConfig)
          Executes a clock implementation.
 void executeSchedule(SessionConfig sessionConfig, ClockConfig clockConfig, ITransaction transaction)
          Deprecated. 
 ClockConfig get(SessionConfig sessionConfig, String clockId, ITransaction transaction)
          Get the configuration of the clock.
 Collection<String> getClockIdsByServiceId(SessionConfig sessionConfig, String serviceId, ITransaction transaction)
          Return the Ids of all clocks registered for the specified service.
 boolean isPortalClockRunning(SessionConfig sessionConfig, ITransaction transaction)
          Verify if the portal clock is running.
 boolean setRunning(SessionConfig sessionConfig, String clockId, boolean running, ITransaction transaction)
          Sets the running status of a clock in the database.
 void update(SessionConfig sessionConfig, ClockConfig clockConfig, ITransaction transaction)
          Update the configuration of a clock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClockManager

public ClockManager()
Method Detail

checkSchedule

public void checkSchedule(SessionConfig sessionConfig,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
This method is called at regular intervals by the framework. The interval period can be configured in the portal config file. For each clockId, a database lock shoud be created to prevent long running clockHandlers to be called repeatedly before they finish. If in the process of handling a clockId, another request for the same clockId needs to be processed, ignore the new request.

Specified by:
checkSchedule in interface IClockManager
Throws:
ManagerException
PortalException

executeSchedule

@Deprecated
public void executeSchedule(SessionConfig sessionConfig,
                                       ClockConfig clockConfig,
                                       ITransaction transaction)
                     throws ManagerException,
                            PortalException
Deprecated. 

Description copied from interface: IClockManager
Execute a registered clock.

Specified by:
executeSchedule in interface IClockManager
Throws:
ManagerException
PortalException

executeSchedule

public void executeSchedule(ClockConfig clockConfig)
                     throws PortalException
Description copied from interface: IClockManager
Executes a clock implementation. Updates the clock scheduling information, such as next run time, accordingly.

Specified by:
executeSchedule in interface IClockManager
Parameters:
clockConfig - the clock configuration.
Throws:
PortalException

add

public String add(SessionConfig sessionConfig,
                  ClockConfig clockConfig,
                  ITransaction transaction)
           throws ManagerException,
                  PortalException
Description copied from interface: IClockManager
Add a clock.

Specified by:
add in interface IClockManager
Returns:
Returns a String.
Throws:
ManagerException
PortalException

addOrUpdate

public void addOrUpdate(SessionConfig sessionConfig,
                        ClockConfig clockConfig,
                        ITransaction transaction)
                 throws ManagerException,
                        PortalException
Description copied from interface: IClockManager
Update the configuration of a clock. If the clock don't exist, it is added to the clock pool.

Specified by:
addOrUpdate in interface IClockManager
Throws:
ManagerException
PortalException

update

public void update(SessionConfig sessionConfig,
                   ClockConfig clockConfig,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IClockManager
Update the configuration of a clock.

Specified by:
update in interface IClockManager
Throws:
ManagerException
PortalException

delete

public void delete(SessionConfig sessionConfig,
                   String clockId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IClockManager
Delete a clock.

Specified by:
delete in interface IClockManager
Throws:
ManagerException
PortalException

enable

public void enable(SessionConfig sessionConfig,
                   String clockId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IClockManager
Set the "True" value to the enable property of a clock. If the value of enable property is true the clock will be running.

Specified by:
enable in interface IClockManager
Throws:
ManagerException
PortalException

disable

public void disable(SessionConfig sessionConfig,
                    String clockId,
                    ITransaction transaction)
             throws ManagerException,
                    PortalException
Description copied from interface: IClockManager
Set the "False" value to the enable property of a clock. If the value of enable property is false the clock is disable.

Specified by:
disable in interface IClockManager
Throws:
ManagerException
PortalException

get

public ClockConfig get(SessionConfig sessionConfig,
                       String clockId,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IClockManager
Get the configuration of the clock.

Specified by:
get in interface IClockManager
Returns:
Returns a ClockConfig.
Throws:
ManagerException
PortalException

isPortalClockRunning

public boolean isPortalClockRunning(SessionConfig sessionConfig,
                                    ITransaction transaction)
                             throws ManagerException,
                                    PortalException
Description copied from interface: IClockManager
Verify if the portal clock is running.

Specified by:
isPortalClockRunning in interface IClockManager
Returns:
Returns true if the portal clock is running and false otherwise.
Throws:
ManagerException
PortalException

setRunning

public boolean setRunning(SessionConfig sessionConfig,
                          String clockId,
                          boolean running,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Description copied from interface: IClockManager
Sets the running status of a clock in the database. Used mainly by the ClockThreadPool class. This method creates it's own transaction.

Specified by:
setRunning in interface IClockManager
Returns:
Returns true if the clock running and false otherwise.
Throws:
ManagerException
PortalException

getClockIdsByServiceId

public Collection<String> getClockIdsByServiceId(SessionConfig sessionConfig,
                                                 String serviceId,
                                                 ITransaction transaction)
                                          throws ManagerException,
                                                 PortalException
Description copied from interface: IClockManager
Return the Ids of all clocks registered for the specified service.

Specified by:
getClockIdsByServiceId in interface IClockManager
serviceId - The Id of the service whose clocks you want to return.
Returns:
A collection of Strings containing the Ids of the clocks associated with the specified service.
Throws:
ManagerException
PortalException


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.