Package com.uc4.communication.requests
Class AgentList
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.AgentList
-
- All Implemented Interfaces:
java.lang.Iterable<AgentListItem>
public class AgentList extends XMLRequest implements java.lang.Iterable<AgentListItem>
Gets a list of Agents.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AgentList.Filter
Filter in the Agent list.
-
Constructor Summary
Constructors Constructor Description AgentList()
Creates a new AgentList request which reads the full agent list (all columns and all agents).AgentList(AgentList.Filter filter, java.lang.String... selectedColumns)
Requests the Agent list with a filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated 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.AgentListItem
getAgentByName(UC4HostName name)
Returns the AgentListItem for the specified name ornull
if not found.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.boolean
isListTruncated()
If max rows are set by the filter and the actual amount of rows exceeds this number than this will return true.java.util.Iterator<AgentListItem>
iterator()
Returns an Iterator which can be used to step through theAgentListItem
.void
setSimpleList(boolean simpleList)
Deprecated.Do not call this method if you need a filtered output, use AgentList(AgentFilter filter, String...int
size()
Returns the total number of items in the Agent list (active and inactive).void
withGenericAgents(boolean with)
If this is set to true then all generic Agents from client 0 are included in the result.-
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
-
-
-
-
Constructor Detail
-
AgentList
public AgentList(AgentList.Filter filter, java.lang.String... selectedColumns)
Requests the Agent list with a filter. This requires at least AE Version 12 and one running JWP.- Parameters:
filter
- Filter to restrict the resultselectedColumns
- Name of optional columns, possible values are:- AUTHENTICATED
- VERSION
- VARIANT
- HARDWARE
- SOFTWARE
- SOFTWARE_VERSION
- IPADDRESS
- PORT
- LICENSE_CLASS
- MIB_INFO
- ROLES
- SM_LINKED
- NET_AREA
- NUMBER_OF_CLIENTS
- RUNNING_JOBS
- LAST_LOGOFF
- RUNNING_FT
- ZDU_VERSION
-
AgentList
public AgentList()
Creates a new AgentList request which reads the full agent list (all columns and all agents).
-
-
Method Detail
-
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
-
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
-
getAgentByName
public AgentListItem getAgentByName(UC4HostName name)
Returns the AgentListItem for the specified name ornull
if not found.- Parameters:
name
- Name of the Agent- Returns:
- AgentListItem containing information about the version and status of the Agent
-
iterator
public java.util.Iterator<AgentListItem> iterator()
Returns an Iterator which can be used to step through theAgentListItem
.- Specified by:
iterator
in interfacejava.lang.Iterable<AgentListItem>
- Returns:
- Iterator containing
AgentListItem
-
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
-
size
public int size()
Returns the total number of items in the Agent list (active and inactive).- Returns:
- number of
AgentListItem
-
isListTruncated
public boolean isListTruncated()
If max rows are set by the filter and the actual amount of rows exceeds this number than this will return true. However the list is truncated in this case.- Returns:
- true if there are more rows than defined by max rows.
-
withGenericAgents
public void withGenericAgents(boolean with)
If this is set to true then all generic Agents from client 0 are included in the result.- Parameters:
with
- generic agents
-
setSimpleList
@Deprecated public void setSimpleList(boolean simpleList)
Deprecated.Do not call this method if you need a filtered output, use AgentList(AgentFilter filter, String... selectedColumns) insteadSets to simple list mode. Only name, JclVariant and active flag are filled to get a faster response. If an AgentFilter is provided in the constructor the filter and columns are ignored if the parameter simpleList is set to true.- Parameters:
simpleList
- true to enable simple-list mode, false to fetch all agent attributes (default)
-
-