Package com.uc4.communication.requests
Class MessageList
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.MessageList
-
- All Implemented Interfaces:
java.lang.Iterable<MessageListItem>
public class MessageList extends XMLRequest implements java.lang.Iterable<MessageListItem>
Find messages in the Automation Engine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MessageList.Category
Category of the message.static class
MessageList.MessageType
Type of the message.static class
MessageList.Order
Sort order.
-
Constructor Summary
Constructors Constructor Description MessageList()
Creates a newMessageList
request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Creates the XML Document for the request.protected java.lang.String
getSrc()
Returns the request source.protected void
handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Sub classes extract the values from the XML document and provide public getter methods.protected boolean
isAllowedInClientZero()
This method is used internally.java.util.Iterator<MessageListItem>
iterator()
void
setAdminMessages(boolean value)
Sets or clears the filter for admin messages.void
setCategory(MessageList.Category cat)
Sets the filter for the message category.void
setMaxNumber(int maxNumber)
Sets the maximum number of the returned rows, the default value is 100.void
setOrder(MessageList.Order order)
Sets the sort order of the returned messages.void
setSecurityMessages(boolean value)
Sets or clears the filter for security messages.void
setTextFilter(int number, java.lang.String insert)
Sets the filter for the message number and insert.void
setTimeRange(DateTime from, DateTime to)
Sets the filter the message timestamp.void
setType(MessageList.MessageType type)
Sets the filter for the type of the message.void
setUser(UC4UserName user)
Sets the filter for a user.int
size()
-
Methods inherited from class com.uc4.communication.requests.XMLRequest
assertClientZero, assertServerVersion, checkClient, checkID, checkLnr, checkNull, checkSelStatisticsPrivilege, checkSystemOverviewPrivilege, checkUC4ObjectEmptyName, checkUC4ObjectName, createNATFor, createNATRequest, emptyAttributes, getAllMessageBoxes, getMessageBox, getRequestID, handleResponse, ignoreMessageBox, send, setMessageBox, showQuarantineNotification
-
-
-
-
Method Detail
-
setAdminMessages
public void setAdminMessages(boolean value)
Sets or clears the filter for admin messages.- Parameters:
value
- true if admin messages should be included in the result, false if not.
-
setSecurityMessages
public void setSecurityMessages(boolean value)
Sets or clears the filter for security messages.- Parameters:
value
- true if security messages should be included in the result, false if not.
-
setMaxNumber
public void setMaxNumber(int maxNumber)
Sets the maximum number of the returned rows, the default value is 100.- Parameters:
maxNumber
- Limit of returned messages, must be between 1 and 9999
-
setUser
public void setUser(UC4UserName user)
Sets the filter for a user.- Parameters:
user
- User name ornull
to clear the filter.
-
setType
public void setType(MessageList.MessageType type)
Sets the filter for the type of the message.- Parameters:
type
- Message type, must not be null
-
setCategory
public void setCategory(MessageList.Category cat)
Sets the filter for the message category.- Parameters:
cat
- categroy, must not be null
-
setTextFilter
public void setTextFilter(int number, java.lang.String insert)
Sets the filter for the message number and insert.- Parameters:
number
- Number of the messageinsert
- Message insert or * for all inserts
-
setTimeRange
public void setTimeRange(DateTime from, DateTime to)
Sets the filter the message timestamp.- Parameters:
from
- From date and timeto
- To date and time
-
setOrder
public void setOrder(MessageList.Order order)
Sets the sort order of the returned messages.- Parameters:
order
- Ascending or descending
-
getSrc
protected java.lang.String getSrc()
Description copied from class:XMLRequest
Returns the request source. This method is used internally.- Specified by:
getSrc
in classXMLRequest
- Returns:
- Source
-
isAllowedInClientZero
protected boolean isAllowedInClientZero()
Description copied from class:XMLRequest
This method is used internally. Tests if thisXMLRequest
is allowed in client 0. The default implementation returnsfalse
, subclasses may override.- Overrides:
isAllowedInClientZero
in classXMLRequest
- Returns:
true
if this request is allowed in client 0,false
otherwise
-
createRequest
protected void createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Description copied from class:XMLRequest
Creates the XML Document for the request. This method is used internally.- Specified by:
createRequest
in classXMLRequest
- Parameters:
doc
- Document, used to create new Elementsrequest
- Request Element - classes append information to this request elementsessionInfo
- Information about the session
-
handleContent
protected void handleContent(com.uc4.util.XMLDocument doc, ConnectionAttributes session)
Description copied from class:XMLRequest
Sub classes extract the values from the XML document and provide public getter methods.- Overrides:
handleContent
in classXMLRequest
- Parameters:
doc
- XML Documentsession
- Info about the user session
-
iterator
public java.util.Iterator<MessageListItem> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<MessageListItem>
-
size
public int size()
- Returns:
- Number of returned messages
-
-