edu.isi.pegasus.common.logging.format

## Class NetloggerEvent

- java.lang.Object
- - edu.isi.pegasus.common.logging.format.NetloggerEvent

All Implemented Interfaces:
  Event, java.lang.Cloneable

    public class NetloggerEvent
    extends java.lang.Object
    implements Event

The netlogger event.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private LogEvent` `mLogEvent` The current event object.
`private EventLogMessage` `mMessage` The current log event message.
`private java.lang.String` `mProgram` The name of the program.

### Constructor Summary

Constructors
Constructor and Description
`NetloggerEvent()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`Event` `add(java.lang.String key, java.lang.String value)` Add to the log message.
`java.lang.String` `createEntityHierarchyMessage(java.lang.String parentType, java.lang.String parentID, java.lang.String childIdType, java.util.Collection<java.lang.String> childIDs)` Creates a log message that connects the parent entities with the children.
`java.lang.String` `createLogMessage()` Creates a log message with the contents of the internal log buffer.
`java.lang.String` `createLogMessageAndReset()` Creates a log message with the contents of the internal log buffer.
`java.lang.String` `getEndEventMessage()` Creates the end message for the event.
`java.lang.String` `getEventName()` Returns the name of event that is currently associated with the log messages.
`java.lang.String` `getProgramName(java.lang.String name)` Returns the program name for the software whose log statement are logged.
`java.lang.String` `getStartEventMessage()` Creates the start message for the event.
`void` `reset()` Reset the internal log message buffer associated with the event
`void` `setEvent(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> map)` Adds the event that is to be associated with the log messages onto an internal stack
`void` `setEvent(java.lang.String name, java.lang.String entityName, java.lang.String entityID)` Set the event that is to be associated with the log messages.
`void` `setProgramName(java.lang.String name)` Sets the program name for the software whose log statement are logged.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### mProgram

    private java.lang.String mProgram

The name of the program.

#### mLogEvent

    private LogEvent mLogEvent

The current event object.

#### mMessage

    private EventLogMessage mMessage

The current log event message.

### Constructor Detail

#### NetloggerEvent

    public NetloggerEvent()

The default constructor.

### Method Detail

#### setProgramName

    public void setProgramName(java.lang.String name)

Sets the program name for the software whose log statement are logged.

Specified by:
  `setProgramName` in interface `Event`
Parameters:
  `name` -

#### getProgramName

    public java.lang.String getProgramName(java.lang.String name)

Returns the program name for the software whose log statement are logged.

Specified by:
  `getProgramName` in interface `Event`
Parameters:
  `name` -
Returns:
  the name of the program

#### setEvent

    public void setEvent(java.lang.String name,
                         java.lang.String entityName,
                         java.lang.String entityID)

Set the event that is to be associated with the log messages.

Specified by:
  `setEvent` in interface `Event`
Parameters:
  `name` - the name of the event to be associated
  `entityName` - the primary entity that is associated with the event e.g. workflow
  `entityID` - the id of that entity.

#### setEvent

    public void setEvent(java.lang.String name,
                         java.util.Map<java.lang.String,java.lang.String> map)

Adds the event that is to be associated with the log messages onto an internal stack

Specified by:
  `setEvent` in interface `Event`
Parameters:
  `name` - the name of the event to be associated
  `map` - Map of Entity Names with the entity identifiers.

#### getEventName

    public java.lang.String getEventName()

Returns the name of event that is currently associated with the log messages.

Specified by:
  `getEventName` in interface `Event`
Returns:
  the event to be associated

#### getStartEventMessage

    public java.lang.String getStartEventMessage()

Creates the start message for the event.

Specified by:
  `getStartEventMessage` in interface `Event`
Returns:
  start event message

#### getEndEventMessage

    public java.lang.String getEndEventMessage()

Creates the end message for the event.

Specified by:
  `getEndEventMessage` in interface `Event`
Returns:
  end event message

#### reset

    public void reset()

Reset the internal log message buffer associated with the event

Specified by:
  `reset` in interface `Event`

#### add

    public Event add(java.lang.String key,
                     java.lang.String value)

Add to the log message.

Specified by:
  `add` in interface `Event`
Parameters:
  `key` -
  `value` -
Returns:
  Self-reference, so calls can be chained

#### createLogMessage

    public java.lang.String createLogMessage()

Creates a log message with the contents of the internal log buffer.

Specified by:
  `createLogMessage` in interface `Event`
Returns:
  the log message

#### createLogMessageAndReset

    public java.lang.String createLogMessageAndReset()

Creates a log message with the contents of the internal log buffer. It then resets the buffer before returning the log message

Specified by:
  `createLogMessageAndReset` in interface `Event`
Returns:
  the log message

#### createEntityHierarchyMessage

    public java.lang.String createEntityHierarchyMessage(java.lang.String parentType,
                                                         java.lang.String parentID,
                                                         java.lang.String childIdType,
                                                         java.util.Collection<java.lang.String> childIDs)

Creates a log message that connects the parent entities with the children. For e.g. can we use to create the log messages connecting the jobs with the workflow they are part of.

Specified by:
  `createEntityHierarchyMessage` in interface `Event`
Parameters:
  `parentType` - the type of parent entity
  `parentID` - the id of the parent entity
  `childIdType` - the type of children entities
  `childIDs` - Collection of children id's
Returns:
  entity hierarch message.