|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.nmr.audit.AbstractAuditor
org.apache.servicemix.nmr.audit.lucene.LuceneAuditor
public class LuceneAuditor
Lucene AuditorQuery implementation. It uses Lucene as the indexing mechanism for searching Exchanges and needs a delegated AuditorMBean to persist Exchanges. The Content of messages are stored as: - org.apache.servicemix.in.contents - org.apache.servicemix.out.contents, if exists - org.apache.servicemix.fault.contents, if exists Properties for IN Messages are stored as: - org.apache.servicemix.in.propertyname - org.apache.servicemix.out.propertyname, if exists - org.apache.servicemix.fault.propertyname, if exists
| Field Summary | |
|---|---|
static String |
FIELD_CONTENT
|
static String |
FIELD_ID
|
static String |
FIELD_MEP
|
static String |
FIELD_PROPERTIES
|
static String |
FIELD_ROLE
|
static String |
FIELD_STATUS
|
| Fields inherited from class org.apache.servicemix.nmr.audit.AbstractAuditor |
|---|
logger |
| Constructor Summary | |
|---|---|
LuceneAuditor()
|
|
| Method Summary | |
|---|---|
protected void |
addExchangePropertiesToDocument(Exchange exchange,
org.apache.lucene.document.Document document)
|
protected void |
addMessageHeadersToDocument(Message message,
org.apache.lucene.document.Document document,
Type type)
|
protected org.apache.lucene.document.Document |
createDocument(Exchange exchange)
|
int |
deleteExchangesByIds(String[] ids)
Delete exchanges given their ids. |
int |
deleteExchangesByRange(int fromIndex,
int toIndex)
Delete exchanges ranging from fromIndex to toIndex. |
void |
exchangeSent(Exchange exchange)
Method called each time an exchange is sent |
String[] |
findExchangesIdsByMessageContent(String type,
String content)
|
String[] |
findExchangesIdsByMessageHeader(String type,
String property,
String value)
|
String[] |
findExchangesIdsByProperty(String property,
String value)
|
String[] |
findExchangesIdsByQuery(String query)
|
String[] |
findExchangesIdsByStatus(Status status)
|
protected String |
getBodyAsText(Message message)
|
AuditorMBean |
getDelegatedAuditor()
|
String |
getDescription()
|
int |
getExchangeCount()
Get the number of exchanges stored by this auditor. |
String[] |
getExchangeIds(String queryContent,
String field)
Searches for Exchanges IDs using the supplied key-field and the expected content of the field |
String[] |
getExchangeIdsByRange(int fromIndex,
int toIndex)
Retrieve a range of message exchange ids. |
Exchange[] |
getExchangesByIds(String[] ids)
Retrieve exchanges for the specified ids. |
LuceneIndexer |
getLuceneIndexer()
|
void |
setDelegatedAuditor(AuditorMBean delegatedAuditor)
|
void |
setLuceneIndexer(LuceneIndexer luceneIndexer)
|
| Methods inherited from class org.apache.servicemix.nmr.audit.AbstractAuditor |
|---|
deleteAllExchanges, deleteExchangeById, deleteExchangeByIndex, exchangeDelivered, exchangeFailed, getAllExchangeIds, getAllExchanges, getExchangeById, getExchangeByIndex, getExchangeIdByIndex, getExchangesByRange, resendExchange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.servicemix.nmr.audit.AuditorMBean |
|---|
deleteAllExchanges, deleteExchangeById, deleteExchangeByIndex, getAllExchangeIds, getAllExchanges, getExchangeById, getExchangeByIndex, getExchangeIdByIndex, getExchangesByRange, resendExchange |
| Field Detail |
|---|
public static final String FIELD_ID
public static final String FIELD_STATUS
public static final String FIELD_MEP
public static final String FIELD_ROLE
public static final String FIELD_PROPERTIES
public static final String FIELD_CONTENT
| Constructor Detail |
|---|
public LuceneAuditor()
| Method Detail |
|---|
public LuceneIndexer getLuceneIndexer()
public void setLuceneIndexer(LuceneIndexer luceneIndexer)
luceneIndexer - The luceneIndexer to set.public AuditorMBean getDelegatedAuditor()
public void setDelegatedAuditor(AuditorMBean delegatedAuditor)
delegatedAuditor - The delegatedAuditor to set.
public int getExchangeCount()
throws AuditorException
AuditorMBean
getExchangeCount in interface AuditorMBeangetExchangeCount in class AbstractAuditorAuditorException - if an error occurs accessing the data store.
public String[] getExchangeIdsByRange(int fromIndex,
int toIndex)
throws AuditorException
AuditorMBean
getExchangeIdsByRange in interface AuditorMBeangetExchangeIdsByRange in class AbstractAuditorfromIndex - the lower bound index of the ids to be retrieved.
fromIndex must be greater or equal to zero.toIndex - the upper bound (exclusive) of the ids to be retrieved.
toIndex must be greater or equal to fromIndex
AuditorException - if an error occurs accessing the data store.
public Exchange[] getExchangesByIds(String[] ids)
throws AuditorException
AuditorMBean
getExchangesByIds in interface AuditorMBeangetExchangesByIds in class AbstractAuditorids - the ids of exchanges to retrieve
AuditorException - if an error occurs accessing the data store.
public int deleteExchangesByRange(int fromIndex,
int toIndex)
throws AuditorException
AuditorMBean
deleteExchangesByRange in interface AuditorMBeandeleteExchangesByRange in class AbstractAuditorfromIndex - the lower bound index of the exchanges to be retrieved.
fromIndex must be greater or equal to zero.toIndex - the upper bound (exclusive) of the exchanges to be retrieved.
toIndex must be greater or equal to fromIndex
AuditorException - if an error occurs accessing the data store.
public int deleteExchangesByIds(String[] ids)
throws AuditorException
AuditorMBean
deleteExchangesByIds in interface AuditorMBeandeleteExchangesByIds in class AbstractAuditorids - the ids of exchanges to retrieve
AuditorException - if an error occurs accessing the data store.public void exchangeSent(Exchange exchange)
ExchangeListener
exchangeSent in interface ExchangeListenerexchange - the exchange sentpublic String getDescription()
public String[] findExchangesIdsByQuery(String query)
throws AuditorException
findExchangesIdsByQuery in interface AuditorQueryMBeanAuditorException
public String[] findExchangesIdsByStatus(Status status)
throws AuditorException
findExchangesIdsByStatus in interface AuditorQueryMBeanAuditorException
public String[] findExchangesIdsByProperty(String property,
String value)
throws AuditorException
findExchangesIdsByProperty in interface AuditorQueryMBeanAuditorException
public String[] findExchangesIdsByMessageContent(String type,
String content)
throws AuditorException
findExchangesIdsByMessageContent in interface AuditorQueryMBeanAuditorException
public String[] findExchangesIdsByMessageHeader(String type,
String property,
String value)
throws AuditorException
findExchangesIdsByMessageHeader in interface AuditorQueryMBeanAuditorException
protected org.apache.lucene.document.Document createDocument(Exchange exchange)
throws AuditorException
AuditorExceptionprotected String getBodyAsText(Message message)
protected void addExchangePropertiesToDocument(Exchange exchange,
org.apache.lucene.document.Document document)
protected void addMessageHeadersToDocument(Message message,
org.apache.lucene.document.Document document,
Type type)
public String[] getExchangeIds(String queryContent,
String field)
throws AuditorException
AuditorQueryMBean
getExchangeIds in interface AuditorQueryMBeanAuditorException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||