com.adventnet.agent.tl1
Class DelayActivation

java.lang.Object
  |
  +--com.adventnet.agent.tl1.DelayActivation

class DelayActivation
extends java.lang.Object

This class is used for Delay Activation.Both automatic and Manual activations are handled here.Here the automatic objects are stored in one vector and their execution time is stored in another vector. The manual activation objects are stored in Hashtable. For scheduling the execution of the objects the internal thread is used.


Inner Class Summary
(package private)  class DelayActivation.QueingThread
          This internal class is used for scheduling the execution of the objects.
 
Field Summary
(package private)  int day
           
(package private)  TL1MessageFormatter formatter
           
(package private)  int hour
           
(package private)  boolean isDelayAct
           
(package private)  java.util.Vector manualActVec
           
(package private)  long millisec
           
(package private)  int minute
           
(package private)  int month
           
(package private)  java.util.Vector objVec
           
(package private)  DelayActivation.QueingThread queue
           
(package private)  TL1AgentResponseInfo responseInfo
           
(package private)  long sec
           
(package private)  int second
           
(package private)  java.util.Hashtable table
           
(package private)  java.util.Vector timeVec
           
(package private)  TL1Agent tl1Agent
           
(package private)  int year
           
 
Constructor Summary
(package private) DelayActivation()
          Default constructor used for accessing the method convertToSeconds from TL1BuiltInCommand.
(package private) DelayActivation(TL1Agent tl1Agent)
          This constructor whenever called from TL1Agent starts the internal thread.
 
Method Summary
(package private)  boolean checkForValidOrderNo(int orderNo, TL1Session sess)
          This method is used to check weather the given order number is already present in the requestInfo's present for manual activation and automatic activation.If it is present then returns true otherwise false.
(package private)  long convertToSeconds(TL1Date date, TL1Time time)
          This method is used to give the number of seconds after January 1, 1970, 00:00:00 GMT upto the execution time as per TL1 specification.The four contions are 1.TL1Date given & TL1Time null -> Then the current system time is taken for the time of the given date and upto then the number of seconds will be calculated.
(package private)  boolean executeDelayAct(TL1AgentRequestInfo requestInfo)
          This metod takes care of executing that request objects and sending them.If successfully executed then returns true.
(package private)  void makeQueue(TL1AgentRequestInfo requestInfo, long seconds)
          This method is used for making the automatic activation objects in ascending order.For this ordinary bubble sorting technic is used.
(package private)  void storeManualActRequest(TL1AgentRequestInfo reqInfo)
          This method is used to store the given requestInfo object into the Hashtable.
(package private)  int totalDelayObjects()
          This method is used to give the total number of objects present in the queue for delayed activation.This is called from SelfMonitor/GET-SM-MSGDA.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

year

int year

month

int month

day

int day

hour

int hour

minute

int minute

second

int second

millisec

long millisec

sec

long sec

isDelayAct

boolean isDelayAct

timeVec

java.util.Vector timeVec

objVec

java.util.Vector objVec

tl1Agent

TL1Agent tl1Agent

responseInfo

TL1AgentResponseInfo responseInfo

formatter

TL1MessageFormatter formatter

queue

DelayActivation.QueingThread queue

table

java.util.Hashtable table

manualActVec

java.util.Vector manualActVec
Constructor Detail

DelayActivation

DelayActivation()
Default constructor used for accessing the method convertToSeconds from TL1BuiltInCommand.

DelayActivation

DelayActivation(TL1Agent tl1Agent)
This constructor whenever called from TL1Agent starts the internal thread. The state of the flag isDelayAct is made true.
Method Detail

storeManualActRequest

void storeManualActRequest(TL1AgentRequestInfo reqInfo)
This method is used to store the given requestInfo object into the Hashtable. The key will be it's order number.
Parameters:
reqInfo - - TL1AgentRequestInfo to be stored in the Hashtable for manual activation.

convertToSeconds

long convertToSeconds(TL1Date date,
                      TL1Time time)
This method is used to give the number of seconds after January 1, 1970, 00:00:00 GMT upto the execution time as per TL1 specification.The four contions are 1.TL1Date given & TL1Time null -> Then the current system time is taken for the time of the given date and upto then the number of seconds will be calculated. 2.TL1Time given & TL1Date null -> Then the current date is taken and the time will be the given time and and upto then the number of seconds will be calculated. 3.TL1TIme & TL1Date given -> Ten the number of seconds calculated up to the given date's given time. 4.TL1Time & TL1Date are null -> Then the number of seconds will be zero.(For current execution.
Parameters:
date - - TL1Date
time - - TL1Time
Returns:
The total nunber of seconds.

checkForValidOrderNo

boolean checkForValidOrderNo(int orderNo,
                             TL1Session sess)
This method is used to check weather the given order number is already present in the requestInfo's present for manual activation and automatic activation.If it is present then returns true otherwise false.

makeQueue

void makeQueue(TL1AgentRequestInfo requestInfo,
               long seconds)
This method is used for making the automatic activation objects in ascending order.For this ordinary bubble sorting technic is used. There are two vectors namely time vector and object vector. The execution time of the object is stored in the time vector.The sorting is based on the timings.Accordinly the placements of the objects in the object vector is altered. So each and every time ,the request comes then the execution time is noted. Then the sorting of the time is done and hence the placement of that object is finallised.
Parameters:
requestInfo - - TL1AgentRequestInfo to be placed in the queue.
seconds - - It's execution time given in seconds.

totalDelayObjects

int totalDelayObjects()
This method is used to give the total number of objects present in the queue for delayed activation.This is called from SelfMonitor/GET-SM-MSGDA.

executeDelayAct

boolean executeDelayAct(TL1AgentRequestInfo requestInfo)
This metod takes care of executing that request objects and sending them.If successfully executed then returns true. any exceptions happen while forming the response info then returns false.
Parameters:
reqInfo - - TL1AgentRequestInfo