TPTP 4.0.0 Monitoring Tools Project
Public API Specification

org.eclipse.hyades.logging.adapter.impl
Class Extractor

java.lang.Object
  extended byorg.eclipse.hyades.logging.adapter.impl.Component
      extended byorg.eclipse.hyades.logging.adapter.impl.ProcessUnit
          extended byorg.eclipse.hyades.logging.adapter.impl.Extractor
All Implemented Interfaces:
IComponent, IExtractor, IProcessUnit
Direct Known Subclasses:
SimpleExtractor

public abstract class Extractor
extends ProcessUnit
implements IExtractor

This is an abstract Extractor class that uses basic Java String searching to provide message extraction from incoming strings.


Field Summary
 
Fields inherited from class org.eclipse.hyades.logging.adapter.impl.ProcessUnit
flushingMode
 
Fields inherited from class org.eclipse.hyades.logging.adapter.impl.Component
logger, status, stopping
 
Constructor Summary
Extractor()
           
 
Method Summary
 java.lang.String getChildEndPattern()
          Get the end pattern to indicate the end of the child message or record.
 java.lang.String getChildStartPattern()
          Get the start pattern to indicate the start of the child message or record.
 boolean getContainsLineBreaks()
          Get whether the messages or records contain line breaks.
 java.lang.String getEndPattern()
          Get the end pattern to indicate the end of the message or record.
 boolean getIncludeChildEndPattern()
          Get whether the child end pattern is to be included in the child message.
 boolean getIncludeChildStartPattern()
          Get whether the child start pattern is to be included in the child message.
 boolean getIncludeEndPattern()
          Get whether the end pattern is to be included in the message.
 boolean getIncludeStartPattern()
          Get whether the start pattern is to be included in the message.
 java.lang.String getLineBreakSymbol()
          Get the new line break symbol that may be used to replace line breaks in the messages.
 boolean getReplaceLineBreaks()
          Get whether line breaks in the messages are to be replaced.
 java.lang.String getStartPattern()
          Get the start pattern to indicate the start of the message or record.
 boolean isNestedMessages()
          Returns whether messages can be nested.
 java.lang.Object[] processEventItems(java.lang.Object[] msgs)
          This implementation processes an array of String objects representing data read from the log.
abstract  MessageString[] processStrings(java.lang.String[] strings)
          Abstract method to process String's.
 void setChildEndPattern(java.lang.String childEndPattern)
          Set the end pattern to indicate the end of the child message or record.
 void setChildStartPattern(java.lang.String childStartPattern)
          Set the start pattern to indicate the start of the child message or record.
 void setContainsLineBreaks(boolean containsLineBreaks)
          Set whether the messages or records contain line breaks.
 void setEndPattern(java.lang.String endPattern)
          Set the end pattern to indicate the end of the message or record.
 void setIncludeChildEndPattern(boolean includeChildEndPattern)
          Set whether the child end pattern is to be included in the child message.
 void setIncludeChildStartPattern(boolean includeChildStartPattern)
          Set whether the child start pattern is to be included in the child message.
 void setIncludeEndPattern(boolean includeEndPattern)
          Set whether the end pattern is to be included in the message.
 void setIncludeStartPattern(boolean includeStartPattern)
          Set whether the start pattern is to be included in the message.
 void setLineBreakSymbol(java.lang.String newLineBreakSymbol)
          Set the new line break symbol that may be used to replace line breaks in the messages.
 void setNestedMessages(boolean nestedMessages)
          Set whether messages can be nested.
 void setReplaceLineBreaks(boolean replaceLineBreaks)
          Set whether line breaks in the messages are to be replaced.
 void setStartPattern(java.lang.String startPattern)
          Set the start pattern to indicate the start of the message or record.
 void stop()
          Method stop.
 java.lang.Object[] testProcessEventItems(java.lang.Object[] msgs)
          In order to avoid runtime failures a context should invoke this test method.
 MessageString[] testProcessStrings(java.lang.String[] events)
          Simulates the processStrings method that access a String array and returns a MessageString array.
 void update()
          update the configuration based on the configuration Element
 
Methods inherited from class org.eclipse.hyades.logging.adapter.impl.ProcessUnit
flushEventItems, getProperties, setProperties
 
Methods inherited from class org.eclipse.hyades.logging.adapter.impl.Component
clean, getComponents, getComponentStatus, getConfiguration, getContextConfiguration, getDescription, getEventFactory, getExecutableClassName, getImplementationCreationDate, getImplementationVersion, getImplementationVersionDescription, getItemsProcessedCount, getLogger, getLoggingLevel, getName, getParent, getRole, getRoleCreationDate, getRoleVersion, getRoleVersionDescription, getUniqueID, incrementItemsProcessedCount, incrementItemsProcessedCount, init, isStopping, log, log, setComponents, setConfiguration, setContextConfiguration, setDescription, setExecutableClassName, setImplemenationCreationDate, setImplementationVersion, setImplementationVersionDescription, setLogger, setLoggingLevel, setName, setParent, setRole, setRoleCreationDate, setRoleVersion, setRoleVersionDescription, setStopping, setUniqueID, start, stop, trace, trace, trace, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.hyades.logging.adapter.IProcessUnit
flushEventItems
 
Methods inherited from interface org.eclipse.hyades.logging.adapter.IComponent
getComponents, getConfiguration, getContextConfiguration, getDescription, getExecutableClassName, getImplementationCreationDate, getImplementationVersion, getImplementationVersionDescription, getLogger, getLoggingLevel, getName, getParent, getRole, getRoleCreationDate, getRoleVersion, getRoleVersionDescription, getUniqueID, init, log, log, setComponents, setConfiguration, setContextConfiguration, setDescription, setExecutableClassName, setImplemenationCreationDate, setImplementationVersion, setImplementationVersionDescription, setLogger, setLoggingLevel, setName, setParent, setRole, setRoleCreationDate, setRoleVersion, setRoleVersionDescription, setUniqueID, start, update
 

Constructor Detail

Extractor

public Extractor()
Method Detail

setNestedMessages

public void setNestedMessages(boolean nestedMessages)
Set whether messages can be nested.

Parameters:
nestedMessages - - boolean whether messages can be nested.

isNestedMessages

public boolean isNestedMessages()
Returns whether messages can be nested.

Returns:
boolean whether messages can be nested.

processEventItems

public java.lang.Object[] processEventItems(java.lang.Object[] msgs)
This implementation processes an array of String objects representing data read from the log. It extracts messages or records from the data and returns them in MessageString objects.

Specified by:
processEventItems in interface IProcessUnit
Overrides:
processEventItems in class ProcessUnit
Parameters:
msgs - - an array of String objects representing log data
Returns:
the extracted messages as an array of MessageString objects where each MessageString object holds a single message.
See Also:
IProcessUnit.processEventItems(java.lang.Object[])

processStrings

public abstract MessageString[] processStrings(java.lang.String[] strings)
Abstract method to process String's. Each implementation class must implement this method to process String's to extract messages.

Specified by:
processStrings in interface IExtractor
Parameters:
strings - - strings to process
Returns:
MessageString[] - message array

testProcessEventItems

public java.lang.Object[] testProcessEventItems(java.lang.Object[] msgs)
                                         throws AdapterInvalidConfig
Description copied from interface: IProcessUnit
In order to avoid runtime failures a context should invoke this test method. An implementation should test for the appropriate types it will consume and produce thus simulating a runtime environment. If a type is not supported an exception should be thrown.

Specified by:
testProcessEventItems in interface IProcessUnit
Overrides:
testProcessEventItems in class ProcessUnit
Throws:
AdapterInvalidConfig
See Also:
org.eclipse.hyades.logging.adapter.IProcessUnit#processEventItem(Object[])

testProcessStrings

public MessageString[] testProcessStrings(java.lang.String[] events)
Description copied from interface: IExtractor
Simulates the processStrings method that access a String array and returns a MessageString array.

Specified by:
testProcessStrings in interface IExtractor
Parameters:
events - - Strings to test processing
Returns:
MessageString[] - message array

stop

public void stop()
Description copied from interface: IComponent
Method stop. Stops the component activity

Specified by:
stop in interface IComponent
Overrides:
stop in class Component
See Also:
IComponent.stop()

update

public void update()
            throws AdapterInvalidConfig
update the configuration based on the configuration Element

Specified by:
update in interface IComponent
Overrides:
update in class ProcessUnit
Throws:
AdapterInvalidConfig
See Also:
IComponent.update()

setContainsLineBreaks

public void setContainsLineBreaks(boolean containsLineBreaks)
Set whether the messages or records contain line breaks.

Parameters:
containsLineBreaks - - boolean whether the messages contain line breaks.

getContainsLineBreaks

public boolean getContainsLineBreaks()
Get whether the messages or records contain line breaks.

Returns:
true if the messages contain line breaks, false otherwise

setReplaceLineBreaks

public void setReplaceLineBreaks(boolean replaceLineBreaks)
Set whether line breaks in the messages are to be replaced.

Parameters:
replaceLineBreaks - - boolean whether line breaks in the messages are to be replaced.

getReplaceLineBreaks

public boolean getReplaceLineBreaks()
Get whether line breaks in the messages are to be replaced.

Returns:
true if line breaks in the messages are to be replaced, false otherwise.

setLineBreakSymbol

public void setLineBreakSymbol(java.lang.String newLineBreakSymbol)
Set the new line break symbol that may be used to replace line breaks in the messages.

Parameters:
newLineBreakSymbol - - the new line break symbol String

getLineBreakSymbol

public java.lang.String getLineBreakSymbol()
Get the new line break symbol that may be used to replace line breaks in the messages.

Returns:
the new line break symbol as a String.

setStartPattern

public void setStartPattern(java.lang.String startPattern)
Set the start pattern to indicate the start of the message or record.

Parameters:
startPattern - - the start pattern String

getStartPattern

public java.lang.String getStartPattern()
Get the start pattern to indicate the start of the message or record.

Returns:
the start pattern String.

setIncludeStartPattern

public void setIncludeStartPattern(boolean includeStartPattern)
Set whether the start pattern is to be included in the message.

Parameters:
includeStartPattern - - boolean whether the start pattern is to be included in the message.

getIncludeStartPattern

public boolean getIncludeStartPattern()
Get whether the start pattern is to be included in the message.

Returns:
true if the start pattern is to be included in the message, false otherwise

setEndPattern

public void setEndPattern(java.lang.String endPattern)
Set the end pattern to indicate the end of the message or record.

Parameters:
endPattern - - the end pattern String.

getEndPattern

public java.lang.String getEndPattern()
Get the end pattern to indicate the end of the message or record.

Returns:
the end pattern String.

setIncludeEndPattern

public void setIncludeEndPattern(boolean includeEndPattern)
Set whether the end pattern is to be included in the message.

Parameters:
includeEndPattern - - boolean whether the end pattern is to be included in the message.

getIncludeEndPattern

public boolean getIncludeEndPattern()
Get whether the end pattern is to be included in the message.

Returns:
true if the end pattern is to be included in the message, false otherwise.

setChildStartPattern

public void setChildStartPattern(java.lang.String childStartPattern)
Set the start pattern to indicate the start of the child message or record.

Parameters:
childStartPattern - - the start pattern String of the child message

getChildStartPattern

public java.lang.String getChildStartPattern()
Get the start pattern to indicate the start of the child message or record.

Returns:
the start pattern String of the child message

setIncludeChildStartPattern

public void setIncludeChildStartPattern(boolean includeChildStartPattern)
Set whether the child start pattern is to be included in the child message.

Parameters:
includeChildStartPattern - - boolean whether the child start pattern is to be included in the child message.

getIncludeChildStartPattern

public boolean getIncludeChildStartPattern()
Get whether the child start pattern is to be included in the child message.

Returns:
true if the child start pattern is to be included in the child message, false otherwise.

setChildEndPattern

public void setChildEndPattern(java.lang.String childEndPattern)
Set the end pattern to indicate the end of the child message or record.

Parameters:
childEndPattern - - the end pattern String of the child message

getChildEndPattern

public java.lang.String getChildEndPattern()
Get the end pattern to indicate the end of the child message or record.

Returns:
the end pattern String of the child message

setIncludeChildEndPattern

public void setIncludeChildEndPattern(boolean includeChildEndPattern)
Set whether the child end pattern is to be included in the child message.

Parameters:
includeChildEndPattern - - boolean whether the child end pattern is to be included in the child message.

getIncludeChildEndPattern

public boolean getIncludeChildEndPattern()
Get whether the child end pattern is to be included in the child message.

Returns:
true if the child end pattern is to be included in the child message. otherwise false.

TPTP 4.0.0 Monitoring Tools Project
Public API Specification