public class DefaultMessageProcessor extends Object implements IMessageProcessor
IMessageProcessor
,
ConfigLoader
Constructor and Description |
---|
DefaultMessageProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
abort()
purges all queues and maps
|
void |
clearTransactionThreadId(long ThreadId) |
protected boolean |
containsSLAXpathOrUserIdentXpath(TransactionalWebServicePolicy pol)
used to determine if we need to save the request or response
|
protected boolean |
doesSLAContainXpath(SLA get)
used to determine if we need to record the request/response pair
|
protected boolean |
doesSLARuleContainXpath(RuleBaseType rule)
recursive used to determine if we need to record the request/response
pair
|
void |
forceNewDataPusherThread()
Use with caution.
|
ConfigLoader |
getConfig() |
String |
getHostName()
returns the lowercase value of the current hostname
|
Set<String> |
getIgnoreList()
list of soap actions that should be ignored by agents
|
String |
getLastErrorMessage() |
int |
getPolicyCache()
gets the size of the current policy cache
|
TransactionalWebServicePolicy |
getPolicyIfAvailable(String url)
Attempts to find and return a service policy from the local cache.
|
int |
getThreadMapSize() |
long |
getTotalmessagesprocessed() |
String |
getTransactionThreadId(Long ThreadId)
Dependency Detection This should only be called in the context of a
client handler seeing outbound transactions
|
Map<String,String> |
getURLaddressMap() |
ArrayList<String> |
getUserIdentities(TransactionalWebServicePolicy p,
MessageCorrelator mc)
turns all user identities as defined by the service policy, plus ip
addresses
|
ArrayList<String> |
getUsersfromXpath(ArrayOfXPathExpressionType xpaths,
String message)
returns user identities via xpath
|
void |
incMessagesProcessed(int size) |
int |
internalMessageMapSize()
gets the size of the current message map
|
protected String |
ipWrapAndCacher(String URL)
IP to DNS mappings to speed up performance non blocking
|
boolean |
isDependencyInjectionEnabled() |
int |
outboundQueueSize()
gets the size of the current queue
|
void |
processMessageInput(String XMLrequest,
int requestSize,
String url,
String soapAction,
String HttpUsername,
String HashCode,
HashMap headers,
String ipaddress,
String agentclassname,
String relatedtransaction,
String threadid)
caches stored data and adds it to the message map.
|
void |
processMessageOutput(String HashCode,
String responseXML,
int responseSize,
boolean isFault,
Long dod,
HashMap headers)
pairs up a response with a request and adds it to the queue for
transmission
|
void |
processMessageOutput(String HashCode,
String responseXML,
int responseSize,
boolean isFault,
Long dod,
HashMap headers,
String relatedTransaction)
wrapper to the main function This is normally only called when a CLIENT
receives a response from a service
|
void |
processPreppedMessage(AddDataRequestMsg request)
this assumes that the request is already prepopulated with all required
information according the policy for this item typically used for the
offline persistent storage agent.
|
void |
purgeMessageMap()
purges the map
|
void |
purgeOutboundQueue()
purges the queue
|
void |
purgePolicyCache()
purges the policy cache
|
void |
purgeThreadMap() |
void |
removeDeadMessage()
Any message in the Message Map older than the dead message interval will
be removed from the Message Map, flagged as faulted and added to the
outbound queue
|
void |
removeFromQueue(String id)
Use when for some reason, a transaction cannot be monitored NOTE, removes
from the Message Map, not the outbound queue
|
void |
removeFromQueue(UUID id)
Use when for some reason, a transaction cannot be monitored NOTE, removes
from the Message Map, not the outbound queue
|
void |
setLastErrorMessage(String msg) |
void |
setRunning(boolean b) |
void |
setTransactionThreadId(Long ThreadId,
String id)
* Dependency Detection Only Set on an inbound service request
|
boolean |
shouldAgentRecordRequestContent(String requesturl)
performance optimzation to be used by agents that determines if the
request body should be it uses a lazy algorithm for resolving request
urls to modified urls and will always resort to being on the safe side
|
boolean |
shouldAgentRecordResponseContent(String requesturl)
performance optimization to be used by agents
|
void |
terminate() |
public int getThreadMapSize()
getThreadMapSize
in interface IMessageProcessor
public void purgeThreadMap()
purgeThreadMap
in interface IMessageProcessor
public void abort()
IMessageProcessor
abort
in interface IMessageProcessor
protected String ipWrapAndCacher(String URL)
URL
- public void clearTransactionThreadId(long ThreadId)
clearTransactionThreadId
in interface IMessageProcessor
public void forceNewDataPusherThread()
IMessageProcessor
forceNewDataPusherThread
in interface IMessageProcessor
public ConfigLoader getConfig()
getConfig
in interface IMessageProcessor
public String getHostName()
IMessageProcessor
getHostName
in interface IMessageProcessor
public String getLastErrorMessage()
getLastErrorMessage
in interface IMessageProcessor
public int getPolicyCache()
IMessageProcessor
getPolicyCache
in interface IMessageProcessor
public TransactionalWebServicePolicy getPolicyIfAvailable(String url)
IMessageProcessor
getPolicyIfAvailable
in interface IMessageProcessor
public long getTotalmessagesprocessed()
getTotalmessagesprocessed
in interface IMessageProcessor
public String getTransactionThreadId(Long ThreadId)
IMessageProcessor
getTransactionThreadId
in interface IMessageProcessor
public ArrayList<String> getUserIdentities(TransactionalWebServicePolicy p, MessageCorrelator mc)
IMessageProcessor
getUserIdentities
in interface IMessageProcessor
p
- policypublic ArrayList<String> getUsersfromXpath(ArrayOfXPathExpressionType xpaths, String message)
IMessageProcessor
getUsersfromXpath
in interface IMessageProcessor
public void incMessagesProcessed(int size)
incMessagesProcessed
in interface IMessageProcessor
public int internalMessageMapSize()
IMessageProcessor
internalMessageMapSize
in interface IMessageProcessor
public int outboundQueueSize()
IMessageProcessor
outboundQueueSize
in interface IMessageProcessor
public void processMessageInput(String XMLrequest, int requestSize, String url, String soapAction, String HttpUsername, String HashCode, HashMap headers, String ipaddress, String agentclassname, String relatedtransaction, String threadid)
IMessageProcessor
processMessageInput
in interface IMessageProcessor
XMLrequest
- - may be null, the request contentrequestSize
- - size of the payloadurl
- - the requested URL that the client asked for
http://localhost/pathsoapAction
- - SOAPAction or HTTP MethodHttpUsername
- the username or DN of the requestorHashCode
- - very important, a unique identifier for this message.
Use UUID.randomheaders
- - Transport layer headers of the requestipaddress
- - IP of the requestoragentclassname
- - the class of the agent that recorded the message.
MUST CONTAIN "client" IF THIS IS A CLIENT or from a proxy TRANSACTION!!
this is necessary for proper URL resolutionrelatedtransaction
- - if this transaction was also recorded
elsewhere, pull this data from the http headersthreadid
- - if this transaction was also recorded elsewhere, pull
this data from the http headers. or generate a new one if it was not
present using UUID.randompublic void processMessageOutput(String HashCode, String responseXML, int responseSize, boolean isFault, Long dod, HashMap headers, String relatedTransaction)
IMessageProcessor
processMessageOutput
in interface IMessageProcessor
public void processMessageOutput(String HashCode, String responseXML, int responseSize, boolean isFault, Long dod, HashMap headers)
IMessageProcessor
processMessageOutput
in interface IMessageProcessor
HashCode
- the UUID of the message that links this response to the
requestresponseXML
- response payloaddod
- time of death, no longer usedpublic void processPreppedMessage(AddDataRequestMsg request)
IMessageProcessor
processPreppedMessage
in interface IMessageProcessor
public void purgeMessageMap()
IMessageProcessor
purgeMessageMap
in interface IMessageProcessor
public void purgeOutboundQueue()
IMessageProcessor
purgeOutboundQueue
in interface IMessageProcessor
public void purgePolicyCache()
IMessageProcessor
purgePolicyCache
in interface IMessageProcessor
public void removeDeadMessage()
IMessageProcessor
removeDeadMessage
in interface IMessageProcessor
public void removeFromQueue(UUID id)
IMessageProcessor
removeFromQueue
in interface IMessageProcessor
public void removeFromQueue(String id)
IMessageProcessor
removeFromQueue
in interface IMessageProcessor
public void setRunning(boolean b)
setRunning
in interface IMessageProcessor
public void setTransactionThreadId(Long ThreadId, String id) throws Exception
IMessageProcessor
setTransactionThreadId
in interface IMessageProcessor
Exception
public boolean shouldAgentRecordRequestContent(String requesturl)
IMessageProcessor
shouldAgentRecordRequestContent
in interface IMessageProcessor
protected boolean doesSLAContainXpath(SLA get)
get
- protected boolean doesSLARuleContainXpath(RuleBaseType rule)
rule
- protected boolean containsSLAXpathOrUserIdentXpath(TransactionalWebServicePolicy pol)
pol
- public boolean shouldAgentRecordResponseContent(String requesturl)
IMessageProcessor
shouldAgentRecordResponseContent
in interface IMessageProcessor
public void terminate()
terminate
in interface IMessageProcessor
public Set<String> getIgnoreList()
IMessageProcessor
getIgnoreList
in interface IMessageProcessor
public Map<String,String> getURLaddressMap()
getURLaddressMap
in interface IMessageProcessor
public boolean isDependencyInjectionEnabled()
isDependencyInjectionEnabled
in interface IMessageProcessor
public void setLastErrorMessage(String msg)
setLastErrorMessage
in interface IMessageProcessor
Copyright © 2008–2017 MIL-OSS. All rights reserved.