public List < ModelServiceInstance > queryUPModelInstances ( ServiceInstanceQuery query ) { List < ModelServiceInstance > upInstances = null ; List < ModelServiceInstance > instances = queryModelInstances ( query ) ; if ( instances != null && instances . size ( ) > 0 ) { for ( ModelServiceInstance instance : instances ) { if ( OperationalStatus . UP . equals ( instance . getStatus ( ) ) ) { if ( upInstances == null ) { upInstances = new ArrayList < ModelServiceInstance > ( ) ; } upInstances . add ( instance ) ; } } } if ( upInstances == null ) { return Collections . emptyList ( ) ; } return upInstances ; }
Query the UP ModelServiceInstance .