Return-Path: X-Original-To: apmail-streams-dev-archive@minotaur.apache.org Delivered-To: apmail-streams-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B8701177A7 for ; Tue, 31 Mar 2015 23:03:33 +0000 (UTC) Received: (qmail 53991 invoked by uid 500); 31 Mar 2015 23:03:18 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 53948 invoked by uid 500); 31 Mar 2015 23:03:18 -0000 Mailing-List: contact dev-help@streams.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@streams.incubator.apache.org Delivered-To: mailing list dev@streams.incubator.apache.org Received: (qmail 53936 invoked by uid 99); 31 Mar 2015 23:03:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2015 23:03:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 31 Mar 2015 23:02:56 +0000 Received: (qmail 52819 invoked by uid 99); 31 Mar 2015 23:02:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2015 23:02:53 +0000 Date: Tue, 31 Mar 2015 23:02:53 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@streams.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (STREAMS-259) Filter a stream of Activities for specific verbs and objectTypes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STREAMS-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14389582#comment-14389582 ] ASF GitHub Bot commented on STREAMS-259: ---------------------------------------- Github user steveblackmon commented on a diff in the pull request: https://github.com/apache/incubator-streams/pull/207#discussion_r27531716 --- Diff: streams-verbs/src/main/java/org/apache/streams/verbs/VerbDefinitionResolver.java --- @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.streams.verbs; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.apache.streams.pojo.json.Activity; +import org.apache.streams.pojo.json.ActivityObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +public class VerbDefinitionResolver { + + private static final Logger LOGGER = LoggerFactory.getLogger(VerbDefinitionResolver.class); + + protected Set verbDefinitionSet; + + public VerbDefinitionResolver() { + // get with reflection + } + + public VerbDefinitionResolver(Set verbDefinitionSet) { + this(); + this.verbDefinitionSet = verbDefinitionSet; + } + + public List matchingVerbDefinitions(Activity activity) { + + Set candidates = Sets.newConcurrentHashSet(verbDefinitionSet); --- End diff -- good catch. fixed in latest push. > Filter a stream of Activities for specific verbs and objectTypes > ---------------------------------------------------------------- > > Key: STREAMS-259 > URL: https://issues.apache.org/jira/browse/STREAMS-259 > Project: Streams > Issue Type: New Feature > Reporter: Steve Blackmon > Assignee: Steve Blackmon > > Provide a way to define and apply a filter to a stream to pass along only activities with defined verbs and objectTypes in specific fields. > Verb Definitions appear to be a good way to specify and identify filtering rules. > https://raw.github.com/activitystreams/activity-streams-verb-definition/master/activity-streams-verb-definition.txt -- This message was sent by Atlassian JIRA (v6.3.4#6332)