private List < TargetWithActionType > getTargetsWithActionType ( final String targetFilterQuery , final Long dsId , final ActionType type , final int count ) { final Page < Target > targets = targetManagement . findByTargetFilterQueryAndNonDS ( PageRequest . of ( 0 , count ) , dsId , targetFilterQuery ) ; // the action type is set to FORCED per default (when not explicitly // specified) final ActionType autoAssignActionType = type == null ? ActionType . FORCED : type ; return targets . getContent ( ) . stream ( ) . map ( t -> new TargetWithActionType ( t . getControllerId ( ) , autoAssignActionType , RepositoryModelConstants . NO_FORCE_TIME ) ) . collect ( Collectors . toList ( ) ) ; }
Gets all matching targets with the designated action from the target management