idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
29,200
protected HawkbitErrorNotificationMessage buildNotification ( final Throwable ex ) { LOG . error ( "Error in UI: " , ex ) ; final String errorMessage = extractMessageFrom ( ex ) ; final VaadinMessageSource i18n = SpringContextHelper . getBean ( VaadinMessageSource . class ) ; return new HawkbitErrorNotificationMessage ...
Method to build a notification based on an exception .
29,201
private void assertMetaDataQuota ( final Long moduleId , final int requested ) { final int maxMetaData = quotaManagement . getMaxMetaDataEntriesPerSoftwareModule ( ) ; QuotaHelper . assertAssignmentQuota ( moduleId , requested , maxMetaData , SoftwareModuleMetadata . class , SoftwareModule . class , softwareModuleMetad...
Asserts the meta data quota for the software module with the given ID .
29,202
public static Specification < JpaAction > hasTargetAssignedArtifact ( final String controllerId , final String sha1Hash ) { return ( actionRoot , query , criteriaBuilder ) -> { final Join < JpaAction , JpaDistributionSet > dsJoin = actionRoot . join ( JpaAction_ . distributionSet ) ; final SetJoin < JpaDistributionSet ...
Specification which joins all necessary tables to retrieve the dependency between a target and a local file assignment through the assigned action of the target . All actions are included not only active actions .
29,203
public CommonDialogWindow getWindow ( final E entity , final String metaDatakey ) { selectedEntity = entity ; metadataWindow = new WindowBuilder ( SPUIDefinitions . CREATE_UPDATE_WINDOW ) . caption ( getMetadataCaption ( ) ) . content ( this ) . cancelButtonClickListener ( event -> onCancel ( ) ) . id ( UIComponentIdPr...
Returns metadata popup .
29,204
public void restoreState ( ) { if ( artifactUploadState . areAllUploadsFinished ( ) ) { artifactUploadState . clearUploadTempData ( ) ; hideUploadProgressButton ( ) ; upload . setEnabled ( true ) ; } else if ( artifactUploadState . isAtLeastOneUploadInProgress ( ) ) { showUploadProgressButton ( ) ; } }
Is called when view is shown to the user
29,205
public void buttonClick ( final ClickEvent event ) { if ( window . getParent ( ) != null ) { isImplicitClose = true ; UI . getCurrent ( ) . removeWindow ( window ) ; } callback . response ( event . getSource ( ) . equals ( okButton ) ) ; }
TenantAwareEvent handler for button clicks .
29,206
@ SuppressWarnings ( "unchecked" ) public static < T > Set < T > getTableValue ( final Table table ) { final Object value = table . getValue ( ) ; Set < T > idsReturn ; if ( value == null ) { idsReturn = Collections . emptySet ( ) ; } else if ( value instanceof Collection ) { final Collection < T > ids = ( Collection <...
Gets the selected item id or in multiselect mode the selected ids .
29,207
public Set < Long > getSelectedEntitiesByTransferable ( final TableTransferable transferable ) { final Set < Long > selectedEntities = getTableValue ( this ) ; final Set < Long > ids = new HashSet < > ( ) ; final Long transferableData = ( Long ) transferable . getData ( SPUIDefinitions . ITEMID ) ; if ( transferableDat...
Return the entity which should be deleted by a transferable
29,208
public void selectEntity ( final Long entityId ) { E entity = null ; if ( entityId != null ) { entity = findEntityByTableValue ( entityId ) . orElse ( null ) ; } setLastSelectedEntityId ( entityId ) ; publishSelectedEntityEvent ( entity ) ; }
Finds the entity object of the given entity ID and performs the publishing of the BaseEntityEventType . SELECTED_ENTITY event
29,209
public void reset ( ) { totalTargetsLabel . setVisible ( false ) ; populateGroupsLegendByTargetCounts ( Collections . emptyList ( ) ) ; if ( groupsLegend . getComponentCount ( ) > MAX_GROUPS_TO_BE_DISPLAYED ) { groupsLegend . getComponent ( MAX_GROUPS_TO_BE_DISPLAYED ) . setVisible ( false ) ; } }
Resets the display of the legend and total targets .
29,210
public void populateTotalTargets ( final Long totalTargets ) { if ( totalTargets == null ) { totalTargetsLabel . setVisible ( false ) ; } else { totalTargetsLabel . setVisible ( true ) ; totalTargetsLabel . setValue ( getTotalTargetMessage ( totalTargets ) ) ; } }
Displays the total targets or hides the label when null is supplied .
29,211
public void populateGroupsLegendByTargetCounts ( final List < Long > listOfTargetCountPerGroup ) { loadingLabel . setVisible ( false ) ; for ( int i = 0 ; i < getGroupsWithoutToBeContinuedLabel ( listOfTargetCountPerGroup . size ( ) ) ; i ++ ) { final Component component = groupsLegend . getComponent ( i ) ; final Labe...
Populates the legend based on a list of anonymous groups . They can t have unassigned targets .
29,212
public void populateGroupsLegendByValidation ( final RolloutGroupsValidation validation , final List < RolloutGroupCreate > groups ) { loadingLabel . setVisible ( false ) ; if ( validation == null ) { return ; } final List < Long > targetsPerGroup = validation . getTargetsPerGroup ( ) ; final long unassigned = validati...
Populates the legend based on a groups validation and a list of groups that is used for resolving their names . Positions of the groups in the groups list and the validation need to be in correct order . Can have unassigned targets that are displayed on top of the groups list which results in one group less to be displ...
29,213
public void populateGroupsLegendByGroups ( final List < RolloutGroup > groups ) { loadingLabel . setVisible ( false ) ; for ( int i = 0 ; i < getGroupsWithoutToBeContinuedLabel ( groups . size ( ) ) ; i ++ ) { final Component component = groupsLegend . getComponent ( i ) ; final Label label = ( Label ) component ; if (...
Populates the legend based on a list of groups .
29,214
private void getTargetFilterStatuses ( ) { unknown = SPUIComponentProvider . getButton ( UIComponentIdProvider . UNKNOWN_STATUS_ICON , TargetUpdateStatus . UNKNOWN . toString ( ) , i18n . getMessage ( UIMessageIdProvider . TOOLTIP_TARGET_STATUS_UNKNOWN ) , SPUIDefinitions . SP_BUTTON_STATUS_STYLE , false , FontAwesome ...
Get - status of FILTER .
29,215
private void applyStatusBtnStyle ( ) { unknown . addStyleName ( "unknownBtn" ) ; inSync . addStyleName ( "inSynchBtn" ) ; pending . addStyleName ( "pendingBtn" ) ; error . addStyleName ( "errorBtn" ) ; registered . addStyleName ( "registeredBtn" ) ; overdue . addStyleName ( "overdueBtn" ) ; }
Apply - status style .
29,216
private void processOverdueFilterStatus ( ) { overdueBtnClicked = ! overdueBtnClicked ; managementUIState . getTargetTableFilters ( ) . setOverdueFilterEnabled ( overdueBtnClicked ) ; if ( overdueBtnClicked ) { buttonClicked . addStyleName ( BTN_CLICKED ) ; eventBus . publish ( this , TargetFilterEvent . FILTER_BY_STAT...
Process - OVERDUE .
29,217
private void processCommonFilterStatus ( final TargetUpdateStatus status , final boolean buttonPressed ) { if ( buttonPressed ) { buttonClicked . addStyleName ( BTN_CLICKED ) ; managementUIState . getTargetTableFilters ( ) . getClickedStatusTargetTags ( ) . add ( status ) ; eventBus . publish ( this , TargetFilterEvent...
Process - COMMON PROCESS .
29,218
private void checkAndCancelExpiredAction ( final Action action ) { if ( action != null && action . hasMaintenanceSchedule ( ) && action . isMaintenanceScheduleLapsed ( ) ) { try { controllerManagement . cancelAction ( action . getId ( ) ) ; } catch ( final CancelActionNotAllowedException e ) { LOG . info ( "Cancel acti...
If the action has a maintenance schedule defined but is no longer valid cancel the action .
29,219
public void populateByRollout ( final Rollout rollout ) { if ( rollout == null ) { return ; } removeAllRows ( ) ; final List < RolloutGroup > groups = rolloutGroupManagement . findByRollout ( PageRequest . of ( 0 , quotaManagement . getMaxRolloutGroupsPerRollout ( ) ) , rollout . getId ( ) ) . getContent ( ) ; for ( fi...
Populate groups by rollout
29,220
private void setGroupsValidation ( final RolloutGroupsValidation validation ) { final int runningValidation = runningValidationsCounter . getAndSet ( 0 ) ; if ( runningValidation > 1 ) { validateRemainingTargets ( ) ; return ; } groupsValidation = validation ; final int lastIdx = groupRows . size ( ) - 1 ; final GroupR...
YOU SHOULD NOT CALL THIS METHOD MANUALLY . It s only for the callback . Only 1 runningValidation should be executed . If this runningValidation is done then this method is called . Maybe then a new runningValidation is executed .
29,221
public String getMinPollingTime ( ) { return systemSecurityContext . runAsSystem ( ( ) -> tenantConfigurationManagement . getConfigurationValue ( TenantConfigurationKey . MIN_POLLING_TIME_INTERVAL , String . class ) . getValue ( ) ) ; }
Returns the configured minimum polling interval .
29,222
@ EventBusListenerMethod ( scope = EventScope . UI ) public void onEvent ( final PinUnpinEvent event ) { final Optional < Long > pinnedDist = managementUIState . getTargetTableFilters ( ) . getPinnedDistId ( ) ; if ( event == PinUnpinEvent . PIN_DISTRIBUTION && pinnedDist . isPresent ( ) ) { displayCountLabel ( pinnedD...
TenantAwareEvent Listener for Pinning Distribution .
29,223
public String getMessage ( final Locale local , final String code , final Object ... args ) { try { return source . getMessage ( code , args , local ) ; } catch ( final NoSuchMessageException ex ) { LOG . error ( "Failed to retrieve message!" , ex ) ; return code ; } }
Tries to resolve the message based on the provided Local . Returns message code if fitting message could not be found .
29,224
public static void verifyRolloutGroupConditions ( final RolloutGroupConditions conditions ) { if ( conditions . getSuccessCondition ( ) == null ) { throw new ValidationException ( "Rollout group is missing success condition" ) ; } if ( conditions . getSuccessAction ( ) == null ) { throw new ValidationException ( "Rollo...
Verifies that the required success condition and action are actually set .
29,225
public static RolloutGroup verifyRolloutGroupHasConditions ( final RolloutGroup group ) { if ( group . getTargetPercentage ( ) < 1F || group . getTargetPercentage ( ) > 100F ) { throw new ValidationException ( "Target percentage has to be between 1 and 100" ) ; } if ( group . getSuccessCondition ( ) == null ) { throw n...
Verifies that the group has the required success condition and action and a falid target percentage .
29,226
public static void verifyRolloutGroupParameter ( final int amountGroup , final QuotaManagement quotaManagement ) { if ( amountGroup <= 0 ) { throw new ValidationException ( "The amount of groups cannot be lower than zero" ) ; } else if ( amountGroup > quotaManagement . getMaxRolloutGroupsPerRollout ( ) ) { throw new Qu...
Verify if the supplied amount of groups is in range
29,227
public static void verifyRolloutInStatus ( final Rollout rollout , final Rollout . RolloutStatus status ) { if ( ! rollout . getStatus ( ) . equals ( status ) ) { throw new RolloutIllegalStateException ( "Rollout is not in status " + status . toString ( ) ) ; } }
Verifies that the Rollout is in the required status .
29,228
public static List < Long > getGroupsByStatusIncludingGroup ( final List < RolloutGroup > groups , final RolloutGroup . RolloutGroupStatus status , final RolloutGroup group ) { return groups . stream ( ) . filter ( innerGroup -> innerGroup . getStatus ( ) . equals ( status ) || innerGroup . equals ( group ) ) . map ( R...
Filters the groups of a Rollout to match a specific status and adds a group to the result .
29,229
public static String getAllGroupsTargetFilter ( final List < RolloutGroup > groups ) { if ( groups . stream ( ) . anyMatch ( group -> StringUtils . isEmpty ( group . getTargetFilterQuery ( ) ) ) ) { return "" ; } return "(" + groups . stream ( ) . map ( RolloutGroup :: getTargetFilterQuery ) . distinct ( ) . sorted ( )...
Creates an RSQL expression that matches all targets in the provided groups . Links all target filter queries with OR .
29,230
public static String getOverlappingWithGroupsTargetFilter ( final String baseFilter , final List < RolloutGroup > groups , final RolloutGroup group ) { final String groupFilter = group . getTargetFilterQuery ( ) ; if ( isTargetFilterInGroups ( groupFilter , groups ) ) { return concatAndTargetFilters ( baseFilter , grou...
Creates an RSQL Filter that matches all targets that are in the provided group and in the provided groups .
29,231
private void decorate ( final Map < String , String > controllerAttibs ) { final VaadinMessageSource i18n = SpringContextHelper . getBean ( VaadinMessageSource . class ) ; final Label title = new Label ( i18n . getMessage ( "label.target.controller.attrs" ) , ContentMode . HTML ) ; title . addStyleName ( SPUIDefinition...
Custom Decorate .
29,232
@ SuppressWarnings ( { "squid:S2221" , "squid:S00112" } ) public < T > T runAsSystemAsTenant ( final Callable < T > callable , final String tenant ) { final SecurityContext oldContext = SecurityContextHolder . getContext ( ) ; try { LOG . debug ( "entering system code execution" ) ; return tenantAware . runAsTenant ( t...
The callable API throws a Exception and not a specific one
29,233
protected DmfTenantSecurityToken createTenantSecruityTokenVariables ( final HttpServletRequest request ) { final String requestURI = request . getRequestURI ( ) ; if ( pathExtractor . match ( request . getContextPath ( ) + CONTROLLER_REQUEST_ANT_PATTERN , requestURI ) ) { LOG . debug ( "retrieving principal from URI re...
Extracts tenant and controllerId from the request URI as path variables .
29,234
@ SuppressWarnings ( "unchecked" ) public < T > T convertMessage ( final Message message , final Class < T > clazz ) { checkMessageBody ( message ) ; message . getMessageProperties ( ) . getHeaders ( ) . put ( AbstractJavaTypeMapper . DEFAULT_CLASSID_FIELD_NAME , clazz . getName ( ) ) ; return ( T ) rabbitTemplate . ge...
Is needed to convert a incoming message to is originally object type .
29,235
public static List < GrantedAuthority > createAllAuthorityList ( ) { return SpPermission . getAllAuthorities ( ) . stream ( ) . map ( SimpleGrantedAuthority :: new ) . collect ( Collectors . toList ( ) ) ; }
Returns all authorities .
29,236
public static Button getButton ( final String id , final String buttonName , final String buttonDesc , final String style , final boolean setStyle , final Resource icon , final Class < ? extends SPUIButtonDecorator > buttonDecoratorclassName ) { Button button = null ; SPUIButtonDecorator buttonDecorator = null ; try { ...
Get Button - Factory Approach for decoration .
29,237
public static String getPinButtonStyle ( ) { final StringBuilder pinStyle = new StringBuilder ( ValoTheme . BUTTON_BORDERLESS_COLORED ) ; pinStyle . append ( ' ' ) ; pinStyle . append ( ValoTheme . BUTTON_SMALL ) ; pinStyle . append ( ' ' ) ; pinStyle . append ( ValoTheme . BUTTON_ICON_ONLY ) ; pinStyle . append ( ' ' ...
Get the style required .
29,238
public static Panel getDistributionSetInfo ( final DistributionSet distributionSet , final String caption , final String style1 , final String style2 ) { return new DistributionSetInfoPanel ( distributionSet , caption , style1 , style2 ) ; }
Get DistributionSet Info Panel .
29,239
public static Label createNameValueLabel ( final String label , final String ... values ) { final String valueStr = StringUtils . arrayToDelimitedString ( values , " " ) ; final Label nameValueLabel = new Label ( getBoldHTMLText ( label ) + valueStr , ContentMode . HTML ) ; nameValueLabel . setSizeFull ( ) ; nameValueL...
Method to CreateName value labels .
29,240
public static VerticalLayout getDetailTabLayout ( ) { final VerticalLayout layout = new VerticalLayout ( ) ; layout . setSpacing ( true ) ; layout . setMargin ( true ) ; layout . setImmediate ( true ) ; return layout ; }
Layout of tabs in detail tabsheet .
29,241
public static Link getLink ( final String id , final String name , final String resource , final FontAwesome icon , final String targetOpen , final String style ) { final Link link = new Link ( name , new ExternalResource ( resource ) ) ; link . setId ( id ) ; link . setIcon ( icon ) ; link . setDescription ( name ) ; ...
Method to create a link .
29,242
public CommonDialogWindow createUpdateSoftwareModuleWindow ( final Long baseSwModuleId ) { this . baseSwModuleId = baseSwModuleId ; resetComponents ( ) ; populateTypeNameCombo ( ) ; populateValuesOfSwModule ( ) ; return createWindow ( ) ; }
Creates window for update software module .
29,243
private void populateValuesOfSwModule ( ) { if ( baseSwModuleId == null ) { return ; } editSwModule = Boolean . TRUE ; softwareModuleManagement . get ( baseSwModuleId ) . ifPresent ( swModule -> { nameTextField . setValue ( swModule . getName ( ) ) ; versionTextField . setValue ( swModule . getVersion ( ) ) ; vendorTex...
fill the data of a softwareModule in the content of the window
29,244
public void addItems ( final List < SuggestTokenDto > suggestions , final VTextField textFieldWidget , final PopupPanel popupPanel , final TextFieldSuggestionBoxServerRpc suggestionServerRpc ) { for ( int index = 0 ; index < suggestions . size ( ) ; index ++ ) { final SuggestTokenDto suggestToken = suggestions . get ( ...
Adds suggestions to the suggestion menu bar .
29,245
public static < T > T getBean ( final String beanName , final Class < T > beanClazz ) { return context . getBean ( beanName , beanClazz ) ; }
method to return a certain bean by its class and name .
29,246
private static String [ ] getDsFilterNameAndVersionEntries ( final String filterString ) { final int semicolonIndex = filterString . indexOf ( ':' ) ; final String dsFilterName = semicolonIndex != - 1 ? filterString . substring ( 0 , semicolonIndex ) : ( filterString + "%" ) ; final String dsFilterVersion = semicolonIn...
field when the semicolon is present
29,247
private Boolean validate ( final DragAndDropEvent event ) { final Transferable transferable = event . getTransferable ( ) ; final Component compsource = transferable . getSourceComponent ( ) ; if ( ! ( compsource instanceof AbstractTable ) ) { uiNotification . displayValidationError ( getI18n ( ) . getMessage ( getActi...
Validate the drop .
29,248
private boolean hasTargetUpdatePermission ( ) { if ( ! permChecker . hasUpdateTargetPermission ( ) ) { uiNotification . displayValidationError ( getI18n ( ) . getMessage ( "message.permission.insufficient" , SpPermission . UPDATE_TARGET ) ) ; return false ; } return true ; }
validate the update permission .
29,249
public void refreshContainer ( ) { final Indexed container = getContainerDataSource ( ) ; if ( hasGeneratedPropertySupport ( ) && getGeneratedPropertySupport ( ) . getRawContainer ( ) instanceof LazyQueryContainer ) { ( ( LazyQueryContainer ) getGeneratedPropertySupport ( ) . getRawContainer ( ) ) . refresh ( ) ; retur...
Refresh the container .
29,250
protected HeaderRow resetHeaderDefaultRow ( ) { getHeader ( ) . removeRow ( getHeader ( ) . getDefaultRow ( ) ) ; final HeaderRow newHeaderRow = getHeader ( ) . appendRow ( ) ; getHeader ( ) . setDefaultRow ( newHeaderRow ) ; return newHeaderRow ; }
Resets the default row of the header . This means the current default row is removed and replaced with a newly created one .
29,251
public static int getCtrlOrMetaModifier ( ) { final WebBrowser webBrowser = Page . getCurrent ( ) . getWebBrowser ( ) ; if ( webBrowser . isMacOSX ( ) ) { return ShortcutAction . ModifierKey . META ; } return ShortcutAction . ModifierKey . CTRL ; }
Returns the ctrl or meta modifier depending on the platform .
29,252
protected void getPreviewButtonColor ( final String color ) { Page . getCurrent ( ) . getJavaScript ( ) . execute ( HawkbitCommonUtil . getPreviewButtonColorScript ( color ) ) ; }
Dynamic styles for window .
29,253
protected void createDynamicStyleForComponents ( final TextField tagName , final TextArea tagDesc , final String taregtTagColor ) { tagName . removeStyleName ( SPUIDefinitions . TAG_NAME ) ; tagDesc . removeStyleName ( SPUIDefinitions . TAG_DESC ) ; getTargetDynamicStyles ( taregtTagColor ) ; tagName . addStyleName ( T...
Set tag name and desc field border color based on chosen color .
29,254
protected void restoreComponentStyles ( ) { tagName . removeStyleName ( TAG_NAME_DYNAMIC_STYLE ) ; tagDesc . removeStyleName ( TAG_DESC_DYNAMIC_STYLE ) ; tagName . addStyleName ( SPUIDefinitions . TAG_NAME ) ; tagDesc . addStyleName ( SPUIDefinitions . TAG_DESC ) ; getPreviewButtonColor ( ColorPickerConstants . DEFAULT...
reset the tag name and tag description component border color .
29,255
public CommonDialogWindow createWindow ( ) { window = new WindowBuilder ( SPUIDefinitions . CREATE_UPDATE_WINDOW ) . caption ( getWindowCaption ( ) ) . content ( this ) . cancelButtonClickListener ( event -> discard ( ) ) . layout ( mainLayout ) . i18n ( i18n ) . saveDialogCloseListener ( new SaveOnDialogCloseListener ...
Creates the window to create or update a tag or type
29,256
private void previewButtonClicked ( ) { if ( ! tagPreviewBtnClicked ) { colorPickerLayout . setSelectedColor ( ColorPickerHelper . rgbToColorConverter ( ColorPickerConstants . DEFAULT_COLOR ) ) ; } tagPreviewBtnClicked = ! tagPreviewBtnClicked ; colorPickerLayout . setVisible ( tagPreviewBtnClicked ) ; }
Open color picker on click of preview button . Auto select the color based on target tag if already selected .
29,257
private static void getTargetDynamicStyles ( final String colorPickedPreview ) { Page . getCurrent ( ) . getJavaScript ( ) . execute ( HawkbitCommonUtil . changeToNewSelectedPreviewColor ( colorPickedPreview ) ) ; }
Get target style - Dynamically as per the color picked cannot be done from the static css .
29,258
private void slidersValueChangeListeners ( ) { colorPickerLayout . getRedSlider ( ) . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; public void valueChange ( final ValueChangeEvent event ) { final double red = ( Double ) event . getProperty ( ) . getValue ( ) ;...
Value change listeners implementations of sliders .
29,259
@ ExceptionHandler ( AbstractServerRtException . class ) public ResponseEntity < ExceptionInfo > handleSpServerRtExceptions ( final HttpServletRequest request , final Exception ex ) { logRequest ( request , ex ) ; final ExceptionInfo response = createExceptionInfo ( ex ) ; final HttpStatus responseStatus ; if ( ex inst...
method for handling exception of type AbstractServerRtException . Called by the Spring - Framework for exception handling .
29,260
@ ExceptionHandler ( HttpMessageNotReadableException . class ) public ResponseEntity < ExceptionInfo > handleHttpMessageNotReadableException ( final HttpServletRequest request , final Exception ex ) { logRequest ( request , ex ) ; final ExceptionInfo response = createExceptionInfo ( new MessageNotReadableException ( ) ...
Method for handling exception of type HttpMessageNotReadableException which is thrown in case the request body is not well formed and cannot be deserialized . Called by the Spring - Framework for exception handling .
29,261
@ ExceptionHandler ( ConstraintViolationException . class ) public ResponseEntity < ExceptionInfo > handleConstraintViolationException ( final HttpServletRequest request , final ConstraintViolationException ex ) { logRequest ( request , ex ) ; final ExceptionInfo response = new ExceptionInfo ( ) ; response . setMessage...
Method for handling exception of type ConstraintViolationException which is thrown in case the request is rejected due to a constraint violation . Called by the Spring - Framework for exception handling .
29,262
@ ExceptionHandler ( ValidationException . class ) public ResponseEntity < ExceptionInfo > handleValidationException ( final HttpServletRequest request , final ValidationException ex ) { logRequest ( request , ex ) ; final ExceptionInfo response = new ExceptionInfo ( ) ; response . setMessage ( ex . getMessage ( ) ) ; ...
Method for handling exception of type ValidationException which is thrown in case the request is rejected due to invalid requests . Called by the Spring - Framework for exception handling .
29,263
protected void onBaseEntityEvent ( final BaseUIEntityEvent < T > baseEntityEvent ) { final BaseEntityEventType eventType = baseEntityEvent . getEventType ( ) ; if ( BaseEntityEventType . SELECTED_ENTITY == eventType || BaseEntityEventType . UPDATED_ENTITY == eventType || BaseEntityEventType . REMOVE_ENTITY == eventType...
Default implementation to handle an entity event .
29,264
public Queue dmfReceiverQueue ( ) { return new Queue ( amqpProperties . getReceiverQueue ( ) , true , false , false , amqpDeadletterProperties . getDeadLetterExchangeArgs ( amqpProperties . getDeadLetterExchange ( ) ) ) ; }
Create the DMF API receiver queue for retrieving DMF messages .
29,265
public Queue authenticationReceiverQueue ( ) { return QueueBuilder . nonDurable ( amqpProperties . getAuthenticationReceiverQueue ( ) ) . autoDelete ( ) . withArguments ( getTTLMaxArgsAuthenticationQueue ( ) ) . build ( ) ; }
Create the DMF API receiver queue for authentication requests called by 3rd party artifact storages for download authorization by devices .
29,266
public AmqpMessageHandlerService amqpMessageHandlerService ( final RabbitTemplate rabbitTemplate , final AmqpMessageDispatcherService amqpMessageDispatcherService , final ControllerManagement controllerManagement , final EntityFactory entityFactory ) { return new AmqpMessageHandlerService ( rabbitTemplate , amqpMessage...
Create AMQP handler service bean .
29,267
@ ConditionalOnMissingBean ( name = "listenerContainerFactory" ) public RabbitListenerContainerFactory < SimpleMessageListenerContainer > listenerContainerFactory ( final SimpleRabbitListenerContainerFactoryConfigurer configurer , final ErrorHandler errorHandler ) { final ConfigurableRabbitListenerContainerFactory fact...
Create RabbitListenerContainerFactory bean if no listenerContainerFactory bean found
29,268
@ ConditionalOnMissingBean ( AmqpControllerAuthentication . class ) public AmqpControllerAuthentication amqpControllerAuthentication ( final SystemManagement systemManagement , final ControllerManagement controllerManagement , final TenantConfigurationManagement tenantConfigurationManagement , final TenantAware tenantA...
create the authentication bean for controller over amqp .
29,269
public void refreshView ( final Set < Class < ? > > eventContainers ) { eventContainers . stream ( ) . filter ( this :: supportNotificationEventContainer ) . forEach ( this :: refreshContainer ) ; clear ( ) ; }
Refresh the view by event container changes .
29,270
public TextField createSearchField ( final TextChangeListener textChangeListener ) { final TextField textField = style ( "filter-box" ) . styleName ( "text-style filter-box-hide" ) . buildTextComponent ( ) ; textField . setWidth ( 100.0F , Unit . PERCENTAGE ) ; textField . addTextChangeListener ( textChangeListener ) ;...
Create a search text field .
29,271
public void showForTargetFilter ( final Long tfqId ) { this . tfqId = tfqId ; final TargetFilterQuery tfq = targetFilterQueryManagement . get ( tfqId ) . orElseThrow ( ( ) -> new EntityNotFoundException ( TargetFilterQuery . class , tfqId ) ) ; final VerticalLayout verticalLayout = initView ( ) ; final DistributionSet ...
Shows a distribution set select window for the given target filter query
29,272
public void saveOrUpdate ( ) { if ( checkBox . getValue ( ) && dsCombo . getValue ( ) != null ) { final ActionType autoAssignActionType = ( ( ActionTypeOption ) actionTypeOptionGroupLayout . getActionTypeOptionGroup ( ) . getValue ( ) ) . getActionType ( ) ; updateTargetFilterQueryDS ( tfqId , ( Long ) dsCombo . getVal...
Is called when the new value should be saved after the save button has been clicked
29,273
static ServerViewComponentClientCriterion [ ] createViewComponentClientCriteria ( ) { final ServerViewComponentClientCriterion [ ] criteria = new ServerViewComponentClientCriterion [ 4 ] ; criteria [ 0 ] = ServerViewComponentClientCriterion . createBuilder ( ) . dragSourceIdPrefix ( UIComponentIdProvider . TARGET_TABLE...
Configures the elements of the composite accept criterion for the Management View .
29,274
public static String trimAndNullIfEmpty ( final String text ) { if ( text != null && ! text . trim ( ) . isEmpty ( ) ) { return text . trim ( ) ; } return null ; }
Trims the text and converts into null in case of an empty string .
29,275
public static String concatStrings ( final String delimiter , final String ... texts ) { final String delim = delimiter == null ? "" : delimiter ; final StringBuilder conCatStrBldr = new StringBuilder ( ) ; if ( null != texts ) { for ( final String text : texts ) { conCatStrBldr . append ( delim ) ; conCatStrBldr . app...
Concatenate the given text all the string arguments with the given delimiter .
29,276
public static String getSoftwareModuleName ( final String caption , final String name ) { return new StringBuilder ( ) . append ( DIV_DESCRIPTION_START + caption + " : " + getBoldHTMLText ( getFormattedName ( name ) ) ) . append ( DIV_DESCRIPTION_END ) . toString ( ) ; }
Get Label for Artifact Details .
29,277
public static String getPollStatusToolTip ( final PollStatus pollStatus , final VaadinMessageSource i18N ) { if ( pollStatus != null && pollStatus . getLastPollDate ( ) != null && pollStatus . isOverdue ( ) ) { final TimeZone tz = SPDateTimeUtil . getBrowserTimeZone ( ) ; return i18N . getMessage ( UIMessageIdProvider ...
Get tool tip for Poll status .
29,278
public static String getFormattedName ( final String orgText ) { return trimAndNullIfEmpty ( orgText ) == null ? SPUIDefinitions . SPACE : orgText ; }
Null check for text .
29,279
public static float getArtifactUploadPopupWidth ( final float newBrowserWidth , final int minPopupWidth ) { final float extraWidth = findRequiredSwModuleExtraWidth ( newBrowserWidth ) ; if ( extraWidth + minPopupWidth > SPUIDefinitions . MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH ) { return SPUIDefinitions . MAX_UPLOAD_CONFIR...
Get artifact upload pop up width .
29,280
public static String removePrefix ( final String text , final String prefix ) { if ( text != null ) { return text . replaceFirst ( prefix , "" ) ; } return null ; }
Remove the prefix from text .
29,281
public static Label getFormatedLabel ( final String labelContent ) { final Label labelValue = new Label ( labelContent , ContentMode . HTML ) ; labelValue . setSizeFull ( ) ; labelValue . addStyleName ( SPUIDefinitions . TEXT_STYLE ) ; labelValue . addStyleName ( "label-style" ) ; return labelValue ; }
Get formatted label . Appends ellipses if content does not fit the label .
29,282
public static String createAssignmentMessage ( final String tagName , final AssignmentResult < ? extends NamedEntity > result , final VaadinMessageSource i18n ) { final StringBuilder formMsg = new StringBuilder ( ) ; final int assignedCount = result . getAssigned ( ) ; final int alreadyAssignedCount = result . getAlrea...
Display Target Tag action message .
29,283
public static LazyQueryContainer createLazyQueryContainer ( final BeanQueryFactory < ? extends AbstractBeanQuery < ? > > queryFactory ) { queryFactory . setQueryConfiguration ( Collections . emptyMap ( ) ) ; return new LazyQueryContainer ( new LazyQueryDefinition ( true , 20 , SPUILabelDefinitions . VAR_NAME ) , queryF...
Create a lazy query container for the given query bean factory with empty configurations .
29,284
public static LazyQueryContainer createDSLazyQueryContainer ( final BeanQueryFactory < ? extends AbstractBeanQuery < ? > > queryFactory ) { queryFactory . setQueryConfiguration ( Collections . emptyMap ( ) ) ; return new LazyQueryContainer ( new LazyQueryDefinition ( true , 20 , "tagIdName" ) , queryFactory ) ; }
Create lazy query container for DS type .
29,285
public static void getDsTableColumnProperties ( final Container container ) { final LazyQueryContainer lqc = ( LazyQueryContainer ) container ; lqc . addContainerProperty ( SPUILabelDefinitions . VAR_ID , Long . class , null , false , false ) ; lqc . addContainerProperty ( SPUILabelDefinitions . VAR_DESC , String . cla...
Set distribution table column properties .
29,286
public static String getScriptSMHighlightWithColor ( final String colorCSS ) { return new StringBuilder ( ) . append ( SM_HIGHLIGHT_SCRIPT_CURRENT ) . append ( "smHighlightStyle = smHighlightStyle + \"" ) . append ( colorCSS ) . append ( "\";" ) . append ( SM_HIGHLIGHT_SCRIPT_APPEND ) . toString ( ) ; }
Highlight software module rows with the color of sw - type .
29,287
public static String changeToNewSelectedPreviewColor ( final String colorPickedPreview ) { return new StringBuilder ( ) . append ( NEW_PREVIEW_COLOR_REMOVE_SCRIPT ) . append ( NEW_PREVIEW_COLOR_CREATE_SCRIPT ) . append ( "var newColorPreviewStyle = \".v-app .new-tag-name{ border: solid 3px " ) . append ( colorPickedPre...
Get javascript to reflect new color selection in color picker preview for name and description fields .
29,288
public static String getPreviewButtonColorScript ( final String color ) { return new StringBuilder ( ) . append ( PREVIEW_BUTTON_COLOR_REMOVE_SCRIPT ) . append ( PREVIEW_BUTTON_COLOR_CREATE_SCRIPT ) . append ( "var tagColorPreviewStyle = \".v-app .tag-color-preview{ height: 15px !important; padding: 0 10px !important; ...
Get javascript to reflect new color selection for preview button .
29,289
public static void applyStatusLblStyle ( final Table targetTable , final Button pinBtn , final Object itemId ) { final Item item = targetTable . getItem ( itemId ) ; if ( item != null ) { final TargetUpdateStatus updateStatus = ( TargetUpdateStatus ) item . getItemProperty ( SPUILabelDefinitions . VAR_TARGET_STATUS ) ....
Apply style for status label in target table .
29,290
public static String formattingFinishedPercentage ( final RolloutGroup rolloutGroup , final float finishedPercentage ) { float tmpFinishedPercentage = 0 ; switch ( rolloutGroup . getStatus ( ) ) { case READY : case SCHEDULED : case ERROR : tmpFinishedPercentage = 0.0F ; break ; case FINISHED : tmpFinishedPercentage = 1...
Formats the finished percentage of a rollout group into a string with one digit after comma .
29,291
public static String getStatusLabelDetailsInString ( final String value , final String style , final String id ) { final StringBuilder val = new StringBuilder ( ) ; if ( ! StringUtils . isEmpty ( value ) ) { val . append ( "value:" ) . append ( value ) . append ( "," ) ; } if ( ! StringUtils . isEmpty ( style ) ) { val...
Returns a formatted string as needed by label custom render . This string holds the properties of a status label .
29,292
public static String getCodePoint ( final StatusFontIcon statusFontIcon ) { if ( statusFontIcon == null ) { return null ; } return statusFontIcon . getFontIcon ( ) != null ? Integer . toString ( statusFontIcon . getFontIcon ( ) . getCodepoint ( ) ) : null ; }
Receive the code point of a given StatusFontIcon .
29,293
public static Locale getCurrentLocale ( ) { final UI currentUI = UI . getCurrent ( ) ; return currentUI == null ? Locale . getDefault ( ) : currentUI . getLocale ( ) ; }
Gets the locale of the current Vaadin UI . If the locale can not be determined the default locale is returned instead .
29,294
public static String getArtifactoryDetailsLabelId ( final String name , final VaadinMessageSource i18n ) { String caption ; if ( StringUtils . hasText ( name ) ) { caption = i18n . getMessage ( UIMessageIdProvider . CAPTION_ARTIFACT_DETAILS_OF , HawkbitCommonUtil . getBoldHTMLText ( name ) ) ; } else { caption = i18n ....
Creates the caption of the Artifact Details table
29,295
public static Locale getLocaleToBeUsed ( final UiProperties . Localization localizationProperties , final Locale desiredLocale ) { final List < String > availableLocals = localizationProperties . getAvailableLocals ( ) ; if ( availableLocals . contains ( desiredLocale . getLanguage ( ) ) ) { return desiredLocale ; } re...
Determine the language that should be used considering localization properties and a desired Locale
29,296
public static void initLocalization ( final UI ui , final Localization localizationProperties , final VaadinMessageSource i18n ) { ui . setLocale ( HawkbitCommonUtil . getLocaleToBeUsed ( localizationProperties , ui . getSession ( ) . getLocale ( ) ) ) ; ui . getReconnectDialogConfiguration ( ) . setDialogText ( i18n ....
Set localization considering properties and UI settings .
29,297
public void populateDSMetadata ( final DistributionSet distributionSet ) { removeAllItems ( ) ; if ( null == distributionSet ) { return ; } selectedDistSetId = distributionSet . getId ( ) ; final List < DistributionSetMetadata > dsMetadataList = distributionSetManagement . findMetaDataByDistributionSetId ( PageRequest ...
Populate distribution set metadata .
29,298
public void addSoftwareModule ( final DmfSoftwareModule createSoftwareModule ) { if ( softwareModules == null ) { softwareModules = new ArrayList < > ( ) ; } softwareModules . add ( createSoftwareModule ) ; }
Add a Software module .
29,299
static < T > void validateTenantConfigurationDataType ( final TenantConfigurationKey configurationKey , final Class < T > propertyType ) { if ( ! configurationKey . getDataType ( ) . isAssignableFrom ( propertyType ) ) { throw new TenantConfigurationValidatorException ( String . format ( "Cannot parse the database valu...
Validates the data type of the tenant configuration . If it is possible to cast to the given data type .