All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.system.event.SystemEvent.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






SystemEvent














org.ocap.system.event
Class SystemEvent

java.lang.Object
  extended by org.ocap.system.event.SystemEvent
Direct Known Subclasses:
DeferredDownloadEvent, ErrorEvent, RebootEvent, ResourceDepletionEvent

public class SystemEvent
extends java.lang.Object

This class is the basis for system event messages. Applications cannot create this class directly, they must create one of the defined subclasses instead.

The event type code is defined with ranges reserved for specific types of events. Ranges defined for the implementation using "SYS" cannot be used by applications.

Ranges defined as "reserved" will be allocated by OCAP (or other future standards). Applications and OCAP implementations SHOULD NOT use these values until their meaning is standardized.

Values in a SYS range that are not reserved may be used by OCAP implementers - their meaning is implementation-dependent.

Values in an APP range that are not reserved may be used by OCAP applications - their meaning is application-dependent. The getAppID() method may be useful to disambiguate these codes.

Informational events can be used for any information desired. Recoverable error events do not prevent an application or the implementation from continued execution. Catastrophic events generated by or on behalf of an application indicate that the application cannot continue execution and will be a cause for self-destruction. Reboot events generated by the implementation indicate that the implementation cannot continue execution and a system generated reboot is imminent.


Field Summary
static int BEGIN_APP_CAT_ERROR_EVENT_TYPES
          Start of range reserved for application generated catastrophic error events defined by OCAP.
static int BEGIN_APP_CAT_ERROR_RESERVED_EVENT_TYPES
          Start of range reserved for application generated catastrophic error events defined by OCAP.
static int BEGIN_APP_INFO_EVENT_TYPES
          Start of range for application generated informational events.
static int BEGIN_APP_INFO_RESERVED_EVENT_TYPES
          Start of range reserved for application generated informational events defined by OCAP.
static int BEGIN_APP_REC_ERROR_EVENT_TYPES
          Start of range for application generated recoverable error events.
static int BEGIN_APP_REC_ERROR_RESERVED_EVENT_TYPES
          Start of range reserved for application generated recoverable error events defined by OCAP.
static int BEGIN_SYS_CAT_ERROR_EVENT_TYPES
          Start of range for system generated catastrophic events.
static int BEGIN_SYS_CAT_ERROR_RESERVED_EVENT_TYPES
          Start of range reserved for system generated catastrophic error events defined by OCAP.
static int BEGIN_SYS_DNLD_EVENT_TYPES
          Start of range reserved for system generated deferred download events in response to a CVT signaling a deferred download.
static int BEGIN_SYS_INFO_EVENT_TYPES
          Start of range for system generated informational events.
static int BEGIN_SYS_INFO_RESERVED_EVENT_TYPES
          Start of range reserved for system generated informational events defined by OCAP.
static int BEGIN_SYS_REBOOT_EVENT_TYPES
          Start of range for system generated reboot events.
static int BEGIN_SYS_REBOOT_RESERVED_EVENT_TYPES
          Start of range reserved for system generated reboot events defined by OCAP.
static int BEGIN_SYS_REC_ERROR_EVENT_TYPES
          Start of range for system generated recoverable error events.
static int BEGIN_SYS_REC_ERROR_RESERVED_EVENT_TYPES
          Start of range reserved for system generated recoverable error events defined by OCAP.
static int BEGIN_SYS_RES_DEP_EVENT_TYPES
          Start of range for system generated resource depletion events.
static int BEGIN_SYS_RES_DEP_RESERVED_EVENT_TYPES
          Start of range reserved for system generated resource depletion events defined by OCAP.
static int END_APP_CAT_ERROR_EVENT_TYPES
          End of range for application generated catastrophic error events.
static int END_APP_INFO_EVENT_TYPES
          End of range for application generated informational events.
static int END_APP_REC_ERROR_EVENT_TYPES
          End of range for application generated recoverable error events.
static int END_SYS_CAT_ERROR_EVENT_TYPES
          End of range for system generated catastrophic error events.
static int END_SYS_DNLD_EVENT_TYPES
          End of range for system deferred download events.
static int END_SYS_INFO_EVENT_TYPES
          End of range for system generated informational events.
static int END_SYS_REBOOT_EVENT_TYPES
          End of range for system generated reboot events.
static int END_SYS_REC_ERROR_EVENT_TYPES
          End of range for system generated recoverable error events.
static int END_SYS_RES_DEP_EVENT_TYPES
          End of range for system generated resource depletion events.
 
Constructor Summary
protected SystemEvent(int typeCode)
          System event constructor.
protected SystemEvent(int typeCode, java.lang.String message)
          System event constructor with message.
protected SystemEvent(int typeCode, java.lang.String message, long date, AppID appId)
          This constructor is provided for internal use by OCAP implementations; applications SHOULD NOT call it.
 
Method Summary
 AppID getAppID()
          Gets the globally unique identifier of the application logging the event.
 long getDate()
          Gets the event date in milli-seconds from midnight January 1, 1970, GMT.
 java.lang.String getMessage()
          Gets the readable message.
 int getTypeCode()
          Gets the event type code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEGIN_SYS_INFO_EVENT_TYPES

public static final int BEGIN_SYS_INFO_EVENT_TYPES
Start of range for system generated informational events.

See Also:
Constant Field Values

BEGIN_SYS_INFO_RESERVED_EVENT_TYPES

public static final int BEGIN_SYS_INFO_RESERVED_EVENT_TYPES
Start of range reserved for system generated informational events defined by OCAP. This reserved range ends with END_SYS_INFO_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_INFO_EVENT_TYPES

public static final int END_SYS_INFO_EVENT_TYPES
End of range for system generated informational events.

See Also:
Constant Field Values

BEGIN_APP_INFO_EVENT_TYPES

public static final int BEGIN_APP_INFO_EVENT_TYPES
Start of range for application generated informational events.

See Also:
Constant Field Values

BEGIN_APP_INFO_RESERVED_EVENT_TYPES

public static final int BEGIN_APP_INFO_RESERVED_EVENT_TYPES
Start of range reserved for application generated informational events defined by OCAP. This reserved range ends with END_APP_INFO_EVENT_TYPES.

See Also:
Constant Field Values

END_APP_INFO_EVENT_TYPES

public static final int END_APP_INFO_EVENT_TYPES
End of range for application generated informational events.

See Also:
Constant Field Values

BEGIN_SYS_REC_ERROR_EVENT_TYPES

public static final int BEGIN_SYS_REC_ERROR_EVENT_TYPES
Start of range for system generated recoverable error events.

These events may refer to a specific application, which will be identified by the getAppID() method, or may be internal system errors, in which case getAppID() will return null.

See Also:
Constant Field Values

BEGIN_SYS_REC_ERROR_RESERVED_EVENT_TYPES

public static final int BEGIN_SYS_REC_ERROR_RESERVED_EVENT_TYPES
Start of range reserved for system generated recoverable error events defined by OCAP. This reserved range ends with END_SYS_REC_ERROR_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_REC_ERROR_EVENT_TYPES

public static final int END_SYS_REC_ERROR_EVENT_TYPES
End of range for system generated recoverable error events.

See Also:
Constant Field Values

BEGIN_APP_REC_ERROR_EVENT_TYPES

public static final int BEGIN_APP_REC_ERROR_EVENT_TYPES
Start of range for application generated recoverable error events.

This type of error is intended to indicate that something went wrong (e.g. a data file could not be loaded or a system call failed), but the application is designed to handle the error gracefully so does not need to terminate.

See Also:
Constant Field Values

BEGIN_APP_REC_ERROR_RESERVED_EVENT_TYPES

public static final int BEGIN_APP_REC_ERROR_RESERVED_EVENT_TYPES
Start of range reserved for application generated recoverable error events defined by OCAP. This reserved range ends with END_APP_REC_ERROR_EVENT_TYPES.

See Also:
Constant Field Values

END_APP_REC_ERROR_EVENT_TYPES

public static final int END_APP_REC_ERROR_EVENT_TYPES
End of range for application generated recoverable error events.

See Also:
Constant Field Values

BEGIN_SYS_CAT_ERROR_EVENT_TYPES

public static final int BEGIN_SYS_CAT_ERROR_EVENT_TYPES
Start of range for system generated catastrophic events.

These the events are generated by the system when it detects a catastrophic failure that will cause (or has caused) the application identified by the getAppID() method to be terminated.

These events may also be internal system errors, in which case getAppID() will return null.

See Also:
Constant Field Values

BEGIN_SYS_CAT_ERROR_RESERVED_EVENT_TYPES

public static final int BEGIN_SYS_CAT_ERROR_RESERVED_EVENT_TYPES
Start of range reserved for system generated catastrophic error events defined by OCAP. This reserved range ends with END_SYS_CAT_ERROR_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_CAT_ERROR_EVENT_TYPES

public static final int END_SYS_CAT_ERROR_EVENT_TYPES
End of range for system generated catastrophic error events.

See Also:
Constant Field Values

BEGIN_APP_CAT_ERROR_EVENT_TYPES

public static final int BEGIN_APP_CAT_ERROR_EVENT_TYPES
Start of range reserved for application generated catastrophic error events defined by OCAP. This reserved range ends with END_APP_CAT_ERROR_EVENT_TYPES.

See Also:
Constant Field Values

BEGIN_APP_CAT_ERROR_RESERVED_EVENT_TYPES

public static final int BEGIN_APP_CAT_ERROR_RESERVED_EVENT_TYPES
Start of range reserved for application generated catastrophic error events defined by OCAP. This reserved range ends with END_APP_CAT_ERROR_EVENT_TYPES.

See Also:
Constant Field Values

END_APP_CAT_ERROR_EVENT_TYPES

public static final int END_APP_CAT_ERROR_EVENT_TYPES
End of range for application generated catastrophic error events.

See Also:
Constant Field Values

BEGIN_SYS_REBOOT_EVENT_TYPES

public static final int BEGIN_SYS_REBOOT_EVENT_TYPES
Start of range for system generated reboot events.

See Also:
Constant Field Values

BEGIN_SYS_REBOOT_RESERVED_EVENT_TYPES

public static final int BEGIN_SYS_REBOOT_RESERVED_EVENT_TYPES
Start of range reserved for system generated reboot events defined by OCAP. This reserved range ends with END_SYS_REBOOT_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_REBOOT_EVENT_TYPES

public static final int END_SYS_REBOOT_EVENT_TYPES
End of range for system generated reboot events.

See Also:
Constant Field Values

BEGIN_SYS_RES_DEP_EVENT_TYPES

public static final int BEGIN_SYS_RES_DEP_EVENT_TYPES
Start of range for system generated resource depletion events.

See Also:
Constant Field Values

BEGIN_SYS_RES_DEP_RESERVED_EVENT_TYPES

public static final int BEGIN_SYS_RES_DEP_RESERVED_EVENT_TYPES
Start of range reserved for system generated resource depletion events defined by OCAP. This reserved range ends with END_SYS_RES_DEP_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_RES_DEP_EVENT_TYPES

public static final int END_SYS_RES_DEP_EVENT_TYPES
End of range for system generated resource depletion events.

See Also:
Constant Field Values

BEGIN_SYS_DNLD_EVENT_TYPES

public static final int BEGIN_SYS_DNLD_EVENT_TYPES
Start of range reserved for system generated deferred download events in response to a CVT signaling a deferred download. This reserved range ends with END_SYS_DNLD_EVENT_TYPES.

See Also:
Constant Field Values

END_SYS_DNLD_EVENT_TYPES

public static final int END_SYS_DNLD_EVENT_TYPES
End of range for system deferred download events.

See Also:
Constant Field Values
Constructor Detail

SystemEvent

protected SystemEvent(int typeCode)
System event constructor. Assigns a date, and AppID. The readable message is set to null.

Parameters:
typeCode - - Unique event type.
Throws:
java.lang.IllegalArgumentException - if the typeCode is not in a defined application range when the event is created by an application.

SystemEvent

protected SystemEvent(int typeCode,
                      java.lang.String message)
System event constructor with message. Assigns a date, and AppID.

Parameters:
typeCode - - Unique event type.
message - - Readable message specific to the event generator.
Throws:
java.lang.IllegalArgumentException - if the typeCode is not in a defined application range when the event is created by an application.

SystemEvent

protected SystemEvent(int typeCode,
                      java.lang.String message,
                      long date,
                      AppID appId)
This constructor is provided for internal use by OCAP implementations; applications SHOULD NOT call it.

Parameters:
typeCode - - The unique error type code.
message - - Readable message specific to the event generator.
date - - Event date in milli-seconds from midnight January 1, 1970 GMT.
appId - - The Id of the application logging the event.
Throws:
java.lang.SecurityException - if this constructor is called by any application.
Method Detail

getAppID

public AppID getAppID()
Gets the globally unique identifier of the application logging the event.

Returns:
The identifier of the application, or null for events that do not have an associated application (such as system initiated reboots).

getTypeCode

public int getTypeCode()
Gets the event type code. Identifies a code specific to the event system.

Returns:
type code of the event.

getDate

public long getDate()
Gets the event date in milli-seconds from midnight January 1, 1970, GMT. The return value from this method can be passed to the java.util.Date(long) constructor.

Returns:
The date the event was submitted to the system.

getMessage

public java.lang.String getMessage()
Gets the readable message.

Returns:
message string of the event.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy