public abstract class XMLRequest
extends java.lang.Object
Constructor and Description |
---|
XMLRequest() |
Modifier and Type | Method and Description |
---|---|
protected static void |
assertClientZero(ConnectionAttributes sessioninfo) |
protected static void |
assertServerVersion(ConnectionAttributes sessioninfo,
int minExpected) |
protected static void |
checkClient(int client) |
protected static void |
checkID(int id) |
protected static void |
checkLnr(int lnr) |
protected static void |
checkNull(java.lang.Object object,
java.lang.String msg) |
protected static void |
checkSelStatisticsPrivilege(ConnectionAttributes sessionInfo) |
protected static void |
checkSystemOverviewPrivilege(ConnectionAttributes sessionInfo) |
protected static void |
checkUC4ObjectEmptyName(UC4ObjectName name) |
protected static void |
checkUC4ObjectName(UC4ObjectName name) |
protected static com.automic.protocol.Message |
createNATFor(XMLRequest r,
ConnectionAttributes sessionInfo) |
protected com.automic.protocol.Message |
createNATRequest(ConnectionAttributes sessionInfo)
Sub classes may override this method send messages in NAT protocol to the AE.
|
protected abstract void |
createRequest(com.uc4.util.XMLDocument doc,
org.w3c.dom.Element request,
ConnectionAttributes sessionInfo)
Creates the XML Document for the request.
|
protected boolean |
emptyAttributes(org.w3c.dom.NamedNodeMap attributeMap,
com.uc4.translate.Message translator)
Returns
true if the attribute map is not empty. |
java.util.List<MessageBox> |
getAllMessageBoxes()
Returns a List of all MessageBoxes object if the server returns messages for this request.
|
MessageBox |
getMessageBox()
Returns a MessageBox object if the server returns a message for this request.
|
java.lang.String |
getRequestID(java.lang.String defaultValue)
Sub classes may override to send a UUID instead.
|
protected abstract java.lang.String |
getSrc()
Returns the request source.
|
protected void |
handleContent(com.uc4.util.XMLDocument doc,
ConnectionAttributes session) |
void |
handleResponse(com.uc4.util.XMLDocument doc,
ConnectionAttributes session)
Handles the response from the server.
|
protected boolean |
ignoreMessageBox() |
protected boolean |
isAllowedInClientZero()
This method is used internally.
|
void |
send(org.w3c.dom.Document doc,
ConnectionAttributes sessioninfo,
java.lang.String nr)
Prepares the request for sending.
|
protected void |
setMessageBox(MessageBox box)
Used in
XMLRequestSet to move the Message Box from a child request to the XMLRequestSet object. |
boolean |
showQuarantineNotification()
Returns
true if a new quarantine message has been found. |
protected abstract java.lang.String getSrc()
protected abstract void createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
doc
- Document, used to create new Elementsrequest
- Request Element - classes append information to this request elementsessionInfo
- Information about the sessionprotected com.automic.protocol.Message createNATRequest(ConnectionAttributes sessionInfo)
sessionInfo
- Session infosprotected static com.automic.protocol.Message createNATFor(XMLRequest r, ConnectionAttributes sessionInfo)
public final void handleResponse(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
IResponseHandler#handleResponse
.doc
- Document returned from the serversession
- Information about the sessionprotected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
public boolean showQuarantineNotification()
true
if a new quarantine message has been found.
This information can be used to show an alert message to users.
The request GetQuarantineMessage
can be used to get more details about the crash.public final MessageBox getMessageBox()
public final java.util.List<MessageBox> getAllMessageBoxes()
protected void setMessageBox(MessageBox box)
XMLRequestSet
to move the Message Box from a child request to the XMLRequestSet
object.box
- Message Boxprotected boolean isAllowedInClientZero()
XMLRequest
is allowed in client 0.
The default implementation returns false
, subclasses may override.true
if this request is allowed in client 0, false
otherwiseprotected boolean ignoreMessageBox()
protected boolean emptyAttributes(org.w3c.dom.NamedNodeMap attributeMap, com.uc4.translate.Message translator)
true
if the attribute map is not empty.
Also an error message is set.
Used by internal tests only.attributeMap
- attribute maptranslator
- message translatortrue
if the attribute map is emptyprotected static final void checkClient(int client)
protected static final void checkID(int id)
protected static final void checkNull(java.lang.Object object, java.lang.String msg)
protected static final void checkLnr(int lnr)
protected static final void checkUC4ObjectName(UC4ObjectName name)
protected static final void checkUC4ObjectEmptyName(UC4ObjectName name)
protected static final void assertClientZero(ConnectionAttributes sessioninfo)
protected static final void assertServerVersion(ConnectionAttributes sessioninfo, int minExpected)
public void send(org.w3c.dom.Document doc, ConnectionAttributes sessioninfo, java.lang.String nr)
doc
- DOMsessioninfo
- Information about the UC4 sessionnr
- Request numberpublic java.lang.String getRequestID(java.lang.String defaultValue)
defaultValue
- Unique number which is not used so farprotected static final void checkSystemOverviewPrivilege(ConnectionAttributes sessionInfo)
protected static final void checkSelStatisticsPrivilege(ConnectionAttributes sessionInfo)