Class EventAnalyticsUtil
- java.lang.Object
-
- lumis.service.analytics.eventanalytics.EventAnalyticsUtil
-
public class EventAnalyticsUtil extends java.lang.Object
Event analytics utils.- Since:
- 11.0.0
- Version:
- $Revision: 24979 $ $Date: 2022-05-02 16:48:21 -0300 (Mon, 02 May 2022) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventAnalyticsUtil.TimeFramePeriod
Represents the timeFramePeriod.
-
Constructor Summary
Constructors Constructor Description EventAnalyticsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addStandardDashBoardsAndAllStandartReports(java.lang.String... dashboardType)
Add standard dashboard by types passed in parameters in all service instances.static boolean
canInheritReport(java.lang.String reportId, java.lang.String requestServiceInstanceId)
Returns whether the service instance config can inherit the report.static void
clearDashboardTemplateInstancesCache()
Clears dashboard template instances cache.static void
clearStandardReportsCache(java.lang.String serviceInstanceId)
Clears the standard reports cache by the given service instance id.static void
createStandardReportsAndDashboards(java.lang.String serviceInstanceId)
Creates the standard definitions for the given service instance.static java.util.Set<java.lang.String>
getDashboardTemplateInstancesIds()
Returns the dashboards template instances identifiers.static java.util.Optional<CompositeDocumentTypeField>
getParentNestedField(DocumentTypeField field)
Returns an optional parent nested object of the given field.static EventAnalyticsReport
getReport(java.lang.String reportId)
Returns the given report.static EventAnalyticsReport
getReport(java.lang.String reportId, boolean translateTitleOfStdReport)
Returns the given report.static EventAnalyticsDashboard
getStandardDashboardByType(java.lang.String dashboardType)
Returns the standard dashboard by its type.static java.util.Optional<EventAnalyticsReport>
getStandardReportByTitle(java.lang.String title, java.lang.String serviceInstanceId)
Returns the standard report by the given title and service instance identifier.static java.util.Map<java.lang.String,java.util.Collection<EventAnalyticsDashboard>>
getTemplateDashboards()
Returns a map with the template dashboards.static boolean
isDashboardTemplateInstance(java.lang.String serviceInstanceId)
Returns a boolean indicating if the given service instance is a dashboard template one.static boolean
isDashboardTemplateInstance(ServiceInstanceConfig serviceInstance)
Returns a boolean indicating if the given service instance is a dashboard template one.static boolean
isStandardDashboardType(java.lang.String type)
Check is dashboard is standard by type.static boolean
isStandardReportId(java.lang.String reportId)
Returns whether the given report identifier is a standard report identifier.static java.lang.String
localize(java.lang.String title)
Translates the given string.static Tuple3<java.util.Date,java.util.Date,EventAnalyticsUtil.TimeFramePeriod>
parseTimeFrame(org.json.JSONObject jsonObject, java.lang.String intervalType)
Parses the time frame obj.
-
-
-
Method Detail
-
getReport
public static EventAnalyticsReport getReport(java.lang.String reportId) throws PortalException
Returns the given report.- Parameters:
reportId
- the report identifier.- Returns:
- the given report
- Throws:
PortalException
- Since:
- 11.2.0
-
getReport
public static EventAnalyticsReport getReport(java.lang.String reportId, boolean translateTitleOfStdReport) throws PortalException
Returns the given report.- Parameters:
reportId
- the report identifier.translateTitleOfStdReport
- indicates whether the report title translation should be performed.- Returns:
- the given report
- Throws:
PortalException
- Since:
- 14.1.0
-
getStandardDashboardByType
public static EventAnalyticsDashboard getStandardDashboardByType(java.lang.String dashboardType) throws PortalException
Returns the standard dashboard by its type.- Parameters:
dashboardType
- the dashboard type.- Returns:
- the standard dashboard by its type.
- Throws:
PortalException
- Since:
- 11.2.0
-
localize
public static java.lang.String localize(java.lang.String title) throws PortalException
Translates the given string.- Parameters:
title
- the string to be translated.- Returns:
- the translated string.
- Throws:
PortalException
- Since:
- 11.2.0
-
isStandardReportId
public static boolean isStandardReportId(java.lang.String reportId)
Returns whether the given report identifier is a standard report identifier.- Parameters:
reportId
- the report identifier.- Returns:
- whether the given report identifier is a standard report identifier.
- Since:
- 11.2.0
-
isStandardDashboardType
public static boolean isStandardDashboardType(java.lang.String type)
Check is dashboard is standard by type.- Parameters:
type
- the dashboard.- Returns:
- true whether dashboard type is of standard dashboard.
- Since:
- 12.2.0
-
addStandardDashBoardsAndAllStandartReports
public static void addStandardDashBoardsAndAllStandartReports(java.lang.String... dashboardType) throws java.lang.Exception
Add standard dashboard by types passed in parameters in all service instances. This method also adds all standards reports that are missing in each service instance. WARNING, this is user inPostUpgradeTaskManager
in step 31.- Parameters:
dashboardType
- the dash boards type standards that be will add in all service instance.- Throws:
java.lang.Exception
- Since:
- 12.2.0
-
createStandardReportsAndDashboards
public static void createStandardReportsAndDashboards(java.lang.String serviceInstanceId) throws PortalException
Creates the standard definitions for the given service instance.- Parameters:
serviceInstanceId
- the service instance identifier.- Throws:
PortalException
- Since:
- 11.0.0
-
canInheritReport
public static boolean canInheritReport(java.lang.String reportId, java.lang.String requestServiceInstanceId) throws PortalException
Returns whether the service instance config can inherit the report.- Parameters:
reportId
- the report to perform the validation.requestServiceInstanceId
- the request service instance to validate the inheritance.- Returns:
- whether the service instance config can inherit the report.
- Throws:
PortalException
- Since:
- 14.0.0
-
getParentNestedField
public static java.util.Optional<CompositeDocumentTypeField> getParentNestedField(DocumentTypeField field)
Returns an optional parent nested object of the given field.- Parameters:
field
- the field- Returns:
- an optional parent nested object of the given field.
- Since:
- 14.0.0
-
getStandardReportByTitle
public static java.util.Optional<EventAnalyticsReport> getStandardReportByTitle(java.lang.String title, java.lang.String serviceInstanceId) throws PortalException
Returns the standard report by the given title and service instance identifier.- Parameters:
title
- the titleserviceInstanceId
- the service instance identifier- Returns:
- the report
- Throws:
PortalException
- Since:
- 14.1.0
-
clearStandardReportsCache
public static void clearStandardReportsCache(java.lang.String serviceInstanceId) throws PortalException
Clears the standard reports cache by the given service instance id.- Parameters:
serviceInstanceId
-- Throws:
PortalException
- Since:
- 14.1.0
-
getDashboardTemplateInstancesIds
public static java.util.Set<java.lang.String> getDashboardTemplateInstancesIds() throws PortalException
Returns the dashboards template instances identifiers.- Returns:
- the dashboards template instances identifiers.
- Throws:
PortalException
- Since:
- 14.1.0
-
isDashboardTemplateInstance
public static boolean isDashboardTemplateInstance(ServiceInstanceConfig serviceInstance) throws PortalException
Returns a boolean indicating if the given service instance is a dashboard template one.- Parameters:
serviceInstance
- the service instance- Returns:
- a boolean indicating if the given service instance is a dashboard template one.
- Throws:
PortalException
- Since:
- 14.1.0
-
isDashboardTemplateInstance
public static boolean isDashboardTemplateInstance(java.lang.String serviceInstanceId) throws PortalException
Returns a boolean indicating if the given service instance is a dashboard template one.- Parameters:
serviceInstanceId
- the service instance identifier.- Returns:
- a boolean indicating if the given service instance is a dashboard template one.
- Throws:
PortalException
- Since:
- 14.1.0
-
getTemplateDashboards
public static java.util.Map<java.lang.String,java.util.Collection<EventAnalyticsDashboard>> getTemplateDashboards() throws PortalException
Returns a map with the template dashboards.- Returns:
- a map with the template dashboards.
- Throws:
PortalException
- Since:
- 14.1.0
-
clearDashboardTemplateInstancesCache
public static void clearDashboardTemplateInstancesCache() throws PortalException
Clears dashboard template instances cache.- Throws:
PortalException
- Since:
- 14.1.0
-
parseTimeFrame
public static Tuple3<java.util.Date,java.util.Date,EventAnalyticsUtil.TimeFramePeriod> parseTimeFrame(org.json.JSONObject jsonObject, java.lang.String intervalType) throws PortalObjectNotFoundException
Parses the time frame obj.- Parameters:
jsonObject
-- Returns:
- The Tuple2 containing the start and the end dates
- Throws:
PortalObjectNotFoundException
- Since:
- 14.2.0
-
-