Real-Time Java AOCS Framework v1.0 API Specification

RtjAocsFramework.AocsEvent
Class EventRepository

java.lang.Object
  |
  +--RtjAocsFramework.BasicObjects.RootObject
        |
        +--RtjAocsFramework.BasicObjects.AocsObject
              |
              +--RtjAocsFramework.AocsEvent.EventRepository
All Implemented Interfaces:
Configurable, ConsistencyCheckable, Resettable, Telemeterable
Direct Known Subclasses:
ChangeEventRepository, ConfigurationEventRepository, FailureEventRepository, ManoeuvreEventRepository, ModeEventRepository, ReconfigurationEventRepository, RecoveryEventRepository, SystemEventRepository, TelecommandEventRepository

public class EventRepository
extends AocsObject
implements ConsistencyCheckable

Base class from which event repository classes are derived.

This class is not intended to be directly instantiated in the framework. It is used as a convenience class to collect together functionalities that are common to all event repository classes. The basic functionality that it provides is the management of the references to the events in the repository. The storage space for the event objects is provided in the derived, and event-specific, classes.

Iterators methods are also provided to go through all the events in the repository starting from the most recent.

The repository behaves like a circular buffer. When the it is full, the oldest event is overwritten.

Copyright: see the Copyright Notice.

Version:
1.0
Author:
Alessandro Pasetti (University of Konstanz)
See Also:
The Intercomponent Communication Document.

Field Summary
 
Fields inherited from interface RtjAocsFramework.TelemetryManagement.Telemeterable
DEBUG_TM, LONG_TM, NORMAL_TM, NTMFORMATS, SHORT_TM
 
Constructor Summary
protected EventRepository()
          Protected constructor.
 
Method Summary
 boolean doConsistencyCheck()
          Check that no events were lost.
 int getCounter()
          Return the value of the iteration counter.
 int getListSize()
           
 RecoveryAction getRecoveryAction()
          Get the recovery action associated to the consistency check.
 int getTelemetryImageLength()
          Return the length (in bits) of the telemetry image of the object.
protected  AocsEvent insert()
          Create and return a new event.
 boolean isConfigured()
          Return false if some configuration data are missing.
 boolean isIterationEnded()
          Return true if the iteration is finished.
 AocsEvent latest()
          Start an iteration by returning the most recently stored event.
 AocsEvent previous()
          Return the next most recent event.
 void reset()
          Bring the resettable state of the object to its initial default value.
 void resetConfiguration()
          Clear all configuration information.
protected  void setEvent(int i, AocsEvent evt)
          Load the argument event in the i-th position in the repository.
 void setRecoveryAction(RecoveryAction r)
          Set the recovery action associated to the consistency check.
protected  void setRepositorySize(int n)
          Initialization method to set the maximum number of events that can be stored in the repository.
 void setTelemetryFormat(byte newFormat)
          Set the telemetry format to 'newFormat'.
 void writeToTelemetry(TelemetryStream stream)
          Direct the object to write its own state to the telemetry stream.
 
Methods inherited from class RtjAocsFramework.BasicObjects.AocsObject
addConfigurationListener, addFailureListener, finalize, getAocsClock, getConfigurationListenerList, getCycle, getDestructionRecoveryAction, getFailureListenerList, getSystemManager, getTelemetryFormat, getTime, removeConfigurationListener, removeFailureListener, reportConfigurationEvent, reportFailure, resetStaticConfiguration, setAocsClock, setDestructionRecoveryAction, setMaxNumberOfConfigurationListeners, setMaxNumberOfFailureListeners, setSystemManager
 
Methods inherited from class RtjAocsFramework.BasicObjects.RootObject
getClassId, getInstanceId, setClassId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventRepository

protected EventRepository()
Protected constructor. This class is not intended to be directly instantiated. Only its subclasses should be instantiated.

Method Detail

setRepositorySize

protected void setRepositorySize(int n)
Initialization method to set the maximum number of events that can be stored in the repository. This method should only called once. Attempts to call it more than once will result in a configuration event being generated.


insert

protected AocsEvent insert()
Create and return a new event.

The caller wishes to have a new event inserted in the repository. If the internal buffer is not yet full, a reference to the next free event is returned. If the repository is full, then a reference to the oldest inserted event is returned.

Returns:
newly inserted event.

setEvent

protected void setEvent(int i,
                        AocsEvent evt)
Load the argument event in the i-th position in the repository.

The event repository should be pictured as an array modelling a circular buffer.

Parameters:
i - position where event should be loaded.
evt - event to be loaded.

latest

public AocsEvent latest()
Start an iteration by returning the most recently stored event.

This method is used in conjunction with previous() and isIterationEnded() when iterating throughthe events in the repository.

Iterations through the list should be performed in a synchronized section.


previous

public AocsEvent previous()
Return the next most recent event.

This method is used in conjunction with latest() and isIterationEnded() when iterating throughthe events in the repository.

Iterations through the list should be performed in a synchronized section.


isIterationEnded

public boolean isIterationEnded()
Return true if the iteration is finished. This method is used in conjunction with latest() and previous() when iterating throughthe events in the repository.

Iterations through the list should be performed in a synchronized section.


getCounter

public int getCounter()
Return the value of the iteration counter.


getListSize

public int getListSize()

reset

public void reset()
Description copied from interface: Resettable
Bring the resettable state of the object to its initial default value. A call to method reset on an object A is sometimes propagated to objects that are logically contained in A (relationship of strong aggregation).

Specified by:
reset in interface Resettable
Overrides:
reset in class AocsObject

resetConfiguration

public void resetConfiguration()
Description copied from interface: Configurable
Clear all configuration information.

Calls to resetConfiguration are propagated to objects that are in a relationship of strong aggregation.

Specified by:
resetConfiguration in interface Configurable
Overrides:
resetConfiguration in class AocsObject

isConfigured

public boolean isConfigured()
Description copied from interface: Configurable
Return false if some configuration data are missing.

Typically, a false value indicates that a plug-in component is missing or that the object has not been initialized. This is a negative check only: a return value of true cannot guarantee that the object is correctly configured.

Calls to resetConfiguration on an object A are normally not propagated objects of type AocsObject that are contained or otherwise aggregated to A. The rationale for this policy is that all objects of type AocsObject implement interface configurable and therefore their configuration status should be checked externally (probably through the configuration check service of the system manager).

Specified by:
isConfigured in interface Configurable
Overrides:
isConfigured in class AocsObject

writeToTelemetry

public void writeToTelemetry(TelemetryStream stream)
Description copied from interface: Telemeterable
Direct the object to write its own state to the telemetry stream.

Specified by:
writeToTelemetry in interface Telemeterable
Overrides:
writeToTelemetry in class AocsObject

setTelemetryFormat

public void setTelemetryFormat(byte newFormat)
Description copied from interface: Telemeterable
Set the telemetry format to 'newFormat'.

Specified by:
setTelemetryFormat in interface Telemeterable
Overrides:
setTelemetryFormat in class AocsObject

getTelemetryImageLength

public int getTelemetryImageLength()
Description copied from interface: Telemeterable
Return the length (in bits) of the telemetry image of the object. This method is useful to verify that the quantity of data generated by a given object is compatible with the capacity of the telemetry channel.

Specified by:
getTelemetryImageLength in interface Telemeterable
Overrides:
getTelemetryImageLength in class AocsObject

doConsistencyCheck

public boolean doConsistencyCheck()
Check that no events were lost. Events are considered lost if the number of events inserted in the repository in between two calls to doConsistencyCheck is greater than the repository capacity.

Specified by:
doConsistencyCheck in interface ConsistencyCheckable
Returns:
true if the internal state was found to be consistent, false otherwise

getRecoveryAction

public RecoveryAction getRecoveryAction()
Description copied from interface: ConsistencyCheckable
Get the recovery action associated to the consistency check.

Specified by:
getRecoveryAction in interface ConsistencyCheckable

setRecoveryAction

public void setRecoveryAction(RecoveryAction r)
Description copied from interface: ConsistencyCheckable
Set the recovery action associated to the consistency check.

Specified by:
setRecoveryAction in interface ConsistencyCheckable

Real-Time Java AOCS Framework v1.0 API Specification

Real-Time Java AOCS Framework project home page

Automatic Control Laboratory, ETH Zuerich
Physikstrasse 3
CH-8092 Zuerich, Switzerland