org.lwes
Class EventFactory

java.lang.Object
  extended by org.lwes.EventFactory

public class EventFactory
extends java.lang.Object


Constructor Summary
EventFactory()
          EventFactory constructor.
 
Method Summary
 Event createEvent(byte[] bytes)
          Create an event from an array of bytes
 Event createEvent(byte[] bytes, boolean validate)
          Create an event from an array of bytes, with optional validation
 Event createEvent(java.lang.String eventName)
          Creates a validated event named eventName.
 Event createEvent(java.lang.String eventName, boolean validate)
          Create an event named eventName and optionally validate the event.
 Event createEvent(java.lang.String eventName, boolean validate, short encoding)
          Create an event named eventName with optional validation and specified encoding
 Event createEvent(java.lang.String eventName, short encoding)
          Create a validated event named eventName with specified encoding.
 java.io.File getESFFile()
          Gets the ESF file used for validation.
 java.lang.String getESFFilePath()
          Gets the path of an ESF file used for validation.
 java.io.InputStream getESFInputStream()
          Gets an InputStream of the ESF file to use for validation.
 void initialize()
          Initializes the EventFactory along with pointers to the ESF file
 void setESFFile(java.io.File esfFile)
          Sets an ESF file for validation.
 void setESFFilePath(java.lang.String path)
          Sets the path of an ESF file to use for validation.
 void setESFInputStream(java.io.InputStream input)
          Sets the InputStream of an ESF file to use for validation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventFactory

public EventFactory()
EventFactory constructor. Creates an empty event template database.

Method Detail

getESFFile

public java.io.File getESFFile()
Gets the ESF file used for validation.

Returns:
the File object

setESFFile

public void setESFFile(java.io.File esfFile)
Sets an ESF file for validation.

Parameters:
esfFile - the File object to set

getESFFilePath

public java.lang.String getESFFilePath()
Gets the path of an ESF file used for validation.

Returns:
the ESF file path

setESFFilePath

public void setESFFilePath(java.lang.String path)
Sets the path of an ESF file to use for validation.

Parameters:
path - the path to the ESF file

getESFInputStream

public java.io.InputStream getESFInputStream()
Gets an InputStream of the ESF file to use for validation.

Returns:
the ESF InputStream object

setESFInputStream

public void setESFInputStream(java.io.InputStream input)
Sets the InputStream of an ESF file to use for validation

Parameters:
input - the InputStream to use

initialize

public void initialize()
                throws EventSystemException
Initializes the EventFactory along with pointers to the ESF file

Throws:
EventSystemException - if there is an exception with setting the ESF files

createEvent

public Event createEvent(java.lang.String eventName)
                  throws EventSystemException
Creates a validated event named eventName.

Parameters:
eventName - the name of the event
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event

createEvent

public Event createEvent(java.lang.String eventName,
                         short encoding)
                  throws EventSystemException
Create a validated event named eventName with specified encoding.

Parameters:
eventName - the name of the event
encoding - the encoding to use
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event

createEvent

public Event createEvent(java.lang.String eventName,
                         boolean validate)
                  throws EventSystemException
Create an event named eventName and optionally validate the event.

Parameters:
eventName - the name of the event
validate - whether or not to validate the event against the EventTemplateDB
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event

createEvent

public Event createEvent(java.lang.String eventName,
                         boolean validate,
                         short encoding)
                  throws EventSystemException
Create an event named eventName with optional validation and specified encoding

Parameters:
eventName - the name of the event
validate - whether or not to validate the event against the EventTemplateDB
encoding - the encoding to use
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event

createEvent

public Event createEvent(byte[] bytes)
                  throws EventSystemException
Create an event from an array of bytes

Parameters:
bytes - the byte array
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event

createEvent

public Event createEvent(byte[] bytes,
                         boolean validate)
                  throws EventSystemException
Create an event from an array of bytes, with optional validation

Parameters:
bytes - the byte array
validate - whether or not to validate this event against the EventTemplateDB
Returns:
the Event object
Throws:
EventSystemException - if there is a problem creating the event