Finding all doc messages

@param peer peer for search
@return found messages
966842
@ObjectiveCName("findAllDocsWithPeer:")
    public Command<List<MessageSearchEntity>> findAllDocs(Peer peer) {
        return callback -> modules.getSearchModule().findAllDocs(peer)
                .then(v -> callback.onResult(v))
                .failure(e -> callback.onError(e));
    }
1019244
function getOnLinePeers()
{
	var arrOnlinePeers = [];
	function compare(){
		return function(a,b){
			return b['count'] - a['count'];
		}
	}

	Object.keys(assocOnlinePeers).forEach(function(curUrl){    
		arrOnlinePeers.push({peer:curUrl, count:assocOnlinePeers[curUrl]});
	})
	if(arrOnlinePeers.length === 0)
		return [];
	else
		return arrOnlinePeers.sort(compare());
}
1234166
@ObjectiveCName("sendMessageWithPeer:withText:withMarkdownText:withMentions:autoDetect:")
    public void sendMessage(@NotNull Peer peer, @NotNull String text, @Nullable String markDownText,
                            @Nullable ArrayList<Integer> mentions, boolean autoDetect) {
        modules.getMessagesModule().sendMessage(peer, text, markDownText, mentions, autoDetect);
    }
55852
@Override
    public R visitDocComment(DocCommentTree node, P p) {
        R r = scan(node.getFirstSentence(), p);
        r = scanAndReduce(node.getBody(), p, r);
        r = scanAndReduce(node.getBlockTags(), p, r);
        return r;
    }
1168744
public List<MessageDestinationType<WebAppType<T>>> getAllMessageDestination()
   {
      List<MessageDestinationType<WebAppType<T>>> list = new ArrayList<MessageDestinationType<WebAppType<T>>>();
      List<Node> nodeList = childNode.get("message-destination");
      for(Node node: nodeList)
      {
         MessageDestinationType<WebAppType<T>>  type = new MessageDestinationTypeImpl<WebAppType<T>>(this, "message-destination", childNode, node);
         list.add(type);
      }
      return list;
   }
618456
def getPeersByName(self, name):
        '''
            
        '''
        peers = self.peers
        if peers is None:
            return None
        return TagCollection([peer for peer in peers if peer.name == name])
597455
def find_by_fileext(fileext, prs):
    
    def pred(pcls):
        """Predicate"""
        return fileext in pcls.extensions()

    pclss = findall_with_pred(pred, prs)
    if not pclss:
        raise UnknownFileTypeError("file extension={}".format(fileext))

    return pclss
851903
public List<MessageDestinationType<WebFragmentDescriptor>> getAllMessageDestination()
   {
      List<MessageDestinationType<WebFragmentDescriptor>> list = new ArrayList<MessageDestinationType<WebFragmentDescriptor>>();
      List<Node> nodeList = model.get("message-destination");
      for(Node node: nodeList)
      {
         MessageDestinationType<WebFragmentDescriptor>  type = new MessageDestinationTypeImpl<WebFragmentDescriptor>(this, "message-destination", model, node);
         list.add(type);
      }
      return list;
   }
1162534
public List<ReplicatorDocument> findAll() {
        InputStream instream = null;
        try {
            final URI uri = new DatabaseURIHelper(dbURI).path("_all_docs")
                    .query("include_docs", "true").build();
            final Reader reader = new InputStreamReader(instream = client.get(uri), "UTF-8");
            final JsonArray jsonArray = new JsonParser().parse(reader)
                    .getAsJsonObject().getAsJsonArray("rows");
            final List<ReplicatorDocument> list = new ArrayList<ReplicatorDocument>();
            for (JsonElement jsonElem : jsonArray) {
                JsonElement elem = jsonElem.getAsJsonObject().get("doc");
                if (!getAsString(elem.getAsJsonObject(), "_id").startsWith("_design")) { // skip
                    // design docs
                    ReplicatorDocument rd = client.getGson().fromJson(elem, ReplicatorDocument
                            .class);
                    list.add(rd);
                }
            }
            return list;
        } catch (UnsupportedEncodingException e) {
            // This should never happen as every implementation of the java platform is required
            // to support UTF-8.
            throw new RuntimeException(e);
        } finally {
            close(instream);
        }
    }
209401
public Collection<Subscription> getSubscriptionsByMessageType(Class messageType) {
        Set<Subscription> subscriptions = new TreeSet<Subscription>(Subscription.SubscriptionByPriorityDesc);
        ReadLock readLock = readWriteLock.readLock();
        try {
            readLock.lock();

            Subscription subscription;
            ArrayList<Subscription> subsPerMessage = subscriptionsPerMessage.get(messageType);

            if (subsPerMessage != null) {
                subscriptions.addAll(subsPerMessage);
            }

            Class[] types = ReflectionUtils.getSuperTypes(messageType);
            for (int i=0, n=types.length; i<n; i++) {
                Class eventSuperType = types[i];
                
                ArrayList<Subscription> subs = subscriptionsPerMessage.get(eventSuperType);
                if (subs != null) {
                    for (int j = 0,m=subs.size(); j<m; j++) {
                        subscription = subs.get(j);

                        if (subscription.handlesMessageType(messageType)) {
                            subscriptions.add(subscription);
                        }
                    }
                }
            }
        }finally{
            readLock.unlock();
        }
        return subscriptions;
    }
488470
private Collection<KeyReader> findReader(final Class<? extends Saga> sagaClazz, final Class<?> messageClazz) {
        Saga saga = sagaProviderFactory.createProvider(sagaClazz).get();
        Collection<KeyReader> readers = saga.keyReaders();
        if (readers == null) {
            // return empty list in case saga returns null for any reason
            readers = new ArrayList<>();
        }

        return readers;
    }
989837
List<Message> getMessages(final Level level) {
        if (level == null) {
            throw new NullPointerException("Level can't be null");
        }

        return Collections.unmodifiableList(this.messages.get(level));
    }
1075147
function () {
      //retrive next messages.
      //TODO: respond to back pressure from streams to each peer.
      //if a given stream is paused, don't retrive more msgs
      //for that peer/stream.
      for(var id in this.state.peers) {
        var state = this.state.peers[id]
        while(state.retrive.length) {
          var id = state.retrive.shift()
          if(state.replicating[id])
            opts.getAt({id: id, sequence:state.replicating[id].sent+1}, this._retrive)
        }
      }
      if(this.state.receive.length) {
        var ev = this.state.receive.shift()
        opts.append(ev.value, function (err, data) {
          if(err) {
            if(this.logging) console.error('EBT:err', err)
            self.block(ev.value.author, ev.id, true)
          }
          else self.onAppend(ev.value)
        })
      }
      for(var k in this.streams)
        this.streams[k].resume()
    }
350003
public List<WordInfo> discover(String doc, int size)
    {
        try
        {
            return discover(new BufferedReader(new StringReader(doc)), size);
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }
1121302
public List<MessageItem> getAllMessagesOnStream()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getAllMessagesOnStream");
    
    List<MessageItem> returnValue = 
      new LinkedList<MessageItem>();    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getAllMessagesOnStream", returnValue);      
    //there are no active messages on an express stream so we
    //return an empty array
    return returnValue;
  }
250968
public List<Peer> findPeersWithServiceMask(int mask) {
        lock.lock();
        try {
            ArrayList<Peer> results = new ArrayList<>(peers.size());
            for (Peer peer : peers)
                if ((peer.getPeerVersionMessage().localServices & mask) == mask)
                    results.add(peer);
            return results;
        } finally {
            lock.unlock();
        }
    }
604515
@ObjectiveCName("sendMessageWithMentionsDetect:withText:withMarkdownText:")
    public void sendMessageWithMentionsDetect(@NotNull Peer peer, @NotNull String text, @NotNull String markdownText) {
        sendMessage(peer, text, markdownText, null, true);
    }