public abstract class Command
extends java.lang.Object
implements com.exalead.search.SearchEventListener
Modifier and Type | Field and Description |
---|---|
protected SearchAPIDelegate |
delegate |
protected static org.apache.log4j.Logger |
logger |
static java.lang.ThreadLocal<com.exalead.search.searchapi.Command.CommandQueryState> |
queryState |
protected java.util.concurrent.atomic.AtomicInteger |
runningQueries |
protected java.util.concurrent.atomic.AtomicInteger |
startingQueries |
Constructor and Description |
---|
Command() |
Modifier and Type | Method and Description |
---|---|
abstract void |
configure()
Build the configuration
|
abstract void |
execute(java.lang.String pathInfo,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Execute the command
|
void |
onDeinit()
When this is called, this command is not used anymore, and the lock has been released.
|
void |
onPreReconfiguration()
Called when this command is about to be removed following a SearchAPI reconfiguration.
|
void |
onQueryDone()
Tell the command that a query has completed
|
void |
onQueryStarted()
Tell the command that a query has successfully started.
|
void |
onQueryStarting()
Tell the command that a command will start.
|
void |
onReconfigurationStarting()
Called when this command is about to be removed following a SearchAPI reconfiguration.
|
protected static java.lang.String |
removeJettyStuff(java.lang.String in) |
protected static void |
sendError(javax.servlet.http.HttpServletResponse resp,
int httpCode,
java.lang.String type,
java.lang.String msg,
java.lang.Throwable e) |
void |
setSearchAPIDelegate(SearchAPIDelegate delegate) |
void |
waitForStartingQueries()
Called at the beginning of a dynamic reconfiguration cycle.
|
protected SearchAPIDelegate delegate
public static java.lang.ThreadLocal<com.exalead.search.searchapi.Command.CommandQueryState> queryState
protected java.util.concurrent.atomic.AtomicInteger startingQueries
protected java.util.concurrent.atomic.AtomicInteger runningQueries
protected static org.apache.log4j.Logger logger
public void setSearchAPIDelegate(SearchAPIDelegate delegate)
public void onQueryStarting()
onQueryStarting
in interface com.exalead.search.SearchEventListener
public void onQueryStarted()
onQueryStarted
in interface com.exalead.search.SearchEventListener
public void onQueryDone()
onQueryDone
in interface com.exalead.search.SearchEventListener
public void waitForStartingQueries()
public abstract void execute(java.lang.String pathInfo, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
pathInfo
- The path relative to the command basejavax.servlet.ServletException
java.io.IOException
public abstract void configure() throws java.lang.Exception
java.lang.Exception
public void onPreReconfiguration() throws java.lang.Exception
java.lang.Exception
public void onReconfigurationStarting() throws java.lang.Exception
java.lang.Exception
public void onDeinit() throws java.lang.Exception
java.lang.Exception
protected static java.lang.String removeJettyStuff(java.lang.String in)
protected static void sendError(javax.servlet.http.HttpServletResponse resp, int httpCode, java.lang.String type, java.lang.String msg, java.lang.Throwable e) throws java.io.IOException
java.io.IOException
Copyright © 2013 Dassault Systèmes, All Rights Reserved.