private Dashboard requestToDashboard ( DashboardRemoteRequest request ) throws HygieiaException { DashboardRemoteRequest . DashboardMetaData metaData = request . getMetaData ( ) ; Application application = new Application ( metaData . getApplicationName ( ) , new Component ( metaData . getComponentName ( ) ) ) ; String appName = null ; String serviceName = null ; if ( ! StringUtils . isEmpty ( metaData . getBusinessApplication ( ) ) ) { Cmdb app = cmdbRepository . findByConfigurationItemAndItemType ( metaData . getBusinessApplication ( ) , "component" ) ; if ( app == null ) throw new HygieiaException ( "Invalid Business Application Name." , HygieiaException . BAD_DATA ) ; appName = app . getConfigurationItem ( ) ; } if ( ! StringUtils . isEmpty ( metaData . getBusinessService ( ) ) ) { Cmdb service = cmdbRepository . findByConfigurationItemAndItemType ( metaData . getBusinessService ( ) , "app" ) ; if ( service == null ) throw new HygieiaException ( "Invalid Business Service Name." , HygieiaException . BAD_DATA ) ; serviceName = service . getConfigurationItem ( ) ; } List < String > activeWidgets = new ArrayList <> ( ) ; return new Dashboard ( true , metaData . getTemplate ( ) , metaData . getTitle ( ) , application , metaData . getOwners ( ) , DashboardType . fromString ( metaData . getType ( ) ) , serviceName , appName , activeWidgets , false , ScoreDisplayType . HEADER ) ; }
Creates a Dashboard object from the request .