Package com.uc4.communication.requests
Class QueryData
- java.lang.Object
-
- com.uc4.communication.requests.XMLRequest
-
- com.uc4.communication.requests.QueryData
-
- All Implemented Interfaces:
java.lang.Iterable<QueryData.Row>
public class QueryData extends XMLRequest implements java.lang.Iterable<QueryData.Row>
Returns exactly one table based on query parameters. There are already some predefined static methods for existing queries (for example list of host types or OS Agents, list of LOGIN objects)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryData.Row
This class represents a row in the returned result set.
-
Constructor Summary
Constructors Constructor Description QueryData(java.lang.String requestName, java.lang.String src, java.util.Map<java.lang.String,java.lang.String> attributes)
Generic constructor (internal use only).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static QueryData
createClientList()
Creates a list of clients.static QueryData
createCodeListForFT()
Creates a list of CODE objects which can be used for FileTransfers.static QueryData
createDashObjectList(java.lang.String right)
Creates a list of Dash Objects considering object rights.static QueryData
createDBConnList()
Creates a list of database connection objects.static QueryData
createEventCollectorList(java.lang.String filter)
Creates a list of Rule Event Objects.static QueryData
createEventDefinitionList(java.lang.String filter)
Creates a list of Event Definition Objects.static QueryData
createEventRuleList(java.lang.String filter)
Creates a list of Rule Event Objects.static QueryData
createExecutableDisplayTypeList()
Creates a list of display names for executable object types.static QueryData
createExecutableObjectTypeList()
Creates a list of executable object types.static QueryData
createExtendedObjectList(java.lang.String objectType)
Creates a list of objects.static QueryData
createFilterList()
Creates a list of OUTPUT filters.static QueryData
createForecastList()
Creates a query for forecast status values.static QueryData
createGroupCriteriaList()
Creates a list of grouping criteria for the activity window.static QueryData
createHostList(java.lang.String agentType)
Creates a list of Agents.static QueryData
createHOSTListForFT()
Creates a list of HOST objects which can be used for FileTransfers.static QueryData
createHostRoleList()
Creates a list of host roles.static QueryData
createHostTypeList()
Creates a list of host types.static QueryData
createHostTypeList(java.lang.String parameter)
Creates a list of host types.static QueryData
createLicenseList()
Deprecated.the license check has been removed in version 12.2 and higherstatic QueryData
createLoginTypeList()
Creates a list of login types.static QueryData
createObjectList(java.lang.String objectType)
Creates a list of objects.static QueryData
createObjectList(java.lang.String objectType, java.lang.String subtype, java.lang.String filter, java.lang.String right)
Creates a list of objects according to the given parameters.static QueryData
createObjectTypeList()
Creates a list of object types.static QueryData
createObjectTypeList(java.lang.String parameter, java.lang.String right)
Creates a list of object types according to the given parameters.static QueryData
createParentWorkflowList(java.lang.String objName)
Creates a list of all Workflows that contain task objNamestatic QueryData
createReportTypeList()
Creates a list of report types.protected void
createRequest(com.uc4.util.XMLDocument doc, org.w3c.dom.Element request, ConnectionAttributes sessionInfo)
Creates the XML Document for the request.static QueryData
createStatusList()
Creates a list of final status values of tasks.static QueryData
createStatusListWithoutUserReturnCodes()
Creates a list of final status values of tasks and ignore User Return Codes.static QueryData
createStoreObjectList(java.lang.String filter)
Creates a list of Store Objects.static QueryData
createVaultAliasProvidersList()
Creates a list of VaultAliasis Providers.static QueryData
createVaultProvidersList()
Creates a list of Vault Providers.static QueryData
createVaultSafeProvidersList()
Creates a list of VaultSafe Providers.int
getColumnCount()
Returns the number of columns or-1
if no table was returned.java.lang.String[]
getColumnNames()
Returns an array of columns of this row ornull
if no table was returned.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<QueryData.Row>
iterator()
int
size()
Returns the number of rows.-
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
-
QueryData
public QueryData(java.lang.String requestName, java.lang.String src, java.util.Map<java.lang.String,java.lang.String> attributes)
Generic constructor (internal use only).- Parameters:
requestName
- Name of the XML requestsrc
- Sourceattributes
- Additional parameters;null
should be used if no additional parameters are provided
-
-
Method Detail
-
createHostTypeList
public static QueryData createHostTypeList()
Creates a list of host types.- Returns:
- Query for host types
-
createHostTypeList
public static QueryData createHostTypeList(java.lang.String parameter)
Creates a list of host types. If you use "dnames" as param you get display names instead of host types.- Parameters:
parameter
- use "dnames" to get display names instead of host types- Returns:
- Query for host types
-
createLoginTypeList
public static QueryData createLoginTypeList()
Creates a list of login types.- Returns:
- Query for login types
-
createHostRoleList
public static QueryData createHostRoleList()
Creates a list of host roles.- Returns:
- Query for host roles
-
createParentWorkflowList
public static QueryData createParentWorkflowList(java.lang.String objName)
Creates a list of all Workflows that contain task objName- Parameters:
objName
- object name- Returns:
- Query for parent WFs
-
createReportTypeList
public static QueryData createReportTypeList()
Creates a list of report types.- Returns:
- Query for report types
-
createHostList
public static QueryData createHostList(java.lang.String agentType)
Creates a list of Agents.- Parameters:
agentType
- Type of the Host for example "WINDOWS" The following special values an also be used- * ... All Agents and dummmies
- *_realnoerp ... Real OS Agents (no ERP/RA Agents or dummies)
- *_real ... All Agents without dummies
null
is passed all Agents and dummies are returned.- Returns:
- Query for agents
-
createClientList
public static QueryData createClientList()
Creates a list of clients.- Returns:
- Query of clients
-
createDBConnList
public static QueryData createDBConnList()
Creates a list of database connection objects.- Returns:
- Query for DB CONN objects
-
createFilterList
public static QueryData createFilterList()
Creates a list of OUTPUT filters.- Returns:
- Query for filters
-
createLicenseList
@Deprecated public static QueryData createLicenseList()
Deprecated.the license check has been removed in version 12.2 and higherCreates a list of license categories.- Returns:
- Category list
-
createObjectList
public static QueryData createObjectList(java.lang.String objectType)
Creates a list of objects.- Parameters:
objectType
- Object type- Returns:
- Query for object names
-
createCodeListForFT
public static QueryData createCodeListForFT()
Creates a list of CODE objects which can be used for FileTransfers.- Returns:
- Query for code objects in FTs
-
createHOSTListForFT
public static QueryData createHOSTListForFT()
Creates a list of HOST objects which can be used for FileTransfers.- Returns:
- Query for code objects in FTs
-
createForecastList
public static QueryData createForecastList()
Creates a query for forecast status values.- Returns:
- Query instance
-
createStatusList
public static QueryData createStatusList()
Creates a list of final status values of tasks.- Returns:
- Query instance
-
createStatusListWithoutUserReturnCodes
public static QueryData createStatusListWithoutUserReturnCodes()
Creates a list of final status values of tasks and ignore User Return Codes.- Returns:
- Query instance without User Return Codes.
-
createExtendedObjectList
public static QueryData createExtendedObjectList(java.lang.String objectType)
Creates a list of objects. This method return additional information like created/modified timestamp and object version.- Parameters:
objectType
- Object type- Returns:
- Query for object names
-
createObjectList
public static QueryData createObjectList(java.lang.String objectType, java.lang.String subtype, java.lang.String filter, java.lang.String right)
Creates a list of objects according to the given parameters. Objects were the user does not have right will be filtered out. Objects were the user has private rights will be flagged as "private".- Parameters:
objectType
- Object typesubtype
- Platform/Subtypefilter
- Filter for object namesright
- one of the following rightsr Access method: Read w Access method: Write x Access method: Execute d Access method: Delete c Access method: Cancel s Access to Statistics p Access to Reports m Access method: Modify at runtime l This access type allows the user to define an SLA for the particular objects - Returns:
- Query for objects names
-
createGroupCriteriaList
public static QueryData createGroupCriteriaList()
Creates a list of grouping criteria for the activity window.- Returns:
- Grouping criteria
-
createObjectTypeList
public static QueryData createObjectTypeList()
Creates a list of object types.- Returns:
- Query for object types
-
createObjectTypeList
public static QueryData createObjectTypeList(java.lang.String parameter, java.lang.String right)
Creates a list of object types according to the given parameters.- Parameters:
parameter
- use "dnames" to get display names instead of host typesright
- available right:
"x" Access method: Execute, to filtering executable object only- Returns:
- Query for object types
-
createExecutableDisplayTypeList
public static QueryData createExecutableDisplayTypeList()
Creates a list of display names for executable object types. The object type is returned in attribute "id", the display name is in attribute "value".- Returns:
- Query for executable object types
-
createExecutableObjectTypeList
public static QueryData createExecutableObjectTypeList()
Creates a list of executable object types.- Returns:
- Query for executable object types
-
createStoreObjectList
public static QueryData createStoreObjectList(java.lang.String filter)
Creates a list of Store Objects. If you don't care about the platform just pass an empty String.- Parameters:
filter
- Name filter- Returns:
- Query for Store Objects; Can be null.
-
createDashObjectList
public static QueryData createDashObjectList(java.lang.String right)
Creates a list of Dash Objects considering object rights.- Parameters:
right
- Object right- Returns:
- Query for Dash Objects; Can be null.
-
createEventRuleList
public static QueryData createEventRuleList(java.lang.String filter)
Creates a list of Rule Event Objects. If you don't care about the platform just pass an empty String.- Parameters:
filter
- Name filter- Returns:
- Query for Rule Event Objects; Can be null.
-
createEventCollectorList
public static QueryData createEventCollectorList(java.lang.String filter)
Creates a list of Rule Event Objects. If you don't care about the platform just pass an empty String.- Parameters:
filter
- Name filter- Returns:
- Query for Rule Event Objects; Can be null.
-
createEventDefinitionList
public static QueryData createEventDefinitionList(java.lang.String filter)
Creates a list of Event Definition Objects. If you don't care about the platform just pass an empty String.- Parameters:
filter
- Name filter- Returns:
- Query for Rule Definition Objects; Can be null.
-
createVaultProvidersList
public static QueryData createVaultProvidersList()
Creates a list of Vault Providers. E.g. CyberArk, CA Pam etc..- Returns:
- Query for Rule Definition Objects; Can be null.
-
createVaultSafeProvidersList
public static QueryData createVaultSafeProvidersList()
Creates a list of VaultSafe Providers. E.g. Safe etc..- Returns:
- Query for Rule Definition Objects; Can be null.
-
createVaultAliasProvidersList
public static QueryData createVaultAliasProvidersList()
Creates a list of VaultAliasis Providers. E.g. Alias etc..- Returns:
- Query for Rule Definition Objects; Can be null.
-
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
-
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
-
getColumnCount
public int getColumnCount()
Returns the number of columns or-1
if no table was returned.- Returns:
- Column count
-
getColumnNames
public java.lang.String[] getColumnNames()
Returns an array of columns of this row ornull
if no table was returned.- Returns:
- column names
-
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<QueryData.Row> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<QueryData.Row>
-
size
public int size()
Returns the number of rows.- Returns:
- Number of rows
-
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
-
-