com.endeca.infront.assembler.event.request
Class RequestEventListener

java.lang.Object
  extended by com.endeca.infront.assembler.event.AssemblerEventAdapter
      extended by com.endeca.infront.assembler.event.request.RequestEventListener
All Implemented Interfaces:
AssemblerEventListener, EventListener
Direct Known Subclasses:
CanonicalLinkBuilder, ContentItemAugmentAdapter, LogServerAdapter

public abstract class RequestEventListener
extends AssemblerEventAdapter

Consolidates Assembler request event information and fires a method with the request information. Extend this class to create custom adaptors for the request events to do things such as send the information to a log server or attach the data to the content item returned by the Assembler.

See Also:
LogServerAdapter, ContentItemAugmentAdapter

Constructor Summary
RequestEventListener()
          Creates a new RequestEventListener without a SessionIdProvider.
RequestEventListener(SessionIdProvider sessionIdProvider)
          Creates a new RequestEventListener with the given SessionIdProvider.
 
Method Summary
 void assemblyComplete(AssemblerEvent event)
          Performs final updates to the RequestEvent for the current request and invokes the handleAssemblerRequestEvent(com.endeca.infront.assembler.event.request.RequestEvent, com.endeca.infront.assembler.ContentItem) method on it.
 void assemblyError(AssemblerEvent event)
          Cleans up the RequestEvent for the current request
 void assemblyStarting(AssemblerEvent event)
          Initializes the RequestEvent for the current request
abstract  void handleAssemblerRequestEvent(RequestEvent requestEvent, ContentItem rootContentItem)
          This method is invoked when an Assembler invocation is complete and the corresponding RequestEvent is fully populated.
 
Methods inherited from class com.endeca.infront.assembler.event.AssemblerEventAdapter
cartridgeError, cartridgeInitializeComplete, cartridgeInitializeStarting, cartridgePreprocessComplete, cartridgePreprocessStarting, cartridgeProcessComplete, cartridgeProcessStarting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestEventListener

public RequestEventListener()
Creates a new RequestEventListener without a SessionIdProvider. This means that the user session ID will not be included on the RequestEvent.


RequestEventListener

public RequestEventListener(SessionIdProvider sessionIdProvider)
Creates a new RequestEventListener with the given SessionIdProvider.

Parameters:
sessionIdProvider - used to determine the user session ID, which will then be added to the RequestEvent
Method Detail

assemblyStarting

public void assemblyStarting(AssemblerEvent event)
Initializes the RequestEvent for the current request

Specified by:
assemblyStarting in interface AssemblerEventListener
Overrides:
assemblyStarting in class AssemblerEventAdapter
Parameters:
event - an event object that describes the request context and input content item}

assemblyComplete

public void assemblyComplete(AssemblerEvent event)
Performs final updates to the RequestEvent for the current request and invokes the handleAssemblerRequestEvent(com.endeca.infront.assembler.event.request.RequestEvent, com.endeca.infront.assembler.ContentItem) method on it.

Specified by:
assemblyComplete in interface AssemblerEventListener
Overrides:
assemblyComplete in class AssemblerEventAdapter
Parameters:
event - an event object that describes the request context and returned content item}

assemblyError

public void assemblyError(AssemblerEvent event)
Cleans up the RequestEvent for the current request

Specified by:
assemblyError in interface AssemblerEventListener
Overrides:
assemblyError in class AssemblerEventAdapter
Parameters:
event - an event object that describes the request context, partially assembled item, and error}
See Also:
CartridgeHandler.preprocess(ContentItem), CartridgeHandler.process(ContentItem)

handleAssemblerRequestEvent

public abstract void handleAssemblerRequestEvent(RequestEvent requestEvent,
                                                 ContentItem rootContentItem)

This method is invoked when an Assembler invocation is complete and the corresponding RequestEvent is fully populated.

Subclasses should implement this method to do whatever it is their purpose to do with the RequestEvent. For example:

Parameters:
requestEvent - The event for the current request
rootContentItem - The assembler output


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.