private void duplicateDashboardErrorCheck ( Dashboard dashboard ) throws HygieiaException { String appName = dashboard . getConfigurationItemBusServName ( ) ; String compName = dashboard . getConfigurationItemBusAppName ( ) ; if ( appName != null && ! appName . isEmpty ( ) && compName != null && ! compName . isEmpty ( ) ) { Dashboard existingDashboard = dashboardRepository . findByConfigurationItemBusServNameIgnoreCaseAndConfigurationItemBusAppNameIgnoreCase ( appName , compName ) ; if ( existingDashboard != null && ! existingDashboard . getId ( ) . equals ( dashboard . getId ( ) ) ) { throw new HygieiaException ( "Existing Dashboard: " + existingDashboard . getTitle ( ) , HygieiaException . DUPLICATE_DATA ) ; } } }
Takes Dashboard and checks to see if there is an existing Dashboard with the same business service and business application Throws error if found