Merge branch 'STREAMS-246' into 0.1-rc1
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..9151f06
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+Apache Streams (incubating)
+Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
+--------------------------------------------------------------------------------
+
+## 0.1
+
+ * Initial release!
\ No newline at end of file
diff --git a/README.txt b/README.md
similarity index 97%
rename from README.txt
rename to README.md
index 6d23022..43aef2a 100644
--- a/README.txt
+++ b/README.md
@@ -1,4 +1,4 @@
-Apache Streams (incubating) - README.txt
+Apache Streams (incubating)
Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9c75df6..d28ffed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
<artifactId>streams-project</artifactId>
<version>0.1-SNAPSHOT</version>
- <name>Apache Streams Project Parent POM</name>
+ <name>Apache Streams Project</name>
<description>Apache Streams Project</description>
@@ -162,6 +162,7 @@
<!-- Build Properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<!-- Release Properties -->
@@ -189,17 +190,24 @@
<joda-time.version>2.2</joda-time.version>
<rave.version>0.22</rave.version>
<datastax.version>1.0.3</datastax.version>
- <jsonschema2pojo.version>0.4.5</jsonschema2pojo.version>
+ <jsonschema2pojo.version>0.4.6</jsonschema2pojo.version>
<jaxb2.version>0.8.3</jaxb2.version>
<jaxb2-basics.version>0.8.4</jaxb2-basics.version>
<jaxbutil.version>1.2.6</jaxbutil.version>
<junit.version>4.11</junit.version>
+ <surefire.plugin.version>2.17</surefire.plugin.version>
+ <failsafe.plugin.version>2.17</failsafe.plugin.version>
+ <war.plugin.version>2.5</war.plugin.version>
+ <resources.plugin.version>2.7</resources.plugin.version>
<slf4j.version>1.7.6</slf4j.version>
<log4j.version>1.2.16</log4j.version>
<logback.version>1.1.1</logback.version>
<commons-io.version>2.4</commons-io.version>
+ <commons-codec.version>1.10</commons-codec.version>
+ <commons-validator.version>1.4.0</commons-validator.version>
<commons-lang3.version>3.1</commons-lang3.version>
<typesafe.config.version>1.2.0</typesafe.config.version>
+ <reflections.version>0.9.9</reflections.version>
<orgjson.version>20140107</orgjson.version>
<guava.version>17.0</guava.version>
<scala.version>2.8.0</scala.version>
@@ -213,6 +221,7 @@
<powermock.version>1.5.6</powermock.version>
<httpcomponents.core.version>4.3.3</httpcomponents.core.version>
<httpcomponents.client.version>4.3.5</httpcomponents.client.version>
+ <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
</properties>
<modules>
@@ -241,6 +250,7 @@
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
@@ -289,6 +299,14 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.7</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -347,6 +365,19 @@
</excludes>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections-maven</artifactId>
+ <version>${reflections.version}-RC2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>reflections</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</pluginManagement>
</build>
@@ -371,6 +402,16 @@
<version>${commons-io.version}</version>
</dependency>
<dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>${commons-codec.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>${commons-validator.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
@@ -387,7 +428,11 @@
<artifactId>config</artifactId>
<version>${typesafe.config.version}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ <version>${reflections.version}</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -564,4 +609,109 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <profiles>
+ <profile>
+ <id>apache-release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <excludes>
+ <exclude>.git/**</exclude>
+ <exclude>.idea/**</exclude>
+ <exclude>**/DEPENDENCIES</exclude>
+ <exclude>**/LICENSE</exclude>
+ <exclude>**/MANIFEST.MF</exclude>
+ <exclude>**/NOTICE</exclude>
+ <exclude>**/README.*</exclude>
+ <exclude>**/target/**</exclude>
+ <exclude>**/src/main/resources/**</exclude>
+ <exclude>**/src/test/resources/**</exclude>
+ <exclude>**/.gitignore</exclude>
+ <exclude>**/*.properties</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/*.ini</exclude>
+ <exclude>**/*.jar</exclude>
+ <exclude>dependency-reduced-pom.xml</exclude>
+ <exclude>rat.txt</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <configuration>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.1</version>
+ <configuration>
+ <additionalparam>-Xdoclint:none</additionalparam>
+ <aggregate>true</aggregate>
+ <failOnError>false</failOnError>
+ <minmemory>128m</minmemory>
+ <maxmemory>1g</maxmemory>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <id>aggregate</id>
+ <reports>
+ <report>javadoc-no-fork</report>
+ <report>test-javadoc-no-fork</report>
+ <report>aggregate</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>${site.plugin.version}</version>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ </profiles>
+
</project>
diff --git a/streams-components/README.md b/streams-components/README.md
new file mode 100644
index 0000000..eb7dd43
--- /dev/null
+++ b/streams-components/README.md
@@ -0,0 +1,10 @@
+streams-components
+==============
+
+These modules contain generic providers, processors, and writers which
+can fulfill a variety of purposes based on the configuration they receive.
+
+They have been designed to be extended in cases where a specific integration
+needs to do something a bit different.
+
+Please help improve these packages, or create new ones!
\ No newline at end of file
diff --git a/streams-components/pom.xml b/streams-components/pom.xml
index 9942e14..138eeef 100644
--- a/streams-components/pom.xml
+++ b/streams-components/pom.xml
@@ -37,6 +37,7 @@
</properties>
<modules>
+ <module>streams-converters</module>
<module>streams-http</module>
</modules>
diff --git a/streams-components/streams-converters/pom.xml b/streams-components/streams-converters/pom.xml
new file mode 100644
index 0000000..58f0c98
--- /dev/null
+++ b/streams-components/streams-converters/pom.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>streams-converters</artifactId>
+ <version>0.1-SNAPSHOT</version>
+
+ <parent>
+ <groupId>org.apache.streams</groupId>
+ <artifactId>streams-components</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.streams</groupId>
+ <artifactId>streams-config</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.streams</groupId>
+ <artifactId>streams-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.jayway.jsonpath</groupId>
+ <artifactId>json-path-assert</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/generated-sources/jsonschema2pojo</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-source-jaxb2</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/generated-sources/jaxb2</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jsonschema2pojo</groupId>
+ <artifactId>jsonschema2pojo-maven-plugin</artifactId>
+ <configuration>
+ <addCompileSourceRoot>true</addCompileSourceRoot>
+ <generateBuilders>true</generateBuilders>
+ <sourcePaths>
+ <sourcePath>src/main/jsonschema</sourcePath>
+ </sourcePaths>
+ <outputDirectory>target/generated-sources/jsonschema2pojo</outputDirectory>
+ <targetPackage>org.apache.streams.converter</targetPackage>
+ <useLongIntegers>true</useLongIntegers>
+ <useJodaDates>true</useJodaDates>
+ <includeJsr303Annotations>true</includeJsr303Annotations>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections-maven</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>reflections</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/ActivityConverterProcessor.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/ActivityConverterProcessor.java
new file mode 100644
index 0000000..4ce6111
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/ActivityConverterProcessor.java
@@ -0,0 +1,262 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.core.StreamsProcessor;
+import org.apache.streams.core.util.DatumUtils;
+import org.apache.streams.data.ActivityConverter;
+import org.apache.streams.data.DocumentClassifier;
+import org.apache.streams.data.util.ActivityUtil;
+import org.apache.streams.exceptions.ActivityConversionException;
+import org.apache.streams.pojo.json.Activity;
+import org.reflections.Reflections;
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.util.ClasspathHelper;
+import org.reflections.util.ConfigurationBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * ActivityConverterProcessor is a utility processor for converting any datum document
+ * to an Activity.
+ *
+ * By default it will handle string json and objectnode representation of existing Activities.
+ *
+ * Implementations can add DocumentClassifiers and ActivityConverterResolvers to the processor
+ * to ensure additional ActivityConverters will be resolved and applied.
+ *
+ * A DocumentClassifier's reponsibility is to recognize document formats and label them, using
+ * a jackson-compatible POJO class.
+ *
+ * An ActivityConverterResolver's reponsibility is to identify ActivityConverter implementations
+ * capable of converting a raw document associated with that POJO class into an activity.
+ *
+ */
+public class ActivityConverterProcessor implements StreamsProcessor {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(ActivityConverterProcessor.class);
+
+ private List<DocumentClassifier> classifiers;
+ private List<ActivityConverter> converters;
+
+ private ActivityConverterProcessorConfiguration configuration;
+
+ public ActivityConverterProcessor() {
+ this.classifiers = Lists.newArrayList();
+ this.converters = Lists.newArrayList();
+ }
+
+ public ActivityConverterProcessor(ActivityConverterProcessorConfiguration configuration) {
+ this();
+ this.configuration = configuration;
+ }
+
+ @Override
+ public List<StreamsDatum> process(StreamsDatum entry) {
+
+ List<StreamsDatum> result = Lists.newLinkedList();
+ Object document = entry.getDocument();
+
+ try {
+
+ // first determine which classes this document might actually be
+ List<Class> detectedClasses = detectClasses(document);
+
+ if( detectedClasses.size() == 0 ) {
+ LOGGER.warn("Unable to classify");
+ return null;
+ } else {
+ LOGGER.debug("Classified document as " + detectedClasses);
+ }
+
+ // for each of these classes:
+ // use TypeUtil to switch the document to that type
+ Map<Class, Object> typedDocs = convertToDetectedClasses(detectedClasses, document);
+
+ if( typedDocs.size() == 0 ) {
+ LOGGER.warn("Unable to convert to any detected Class");
+ return result;
+ }
+ else {
+ LOGGER.debug("Document has " + typedDocs.size() + " representations: " + typedDocs.toString());
+ }
+
+ // for each specified / discovered converter
+ for( ActivityConverter converter : converters ) {
+
+ Object typedDoc = typedDocs.get(converter.requiredClass());
+
+ List<Activity> activities = applyConverter(converter, typedDoc);
+
+ for (Activity activity : activities) {
+ StreamsDatum datum = DatumUtils.cloneDatum(entry);
+ datum.setId(activity.getId());
+ datum.setDocument(activity);
+ result.add(datum);
+ }
+ }
+
+ } catch( Exception e ) {
+ LOGGER.warn("General exception in process! " + e.getMessage());
+ } finally {
+ return result;
+ }
+
+ }
+
+ protected List<Activity> applyConverter(ActivityConverter converter, Object typedDoc) {
+
+ List<Activity> activities = Lists.newArrayList();
+ // if the document can be typed as the required class
+ if( typedDoc != null ) {
+
+ // let the converter create activities if it can
+ try {
+ activities = convertToActivity(converter, typedDoc);
+ } catch( Exception e ) {
+ LOGGER.debug("convertToActivity caught exception " + e.getMessage());
+ }
+
+ }
+ return activities;
+ }
+
+ protected List<Activity> convertToActivity(ActivityConverter converter, Object document) {
+
+ List<Activity> activities = Lists.newArrayList();
+ try {
+ activities = converter.toActivityList(document);
+ } catch (ActivityConversionException e1) {
+ LOGGER.debug(converter.getClass().getCanonicalName() + " unable to convert " + converter.requiredClass().getClass().getCanonicalName() + " to Activity");
+ }
+
+ for (Activity activity : activities) {
+
+ if (activity != null) {
+
+ // only accept valid activities
+ // this primitive validity check should be replaced with
+ // one that applies javax.validation to JSR303 annotations
+ // on the Activity json schema once a suitable implementation
+ // is found.
+ if (!ActivityUtil.isValid(activity)) {
+ activities.remove(activity);
+ LOGGER.debug(converter.getClass().getCanonicalName() + " produced invalid Activity converting " + converter.requiredClass().getClass().getCanonicalName());
+ }
+
+ } else {
+ LOGGER.debug(converter.getClass().getCanonicalName() + " returned null converting " + converter.requiredClass().getClass().getCanonicalName() + " to Activity");
+ }
+
+ }
+ return activities;
+
+ }
+
+ protected List<Class> detectClasses(Object document) {
+
+ Set<Class> detectedClasses = Sets.newConcurrentHashSet();
+ for( DocumentClassifier classifier : classifiers ) {
+ List<Class> detected = classifier.detectClasses(document);
+ if( detected != null && detected.size() > 0)
+ detectedClasses.addAll(detected);
+ }
+
+ return Lists.newArrayList(detectedClasses);
+ }
+
+ private Map<Class, Object> convertToDetectedClasses(List<Class> datumClasses, Object document) {
+
+ Map<Class, Object> convertedDocuments = Maps.newHashMap();
+ for( Class detectedClass : datumClasses ) {
+
+ Object typedDoc;
+ if (detectedClass.isInstance(document))
+ typedDoc = document;
+ else
+ typedDoc = TypeConverterUtil.convert(document, detectedClass);
+
+ if( typedDoc != null )
+ convertedDocuments.put(detectedClass, typedDoc);
+ }
+
+ return convertedDocuments;
+ }
+
+ @Override
+ public void prepare(Object configurationObject) {
+ Reflections reflections = new Reflections(new ConfigurationBuilder()
+ .setUrls(ClasspathHelper.forPackage("org.apache.streams"))
+ .setScanners(new SubTypesScanner()));
+ if (configuration.getClassifiers().size() > 0) {
+ for( DocumentClassifier classifier : configuration.getClassifiers()) {
+ try {
+ this.classifiers.add(classifier);
+ } catch (Exception e) {
+ LOGGER.warn("Exception adding " + classifier);
+ }
+ }
+ } else {
+ Set<Class<? extends DocumentClassifier>> classifierClasses = reflections.getSubTypesOf(DocumentClassifier.class);
+ for (Class classifierClass : classifierClasses) {
+ try {
+ this.classifiers.add((DocumentClassifier) classifierClass.newInstance());
+ } catch (Exception e) {
+ LOGGER.warn("Exception instantiating " + classifierClass);
+ }
+ }
+ }
+ Preconditions.checkArgument(this.classifiers.size() > 0);
+ if (configuration.getConverters().size() > 0) {
+ for( ActivityConverter converter : configuration.getConverters()) {
+ try {
+ this.converters.add(converter);
+ } catch (Exception e) {
+ LOGGER.warn("Exception adding " + converter);
+ }
+ }
+ } else {
+ Set<Class<? extends ActivityConverter>> converterClasses = reflections.getSubTypesOf(ActivityConverter.class);
+ for (Class converterClass : converterClasses) {
+ try {
+ this.converters.add((ActivityConverter) converterClass.newInstance());
+ } catch (Exception e) {
+ LOGGER.warn("Exception instantiating " + converterClass);
+ }
+ }
+ }
+ Preconditions.checkArgument(this.converters.size() > 0);
+ }
+
+ @Override
+ public void cleanUp() {
+
+ }
+
+};
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseDocumentClassifier.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseDocumentClassifier.java
new file mode 100644
index 0000000..6451aba
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseDocumentClassifier.java
@@ -0,0 +1,83 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.streams.data.DocumentClassifier;
+import org.apache.streams.data.util.ActivityUtil;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * BaseDocumentClassifier is included by default in all
+ * @see {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ * Ensures generic String and ObjectNode documents can be converted to Activity
+ *
+ */
+public class BaseDocumentClassifier implements DocumentClassifier {
+
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<Class> detectClasses(Object document) {
+ Preconditions.checkArgument(
+ document instanceof String
+ || document instanceof ObjectNode);
+
+ Activity activity = null;
+ ObjectNode node = null;
+
+ List<Class> classes = Lists.newArrayList();
+ // Soon javax.validation will available in jackson
+ // That will make this simpler and more powerful
+ if( document instanceof String ) {
+ classes.add(String.class);
+ try {
+ activity = this.mapper.readValue((String)document, Activity.class);
+ if(activity != null && ActivityUtil.isValid(activity))
+ classes.add(Activity.class);
+ } catch (IOException e1) {
+ try {
+ node = this.mapper.readValue((String)document, ObjectNode.class);
+ classes.add(ObjectNode.class);
+ } catch (IOException e2) { }
+ }
+ } else if( document instanceof ObjectNode ){
+ classes.add(ObjectNode.class);
+ activity = this.mapper.convertValue((ObjectNode)document, Activity.class);
+ if(ActivityUtil.isValid(activity))
+ classes.add(Activity.class);
+ } else {
+ classes.add(document.getClass());
+ }
+
+ return classes;
+
+ }
+
+}
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseObjectNodeActivityConverter.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseObjectNodeActivityConverter.java
new file mode 100644
index 0000000..a6d2bd5
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseObjectNodeActivityConverter.java
@@ -0,0 +1,93 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.streams.data.ActivityConverter;
+import org.apache.streams.exceptions.ActivityConversionException;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+
+import java.util.List;
+
+/**
+ * BaseObjectNodeActivityConverter is included by default in all
+ * @see {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ * Ensures generic ObjectNode representation of an Activity can be converted to Activity
+ *
+ */
+public class BaseObjectNodeActivityConverter implements ActivityConverter<ObjectNode> {
+
+ public static Class requiredClass = ObjectNode.class;
+
+ private ObjectMapper mapper = new StreamsJacksonMapper();
+
+ @Override
+ public Class requiredClass() {
+ return requiredClass;
+ }
+
+ @Override
+ public String serializationFormat() {
+ return null;
+ }
+
+ @Override
+ public ObjectNode fromActivity(Activity deserialized) throws ActivityConversionException {
+ try {
+ return mapper.convertValue(deserialized, ObjectNode.class);
+ } catch (Exception e) {
+ throw new ActivityConversionException();
+ }
+ }
+
+ @Override
+ public List<Activity> toActivityList(ObjectNode serialized) throws ActivityConversionException {
+ List<Activity> activityList = Lists.newArrayList();
+ try {
+ activityList.add(mapper.convertValue(serialized, Activity.class));
+ } catch (Exception e) {
+ throw new ActivityConversionException();
+ } finally {
+ return activityList;
+ }
+ }
+
+ @Override
+ public List<ObjectNode> fromActivityList(List<Activity> list) {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public List<Activity> toActivityList(List<ObjectNode> list) {
+ List<Activity> result = Lists.newArrayList();
+ for( ObjectNode item : list ) {
+ try {
+ result.addAll(toActivityList(item));
+ } catch (ActivityConversionException e) {}
+ }
+ return result;
+ }
+
+}
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseStringActivityConverter.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseStringActivityConverter.java
new file mode 100644
index 0000000..ced1c7a
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/BaseStringActivityConverter.java
@@ -0,0 +1,93 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.streams.data.ActivityConverter;
+import org.apache.streams.exceptions.ActivityConversionException;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+
+import java.util.List;
+
+/**
+ * BaseObjectNodeActivityConverter is included by default in all
+ * @see {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ * Ensures generic String Json representation of an Activity can be converted to Activity
+ *
+ */
+public class BaseStringActivityConverter implements ActivityConverter<String> {
+
+ public static Class requiredClass = String.class;
+
+ private ObjectMapper mapper = new StreamsJacksonMapper();
+
+ @Override
+ public Class requiredClass() {
+ return requiredClass;
+ }
+
+ @Override
+ public String serializationFormat() {
+ return null;
+ }
+
+ @Override
+ public String fromActivity(Activity deserialized) throws ActivityConversionException {
+ try {
+ return mapper.writeValueAsString(deserialized);
+ } catch (JsonProcessingException e) {
+ throw new ActivityConversionException();
+ }
+ }
+
+ @Override
+ public List<Activity> toActivityList(String serialized) throws ActivityConversionException {
+ List<Activity> activityList = Lists.newArrayList();
+ try {
+ activityList.add(mapper.readValue(serialized, Activity.class));
+ } catch (Exception e) {
+ throw new ActivityConversionException();
+ } finally {
+ return activityList;
+ }
+ }
+
+ @Override
+ public List<String> fromActivityList(List<Activity> list) {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public List<Activity> toActivityList(List<String> list) {
+ List<Activity> result = Lists.newArrayList();
+ for( String item : list ) {
+ try {
+ result.addAll(toActivityList(item));
+ } catch (ActivityConversionException e) {}
+ }
+ return result;
+ }
+}
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterProcessor.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterProcessor.java
new file mode 100644
index 0000000..9c8b2bd
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterProcessor.java
@@ -0,0 +1,91 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.core.StreamsProcessor;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * TypeConverterProcessor converts between String json and jackson-compatible POJO objects.
+ *
+ * Activity is one supported jackson-compatible POJO, so JSON String and objects with structual similarities
+ * to Activity can be converted to Activity objects.
+ *
+ * However, conversion to Activity should probably use {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ */
+public class TypeConverterProcessor implements StreamsProcessor, Serializable {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(TypeConverterProcessor.class);
+
+ private List<String> formats = Lists.newArrayList();
+
+ protected ObjectMapper mapper;
+
+ protected Class outClass;
+
+ public TypeConverterProcessor(Class outClass) {
+ this.outClass = outClass;
+ }
+
+ public TypeConverterProcessor(Class outClass, List<String> formats) {
+ this(outClass);
+ this.formats = formats;
+ }
+
+ @Override
+ public List<StreamsDatum> process(StreamsDatum entry) {
+
+ List<StreamsDatum> result = Lists.newLinkedList();
+ Object inDoc = entry.getDocument();
+
+ Object outDoc = TypeConverterUtil.convert(inDoc, outClass, mapper);
+
+ if( outDoc != null ) {
+ entry.setDocument(outDoc);
+ result.add(entry);
+ }
+
+ return result;
+ }
+
+ @Override
+ public void prepare(Object configurationObject) {
+ if( formats.size() > 0 )
+ this.mapper = StreamsJacksonMapper.getInstance(formats);
+ else
+ this.mapper = StreamsJacksonMapper.getInstance();
+ }
+
+ @Override
+ public void cleanUp() {
+ this.mapper = null;
+ }
+
+};
diff --git a/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
new file mode 100644
index 0000000..14955a7
--- /dev/null
+++ b/streams-components/streams-converters/src/main/java/org/apache/streams/converter/TypeConverterUtil.java
@@ -0,0 +1,70 @@
+/*
+ * 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.converter;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+/**
+ * TypeConverterUtil supports TypeConverterProcessor in converting between String json and
+ * jackson-compatible POJO objects
+ */
+public class TypeConverterUtil {
+
+ private final static Logger LOGGER = LoggerFactory.getLogger(TypeConverterUtil.class);
+
+ public static Object convert(Object object, Class outClass) {
+ return TypeConverterUtil.convert(object, outClass, StreamsJacksonMapper.getInstance());
+ }
+
+ public static Object convert(Object object, Class outClass, ObjectMapper mapper) {
+ ObjectNode node = null;
+ Object outDoc = null;
+ if( object instanceof String ) {
+ try {
+ node = mapper.readValue((String)object, ObjectNode.class);
+ } catch (IOException e) {
+ LOGGER.warn(e.getMessage());
+ LOGGER.warn(object.toString());
+ }
+ } else {
+ node = mapper.convertValue(object, ObjectNode.class);
+ }
+
+ if(node != null) {
+ try {
+ if( outClass == String.class )
+ outDoc = mapper.writeValueAsString(node);
+ else
+ outDoc = mapper.convertValue(node, outClass);
+
+ } catch (Throwable e) {
+ LOGGER.warn(e.getMessage());
+ LOGGER.warn(node.toString());
+ }
+ }
+
+ return outDoc;
+ }
+}
diff --git a/streams-components/streams-converters/src/main/jsonschema/org/apache/streams/converter/ActivityConverterProcessorConfiguration.json b/streams-components/streams-converters/src/main/jsonschema/org/apache/streams/converter/ActivityConverterProcessorConfiguration.json
new file mode 100644
index 0000000..93ac094
--- /dev/null
+++ b/streams-components/streams-converters/src/main/jsonschema/org/apache/streams/converter/ActivityConverterProcessorConfiguration.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "javaType" : "org.apache.streams.converter.ActivityConverterProcessorConfiguration",
+ "javaInterfaces": ["java.io.Serializable"],
+ "properties": {
+ "classifiers": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "javaType": "org.apache.streams.data.DocumentClassifier"
+ }
+ },
+ "converters": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "javaType": "org.apache.streams.data.ActivityConverter"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/BaseActivityConverterProcessorTest.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/BaseActivityConverterProcessorTest.java
new file mode 100644
index 0000000..97a52a4
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/BaseActivityConverterProcessorTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.converter.test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.streams.converter.ActivityConverterProcessor;
+import org.apache.streams.converter.ActivityConverterProcessorConfiguration;
+import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.List;
+
+import static junit.framework.Assert.*;
+
+/**
+ * Test for
+ * @see {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ * Test that default String & ObjectNode conversion works.
+ */
+public class BaseActivityConverterProcessorTest {
+
+ private static final ObjectMapper mapper = new StreamsJacksonMapper();
+
+ private static final String ACTIVITY_JSON = "{\"id\":\"id\",\"published\":\"Tue Jan 17 21:21:46 Z 2012\",\"verb\":\"post\",\"provider\":{\"id\":\"providerid\"}}";
+
+ ActivityConverterProcessor processor;
+
+ @Before
+ public void setup() {
+ processor = new ActivityConverterProcessor(new ActivityConverterProcessorConfiguration());
+ processor.prepare(new ActivityConverterProcessorConfiguration());
+ }
+
+ @Test
+ public void testBaseActivitySerializerProcessorInvalid() {
+ String INVALID_DOCUMENT = " 38Xs}";
+ StreamsDatum datum = new StreamsDatum(INVALID_DOCUMENT);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(0, result.size());
+ }
+
+ @Test
+ public void testActivityConverterProcessorString() {
+ StreamsDatum datum = new StreamsDatum(ACTIVITY_JSON);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(((Activity)resultDatum.getDocument()).getVerb().equals("post"));
+ }
+
+ @Test
+ public void testBaseActivitySerializerProcessorObject() throws IOException {
+ ObjectNode OBJECT_DOCUMENT = mapper.readValue(ACTIVITY_JSON, ObjectNode.class);
+ StreamsDatum datum = new StreamsDatum(OBJECT_DOCUMENT);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(((Activity)resultDatum.getDocument()).getVerb().equals("post"));
+ }
+
+}
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverter.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverter.java
new file mode 100644
index 0000000..8421273
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverter.java
@@ -0,0 +1,72 @@
+/*
+ * 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.converter.test;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.streams.converter.ActivityConverterProcessor;
+import org.apache.streams.converter.ActivityConverterProcessorConfiguration;
+import org.apache.streams.data.ActivityConverter;
+import org.apache.streams.exceptions.ActivityConversionException;
+import org.apache.streams.pojo.json.Activity;
+import org.apache.streams.pojo.json.Provider;
+
+import java.util.List;
+
+/**
+ * Support class for
+ * @see {@link org.apache.streams.converter.test.CustomActivityConverterProcessorTest}
+ */
+public class CustomActivityConverter implements ActivityConverter<CustomType> {
+
+
+ @Override
+ public Class requiredClass() {
+ return CustomType.class;
+ }
+
+ @Override
+ public String serializationFormat() {
+ return null;
+ }
+
+ @Override
+ public CustomType fromActivity(Activity deserialized) throws ActivityConversionException {
+ return null;
+ }
+
+ @Override
+ public List<Activity> toActivityList(CustomType document) throws ActivityConversionException {
+ Activity customActivity = new Activity();
+ customActivity.setId(document.getTest());
+ customActivity.setVerb(document.getTest());
+ customActivity.setProvider((Provider)new Provider().withId(document.getTest()));
+ return Lists.newArrayList(customActivity);
+ }
+
+ @Override
+ public List<Activity> toActivityList(List<CustomType> list) throws ActivityConversionException {
+ return null;
+ }
+
+ @Override
+ public List<CustomType> fromActivityList(List<Activity> list) throws ActivityConversionException {
+ return null;
+ }
+}
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverterProcessorTest.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverterProcessorTest.java
new file mode 100644
index 0000000..c9333c7
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomActivityConverterProcessorTest.java
@@ -0,0 +1,103 @@
+/*
+ * 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.converter.test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.streams.converter.ActivityConverterProcessor;
+import org.apache.streams.converter.ActivityConverterProcessorConfiguration;
+import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.List;
+
+import static junit.framework.Assert.*;
+
+/**
+ * Test for
+ * @see {@link org.apache.streams.converter.ActivityConverterProcessor}
+ *
+ * Test that arbitrary POJO conversion works, including when POJO represented as String & ObjectNode.
+ */
+public class CustomActivityConverterProcessorTest {
+
+ private static final ObjectMapper mapper = new StreamsJacksonMapper();
+
+ ActivityConverterProcessor processor;
+
+ ActivityConverterProcessorConfiguration configuration;
+
+ CustomType testDocument;
+
+ @Before
+ public void setup() {
+ configuration = new ActivityConverterProcessorConfiguration();
+ configuration.getClassifiers().add(new CustomDocumentClassifier());
+ configuration.getConverters().add(new CustomActivityConverter());
+ processor = new ActivityConverterProcessor(configuration);
+ processor.prepare(configuration);
+ testDocument = new CustomType();
+ testDocument.setTest("testValue");
+ }
+
+ @Test
+ public void testCustomActivityConverterProcessorString() throws IOException {
+ StreamsDatum datum = new StreamsDatum(mapper.writeValueAsString(testDocument));
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(((Activity)resultDatum.getDocument()).getVerb().equals("testValue"));
+ }
+
+ @Test
+ public void testCustomActivitySerializerProcessorObjectNode() throws IOException {
+ ObjectNode OBJECT_DOCUMENT = mapper.convertValue(testDocument, ObjectNode.class);
+ StreamsDatum datum = new StreamsDatum(OBJECT_DOCUMENT);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(((Activity)resultDatum.getDocument()).getVerb().equals("testValue"));
+ }
+
+ @Test
+ public void testCustomActivitySerializerProcessorPOJO() throws IOException {
+ StreamsDatum datum = new StreamsDatum(testDocument);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(((Activity)resultDatum.getDocument()).getVerb().equals("testValue"));
+ }
+
+}
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomDocumentClassifier.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomDocumentClassifier.java
new file mode 100644
index 0000000..685ce8c
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomDocumentClassifier.java
@@ -0,0 +1,75 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter.test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.streams.converter.ActivityConverterProcessorConfiguration;
+import org.apache.streams.data.DocumentClassifier;
+import org.apache.streams.data.util.ActivityUtil;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Support class for
+ * @see {@link org.apache.streams.converter.test.CustomActivityConverterProcessorTest}
+ */
+public class CustomDocumentClassifier implements DocumentClassifier {
+
+ private ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+
+ @Override
+ public List<Class> detectClasses(Object document) {
+
+ CustomType possibleMatchDocument = null;
+ ObjectNode node = null;
+
+ List<Class> classes = Lists.newArrayList();
+
+ if( document instanceof String ) {
+ classes.add(String.class);
+ try {
+ possibleMatchDocument = this.mapper.readValue((String)document, CustomType.class);
+ if(possibleMatchDocument != null && possibleMatchDocument.getTest() != null)
+ classes.add(CustomType.class);
+ } catch (IOException e1) {
+ try {
+ node = this.mapper.readValue((String)document, ObjectNode.class);
+ classes.add(ObjectNode.class);
+ } catch (IOException e2) { }
+ }
+ } else if( document instanceof ObjectNode ){
+ classes.add(ObjectNode.class);
+ possibleMatchDocument = this.mapper.convertValue((ObjectNode)document, CustomType.class);
+ if(possibleMatchDocument != null && possibleMatchDocument.getTest() != null) {
+ classes.add(CustomType.class);
+ }
+ } else {
+ classes.add(document.getClass());
+ }
+
+ return classes;
+ }
+}
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomType.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomType.java
new file mode 100644
index 0000000..ddcec4b
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/CustomType.java
@@ -0,0 +1,37 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.converter.test;
+
+/**
+ * Support class for
+ * @see {@link org.apache.streams.converter.test.CustomActivityConverterProcessorTest}
+ */
+public class CustomType {
+
+ private String test;
+
+ public String getTest() {
+ return test;
+ }
+
+ public void setTest(String test) {
+ this.test = test;
+ }
+}
diff --git a/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
new file mode 100644
index 0000000..0abc23e
--- /dev/null
+++ b/streams-components/streams-converters/src/test/java/org/apache/streams/converter/test/TypeConverterProcessorTest.java
@@ -0,0 +1,190 @@
+/*
+ * 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.converter.test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
+import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.core.StreamsProcessor;
+import org.apache.streams.converter.TypeConverterProcessor;
+import org.apache.streams.data.util.ActivityUtil;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.List;
+
+import static junit.framework.Assert.*;
+
+/**
+ * Tests for
+ * @see {@link org.apache.streams.converter.TypeConverterProcessor}
+ */
+public class TypeConverterProcessorTest {
+
+ private static final String DATASIFT_JSON = "{\"demographic\":{\"gender\":\"female\"},\"interaction\":{\"schema\":{\"version\":3},\"source\":\"Twitter for Android\",\"author\":{\"username\":\"ViiOLeee\",\"name\":\"Violeta Anguita\",\"id\":70931384,\"avatar\":\"http://pbs.twimg.com/profile_images/378800000851401229/bbf480cde2e9923a1d20acd393da0212_normal.jpeg\",\"link\":\"http://twitter.com/ViiOLeee\",\"language\":\"en\"},\"type\":\"twitter\",\"created_at\":\"Tue, 27 May 2014 22:38:15 +0000\",\"received_at\":1.401230295658E9,\"content\":\"RT @AliiAnguita: \\\"@Pharrell: Loved working with @edsheeran on Sing. He's a genius. https://t.co/wB2qKyJMRw\\\" @ViiOLeee look at this!\",\"id\":\"1e3e5ef97532a580e0741841f5746728\",\"link\":\"http://twitter.com/ViiOLeee/status/471420141989666817\",\"mentions\":[\"Pharrell\",\"edsheeran\",\"ViiOLeee\",\"AliiAnguita\"],\"mention_ids\":[338084918,85452649,70931384]},\"klout\":{\"score\":34},\"language\":{\"tag\":\"en\",\"tag_extended\":\"en\",\"confidence\":98},\"links\":{\"code\":[200],\"created_at\":[\"Tue, 27 May 2014 14:28:06 +0000\"],\"meta\":{\"charset\":[\"UTF-8\"],\"content_type\":[\"text/html\"],\"description\":[\"Official Video for Ed Sheeran's track SING Get this track on iTunes: http://smarturl.it/EdSing Pre-order 'x' on iTunes and get 'One' instantly: http://smartu...\"],\"keywords\":[[\"ed sheeran\",\"ed sheeran sing\",\"ed sheeran new album\",\"Ed Sheeran (Musical Artist)\",\"ed sheeran one\",\"ed sheeran fault in our stars\",\"ed sheeran all of the stars\",\"s...\"]],\"lang\":[\"en\"],\"opengraph\":[{\"site_name\":\"YouTube\",\"url\":\"http://www.youtube.com/watch?v=tlYcUqEPN58\",\"title\":\"Ed Sheeran - SING [Official Video]\",\"image\":\"https://i1.ytimg.com/vi/tlYcUqEPN58/maxresdefault.jpg\",\"description\":\"Official Video for Ed Sheeran's track SING Get this track on iTunes: http://smarturl.it/EdSing Pre-order 'x' on iTunes and get 'One' instantly: http://smartu...\",\"type\":\"video\"}],\"twitter\":[{\"card\":\"player\",\"site\":\"@youtube\",\"url\":\"http://www.youtube.com/watch?v=tlYcUqEPN58\",\"title\":\"Ed Sheeran - SING [Official Video]\",\"description\":\"Official Video for Ed Sheeran's track SING Get this track on iTunes: http://smarturl.it/EdSing Pre-order 'x' on iTunes and get 'One' instantly: http://smartu...\",\"image\":\"https://i1.ytimg.com/vi/tlYcUqEPN58/maxresdefault.jpg\",\"app\":{\"iphone\":{\"name\":\"YouTube\",\"id\":\"544007664\",\"url\":\"vnd.youtube://watch/tlYcUqEPN58\"},\"ipad\":{\"name\":\"YouTube\",\"id\":\"544007664\",\"url\":\"vnd.youtube://watch/tlYcUqEPN58\"},\"googleplay\":{\"name\":\"YouTube\",\"id\":\"com.google.android.youtube\",\"url\":\"http://www.youtube.com/watch?v=tlYcUqEPN58\"}},\"player\":\"https://www.youtube.com/embed/tlYcUqEPN58\",\"player_width\":\"1280\",\"player_height\":\"720\"}]},\"normalized_url\":[\"https://youtube.com/watch?v=tlYcUqEPN58\"],\"retweet_count\":[0],\"title\":[\"Ed Sheeran - SING [Official Video] - YouTube\"],\"url\":[\"https://www.youtube.com/watch?v=tlYcUqEPN58\"]},\"twitter\":{\"id\":\"471420141989666817\",\"retweet\":{\"text\":\"\\\"@Pharrell: Loved working with @edsheeran on Sing. He's a genius. https://t.co/wB2qKyJMRw\\\" @ViiOLeee look at this!\",\"id\":\"471420141989666817\",\"user\":{\"name\":\"Violeta Anguita\",\"description\":\"La vida no seria la fiesta que todos esperamos, pero mientras estemos aqui debemos BAILAR!!! #ErasmusOnceErasmusForever\",\"location\":\"Espanhaa..Olaa!\",\"statuses_count\":5882,\"followers_count\":249,\"friends_count\":1090,\"screen_name\":\"ViiOLeee\",\"profile_image_url\":\"http://pbs.twimg.com/profile_images/378800000851401229/bbf480cde2e9923a1d20acd393da0212_normal.jpeg\",\"profile_image_url_https\":\"https://pbs.twimg.com/profile_images/378800000851401229/bbf480cde2e9923a1d20acd393da0212_normal.jpeg\",\"lang\":\"en\",\"time_zone\":\"Madrid\",\"utc_offset\":7200,\"listed_count\":1,\"id\":70931384,\"id_str\":\"70931384\",\"geo_enabled\":false,\"verified\":false,\"favourites_count\":275,\"created_at\":\"Wed, 02 Sep 2009 10:19:59 +0000\"},\"source\":\"<a href=\\\"http://twitter.com/download/android\\\" rel=\\\"nofollow\\\">Twitter for Android</a>\",\"count\":1,\"created_at\":\"Tue, 27 May 2014 22:38:15 +0000\",\"mentions\":[\"Pharrell\",\"edsheeran\",\"ViiOLeee\",\"AliiAnguita\"],\"mention_ids\":[338084918,85452649,70931384],\"links\":[\"https://www.youtube.com/watch?v=tlYcUqEPN58\"],\"display_urls\":[\"youtube.com/watch?v=tlYcUq���\"],\"domains\":[\"www.youtube.com\"],\"lang\":\"en\"},\"retweeted\":{\"id\":\"471419867078209536\",\"user\":{\"name\":\"Alicia Anguita \",\"description\":\"Estudiante de Ingenieria de la Edificaci��n en Granada.\",\"statuses_count\":371,\"followers_count\":185,\"friends_count\":404,\"screen_name\":\"AliiAnguita\",\"profile_image_url\":\"http://pbs.twimg.com/profile_images/424248659677442048/qCPZL8c9_normal.jpeg\",\"profile_image_url_https\":\"https://pbs.twimg.com/profile_images/424248659677442048/qCPZL8c9_normal.jpeg\",\"lang\":\"es\",\"listed_count\":0,\"id\":561201891,\"id_str\":\"561201891\",\"geo_enabled\":false,\"verified\":false,\"favourites_count\":17,\"created_at\":\"Mon, 23 Apr 2012 13:11:44 +0000\"},\"source\":\"<a href=\\\"http://twitter.com/download/android\\\" rel=\\\"nofollow\\\">Twitter for Android</a>\",\"created_at\":\"Tue, 27 May 2014 22:37:09 +0000\"}}}";
+
+ private static final String ACTIVITY_JSON = "{\"id\":\"id\",\"published\":\"Tue Jan 17 21:21:46 Z 2012\",\"verb\":\"post\",\"provider\":{\"id\":\"providerid\"}}";
+
+ public static final String DATASIFT_FORMAT = "EEE, dd MMM yyyy HH:mm:ss Z";
+
+ /**
+ * Tests conversion from String to String
+ */
+ @Test
+ public void testTypeConverterStringToString() {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(String.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ StreamsDatum datum = new StreamsDatum(DATASIFT_JSON, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof String);
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ /**
+ * Tests conversion from String to ObjectNode
+ */
+ @Test
+ public void testTypeConverterStringToObjectNode() {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(ObjectNode.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ StreamsDatum datum = new StreamsDatum(DATASIFT_JSON, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof ObjectNode);
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ /**
+ * Tests conversion from ObjectNode to String
+ */
+ @Test
+ public void testTypeConverterObjectNodeToString() throws IOException {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(String.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance(DATASIFT_FORMAT);
+ ObjectNode node = mapper.readValue(DATASIFT_JSON, ObjectNode.class);
+ StreamsDatum datum = new StreamsDatum(node, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof String);
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ /**
+ * Tests conversion from String to POJO (Activity)
+ */
+ @Test
+ public void testTypeConverterStringToActivity() {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(Activity.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ StreamsDatum datum = new StreamsDatum(ACTIVITY_JSON, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(ActivityUtil.isValid((Activity)resultDatum.getDocument()));
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ /**
+ * Tests conversion from ObjectNode to POJO (Activity)
+ */
+ @Test
+ public void testTypeConverterObjectNodeToActivity() throws IOException {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(Activity.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance(DATASIFT_FORMAT);
+ ObjectNode node = mapper.readValue(ACTIVITY_JSON, ObjectNode.class);
+ StreamsDatum datum = new StreamsDatum(node, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof Activity);
+ assertTrue(ActivityUtil.isValid((Activity)resultDatum.getDocument()));
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ /**
+ * Tests conversion from POJO (Activity) to String
+ */
+ @Test
+ public void testTypeConverterActivityToString() throws IOException {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(String.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance(DATASIFT_FORMAT);
+ Activity node = mapper.readValue(ACTIVITY_JSON, Activity.class);
+ StreamsDatum datum = new StreamsDatum(node, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof String);
+ assertEquals(ID, resultDatum.getId());
+ }
+
+ @Test
+ public void testTypeConverterActivityToObjectNode() throws IOException {
+ final String ID = "1";
+ StreamsProcessor processor = new TypeConverterProcessor(ObjectNode.class, Lists.newArrayList(DATASIFT_FORMAT));
+ processor.prepare(null);
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance(DATASIFT_FORMAT);
+ Activity node = mapper.readValue(ACTIVITY_JSON, Activity.class);
+ StreamsDatum datum = new StreamsDatum(node, ID);
+ List<StreamsDatum> result = processor.process(datum);
+ assertNotNull(result);
+ assertEquals(1, result.size());
+ StreamsDatum resultDatum = result.get(0);
+ assertNotNull(resultDatum);
+ assertNotNull(resultDatum.getDocument());
+ assertTrue(resultDatum.getDocument() instanceof ObjectNode);
+ assertEquals(ID, resultDatum.getId());
+ }
+
+
+}
diff --git a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpConfiguration.json b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpConfiguration.json
index b4dc243..7c5006c 100644
--- a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpConfiguration.json
+++ b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.components.http.HttpConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProcessorConfiguration.json b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProcessorConfiguration.json
index 32e4c23..9706761 100644
--- a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProcessorConfiguration.json
+++ b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProcessorConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.components.http.HttpProcessorConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"extends": { "$ref": "HttpConfiguration.json" },
diff --git a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProviderConfiguration.json b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProviderConfiguration.json
index 2c135d9..41c158e 100644
--- a/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProviderConfiguration.json
+++ b/streams-components/streams-http/src/main/jsonschema/org/apache/streams/components/http/HttpProviderConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.components.http.HttpProviderConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"extends": { "$ref": "HttpConfiguration.json" },
diff --git a/streams-config/README.md b/streams-config/README.md
new file mode 100644
index 0000000..7456311
--- /dev/null
+++ b/streams-config/README.md
@@ -0,0 +1,4 @@
+streams-config
+==============
+
+streams-config provides a centralized configuration system for streams.
\ No newline at end of file
diff --git a/streams-config/src/main/jsonschema/ComponentConfiguration.json b/streams-config/src/main/jsonschema/ComponentConfiguration.json
index dcb9cde..4e015fe 100644
--- a/streams-config/src/main/jsonschema/ComponentConfiguration.json
+++ b/streams-config/src/main/jsonschema/ComponentConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.config.ComponentConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-config/src/main/jsonschema/StreamsConfiguration.json b/streams-config/src/main/jsonschema/StreamsConfiguration.json
index b6f30b1..3cafbc7 100644
--- a/streams-config/src/main/jsonschema/StreamsConfiguration.json
+++ b/streams-config/src/main/jsonschema/StreamsConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.config.StreamsConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/README.md b/streams-contrib/README.md
new file mode 100644
index 0000000..6d5427b
--- /dev/null
+++ b/streams-contrib/README.md
@@ -0,0 +1,7 @@
+streams-contrib
+==============
+
+These modules contain data schemas, API synchronizations, and ActivityStreams
+conversions unique to specific sites and software packages.
+
+Please help improve these packages, or create new ones!
\ No newline at end of file
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/README.md b/streams-contrib/streams-amazon-aws/streams-persist-s3/README.md
new file mode 100644
index 0000000..5e5aa2b
--- /dev/null
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/README.md
@@ -0,0 +1,18 @@
+streams-persist-s3
+==============
+
+Write documents to an S3 bucket.
+
+Example writer configuration:
+
+ "s3": {
+ "key": "",
+ "secretKey": "",
+ "bucket": "",
+ "protocol": "HTTP",
+ "writerPath": "path/",
+ "writerFilePrefix": "prefix",
+ "chunk": false,
+ "region": "us-east-1"
+ }
+
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3Configurator.java b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3Configurator.java
index 6bf1672..ccf32c0 100644
--- a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3Configurator.java
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3Configurator.java
@@ -69,7 +69,9 @@
LOGGER.warn("Could not parse S3Configuration");
}
- Preconditions.checkArgument(s3Configuration.getWriterPath().endsWith("/"), s3Configuration.getWriterPath() + " must end with '/'");
+ if(!s3Configuration.getWriterPath().endsWith("/")) {
+ s3Configuration.setWriterPath(s3Configuration.getWriterPath() + "/");
+ }
return s3Configuration;
}
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3PersistWriter.java b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3PersistWriter.java
index 9111265..ad09b32 100644
--- a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3PersistWriter.java
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/java/org/apache/streams/s3/S3PersistWriter.java
@@ -27,8 +27,10 @@
import com.amazonaws.services.s3.S3ClientOptions;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import org.apache.streams.core.*;
+import org.apache.streams.jackson.StreamsJacksonMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -249,26 +251,32 @@
// Connect to S3
synchronized (this) {
- // if the user has chosen to not set the object mapper, then set a default object mapper for them.
- if(this.objectMapper == null)
- this.objectMapper = new ObjectMapper();
+ try {
+ // if the user has chosen to not set the object mapper, then set a default object mapper for them.
+ if (this.objectMapper == null)
+ this.objectMapper = new StreamsJacksonMapper();
- // Create the credentials Object
- if(this.amazonS3Client == null) {
- AWSCredentials credentials = new BasicAWSCredentials(s3WriterConfiguration.getKey(), s3WriterConfiguration.getSecretKey());
+ // Create the credentials Object
+ if (this.amazonS3Client == null) {
+ AWSCredentials credentials = new BasicAWSCredentials(s3WriterConfiguration.getKey(), s3WriterConfiguration.getSecretKey());
- ClientConfiguration clientConfig = new ClientConfiguration();
- clientConfig.setProtocol(Protocol.valueOf(s3WriterConfiguration.getProtocol().toString()));
+ ClientConfiguration clientConfig = new ClientConfiguration();
+ clientConfig.setProtocol(Protocol.valueOf(s3WriterConfiguration.getProtocol().toString()));
- // We do not want path style access
- S3ClientOptions clientOptions = new S3ClientOptions();
- clientOptions.setPathStyleAccess(false);
+ // We do not want path style access
+ S3ClientOptions clientOptions = new S3ClientOptions();
+ clientOptions.setPathStyleAccess(false);
- this.amazonS3Client = new AmazonS3Client(credentials, clientConfig);
- if( !Strings.isNullOrEmpty(s3WriterConfiguration.getRegion()))
- this.amazonS3Client.setRegion(Region.getRegion(Regions.fromName(s3WriterConfiguration.getRegion())));
- this.amazonS3Client.setS3ClientOptions(clientOptions);
+ this.amazonS3Client = new AmazonS3Client(credentials, clientConfig);
+ if (!Strings.isNullOrEmpty(s3WriterConfiguration.getRegion()))
+ this.amazonS3Client.setRegion(Region.getRegion(Regions.fromName(s3WriterConfiguration.getRegion())));
+ this.amazonS3Client.setS3ClientOptions(clientOptions);
+ }
+ } catch (Exception e) {
+ LOGGER.error("Exception while preparing the S3 client: {}", e);
}
+
+ Preconditions.checkArgument(this.amazonS3Client != null);
}
}
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3Configuration.json b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3Configuration.json
index a136308..ae696df 100644
--- a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3Configuration.json
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3Configuration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.s3.S3Configuration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3ReaderConfiguration.json b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3ReaderConfiguration.json
index 2959b3d..0b3943f 100644
--- a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3ReaderConfiguration.json
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3ReaderConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.s3.S3ReaderConfiguration",
"extends": {"$ref":"S3Configuration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3WriterConfiguration.json b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3WriterConfiguration.json
index f43087b..58d3055 100644
--- a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3WriterConfiguration.json
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/main/jsonschema/org/apache/streams/s3/S3WriterConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.s3.S3WriterConfiguration",
"extends": {"$ref":"S3Configuration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-amazon-aws/streams-persist-s3/src/test/java/org/apache/streams/s3/S3PersistWriterTest.java b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/test/java/org/apache/streams/s3/S3PersistWriterTest.java
new file mode 100644
index 0000000..d585eea
--- /dev/null
+++ b/streams-contrib/streams-amazon-aws/streams-persist-s3/src/test/java/org/apache/streams/s3/S3PersistWriterTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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.s3;
+
+import org.junit.After;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+
+public class S3PersistWriterTest {
+ private S3PersistWriter s3PersistWriter;
+
+ @After
+ public void tearDown() {
+ s3PersistWriter = null;
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testBadS3Config() {
+ s3PersistWriter = new S3PersistWriter(getBadConfig());
+
+ s3PersistWriter.prepare(null);
+ }
+
+ @Test
+ public void testGoodS3Config() {
+ s3PersistWriter = new S3PersistWriter(getGoodConfig());
+
+ s3PersistWriter.prepare(null);
+
+ assertNotNull(s3PersistWriter.getAmazonS3Client());
+ }
+
+ @Test
+ public void testCleanup() {
+ s3PersistWriter = new S3PersistWriter(getGoodConfig());
+
+ s3PersistWriter.prepare(null);
+
+ s3PersistWriter.cleanUp();
+ }
+
+ private S3WriterConfiguration getBadConfig() {
+ S3WriterConfiguration s3WriterConfiguration = new S3WriterConfiguration();
+
+ s3WriterConfiguration.setWriterPath("bad_path");
+ s3WriterConfiguration.setBucket("random_bucket");
+
+ return s3WriterConfiguration;
+ }
+
+ private S3WriterConfiguration getGoodConfig() {
+ S3WriterConfiguration s3WriterConfiguration = new S3WriterConfiguration();
+
+ s3WriterConfiguration.setWriterPath("good_path/");
+ s3WriterConfiguration.setBucket("random_bucket");
+ s3WriterConfiguration.setKey("key");
+ s3WriterConfiguration.setProtocol(S3Configuration.Protocol.HTTP);
+ s3WriterConfiguration.setSecretKey("secret!");
+ s3WriterConfiguration.setWriterFilePrefix("prefix");
+
+ return s3WriterConfiguration;
+ }
+}
\ No newline at end of file
diff --git a/streams-contrib/streams-persist-console/README.md b/streams-contrib/streams-persist-console/README.md
new file mode 100644
index 0000000..237c025
--- /dev/null
+++ b/streams-contrib/streams-persist-console/README.md
@@ -0,0 +1,16 @@
+streams-persist-console
+=====================
+
+Read and write documents from console
+
+This can also be used to read and write files.
+
+For example, to read a stream from a file of json documents:
+
+ cat inputfile.txt | java -jar stream.jar
+
+For example, to write a stream to a file of json documents:
+
+ java -jar stream.jar > outputfile.txt
+
+NOTE: Be sure to disable the console logger in the latter case.
\ No newline at end of file
diff --git a/streams-contrib/streams-persist-console/pom.xml b/streams-contrib/streams-persist-console/pom.xml
index 349ba00..2d5462c 100644
--- a/streams-contrib/streams-persist-console/pom.xml
+++ b/streams-contrib/streams-persist-console/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-elasticsearch/pom.xml b/streams-contrib/streams-persist-elasticsearch/pom.xml
index 8b651f4..30a85c8 100644
--- a/streams-contrib/streams-persist-elasticsearch/pom.xml
+++ b/streams-contrib/streams-persist-elasticsearch/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchMetadataUtil.java b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchMetadataUtil.java
index 2d96b57..c16c8d4 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchMetadataUtil.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/java/org/apache/streams/elasticsearch/ElasticsearchMetadataUtil.java
@@ -1,3 +1,21 @@
+/*
+ * 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.elasticsearch;
import com.fasterxml.jackson.databind.JsonNode;
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchConfiguration.json b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchConfiguration.json
index e2ed37c..948c4b2 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchConfiguration.json
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.elasticsearch.ElasticsearchConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchReaderConfiguration.json b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchReaderConfiguration.json
index 03c7286..99572d3 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchReaderConfiguration.json
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchReaderConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.elasticsearch.ElasticsearchReaderConfiguration",
"extends": {"$ref":"ElasticsearchConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchWriterConfiguration.json b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchWriterConfiguration.json
index 603b0bf..6000ea8 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchWriterConfiguration.json
+++ b/streams-contrib/streams-persist-elasticsearch/src/main/jsonschema/org/apache/streams/elasticsearch/ElasticsearchWriterConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.elasticsearch.ElasticsearchWriterConfiguration",
"extends": {"$ref":"ElasticsearchConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDatumFromMetadataProcessor.java b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDatumFromMetadataProcessor.java
index 66434bc..2316a88 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDatumFromMetadataProcessor.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDatumFromMetadataProcessor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.elasticsearch.test;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDocumentToMetadataProcessor.java b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDocumentToMetadataProcessor.java
index b2bfa84..8900ef3 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDocumentToMetadataProcessor.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestDocumentToMetadataProcessor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.elasticsearch.test;
import com.fasterxml.jackson.core.JsonProcessingException;
diff --git a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestElasticsearchPersistWriter.java b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestElasticsearchPersistWriter.java
index 8452592..e460a1c 100644
--- a/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestElasticsearchPersistWriter.java
+++ b/streams-contrib/streams-persist-elasticsearch/src/test/java/org/apache/streams/elasticsearch/test/TestElasticsearchPersistWriter.java
@@ -1,3 +1,21 @@
+/*
+ * 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.elasticsearch.test;
import com.google.common.collect.Lists;
diff --git a/streams-contrib/streams-persist-hbase/README.md b/streams-contrib/streams-persist-hbase/README.md
new file mode 100644
index 0000000..5cca090
--- /dev/null
+++ b/streams-contrib/streams-persist-hbase/README.md
@@ -0,0 +1,20 @@
+streams-persist-hbase
+=====================
+
+Read and write to HBase
+
+Example reader or writer configuration:
+
+ hbase {
+ rootdir = "hdfs://cloudera-vm-local:8020/hbase"
+ zookeeper {
+ quorum = "cloudera-vm-local"
+ property {
+ clientPort = 2181
+ }
+ }
+ table = "test_table"
+ family = "test_family"
+ qualifier = "test_column"
+ }
+
diff --git a/streams-contrib/streams-persist-hbase/pom.xml b/streams-contrib/streams-persist-hbase/pom.xml
index 44a15fb..774f093 100644
--- a/streams-contrib/streams-persist-hbase/pom.xml
+++ b/streams-contrib/streams-persist-hbase/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-hbase/src/main/jsonschema/org/apache/streams/hbase/HbaseConfiguration.json b/streams-contrib/streams-persist-hbase/src/main/jsonschema/org/apache/streams/hbase/HbaseConfiguration.json
index d3ac8db..f531fa9 100644
--- a/streams-contrib/streams-persist-hbase/src/main/jsonschema/org/apache/streams/hbase/HbaseConfiguration.json
+++ b/streams-contrib/streams-persist-hbase/src/main/jsonschema/org/apache/streams/hbase/HbaseConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.hbase.HbaseConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-persist-hdfs/README.md b/streams-contrib/streams-persist-hdfs/README.md
new file mode 100644
index 0000000..1b038b3
--- /dev/null
+++ b/streams-contrib/streams-persist-hdfs/README.md
@@ -0,0 +1,29 @@
+streams-persist-hdfs
+=====================
+
+Read and write to HDFS
+
+Example reader configuration:
+
+ hdfs {
+ host = "localhost"
+ port = "50070"
+ path = "/user/cloudera"
+ user = "cloudera"
+ password = "cloudera"
+ }
+
+Example writer configuration:
+
+ hdfs {
+ host = "localhost"
+ port = "50070"
+ path = "/user/cloudera"
+ user = "cloudera"
+ password = "cloudera"
+ writerPath = "/history/twitter/example"
+ writerFilePrefix = "streams-"
+ }
+
+
+
diff --git a/streams-contrib/streams-persist-hdfs/pom.xml b/streams-contrib/streams-persist-hdfs/pom.xml
index 37a18c5..ef487f6 100644
--- a/streams-contrib/streams-persist-hdfs/pom.xml
+++ b/streams-contrib/streams-persist-hdfs/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsConfiguration.json b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsConfiguration.json
index e33994b..8d0a397 100644
--- a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsConfiguration.json
+++ b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.hdfs.HdfsConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsReaderConfiguration.json b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsReaderConfiguration.json
index 2ae8367..39f6c8e 100644
--- a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsReaderConfiguration.json
+++ b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsReaderConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.hdfs.HdfsReaderConfiguration",
"extends": {"$ref":"HdfsConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsWriterConfiguration.json b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsWriterConfiguration.json
index fedda38..29f2d3d 100644
--- a/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsWriterConfiguration.json
+++ b/streams-contrib/streams-persist-hdfs/src/main/jsonschema/org/apache/streams/hdfs/HdfsWriterConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.hdfs.HdfsWriterConfiguration",
"extends": {"$ref":"HdfsConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-persist-kafka/README.md b/streams-contrib/streams-persist-kafka/README.md
new file mode 100644
index 0000000..e110492
--- /dev/null
+++ b/streams-contrib/streams-persist-kafka/README.md
@@ -0,0 +1,14 @@
+streams-persist-kafka
+=====================
+
+Read and write to Kafka
+
+Example reader / writer configuration:
+
+ kafka {
+ brokerlist = "localhost:9092"
+ zkconnect = "localhost:2181"
+ topic = "topic"
+ groupId = "group"
+ }
+
diff --git a/streams-contrib/streams-persist-kafka/pom.xml b/streams-contrib/streams-persist-kafka/pom.xml
index 3c6d24d..5acc75d 100644
--- a/streams-contrib/streams-persist-kafka/pom.xml
+++ b/streams-contrib/streams-persist-kafka/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-kafka/src/main/jsonschema/org/apache/streams/kafka/KafkaConfiguration.json b/streams-contrib/streams-persist-kafka/src/main/jsonschema/org/apache/streams/kafka/KafkaConfiguration.json
index 3dc84c3..88e5554 100644
--- a/streams-contrib/streams-persist-kafka/src/main/jsonschema/org/apache/streams/kafka/KafkaConfiguration.json
+++ b/streams-contrib/streams-persist-kafka/src/main/jsonschema/org/apache/streams/kafka/KafkaConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.kafka.KafkaConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-persist-mongo/README.md b/streams-contrib/streams-persist-mongo/README.md
index 57d18c7..1dfee2f 100644
--- a/streams-contrib/streams-persist-mongo/README.md
+++ b/streams-contrib/streams-persist-mongo/README.md
@@ -5,12 +5,11 @@
Example configuration:
- {
- "mongo": {
- "host": "localhost",
- "port": 27017,
- "db": "local",
- "collection": "startup_log"
- }
+ "mongo": {
+ "host": "localhost",
+ "port": 27017,
+ "db": "local",
+ "collection": "startup_log"
}
+
diff --git a/streams-contrib/streams-persist-mongo/pom.xml b/streams-contrib/streams-persist-mongo/pom.xml
index 668d0e9..782f58c 100644
--- a/streams-contrib/streams-persist-mongo/pom.xml
+++ b/streams-contrib/streams-persist-mongo/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-persist-mongo/src/main/jsonschema/org/apache/streams/mongo/MongoConfiguration.json b/streams-contrib/streams-persist-mongo/src/main/jsonschema/org/apache/streams/mongo/MongoConfiguration.json
index dc2a553..88857c6 100644
--- a/streams-contrib/streams-persist-mongo/src/main/jsonschema/org/apache/streams/mongo/MongoConfiguration.json
+++ b/streams-contrib/streams-persist-mongo/src/main/jsonschema/org/apache/streams/mongo/MongoConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.mongo.MongoConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-processor-jackson/README.md b/streams-contrib/streams-processor-jackson/README.md
new file mode 100644
index 0000000..b0dc3c7
--- /dev/null
+++ b/streams-contrib/streams-processor-jackson/README.md
@@ -0,0 +1,5 @@
+streams-processor-jackson
+=====================
+
+Jackson Utility Processors
+
diff --git a/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/CleanAdditionalPropertiesProcessor.java b/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/CleanAdditionalPropertiesProcessor.java
index 56b0c5c..c5e9a4b 100644
--- a/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/CleanAdditionalPropertiesProcessor.java
+++ b/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/CleanAdditionalPropertiesProcessor.java
@@ -1,3 +1,22 @@
+/*
+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
+with the License. You may obtain a copy of the License at
+
+ 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.jackson;
import com.fasterxml.jackson.databind.JsonNode;
diff --git a/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/TypeConverterProcessor.java b/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/TypeConverterProcessor.java
index 63d03e9..4466117 100644
--- a/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/TypeConverterProcessor.java
+++ b/streams-contrib/streams-processor-jackson/src/main/java/org/apache/streams/jackson/TypeConverterProcessor.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.jackson;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-processor-json/README.md b/streams-contrib/streams-processor-json/README.md
new file mode 100644
index 0000000..3c88021
--- /dev/null
+++ b/streams-contrib/streams-processor-json/README.md
@@ -0,0 +1,5 @@
+streams-processor-json
+=====================
+
+JsonPath Utility Processors
+
diff --git a/streams-contrib/streams-processor-lucene/pom.xml b/streams-contrib/streams-processor-lucene/pom.xml
index 6bca713..105cdba 100644
--- a/streams-contrib/streams-processor-lucene/pom.xml
+++ b/streams-contrib/streams-processor-lucene/pom.xml
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+ with the License. You may obtain a copy of the License at
+
+ 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-processor-lucene/src/main/java/org/apache/streams/lucene/LuceneSimpleTaggingProcessor.java b/streams-contrib/streams-processor-lucene/src/main/java/org/apache/streams/lucene/LuceneSimpleTaggingProcessor.java
index 5473967..2595afd 100644
--- a/streams-contrib/streams-processor-lucene/src/main/java/org/apache/streams/lucene/LuceneSimpleTaggingProcessor.java
+++ b/streams-contrib/streams-processor-lucene/src/main/java/org/apache/streams/lucene/LuceneSimpleTaggingProcessor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.lucene;
import com.fasterxml.jackson.core.JsonParseException;
diff --git a/streams-contrib/streams-processor-lucene/src/main/jsonschema/org/apache/streams/lucene/LuceneTaggerConfiguration.json b/streams-contrib/streams-processor-lucene/src/main/jsonschema/org/apache/streams/lucene/LuceneTaggerConfiguration.json
index 19fcd76..048503e 100644
--- a/streams-contrib/streams-processor-lucene/src/main/jsonschema/org/apache/streams/lucene/LuceneTaggerConfiguration.json
+++ b/streams-contrib/streams-processor-lucene/src/main/jsonschema/org/apache/streams/lucene/LuceneTaggerConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.lucene.LuceneTaggerConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-processor-lucene/src/test/java/org/apache/streams/lucene/TestLucenSimpleTaggingProcessor.java b/streams-contrib/streams-processor-lucene/src/test/java/org/apache/streams/lucene/TestLucenSimpleTaggingProcessor.java
index b1b295e..62355c5 100644
--- a/streams-contrib/streams-processor-lucene/src/test/java/org/apache/streams/lucene/TestLucenSimpleTaggingProcessor.java
+++ b/streams-contrib/streams-processor-lucene/src/test/java/org/apache/streams/lucene/TestLucenSimpleTaggingProcessor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.lucene;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-processor-peoplepattern/README.md b/streams-contrib/streams-processor-peoplepattern/README.md
new file mode 100644
index 0000000..aa8dae0
--- /dev/null
+++ b/streams-contrib/streams-processor-peoplepattern/README.md
@@ -0,0 +1,13 @@
+streams-processor-peoplepattern
+=====================
+
+PeoplePattern API Processors
+
+Example configuration:
+
+ "peoplepattern": {
+ "username": "",
+ "password": ""
+ }
+
+
diff --git a/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/AccountType.json b/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/AccountType.json
index 5656b44..8c8d7e9 100644
--- a/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/AccountType.json
+++ b/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/AccountType.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType": "org.apache.streams.peoplepattern.AccountType",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/Demographics.json b/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/Demographics.json
index d1f64d8..bf8272f 100644
--- a/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/Demographics.json
+++ b/streams-contrib/streams-processor-peoplepattern/src/main/jsonschema/org/apache/streams/peoplepattern/Demographics.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType": "org.apache.streams.peoplepattern.Demographics",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-processor-regex/README.md b/streams-contrib/streams-processor-regex/README.md
new file mode 100644
index 0000000..8e45714
--- /dev/null
+++ b/streams-contrib/streams-processor-regex/README.md
@@ -0,0 +1,5 @@
+streams-processor-regex
+=====================
+
+Regex Utility Processors
+
diff --git a/streams-contrib/streams-processor-tika/pom.xml b/streams-contrib/streams-processor-tika/pom.xml
index 29ea129..897a3ae 100644
--- a/streams-contrib/streams-processor-tika/pom.xml
+++ b/streams-contrib/streams-processor-tika/pom.xml
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+ with the License. You may obtain a copy of the License at
+
+ 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/CategoryParser.java b/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/CategoryParser.java
index d055cbc..18ff747 100644
--- a/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/CategoryParser.java
+++ b/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/CategoryParser.java
@@ -1,3 +1,21 @@
+/*
+ * 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.tika;
import java.io.Serializable;
diff --git a/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/TikaProcessor.java b/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/TikaProcessor.java
index 1e694c5..bd93d88 100644
--- a/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/TikaProcessor.java
+++ b/streams-contrib/streams-processor-tika/src/main/java/org/apache/streams/tika/TikaProcessor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.tika;
import com.fasterxml.jackson.core.JsonProcessingException;
diff --git a/streams-contrib/streams-processor-tika/src/main/jsonschema/org/apache/streams/tika/BoilerPipeArticle.json b/streams-contrib/streams-processor-tika/src/main/jsonschema/org/apache/streams/tika/BoilerPipeArticle.json
index 137a4be..58f817e 100644
--- a/streams-contrib/streams-processor-tika/src/main/jsonschema/org/apache/streams/tika/BoilerPipeArticle.json
+++ b/streams-contrib/streams-processor-tika/src/main/jsonschema/org/apache/streams/tika/BoilerPipeArticle.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"properties": {
"siteStatus" : {
"type" : "string",
diff --git a/streams-contrib/streams-processor-urls/README.md b/streams-contrib/streams-processor-urls/README.md
new file mode 100644
index 0000000..ea858b8
--- /dev/null
+++ b/streams-contrib/streams-processor-urls/README.md
@@ -0,0 +1,5 @@
+streams-processor-urls
+=====================
+
+URL Utility Processors
+
diff --git a/streams-contrib/streams-processor-urls/pom.xml b/streams-contrib/streams-processor-urls/pom.xml
index e4f9233..df46e3d 100644
--- a/streams-contrib/streams-processor-urls/pom.xml
+++ b/streams-contrib/streams-processor-urls/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -49,6 +66,14 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/streams-contrib/streams-processor-urls/src/main/java/org/apache/streams/urls/LinkResolver.java b/streams-contrib/streams-processor-urls/src/main/java/org/apache/streams/urls/LinkResolver.java
index 5497b92..42867d7 100644
--- a/streams-contrib/streams-processor-urls/src/main/java/org/apache/streams/urls/LinkResolver.java
+++ b/streams-contrib/streams-processor-urls/src/main/java/org/apache/streams/urls/LinkResolver.java
@@ -19,6 +19,9 @@
package org.apache.streams.urls;
import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import org.apache.commons.codec.net.URLCodec;
+import org.apache.commons.validator.routines.UrlValidator;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -137,8 +140,10 @@
this.linkDetails.setRedirected(false);
linkDetails.setFinalURL(cleanURL(linkDetails.getFinalURL()));
- linkDetails.setNormalizedURL(normalizeURL(linkDetails.getFinalURL()));
- linkDetails.setUrlParts(tokenizeURL(linkDetails.getNormalizedURL()));
+ if( !Strings.isNullOrEmpty(linkDetails.getFinalURL()))
+ linkDetails.setNormalizedURL(normalizeURL(linkDetails.getFinalURL()));
+ if( !Strings.isNullOrEmpty(linkDetails.getNormalizedURL()))
+ linkDetails.setUrlParts(tokenizeURL(linkDetails.getNormalizedURL()));
this.updateTookInMillis();
}
@@ -152,6 +157,13 @@
Preconditions.checkNotNull(linkDetails);
Preconditions.checkNotNull(url);
+ // Check url validity
+ UrlValidator urlValidator = new UrlValidator();
+ if (!urlValidator.isValid(url)) {
+ linkDetails.setLinkStatus(LinkDetails.LinkStatus.MALFORMED_URL);
+ return;
+ }
+
// Check to see if they wound up in a redirect loop,
// IE: 'A' redirects to 'B', then 'B' redirects to 'A'
if ((linkDetails.getRedirectCount() != null && linkDetails.getRedirectCount() > 0 &&
@@ -365,13 +377,17 @@
// Decode URL to remove any %20 type stuff
String normalizedUrl = url;
try {
- // I've used a URLDecoder that's part of Java here,
- // but this functionality exists in most modern languages
- // and is universally called url decoding
- normalizedUrl = URLDecoder.decode(url, "UTF-8");
- } catch (UnsupportedEncodingException uee) {
- System.err.println("Unable to Decode URL. Decoding skipped.");
- uee.printStackTrace();
+
+ // Replaced URLDecode with commons-codec b/c of failing tests
+
+ URLCodec codec = new URLCodec();
+
+ normalizedUrl = codec.decode(url);
+
+ // Remove the protocol, http:// ftp:// or similar from the front
+ if (normalizedUrl.contains("://"))
+ normalizedUrl = normalizedUrl.split(":/{2}")[1];
+
} catch (NullPointerException npe) {
System.err.println("NPE Decoding URL. Decoding skipped.");
npe.printStackTrace();
@@ -380,9 +396,6 @@
e.printStackTrace();
}
- // Remove the protocol, http:// ftp:// or similar from the front
- if (normalizedUrl.contains("://"))
- normalizedUrl = normalizedUrl.split(":/{2}")[1];
// Room here to do more pre-processing
diff --git a/streams-contrib/streams-processor-urls/src/main/jsonschema/org/apache/streams/urls/LinkDetails.json b/streams-contrib/streams-processor-urls/src/main/jsonschema/org/apache/streams/urls/LinkDetails.json
index 82abe21..21099d7 100644
--- a/streams-contrib/streams-processor-urls/src/main/jsonschema/org/apache/streams/urls/LinkDetails.json
+++ b/streams-contrib/streams-processor-urls/src/main/jsonschema/org/apache/streams/urls/LinkDetails.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType": "org.apache.streams.urls.LinkDetails",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-processor-urls/src/test/java/org/apache/streams/urls/TestLinkUnwinderProcessor.java b/streams-contrib/streams-processor-urls/src/test/java/org/apache/streams/urls/TestLinkUnwinderProcessor.java
index ee1f83e..a554008 100644
--- a/streams-contrib/streams-processor-urls/src/test/java/org/apache/streams/urls/TestLinkUnwinderProcessor.java
+++ b/streams-contrib/streams-processor-urls/src/test/java/org/apache/streams/urls/TestLinkUnwinderProcessor.java
@@ -23,6 +23,7 @@
import com.google.common.collect.Sets;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.streams.core.StreamsDatum;
+import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.jackson.StreamsJacksonModule;
import org.apache.streams.pojo.json.Activity;
import org.junit.Test;
@@ -39,12 +40,28 @@
private static String activityString;
@Test
+ public void testLinkUnwinderBadDomain() {
+ LinkResolver resolver = new LinkResolver("http://nope@#$%");
+ resolver.run();
+ LinkDetails details = resolver.getLinkDetails();
+ assertEquals("Should be 400", LinkDetails.LinkStatus.MALFORMED_URL, details.getLinkStatus());
+ }
+
+ @Test
public void testLinkResolverSerializability() {
LinkResolver resolver = new LinkResolver("http://bit.ly/1cX5Rh4");
LinkResolver clone = SerializationUtils.clone(resolver);
}
@Test
+ public void test404Link() {
+ LinkResolver resolver = new LinkResolver("http://www.kneesupmotherbrown.me/2013/05/26/well-its-fair-to-say-may-has-been-a-crappy-month");
+ resolver.run();
+ LinkDetails details = resolver.getLinkDetails();
+ assertEquals("Should be 404", LinkDetails.LinkStatus.NOT_FOUND, details.getLinkStatus());
+ }
+
+ @Test
public void testLinkResolverProcessorSerializability() {
LinkResolverProcessor processor = new LinkResolverProcessor();
LinkResolverProcessor clone = SerializationUtils.clone(processor);
@@ -57,6 +74,12 @@
}
@Test
+ public void testActivityLinkUnwinderProcessorTdotCo() throws Exception{
+ testActivityUnwinderHelper(Lists.newArrayList("http://t.co/lLFgFynv2G"), Lists.newArrayList("http://www.holmesreport.com/latest"));
+ testStringActivityUnwinderHelper(Lists.newArrayList("http://t.co/lLFgFynv2G"), Lists.newArrayList("http://www.holmesreport.com/latest"));
+ }
+
+ @Test
public void testActivityLinkUnwinderProcessorGoogle() throws Exception{
testActivityUnwinderHelper(Lists.newArrayList("http://goo.gl/wSrHDA"), Lists.newArrayList("http://www.wcgworld.com/"));
testStringActivityUnwinderHelper(Lists.newArrayList("http://goo.gl/wSrHDA"), Lists.newArrayList("http://www.wcgworld.com/"));
@@ -76,32 +99,31 @@
@Test
public void testActivityLinkUnwinderProcessorMulti() throws Exception{
+ // changed these tests because the processor now guarantees each result returned only once
testActivityUnwinderHelper(Lists.newArrayList("http://x.co/3yapt", "http://ow.ly/u4Kte", "http://goo.gl/wSrHDA"), Lists.newArrayList("http://www.wcgworld.com/"));
testStringActivityUnwinderHelper(Lists.newArrayList("http://x.co/3yapt", "http://ow.ly/u4Kte", "http://goo.gl/wSrHDA"), Lists.newArrayList("http://www.wcgworld.com/"));
}
- @Test
- public void testActivityLinkUnwinderProcessorUnwindable() throws Exception{
- testActivityUnwinderHelper(Lists.newArrayList("http://bit.ly/1cX5Rh4", "http://nope@#$%e"), Lists.newArrayList("http://www.wcgworld.com/"));
- testStringActivityUnwinderHelper(Lists.newArrayList("http://bit.ly/1cX5Rh4", "http://nope@#$%s"), Lists.newArrayList("http://www.wcgworld.com/"));
- }
-
public void testActivityUnwinderHelper(List<String> input, List<String> expected) throws Exception{
+
+ // Purge all of the domain wait times (for testing)
LinkResolverHelperFunctions.purgeAllDomainWaitTimes();
- ObjectMapper mapper = new ObjectMapper();
- mapper.disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- mapper.registerModule(new StreamsJacksonModule());
+
+ // Create a new activity
Activity activity = new Activity();
activity.setLinks(input);
StreamsDatum datum = new StreamsDatum(activity);
LinkResolverProcessor processor = new LinkResolverProcessor();
processor.prepare(null);
+
List<StreamsDatum> result = processor.process(datum);
assertNotNull(result);
assertEquals(1, result.size());
StreamsDatum resultDatum = result.get(0);
assertNotNull(resultDatum);
assertTrue(resultDatum.getDocument() instanceof Activity);
+
+
Activity resultActivity = (Activity) resultDatum.getDocument();
assertNotNull(resultActivity.getLinks());
List<String> resultLinks = resultActivity.getLinks();
@@ -111,12 +133,9 @@
public void testStringActivityUnwinderHelper(List<String> input, List<String> expected) throws Exception{
LinkResolverHelperFunctions.purgeAllDomainWaitTimes();
- ObjectMapper mapper = new ObjectMapper();
- mapper.disable(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- mapper.registerModule(new StreamsJacksonModule());
Activity activity = new Activity();
activity.setLinks(input);
- String str = mapper.writeValueAsString(activity);
+ String str = StreamsJacksonMapper.getInstance().writeValueAsString(activity);
StreamsDatum datum = new StreamsDatum(str);
LinkResolverProcessor processor = new LinkResolverProcessor();
processor.prepare(null);
@@ -127,7 +146,7 @@
assertNotNull(resultDatum);
assertTrue(resultDatum.getDocument() instanceof String);
String resultActivityString = (String) resultDatum.getDocument();
- Activity resultActivity = mapper.readValue(resultActivityString, Activity.class);
+ Activity resultActivity = StreamsJacksonMapper.getInstance().readValue(resultActivityString, Activity.class);
assertNotNull(resultActivity.getLinks());
List<String> resultLinks = resultActivity.getLinks();
assertEquals(expected.size(), resultLinks.size());
diff --git a/streams-contrib/streams-provider-datasift/README.md b/streams-contrib/streams-provider-datasift/README.md
new file mode 100644
index 0000000..a29fb16
--- /dev/null
+++ b/streams-contrib/streams-provider-datasift/README.md
@@ -0,0 +1,18 @@
+streams-provider-datasift
+=====================
+
+Datasift Provider
+
+Example configuration:
+
+ datasift {
+ apiKey = ""
+ userName = ""
+ hashes = [
+ "b8aaf7cec5faa2fadbd55d651933a31e",
+ "f41f054e2a2ba8d2e7b0d74f56e727d6"
+ ]
+ }
+
+
+
diff --git a/streams-contrib/streams-provider-datasift/pom.xml b/streams-contrib/streams-provider-datasift/pom.xml
index 7dfa2a8..9a83c81 100644
--- a/streams-contrib/streams-provider-datasift/pom.xml
+++ b/streams-contrib/streams-provider-datasift/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -93,7 +110,13 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.streams</groupId>
+ <artifactId>streams-util</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
@@ -126,6 +149,18 @@
</sources>
</configuration>
</execution>
+ <execution>
+ <id>add-test-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/test/java17</source>
+ </sources>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
@@ -150,34 +185,4 @@
</plugin>
</plugins>
</build>
- <profiles>
- <profile>
- <id>java7</id>
- <activation>
- <jdk>[1.7,]</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>src/test/java17</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/csdl/DatasiftCsdlUtil.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/csdl/DatasiftCsdlUtil.java
index 7ff03fb..049ed8c 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/csdl/DatasiftCsdlUtil.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/csdl/DatasiftCsdlUtil.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.csdl;
import com.google.common.collect.Lists;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftActivitySerializerProcessor.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftActivitySerializerProcessor.java
index a4a4b5a..1f5a83a 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftActivitySerializerProcessor.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftActivitySerializerProcessor.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.processor;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftTypeConverterProcessor.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftTypeConverterProcessor.java
index 1166b2e..018c07b 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftTypeConverterProcessor.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/processor/DatasiftTypeConverterProcessor.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.processor;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
index 4939180..8200ce2 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftManagedSourceSetup.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.provider;
import com.datasift.client.DataSiftClient;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftPushProvider.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftPushProvider.java
index 264dbbe..e850a6e 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftPushProvider.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftPushProvider.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.provider;
import com.datasift.client.stream.DeletedInteraction;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
index b9d31ff..6ec395d 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamConfigurator.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.provider;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
index 8ed1443..558ae8a 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/DatasiftStreamProvider.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.provider;
import com.datasift.client.DataSiftClient;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/ErrorHandler.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/ErrorHandler.java
index aa9c49e..d5f19d5 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/ErrorHandler.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/ErrorHandler.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.provider;
import com.datasift.client.stream.ErrorListener;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/Subscription.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/Subscription.java
index 10b1e89..058ba1d 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/Subscription.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/provider/Subscription.java
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+
package org.apache.streams.datasift.provider;
import com.datasift.client.core.Stream;
diff --git a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializer.java b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializer.java
index 573f5a7..00db30d 100644
--- a/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializer.java
+++ b/streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializer.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.serializer;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/Datasift.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/Datasift.json
index d336d73..52d9912 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/Datasift.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/Datasift.json
@@ -1,6 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType": "org.apache.streams.datasift.Datasift",
"properties": {
"blog": {
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftConfiguration.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftConfiguration.json
index 9a0f027..99f889e 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftConfiguration.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType": "org.apache.streams.datasift.DatasiftConfiguration",
"javaInterfaces": [
"java.io.Serializable"
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPush.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPush.json
index 50e4f00..39565ad 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPush.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPush.json
@@ -1,7 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType": "org.apache.streams.datasift.DatasiftPush",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"id": {
"type": "string"
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPushConfiguration.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPushConfiguration.json
index bb65ef0..4c9fe5c 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPushConfiguration.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftPushConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.DatasiftPushConfiguration",
"extends": {"$ref":"DatasiftConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftStreamConfiguration.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftStreamConfiguration.json
index 91a9974..5c43fea 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftStreamConfiguration.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/DatasiftStreamConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.DatasiftStreamConfiguration",
"extends": {"$ref":"DatasiftConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/facebook/DatasiftFacebook.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/facebook/DatasiftFacebook.json
index a483d79..6085124 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/facebook/DatasiftFacebook.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/facebook/DatasiftFacebook.json
@@ -1,7 +1,12 @@
{
- "type" : "object",
- "$schema" : "http://json-schema.org/draft-03/schema",
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.facebook.Facebook",
+ "javaInterfaces": ["java.io.Serializable"],
"properties" :
{
"application" :
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/instagram/DatasiftInstagram.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/instagram/DatasiftInstagram.json
index 1397cba..8c209b1 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/instagram/DatasiftInstagram.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/instagram/DatasiftInstagram.json
@@ -1,7 +1,12 @@
{
- "type" : "object",
- "$schema" : "http://json-schema.org/draft-03/schema",
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.instagram.Instagram",
+ "javaInterfaces": ["java.io.Serializable"],
"properties" :
{
"caption" :
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/interaction/DatasiftInteraction.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/interaction/DatasiftInteraction.json
index fd4d576..5ff366a 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/interaction/DatasiftInteraction.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/interaction/DatasiftInteraction.json
@@ -1,7 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType": "org.apache.streams.datasift.interaction.Interaction",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"author": {
"javaType": "org.apache.streams.datasift.interaction.Author",
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitter.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitter.json
index b11f81a..8c373a3 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitter.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitter.json
@@ -1,7 +1,12 @@
{
- "type" : "object",
- "$schema" : "http://json-schema.org/draft-03/schema",
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.twitter.Twitter",
+ "javaInterfaces": ["java.io.Serializable"],
"properties" :
{
"created_at" :
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterMedia.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterMedia.json
index 2084932..ee19320 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterMedia.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterMedia.json
@@ -1,6 +1,12 @@
{
- "type" : "object",
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.datasift.twitter.Media",
+ "javaInterfaces": ["java.io.Serializable"],
"properties" :
{
"display_url" :
diff --git a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterUser.json b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterUser.json
index 3be49ff..d444ee0 100644
--- a/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterUser.json
+++ b/streams-contrib/streams-provider-datasift/src/main/jsonschema/org/apache/streams/datasift/twitter/DatasiftTwitterUser.json
@@ -1,7 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
"javaType": "org.apache.streams.datasift.twitter.DatasiftTwitterUser",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"created_at": {
"type": "string",
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
index 8f7ad43..1cdd0cf 100644
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftActivitySerializerTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.serializer;
import com.fasterxml.jackson.databind.JsonNode;
@@ -10,10 +28,13 @@
import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.pojo.json.Activity;
import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.util.files.StreamsScannerUtil;
import org.junit.Before;
import org.junit.Test;
+import java.io.InputStream;
import java.util.Scanner;
+import java.util.regex.Pattern;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -31,7 +52,9 @@
@Test
public void testConversion() throws Exception {
- Scanner scanner = new Scanner(DatasiftActivitySerializerTest.class.getResourceAsStream("/rand_sample_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
try {
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftEventClassifierTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftEventClassifierTest.java
index fda57c4..a29d0f4 100644
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftEventClassifierTest.java
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftEventClassifierTest.java
@@ -25,9 +25,12 @@
import org.apache.streams.datasift.twitter.Twitter;
import org.apache.streams.datasift.util.StreamsDatasiftMapper;
import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.util.files.StreamsScannerUtil;
import org.junit.Test;
+import java.io.InputStream;
import java.util.Scanner;
+import java.util.regex.Pattern;
/**
* Created by sblackmon on 12/13/13.
@@ -38,7 +41,9 @@
@Test
public void testTwitterDetection() throws Exception {
- Scanner scanner = new Scanner(DatasiftActivitySerializerTest.class.getResourceAsStream("/twitter_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/twitter_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
line = scanner.nextLine();
@@ -50,7 +55,9 @@
@Test
public void testInstagramDetection() throws Exception {
- Scanner scanner = new Scanner(DatasiftActivitySerializerTest.class.getResourceAsStream("/instagram_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/instagram_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
line = scanner.nextLine();
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
index 5350d74..ad7ea5c 100644
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInstagramActivitySerializerTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.serializer;
import com.fasterxml.jackson.databind.JsonNode;
@@ -9,9 +27,11 @@
import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.pojo.json.Activity;
import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.util.files.StreamsScannerUtil;
import org.junit.Before;
import org.junit.Test;
+import java.io.InputStream;
import java.util.Scanner;
import static org.junit.Assert.assertEquals;
@@ -28,7 +48,9 @@
@Test
@Override
public void testConversion() throws Exception {
- Scanner scanner = new Scanner(DatasiftActivitySerializerTest.class.getResourceAsStream("/instagram_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/instagram_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
line = scanner.nextLine();
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
index 21d4ebb..68e041b 100644
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftInteractionActivitySerializerTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.serializer;
import com.fasterxml.jackson.databind.JsonNode;
@@ -9,9 +27,11 @@
import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.pojo.json.Activity;
import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.util.files.StreamsScannerUtil;
import org.junit.Before;
import org.junit.Test;
+import java.io.InputStream;
import java.util.Scanner;
import static org.junit.Assert.assertEquals;
@@ -28,7 +48,9 @@
@Test
@Override
public void testConversion() throws Exception {
- Scanner scanner = new Scanner(DatasiftInteractionActivitySerializerTest.class.getResourceAsStream("/rand_sample_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/rand_sample_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
try {
diff --git a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
index 33b1f77..652d381 100644
--- a/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
+++ b/streams-contrib/streams-provider-datasift/src/test/java17/org/apache/streams/datasift/serializer/DatasiftTwitterActivitySerializerTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.datasift.serializer;
import com.fasterxml.jackson.databind.JsonNode;
@@ -9,10 +27,14 @@
import org.apache.streams.jackson.StreamsJacksonMapper;
import org.apache.streams.pojo.json.Activity;
import org.apache.streams.pojo.json.Actor;
+import org.apache.streams.util.files.StreamsScannerUtil;
import org.junit.Before;
import org.junit.Test;
+import java.io.InputStream;
+import java.net.URL;
import java.util.Scanner;
+import java.util.regex.Pattern;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -28,7 +50,9 @@
@Test
@Override
public void testConversion() throws Exception {
- Scanner scanner = new Scanner(DatasiftTwitterActivitySerializerTest.class.getResourceAsStream("/twitter_datasift_json.txt"));
+
+ Scanner scanner = StreamsScannerUtil.getInstance("/twitter_datasift_json.txt");
+
String line = null;
while(scanner.hasNextLine()) {
line = scanner.nextLine();
diff --git a/streams-contrib/streams-provider-facebook/README.md b/streams-contrib/streams-provider-facebook/README.md
new file mode 100644
index 0000000..ad58d68
--- /dev/null
+++ b/streams-contrib/streams-provider-facebook/README.md
@@ -0,0 +1,17 @@
+streams-provider-facebook
+=====================
+
+Facebook Provider
+
+Example configuration:
+
+ facebook {
+ oauth {
+ appId = ""
+ appSecret = ""
+ accessToken = ""
+ }
+ }
+
+
+
diff --git a/streams-contrib/streams-provider-facebook/metadata/facebook_post.mup b/streams-contrib/streams-provider-facebook/metadata/facebook_post.mup
index ccedae4..9668633 100644
--- a/streams-contrib/streams-provider-facebook/metadata/facebook_post.mup
+++ b/streams-contrib/streams-provider-facebook/metadata/facebook_post.mup
@@ -1,694 +1,697 @@
{
- "title": "Serializer",
- "id": 1,
- "formatVersion": 2,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "Activity",
- "id": 2,
- "ideas": {
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "title": "Serializer",
+ "id": 1,
+ "formatVersion": 2,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
"1": {
- "title": "actor",
- "id": 4,
- "ideas": {
- "1": {
- "title": "summary",
- "id": 28
- },
- "7": {
- "title": "url",
- "id": 41
- },
- "0.5": {
- "title": "displayName",
- "id": 32,
- "attr": {
- "style": {}
- }
- },
- "0.75": {
- "title": "extensions",
- "id": 33,
- "ideas": {
+ "title": "Activity",
+ "id": 2,
+ "ideas": {
"1": {
- "title": "followers",
- "id": 34
+ "title": "actor",
+ "id": 4,
+ "ideas": {
+ "1": {
+ "title": "summary",
+ "id": 28
+ },
+ "7": {
+ "title": "url",
+ "id": 41
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 32,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.75": {
+ "title": "extensions",
+ "id": 33,
+ "ideas": {
+ "1": {
+ "title": "followers",
+ "id": 34
+ },
+ "2": {
+ "title": "handle",
+ "id": 35
+ },
+ "3": {
+ "title": "location",
+ "id": 36
+ },
+ "4": {
+ "title": "location",
+ "id": 37
+ },
+ "5": {
+ "title": "screenName",
+ "id": 38
+ },
+ "6": {
+ "title": "posts",
+ "id": 39
+ },
+ "7": {
+ "title": "favorites",
+ "id": 40
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.875": {
+ "title": "handle",
+ "id": 30,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.9375": {
+ "title": "id",
+ "id": 29,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.96875": {
+ "title": "image",
+ "id": 31,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
},
"2": {
- "title": "handle",
- "id": 35
+ "title": "id",
+ "id": 5
},
"3": {
- "title": "location",
- "id": 36
+ "title": "verb",
+ "id": 6
+ },
+ "1.5": {
+ "title": "content",
+ "id": 16,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.5": {
+ "title": "icon",
+ "id": 13,
+ "attr": {
+ "style": {}
+ }
+ },
+ "1.75": {
+ "title": "generator",
+ "id": 12,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 62
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 63,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.75": {
+ "title": "links",
+ "id": 18,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.875": {
+ "title": "object",
+ "id": 8,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "content",
+ "id": 22
+ },
+ "2": {
+ "title": "id",
+ "id": 23
+ },
+ "4": {
+ "title": "objectType",
+ "id": 25
+ },
+ "1.5": {
+ "title": "geo",
+ "id": 24,
+ "ideas": {
+ "1": {
+ "title": "coordinates",
+ "id": 26
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.9375": {
+ "title": "published",
+ "id": 10,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {}
+ },
+ "2.90625": {
+ "title": "provider",
+ "id": 14,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 20
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 21,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.96875": {
+ "title": "target",
+ "id": 9,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 64
+ },
+ "2": {
+ "title": "image",
+ "id": 65
+ },
+ "4": {
+ "title": "summary",
+ "id": 67
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 66,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.25": {
+ "title": "content",
+ "id": 68,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.984375": {
+ "title": "updated",
+ "id": 11,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.9765625": {
+ "title": "title",
+ "id": 15,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.9921875": {
+ "title": "url",
+ "id": 17,
+ "attr": {
+ "style": {}
+ }
+ },
+ "1.625": {
+ "title": "extensions",
+ "id": 42,
+ "ideas": {
+ "1": {
+ "title": "facebook",
+ "id": 43,
+ "ideas": {}
+ },
+ "6": {
+ "title": "user_mentions",
+ "id": 58,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 59
+ },
+ "2": {
+ "title": "handle",
+ "id": 60
+ },
+ "3": {
+ "title": "displayName",
+ "id": 61
+ }
+ }
+ },
+ "0.5": {
+ "title": "hashtags",
+ "id": 57,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.75": {
+ "title": "location",
+ "id": 48,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 49
+ },
+ "2": {
+ "title": "coordinates",
+ "id": 50,
+ "ideas": {
+ "1": {
+ "title": "type",
+ "id": 52
+ },
+ "2": {
+ "title": "coordinates",
+ "id": 53
+ }
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.625": {
+ "title": "likes",
+ "id": 54,
+ "ideas": {
+ "1": {
+ "title": "perspectival",
+ "id": 55
+ },
+ "2": {
+ "title": "count",
+ "id": 56
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.875": {
+ "title": "rebroadcasts",
+ "id": 45,
+ "ideas": {
+ "1": {
+ "title": "perspectival",
+ "id": 46
+ },
+ "2": {
+ "title": "count",
+ "id": 47
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "-1": {
+ "title": "Facebook Post",
+ "id": 3,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 69
+ },
+ "2": {
+ "title": "likes",
+ "id": 92,
+ "ideas": {
+ "1": {
+ "title": "data",
+ "id": 93,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 94
+ },
+ "2": {
+ "title": "name",
+ "id": 95
+ }
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "3": {
+ "title": "message",
+ "id": 74
},
"4": {
- "title": "location",
- "id": 37
- },
- "5": {
- "title": "screenName",
- "id": 38
- },
- "6": {
- "title": "posts",
- "id": 39
+ "title": "picture",
+ "id": 75
},
"7": {
- "title": "favorites",
- "id": 40
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.875": {
- "title": "handle",
- "id": 30,
- "attr": {
- "style": {}
- }
- },
- "0.9375": {
- "title": "id",
- "id": 29,
- "attr": {
- "style": {}
- }
- },
- "0.96875": {
- "title": "image",
- "id": 31,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2": {
- "title": "id",
- "id": 5
- },
- "3": {
- "title": "verb",
- "id": 6
- },
- "1.5": {
- "title": "content",
- "id": 16,
- "attr": {
- "style": {}
- }
- },
- "2.5": {
- "title": "icon",
- "id": 13,
- "attr": {
- "style": {}
- }
- },
- "1.75": {
- "title": "generator",
- "id": 12,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 62
- },
- "0.5": {
- "title": "displayName",
- "id": 63,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.75": {
- "title": "links",
- "id": 18,
- "attr": {
- "style": {}
- }
- },
- "2.875": {
- "title": "object",
- "id": 8,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "content",
- "id": 22
- },
- "2": {
- "title": "id",
- "id": 23
- },
- "4": {
- "title": "objectType",
- "id": 25
- },
- "1.5": {
- "title": "geo",
- "id": 24,
- "ideas": {
- "1": {
- "title": "coordinates",
- "id": 26
- }
- },
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.9375": {
- "title": "published",
- "id": 10,
- "attr": {
- "style": {}
- },
- "ideas": {}
- },
- "2.90625": {
- "title": "provider",
- "id": 14,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 20
- },
- "0.5": {
- "title": "displayName",
- "id": 21,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.96875": {
- "title": "target",
- "id": 9,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 64
- },
- "2": {
- "title": "image",
- "id": 65
- },
- "4": {
- "title": "summary",
- "id": 67
- },
- "0.5": {
- "title": "displayName",
- "id": 66,
- "attr": {
- "style": {}
- }
- },
- "0.25": {
- "title": "content",
- "id": 68,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.984375": {
- "title": "updated",
- "id": 11,
- "attr": {
- "style": {}
- }
- },
- "2.9765625": {
- "title": "title",
- "id": 15,
- "attr": {
- "style": {}
- }
- },
- "2.9921875": {
- "title": "url",
- "id": 17,
- "attr": {
- "style": {}
- }
- },
- "1.625": {
- "title": "extensions",
- "id": 42,
- "ideas": {
- "1": {
- "title": "facebook",
- "id": 43,
- "ideas": {}
- },
- "6": {
- "title": "user_mentions",
- "id": 58,
- "ideas": {
- "1": {
- "title": "id",
- "id": 59
- },
- "2": {
- "title": "handle",
- "id": 60
- },
- "3": {
- "title": "displayName",
- "id": 61
- }
- }
- },
- "0.5": {
- "title": "hashtags",
- "id": 57,
- "attr": {
- "style": {}
- }
- },
- "0.75": {
- "title": "location",
- "id": 48,
- "ideas": {
- "1": {
- "title": "id",
- "id": 49
- },
- "2": {
- "title": "coordinates",
- "id": 50,
- "ideas": {
- "1": {
- "title": "type",
- "id": 52
+ "title": "shares",
+ "id": 97,
+ "ideas": {
+ "1": {
+ "title": "count",
+ "id": 98
+ }
},
- "2": {
- "title": "coordinates",
- "id": 53
+ "attr": {
+ "style": {}
}
- }
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.625": {
- "title": "likes",
- "id": 54,
- "ideas": {
- "1": {
- "title": "perspectival",
- "id": 55
},
- "2": {
- "title": "count",
- "id": 56
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.875": {
- "title": "rebroadcasts",
- "id": 45,
- "ideas": {
- "1": {
- "title": "perspectival",
- "id": 46
+ "10": {
+ "title": "type",
+ "id": 96
},
- "2": {
- "title": "count",
- "id": 47
- }
- },
- "attr": {
- "style": {}
- }
- }
- },
- "attr": {
- "style": {}
- }
- }
- }
- },
- "-1": {
- "title": "Facebook Post",
- "id": 3,
- "ideas": {
- "1": {
- "title": "id",
- "id": 69
- },
- "2": {
- "title": "likes",
- "id": 92,
- "ideas": {
- "1": {
- "title": "data",
- "id": 93,
- "ideas": {
- "1": {
- "title": "id",
- "id": 94
- },
- "2": {
- "title": "name",
- "id": 95
- }
- }
- }
- },
- "attr": {
- "style": {}
- }
- },
- "3": {
- "title": "message",
- "id": 74
- },
- "4": {
- "title": "picture",
- "id": 75
- },
- "7": {
- "title": "shares",
- "id": 97,
- "ideas": {
- "1": {
- "title": "count",
- "id": 98
- }
- },
- "attr": {
- "style": {}
- }
- },
- "10": {
- "title": "type",
- "id": 96
- },
- "15": {
- "title": "updated_time",
- "id": 105
- },
- "0.5": {
- "title": "actions",
- "id": 78,
- "ideas": {
- "1": {
- "title": "name",
- "id": 79
- },
- "0.5": {
- "title": "link",
- "id": 80,
- "attr": {
- "style": {}
- }
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.75": {
- "title": "application",
- "id": 100,
- "ideas": {
- "1": {
- "title": "name",
- "id": 101
- },
- "3": {
- "title": "namespace",
- "id": 103
- },
- "0.5": {
- "title": "id",
- "id": 102,
- "attr": {
- "style": {}
- }
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.875": {
- "title": "comments",
- "id": 81,
- "ideas": {
- "1": {
- "title": "data",
- "id": 82,
- "ideas": {
- "1": {
- "title": "user_likes",
- "id": 83
+ "15": {
+ "title": "updated_time",
+ "id": 105
},
"0.5": {
- "title": "can_remove",
- "id": 87,
- "attr": {
- "style": {}
- }
+ "title": "actions",
+ "id": 78,
+ "ideas": {
+ "1": {
+ "title": "name",
+ "id": 79
+ },
+ "0.5": {
+ "title": "link",
+ "id": 80,
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
},
"0.75": {
- "title": "created_time",
- "id": 91,
- "attr": {
- "style": {}
- }
+ "title": "application",
+ "id": 100,
+ "ideas": {
+ "1": {
+ "title": "name",
+ "id": 101
+ },
+ "3": {
+ "title": "namespace",
+ "id": 103
+ },
+ "0.5": {
+ "title": "id",
+ "id": 102,
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
},
"0.875": {
- "title": "id",
- "id": 85,
- "attr": {
- "style": {}
- },
- "ideas": {}
- },
- "0.8125": {
- "title": "from",
- "id": 88,
- "ideas": {
- "1": {
- "title": "id",
- "id": 89
+ "title": "comments",
+ "id": 81,
+ "ideas": {
+ "1": {
+ "title": "data",
+ "id": 82,
+ "ideas": {
+ "1": {
+ "title": "user_likes",
+ "id": 83
+ },
+ "0.5": {
+ "title": "can_remove",
+ "id": 87,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.75": {
+ "title": "created_time",
+ "id": 91,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.875": {
+ "title": "id",
+ "id": 85,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {}
+ },
+ "0.8125": {
+ "title": "from",
+ "id": 88,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 89
+ },
+ "2": {
+ "title": "name",
+ "id": 90
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.9375": {
+ "title": "like_count",
+ "id": 86,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.96875": {
+ "title": "message",
+ "id": 84,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ }
},
- "2": {
- "title": "name",
- "id": 90
+ "attr": {
+ "style": {}
}
- },
- "attr": {
- "style": {}
- }
},
"0.9375": {
- "title": "like_count",
- "id": 86,
- "attr": {
- "style": {}
- }
+ "title": "from",
+ "id": 70,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 71
+ },
+ "2": {
+ "title": "name",
+ "id": 72
+ },
+ "0.5": {
+ "title": "category",
+ "id": 73,
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
},
"0.96875": {
- "title": "message",
- "id": 84,
- "attr": {
- "style": {}
- }
+ "title": "icon",
+ "id": 77,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.5": {
+ "title": "link",
+ "id": 76,
+ "attr": {
+ "style": {}
+ }
+ },
+ "3.5": {
+ "title": "object_id",
+ "id": 99,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.8125": {
+ "title": "created_time",
+ "id": 104,
+ "attr": {
+ "style": {}
+ }
}
- }
}
- },
- "attr": {
- "style": {}
- }
- },
- "0.9375": {
- "title": "from",
- "id": 70,
- "ideas": {
- "1": {
- "title": "id",
- "id": 71
- },
- "2": {
- "title": "name",
- "id": 72
- },
- "0.5": {
- "title": "category",
- "id": 73,
- "attr": {
- "style": {}
- }
+ }
+ },
+ "links": [
+ {
+ "ideaIdFrom": 104,
+ "ideaIdTo": 10,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
}
- },
- "attr": {
- "style": {}
- }
},
- "0.96875": {
- "title": "icon",
- "id": 77,
- "attr": {
- "style": {}
- }
+ {
+ "ideaIdFrom": 21,
+ "ideaIdTo": 101,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
},
- "2.5": {
- "title": "link",
- "id": 76,
- "attr": {
- "style": {}
- }
+ {
+ "ideaIdFrom": 102,
+ "ideaIdTo": 20,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
},
- "3.5": {
- "title": "object_id",
- "id": 99,
- "attr": {
- "style": {}
- }
+ {
+ "ideaIdFrom": 43,
+ "ideaIdTo": 3,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
},
- "0.8125": {
- "title": "created_time",
- "id": 104,
- "attr": {
- "style": {}
- }
+ {
+ "ideaIdFrom": 72,
+ "ideaIdTo": 32,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 13,
+ "ideaIdTo": 77,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 18,
+ "ideaIdTo": 76,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 74,
+ "ideaIdTo": 16,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 98,
+ "ideaIdTo": 47,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 105,
+ "ideaIdTo": 11,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
}
- }
- }
- },
- "links": [
- {
- "ideaIdFrom": 104,
- "ideaIdTo": 10,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 21,
- "ideaIdTo": 101,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 102,
- "ideaIdTo": 20,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 43,
- "ideaIdTo": 3,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 72,
- "ideaIdTo": 32,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 13,
- "ideaIdTo": 77,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 18,
- "ideaIdTo": 76,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 74,
- "ideaIdTo": 16,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 98,
- "ideaIdTo": 47,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 105,
- "ideaIdTo": 11,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- }
- ]
+ ]
}
\ No newline at end of file
diff --git a/streams-contrib/streams-provider-facebook/pom.xml b/streams-contrib/streams-provider-facebook/pom.xml
index c3c3603..261918f 100644
--- a/streams-contrib/streams-provider-facebook/pom.xml
+++ b/streams-contrib/streams-provider-facebook/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookActivityUtil.java b/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookActivityUtil.java
index 62743af..66d06ef 100644
--- a/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookActivityUtil.java
+++ b/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookActivityUtil.java
@@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.streams.facebook.serializer;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookStreamsPostSerializer.java b/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookStreamsPostSerializer.java
index 3c5cae6..3375931 100644
--- a/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookStreamsPostSerializer.java
+++ b/streams-contrib/streams-provider-facebook/src/main/java/org/apache/streams/facebook/serializer/FacebookStreamsPostSerializer.java
@@ -1,3 +1,21 @@
+/*
+ * 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.facebook.serializer;
import org.apache.streams.data.ActivitySerializer;
diff --git a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookConfiguration.json b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookConfiguration.json
index 3356623..cab7c1b 100644
--- a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookConfiguration.json
+++ b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.facebook.FacebookConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserInformationConfiguration.json b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserInformationConfiguration.json
index b351be9..e9dea97 100644
--- a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserInformationConfiguration.json
+++ b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserInformationConfiguration.json
@@ -1,11 +1,13 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.facebook.FacebookUserInformationConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"extends": {"$ref":"FacebookConfiguration.json"},
- "javaInterfaces": ["java.io.Serializable"],
"properties": {
"info": {
"type": "array",
diff --git a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserstreamConfiguration.json b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserstreamConfiguration.json
index bcb2258..86fc484 100644
--- a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserstreamConfiguration.json
+++ b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/FacebookUserstreamConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.facebook.FacebookUserstreamConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"extends": {"$ref":"FacebookConfiguration.json"},
diff --git a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/Page.json b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/Page.json
index 31a3bc5..6d7cdeb 100644
--- a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/Page.json
+++ b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/Page.json
@@ -1,168 +1,171 @@
-{
- "type":"object",
- "$schema":"http://json-schema.org/draft-03/schema",
- "id":"#",
- "javaType":"org.apache.streams.facebook.Page",
- "javaInterfaces":[
- "java.io.Serializable"
- ],
- "properties":{
- "about":{
- "type":"string",
- "required":false
- },
- "username":{
- "type":"string",
- "required":false
- },
- "accessToken":{
- "type":"null",
- "id":"http://jsonschema.net/accessToken",
- "required":false
- },
- "category":{
- "type":"string",
- "id":"http://jsonschema.net/category",
- "required":false
- },
- "checkins":{
- "type":"integer",
- "id":"http://jsonschema.net/checkins",
- "required":false
- },
- "communityPage":{
- "type":"boolean",
- "id":"http://jsonschema.net/communityPage",
- "required":false
- },
- "cover":{
- "type":"object",
- "id":"http://jsonschema.net/cover",
- "required":false,
- "properties":{
- "id":{
- "type":"null",
- "id":"http://jsonschema.net/cover/id",
- "required":false
- },
- "offsetY":{
- "type":"number",
- "id":"http://jsonschema.net/cover/offsetY",
- "required":false
- },
- "source":{
- "type":"string",
- "id":"http://jsonschema.net/cover/source",
- "required":false
+{
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "javaType": "org.apache.streams.facebook.Page",
+ "javaInterfaces": [
+ "java.io.Serializable"
+ ],
+ "properties": {
+ "about": {
+ "type": "string",
+ "required": false
+ },
+ "username": {
+ "type": "string",
+ "required": false
+ },
+ "accessToken": {
+ "type": "null",
+ "id": "http://jsonschema.net/accessToken",
+ "required": false
+ },
+ "category": {
+ "type": "string",
+ "id": "http://jsonschema.net/category",
+ "required": false
+ },
+ "checkins": {
+ "type": "integer",
+ "id": "http://jsonschema.net/checkins",
+ "required": false
+ },
+ "communityPage": {
+ "type": "boolean",
+ "id": "http://jsonschema.net/communityPage",
+ "required": false
+ },
+ "cover": {
+ "type": "object",
+ "id": "http://jsonschema.net/cover",
+ "required": false,
+ "properties": {
+ "id": {
+ "type": "null",
+ "id": "http://jsonschema.net/cover/id",
+ "required": false
+ },
+ "offsetY": {
+ "type": "number",
+ "id": "http://jsonschema.net/cover/offsetY",
+ "required": false
+ },
+ "source": {
+ "type": "string",
+ "id": "http://jsonschema.net/cover/source",
+ "required": false
+ }
}
- }
- },
- "createdTime":{
- "type":"null",
- "id":"http://jsonschema.net/createdTime",
- "required":false
- },
- "id":{
- "type":"string",
- "id":"http://jsonschema.net/id",
- "required":false
- },
- "likes":{
- "type":"integer",
- "id":"http://jsonschema.net/likes",
- "required":false
- },
- "link":{
- "type":"string",
- "id":"http://jsonschema.net/link",
- "required":false
- },
- "location":{
- "type":"object",
- "id":"http://jsonschema.net/location",
- "required":false,
- "properties":{
- "city":{
- "type":"string",
- "id":"http://jsonschema.net/location/city",
- "required":false
- },
- "country":{
- "type":"string",
- "id":"http://jsonschema.net/location/country",
- "required":false
- },
- "latitude":{
- "type":"null",
- "id":"http://jsonschema.net/location/latitude",
- "required":false
- },
- "longitude":{
- "type":"null",
- "id":"http://jsonschema.net/location/longitude",
- "required":false
- },
- "state":{
- "type":"string",
- "id":"http://jsonschema.net/location/state",
- "required":false
- },
- "street":{
- "type":"string",
- "id":"http://jsonschema.net/location/street",
- "required":false
- },
- "text":{
- "type":"null",
- "id":"http://jsonschema.net/location/text",
- "required":false
- },
- "zip":{
- "type":"string",
- "id":"http://jsonschema.net/location/zip",
- "required":false
+ },
+ "createdTime": {
+ "type": "null",
+ "id": "http://jsonschema.net/createdTime",
+ "required": false
+ },
+ "id": {
+ "type": "string",
+ "id": "http://jsonschema.net/id",
+ "required": false
+ },
+ "likes": {
+ "type": "integer",
+ "id": "http://jsonschema.net/likes",
+ "required": false
+ },
+ "link": {
+ "type": "string",
+ "id": "http://jsonschema.net/link",
+ "required": false
+ },
+ "location": {
+ "type": "object",
+ "id": "http://jsonschema.net/location",
+ "required": false,
+ "properties": {
+ "city": {
+ "type": "string",
+ "id": "http://jsonschema.net/location/city",
+ "required": false
+ },
+ "country": {
+ "type": "string",
+ "id": "http://jsonschema.net/location/country",
+ "required": false
+ },
+ "latitude": {
+ "type": "null",
+ "id": "http://jsonschema.net/location/latitude",
+ "required": false
+ },
+ "longitude": {
+ "type": "null",
+ "id": "http://jsonschema.net/location/longitude",
+ "required": false
+ },
+ "state": {
+ "type": "string",
+ "id": "http://jsonschema.net/location/state",
+ "required": false
+ },
+ "street": {
+ "type": "string",
+ "id": "http://jsonschema.net/location/street",
+ "required": false
+ },
+ "text": {
+ "type": "null",
+ "id": "http://jsonschema.net/location/text",
+ "required": false
+ },
+ "zip": {
+ "type": "string",
+ "id": "http://jsonschema.net/location/zip",
+ "required": false
+ }
}
- }
- },
- "metadata":{
- "type":"null",
- "id":"http://jsonschema.net/metadata",
- "required":false
- },
- "name":{
- "type":"string",
- "id":"http://jsonschema.net/name",
- "required":false
- },
- "phone":{
- "type":"string",
- "id":"http://jsonschema.net/phone",
- "required":false
- },
- "picture":{
- "type":"null",
- "id":"http://jsonschema.net/picture",
- "required":false
- },
- "published":{
- "type":"boolean",
- "id":"http://jsonschema.net/published",
- "required":false
- },
- "talkingAboutCount":{
- "type":"integer",
- "id":"http://jsonschema.net/talkingAboutCount",
- "required":false
- },
- "website":{
- "type":"string",
- "id":"http://jsonschema.net/website",
- "required":false
- },
- "wereHereCount":{
- "type":"integer",
- "id":"http://jsonschema.net/wereHereCount",
- "required":false
- }
- }
+ },
+ "metadata": {
+ "type": "null",
+ "id": "http://jsonschema.net/metadata",
+ "required": false
+ },
+ "name": {
+ "type": "string",
+ "id": "http://jsonschema.net/name",
+ "required": false
+ },
+ "phone": {
+ "type": "string",
+ "id": "http://jsonschema.net/phone",
+ "required": false
+ },
+ "picture": {
+ "type": "null",
+ "id": "http://jsonschema.net/picture",
+ "required": false
+ },
+ "published": {
+ "type": "boolean",
+ "id": "http://jsonschema.net/published",
+ "required": false
+ },
+ "talkingAboutCount": {
+ "type": "integer",
+ "id": "http://jsonschema.net/talkingAboutCount",
+ "required": false
+ },
+ "website": {
+ "type": "string",
+ "id": "http://jsonschema.net/website",
+ "required": false
+ },
+ "wereHereCount": {
+ "type": "integer",
+ "id": "http://jsonschema.net/wereHereCount",
+ "required": false
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/graph/Post.json b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/graph/Post.json
index 23bcb08..487013c 100644
--- a/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/graph/Post.json
+++ b/streams-contrib/streams-provider-facebook/src/main/jsonschema/org/apache/streams/facebook/graph/Post.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType": "org.apache.streams.facebook.Post",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"id": {
"type": "string"
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml
index 8563504..30491b4 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-facebook/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-flickr/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-flickr/pom.xml
index a586062..ec7e4c0 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-flickr/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-flickr/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-googleplus/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-googleplus/pom.xml
index cf0966b..9a20e2e 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-googleplus/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-googleplus/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-instagram/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-instagram/pom.xml
index 5f299e3..5e326dd 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-instagram/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-instagram/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-instagram/src/main/jsonschema/com/instagram/Instagram.json b/streams-contrib/streams-provider-gnip/gnip-edc-instagram/src/main/jsonschema/com/instagram/Instagram.json
index 029f6e9..0c9e4c0 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-instagram/src/main/jsonschema/com/instagram/Instagram.json
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-instagram/src/main/jsonschema/com/instagram/Instagram.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "com.instagram.pojo.Instagram",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"caption": {
"type": "object",
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-reddit/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-reddit/pom.xml
index d3b8516..0061b32 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-reddit/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-reddit/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-edc-youtube/pom.xml b/streams-contrib/streams-provider-gnip/gnip-edc-youtube/pom.xml
index 7c856a6..4719f05 100644
--- a/streams-contrib/streams-provider-gnip/gnip-edc-youtube/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-edc-youtube/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-powertrack/pom.xml b/streams-contrib/streams-provider-gnip/gnip-powertrack/pom.xml
index 3737b2a..7819400 100644
--- a/streams-contrib/streams-provider-gnip/gnip-powertrack/pom.xml
+++ b/streams-contrib/streams-provider-gnip/gnip-powertrack/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/jsonschema/com/gnip/Gnip.json b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/jsonschema/com/gnip/Gnip.json
index 3cc24ca..ec3a468 100644
--- a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/jsonschema/com/gnip/Gnip.json
+++ b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/jsonschema/com/gnip/Gnip.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
- "javaType": "com.gnip.pojo.Gnip",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
+ "javaType": "com.gnip.pojo.Gnip",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"profileLocations": {
"properties": {
diff --git a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/binding.xjb b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/binding.xjb
index 0f31d3c..d94a76b 100644
--- a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/binding.xjb
+++ b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/binding.xjb
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
diff --git a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/entry.xsd b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/entry.xsd
index 04119e9..da7cf99 100644
--- a/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/entry.xsd
+++ b/streams-contrib/streams-provider-gnip/gnip-powertrack/src/main/xmlschema/com/gnip/entry.xsd
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="entry" type="entry"/>
diff --git a/streams-contrib/streams-provider-gnip/pom.xml b/streams-contrib/streams-provider-gnip/pom.xml
index 8b151b8..327bba8 100644
--- a/streams-contrib/streams-provider-gnip/pom.xml
+++ b/streams-contrib/streams-provider-gnip/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-google/google-gmail/README.md b/streams-contrib/streams-provider-google/google-gmail/README.md
new file mode 100644
index 0000000..fe2d138
--- /dev/null
+++ b/streams-contrib/streams-provider-google/google-gmail/README.md
@@ -0,0 +1,14 @@
+google-gmail
+=====================
+
+GMail Provider
+
+Example configuration:
+
+ gmail {
+ username = ""
+ password = ""
+ }
+
+
+
diff --git a/streams-contrib/streams-provider-google/google-gmail/pom.xml b/streams-contrib/streams-provider-google/google-gmail/pom.xml
index b92e1a7..3d03c9e 100644
--- a/streams-contrib/streams-provider-google/google-gmail/pom.xml
+++ b/streams-contrib/streams-provider-google/google-gmail/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-google/google-gmail/src/main/jsonschema/com/google/gmail/GMailConfiguration.json b/streams-contrib/streams-provider-google/google-gmail/src/main/jsonschema/com/google/gmail/GMailConfiguration.json
index b25d5e0..2a6a468 100644
--- a/streams-contrib/streams-provider-google/google-gmail/src/main/jsonschema/com/google/gmail/GMailConfiguration.json
+++ b/streams-contrib/streams-provider-google/google-gmail/src/main/jsonschema/com/google/gmail/GMailConfiguration.json
@@ -1,8 +1,11 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
"javaType" : "com.google.gmail.GMailConfiguration",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"userName": {
"type": "string"
diff --git a/streams-contrib/streams-provider-google/google-gplus/README.md b/streams-contrib/streams-provider-google/google-gplus/README.md
new file mode 100644
index 0000000..b2175a0
--- /dev/null
+++ b/streams-contrib/streams-provider-google/google-gplus/README.md
@@ -0,0 +1,22 @@
+google-gplus
+=====================
+
+Google+ Provider
+
+Example configuration:
+
+ gplus {
+ googlePlusUsers = [
+ {
+ userId = ""
+ }
+ ]
+ oauth {
+ appName = ""
+ pathToP12KeyFile = "Absolute Path to key file"
+ serviceAccountEmailAddress = ""
+ }
+ }
+
+
+
diff --git a/streams-contrib/streams-provider-google/google-gplus/pom.xml b/streams-contrib/streams-provider-google/google-gplus/pom.xml
index 17e6210..6a87a7f 100644
--- a/streams-contrib/streams-provider-google/google-gplus/pom.xml
+++ b/streams-contrib/streams-provider-google/google-gplus/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusDataCollector.java b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusDataCollector.java
index 1894dc4..5be2f9c 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusDataCollector.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusDataCollector.java
@@ -1,3 +1,21 @@
+/*
+ * 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 com.google.gplus.provider;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityCollector.java b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityCollector.java
index f1824b5..d76e225 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityCollector.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityCollector.java
@@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package com.google.gplus.provider;
import com.fasterxml.jackson.core.JsonGenerationException;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityProvider.java b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityProvider.java
index a80a7ab..933feab 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityProvider.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserActivityProvider.java
@@ -1,3 +1,21 @@
+/*
+ * 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 com.google.gplus.provider;
import com.google.api.services.plus.Plus;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataCollector.java b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataCollector.java
index 65ef9b1..90efd99 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataCollector.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataCollector.java
@@ -1,3 +1,21 @@
+/*
+ * 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 com.google.gplus.provider;
import com.fasterxml.jackson.databind.DeserializationFeature;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataProvider.java b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataProvider.java
index e2c8c5c..1833d41 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataProvider.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/java/com/google/gplus/provider/GPlusUserDataProvider.java
@@ -1,3 +1,21 @@
+/*
+ * 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 com.google.gplus.provider;
import com.google.api.services.plus.Plus;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/main/jsonschema/com/google/gplus/GPlusConfiguration.json b/streams-contrib/streams-provider-google/google-gplus/src/main/jsonschema/com/google/gplus/GPlusConfiguration.json
index 0b96694..3b7795b 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/main/jsonschema/com/google/gplus/GPlusConfiguration.json
+++ b/streams-contrib/streams-provider-google/google-gplus/src/main/jsonschema/com/google/gplus/GPlusConfiguration.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.google.gplus.GPlusConfiguration",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"protocol": {
"type": "string",
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestAbstractGPlusProvider.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestAbstractGPlusProvider.java
index d5cfb2c..f7b3dfb 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestAbstractGPlusProvider.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestAbstractGPlusProvider.java
@@ -1,3 +1,22 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 com.google.gplus.provider;
import com.carrotsearch.randomizedtesting.RandomizedTest;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserActivityCollector.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserActivityCollector.java
index 1484af5..3afaec4 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserActivityCollector.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserActivityCollector.java
@@ -1,3 +1,22 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 com.google.gplus.provider;
import com.carrotsearch.randomizedtesting.RandomizedTest;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserDataCollector.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserDataCollector.java
index 784e1b5..1251b9a 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserDataCollector.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/provider/TestGPlusUserDataCollector.java
@@ -1,3 +1,22 @@
+/*
+ * 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
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 com.google.gplus.provider;
import com.google.api.client.googleapis.json.GoogleJsonResponseException;
diff --git a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/serializer/util/GPlusEventClassifierTest.java b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/serializer/util/GPlusEventClassifierTest.java
index 308afe0..8b4c29b 100644
--- a/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/serializer/util/GPlusEventClassifierTest.java
+++ b/streams-contrib/streams-provider-google/google-gplus/src/test/java/com/google/gplus/serializer/util/GPlusEventClassifierTest.java
@@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package com.google.gplus.serializer.util;
import com.fasterxml.jackson.databind.node.ObjectNode;
diff --git a/streams-contrib/streams-provider-google/pom.xml b/streams-contrib/streams-provider-google/pom.xml
index 4ff3adb..a884f5a 100644
--- a/streams-contrib/streams-provider-google/pom.xml
+++ b/streams-contrib/streams-provider-google/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-instagram/README.md b/streams-contrib/streams-provider-instagram/README.md
index 3bca23b..95de3f3 100644
--- a/streams-contrib/streams-provider-instagram/README.md
+++ b/streams-contrib/streams-provider-instagram/README.md
@@ -1,4 +1,5 @@
streams-provider-instagram
+==========================
Purpose
diff --git a/streams-contrib/streams-provider-instagram/metadata/InstagramMediaDataActivitySerializer.mup b/streams-contrib/streams-provider-instagram/metadata/InstagramMediaDataActivitySerializer.mup
index deddd26..39c49c4 100644
--- a/streams-contrib/streams-provider-instagram/metadata/InstagramMediaDataActivitySerializer.mup
+++ b/streams-contrib/streams-provider-instagram/metadata/InstagramMediaDataActivitySerializer.mup
@@ -1,894 +1,897 @@
{
- "title": "InstagramMediaDataActivitySerializer",
- "id": 1,
- "formatVersion": 2,
- "ideas": {
- "1": {
- "title": "activity",
- "id": 2,
- "ideas": {
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "title": "InstagramMediaDataActivitySerializer",
+ "id": 1,
+ "formatVersion": 2,
+ "ideas": {
"1": {
- "title": "published",
- "id": 25
- },
- "2": {
- "title": "id:instagram:post:<id>",
- "id": 26
- },
- "3": {
- "title": "provider",
- "id": 27,
- "ideas": {
- "1": {
- "title": "id",
- "id": 28,
- "ideas": {
+ "title": "activity",
+ "id": 2,
+ "ideas": {
"1": {
- "title": "id:providers:instagram",
- "id": 31
- }
- }
- },
- "2": {
- "title": "displayName",
- "id": 29,
- "ideas": {
- "1": {
- "title": "Instagram",
- "id": 30
- }
- }
- }
- }
- },
- "6": {
- "title": "url",
- "id": 40
- },
- "7": {
- "title": "object",
- "id": 46,
- "ideas": {
- "1": {
- "title": "objectType",
- "id": 38,
- "attr": {
- "style": {}
- }
- },
- "2": {
- "title": "attachments",
- "id": 51,
- "ideas": {
- "1": {
- "title": "object",
- "id": 52,
- "ideas": {
- "1": {
- "title": "objectType",
- "id": 53,
- "ideas": {
- "1": {
- "title": "\"image\"",
- "id": 81
- }
- }
- },
- "2": {
- "title": "image",
- "id": 54,
- "ideas": {
- "1": {
- "title": "url",
- "id": 55
- },
- "2": {
- "title": "height",
- "id": 56
- },
- "3": {
- "title": "width",
- "id": 57
- }
- }
- }
- }
+ "title": "published",
+ "id": 25
},
"2": {
- "title": "object",
- "ideas": {
- "1": {
- "title": "objectType",
- "ideas": {
- "1": {
- "title": "\"image\"",
- "id": 101
- }
- },
- "id": 100
- },
- "2": {
- "title": "image",
- "ideas": {
- "1": {
- "title": "url",
- "id": 103
- },
- "2": {
- "title": "height",
- "id": 104
- },
- "3": {
- "title": "width",
- "id": 105
- }
- },
- "id": 102
- }
- },
- "id": 99,
- "attr": {
- "style": {}
- }
+ "title": "id:instagram:post:<id>",
+ "id": 26
},
"3": {
- "title": "object",
- "ideas": {
- "1": {
- "title": "objectType",
- "ideas": {
+ "title": "provider",
+ "id": 27,
+ "ideas": {
"1": {
- "title": "\"video\"",
- "id": 108
- }
- },
- "id": 107
- },
- "2": {
- "title": "image",
- "ideas": {
- "1": {
- "title": "url",
- "id": 110
+ "title": "id",
+ "id": 28,
+ "ideas": {
+ "1": {
+ "title": "id:providers:instagram",
+ "id": 31
+ }
+ }
},
"2": {
- "title": "height",
- "id": 111
+ "title": "displayName",
+ "id": 29,
+ "ideas": {
+ "1": {
+ "title": "Instagram",
+ "id": 30
+ }
+ }
+ }
+ }
+ },
+ "6": {
+ "title": "url",
+ "id": 40
+ },
+ "7": {
+ "title": "object",
+ "id": 46,
+ "ideas": {
+ "1": {
+ "title": "objectType",
+ "id": 38,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2": {
+ "title": "attachments",
+ "id": 51,
+ "ideas": {
+ "1": {
+ "title": "object",
+ "id": 52,
+ "ideas": {
+ "1": {
+ "title": "objectType",
+ "id": 53,
+ "ideas": {
+ "1": {
+ "title": "\"image\"",
+ "id": 81
+ }
+ }
+ },
+ "2": {
+ "title": "image",
+ "id": 54,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 55
+ },
+ "2": {
+ "title": "height",
+ "id": 56
+ },
+ "3": {
+ "title": "width",
+ "id": 57
+ }
+ }
+ }
+ }
+ },
+ "2": {
+ "title": "object",
+ "ideas": {
+ "1": {
+ "title": "objectType",
+ "ideas": {
+ "1": {
+ "title": "\"image\"",
+ "id": 101
+ }
+ },
+ "id": 100
+ },
+ "2": {
+ "title": "image",
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 103
+ },
+ "2": {
+ "title": "height",
+ "id": 104
+ },
+ "3": {
+ "title": "width",
+ "id": 105
+ }
+ },
+ "id": 102
+ }
+ },
+ "id": 99,
+ "attr": {
+ "style": {}
+ }
+ },
+ "3": {
+ "title": "object",
+ "ideas": {
+ "1": {
+ "title": "objectType",
+ "ideas": {
+ "1": {
+ "title": "\"video\"",
+ "id": 108
+ }
+ },
+ "id": 107
+ },
+ "2": {
+ "title": "image",
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 110
+ },
+ "2": {
+ "title": "height",
+ "id": 111
+ },
+ "3": {
+ "title": "width",
+ "id": 112
+ }
+ },
+ "id": 109
+ }
+ },
+ "id": 106,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
},
"3": {
- "title": "width",
- "id": 112
+ "title": "image\n\nIF objectType == video\nimage = data.videos.standard_resolution\nELSE \nimage = data.images.standard_resolution",
+ "id": 62,
+ "attr": {
+ "position": [
+ 74.5,
+ 74,
+ 1
+ ],
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 64
+ },
+ "2": {
+ "title": "height",
+ "id": 65
+ },
+ "3": {
+ "title": "width",
+ "id": 66
+ }
+ }
+ },
+ "4": {
+ "title": "content",
+ "id": 113
}
- },
- "id": 109
}
- },
- "id": 106,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "3": {
- "title": "image\n\nIF objectType == video\nimage = data.videos.standard_resolution\nELSE \nimage = data.images.standard_resolution",
- "id": 62,
- "attr": {
- "position": [
- 74.5,
- 74,
- 1
- ],
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "url",
- "id": 64
},
- "2": {
- "title": "height",
- "id": 65
+ "8": {
+ "title": "extensions",
+ "id": 75,
+ "ideas": {
+ "1": {
+ "title": "instagram",
+ "id": 91,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2": {
+ "title": "location",
+ "id": 77,
+ "ideas": {
+ "1": {
+ "title": "coordinates",
+ "id": 78,
+ "ideas": {
+ "1": {
+ "title": "type",
+ "id": 79,
+ "ideas": {
+ "1": {
+ "title": "\"Point\"",
+ "id": 80
+ }
+ }
+ },
+ "0.5": {
+ "title": "coordinates\n\n[longitude,latitude]",
+ "id": 82,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ }
+ }
+ },
+ "12": {
+ "title": "hashtags",
+ "id": 76,
+ "attr": {
+ "position": [
+ 93.5,
+ 125.5,
+ 1
+ ],
+ "style": {}
+ }
+ },
+ "13": {
+ "title": "user_mentions",
+ "id": 92,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 93
+ },
+ "2": {
+ "title": "handle",
+ "id": 94
+ }
+ }
+ },
+ "9.5": {
+ "title": "rebroadcasts",
+ "id": 88,
+ "attr": {
+ "style": {}
+ }
+ },
+ "10.75": {
+ "title": "likes",
+ "id": 87,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "count",
+ "id": 90
+ }
+ }
+ }
+ },
+ "attr": {}
},
- "3": {
- "title": "width",
- "id": 66
+ "9": {
+ "title": "content",
+ "id": 114
+ },
+ "0.5": {
+ "title": "actor",
+ "id": 32,
+ "ideas": {
+ "1": {
+ "title": "id:instagram:<id>",
+ "id": 35
+ },
+ "2": {
+ "title": "image",
+ "id": 49,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 50
+ }
+ }
+ },
+ "0.5": {
+ "title": "handle",
+ "id": 36,
+ "attr": {
+ "position": [
+ 63.5,
+ -66,
+ 1
+ ],
+ "style": {}
+ }
+ },
+ "0.25": {
+ "title": "extensions",
+ "id": 47,
+ "ideas": {
+ "1": {
+ "title": "screenName",
+ "id": 48,
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "position": [
+ 60.5,
+ -126.5,
+ 2
+ ],
+ "style": {}
+ }
+ }
+ }
}
- }
- },
- "4": {
- "title": "content",
- "id": 113
}
- }
},
- "8": {
- "title": "extensions",
- "id": 75,
- "ideas": {
- "1": {
- "title": "instagram",
- "id": 91,
- "attr": {
- "style": {}
- }
- },
- "2": {
- "title": "location",
- "id": 77,
- "ideas": {
+ "-1": {
+ "title": "data",
+ "id": 4,
+ "ideas": {
"1": {
- "title": "coordinates",
- "id": 78,
- "ideas": {
- "1": {
- "title": "type",
- "id": 79,
- "ideas": {
+ "title": "comments",
+ "id": 5,
+ "ideas": {
"1": {
- "title": "\"Point\"",
- "id": 80
+ "title": "data",
+ "id": 44
}
- }
+ }
+ },
+ "3": {
+ "title": "caption",
+ "id": 7,
+ "ideas": {}
+ },
+ "4": {
+ "title": "links",
+ "id": 9
+ },
+ "5": {
+ "title": "link",
+ "id": 10
+ },
+ "6": {
+ "title": "user",
+ "id": 11,
+ "ideas": {
+ "1": {
+ "title": "username",
+ "id": 33
+ },
+ "2": {
+ "title": "profile_picture",
+ "id": 34
+ },
+ "3": {
+ "title": "id",
+ "id": 37
+ }
+ }
+ },
+ "9": {
+ "title": "type",
+ "id": 21
+ },
+ "12": {
+ "title": "videos",
+ "id": 41,
+ "ideas": {
+ "1": {
+ "title": "low_resolution",
+ "id": 42,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 67
+ },
+ "2": {
+ "title": "height",
+ "id": 68
+ },
+ "3": {
+ "title": "width",
+ "id": 69
+ }
+ }
+ },
+ "2": {
+ "title": "standard_resolution",
+ "id": 43,
+ "ideas": {
+ "1": {
+ "title": "height",
+ "id": 70
+ },
+ "2": {
+ "title": "width",
+ "id": 71
+ },
+ "3": {
+ "title": "url",
+ "id": 72
+ }
+ }
+ }
+ }
+ },
+ "13": {
+ "title": "tags",
+ "id": 45,
+ "ideas": {}
+ },
+ "14": {
+ "title": "users_in_photo",
+ "id": 95,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 96,
+ "ideas": {}
+ },
+ "2": {
+ "title": "profile_picture",
+ "id": 98
+ },
+ "3": {
+ "title": "username",
+ "id": 97,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "11.5": {
+ "title": "images",
+ "id": 14,
+ "ideas": {
+ "1": {
+ "title": "low_resolution",
+ "id": 15,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 18
+ },
+ "2": {
+ "title": "height",
+ "id": 58
+ },
+ "3": {
+ "title": "width",
+ "id": 59
+ }
+ }
+ },
+ "2": {
+ "title": "thumbnail",
+ "id": 16,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 19
+ },
+ "2": {
+ "title": "height",
+ "id": 60
+ },
+ "3": {
+ "title": "width",
+ "id": 61
+ }
+ }
+ },
+ "3": {
+ "title": "standard_resolution",
+ "id": 17,
+ "ideas": {
+ "1": {
+ "title": "url",
+ "id": 20
+ },
+ "2": {
+ "title": "height",
+ "id": 73
+ },
+ "3": {
+ "title": "width",
+ "id": 74
+ }
+ }
+ }
+ }
+ },
+ "6.5": {
+ "title": "id",
+ "id": 23
+ },
+ "6.25": {
+ "title": "created_time",
+ "id": 12
+ },
+ "12.5": {
+ "title": "likes",
+ "id": 6,
+ "ideas": {
+ "1": {
+ "title": "count",
+ "id": 89
+ }
},
- "0.5": {
- "title": "coordinates\n\n[longitude,latitude]",
- "id": 82,
- "attr": {
+ "attr": {
"style": {}
- }
}
- }
- }
- }
- },
- "12": {
- "title": "hashtags",
- "id": 76,
- "attr": {
- "position": [
- 93.5,
- 125.5,
- 1
- ],
- "style": {}
- }
- },
- "13": {
- "title": "user_mentions",
- "id": 92,
- "ideas": {
- "1": {
- "title": "id",
- "id": 93
},
- "2": {
- "title": "handle",
- "id": 94
+ "12.25": {
+ "title": "location",
+ "id": 24,
+ "ideas": {
+ "1": {
+ "title": "latitude",
+ "id": 83
+ },
+ "2": {
+ "title": "longitude",
+ "id": 84
+ }
+ },
+ "attr": {
+ "style": {}
+ }
}
- }
- },
- "9.5": {
- "title": "rebroadcasts",
- "id": 88,
- "attr": {
- "style": {}
- }
- },
- "10.75": {
- "title": "likes",
- "id": 87,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "count",
- "id": 90
- }
- }
}
- },
- "attr": {}
- },
- "9": {
- "title": "content",
- "id": 114
- },
- "0.5": {
- "title": "actor",
- "id": 32,
- "ideas": {
- "1": {
- "title": "id:instagram:<id>",
- "id": 35
- },
- "2": {
- "title": "image",
- "id": 49,
- "ideas": {
- "1": {
- "title": "url",
- "id": 50
+ }
+ },
+ "links": [
+ {
+ "ideaIdFrom": 23,
+ "ideaIdTo": 26,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
- },
- "0.5": {
- "title": "handle",
- "id": 36,
- "attr": {
- "position": [
- 63.5,
- -66,
- 1
- ],
- "style": {}
- }
- },
- "0.25": {
- "title": "extensions",
- "id": 47,
- "ideas": {
- "1": {
- "title": "screenName",
- "id": 48,
- "attr": {
- "style": {}
- }
+ }
+ },
+ {
+ "ideaIdFrom": 33,
+ "ideaIdTo": 36,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- },
- "attr": {
- "position": [
- 60.5,
- -126.5,
- 2
- ],
- "style": {}
- }
}
- }
- }
- }
- },
- "-1": {
- "title": "data",
- "id": 4,
- "ideas": {
- "1": {
- "title": "comments",
- "id": 5,
- "ideas": {
- "1": {
- "title": "data",
- "id": 44
- }
- }
},
- "3": {
- "title": "caption",
- "id": 7,
- "ideas": {}
- },
- "4": {
- "title": "links",
- "id": 9
- },
- "5": {
- "title": "link",
- "id": 10
- },
- "6": {
- "title": "user",
- "id": 11,
- "ideas": {
- "1": {
- "title": "username",
- "id": 33
- },
- "2": {
- "title": "profile_picture",
- "id": 34
- },
- "3": {
- "title": "id",
- "id": 37
- }
- }
- },
- "9": {
- "title": "type",
- "id": 21
- },
- "12": {
- "title": "videos",
- "id": 41,
- "ideas": {
- "1": {
- "title": "low_resolution",
- "id": 42,
- "ideas": {
- "1": {
- "title": "url",
- "id": 67
- },
- "2": {
- "title": "height",
- "id": 68
- },
- "3": {
- "title": "width",
- "id": 69
+ {
+ "ideaIdFrom": 37,
+ "ideaIdTo": 35,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
- },
- "2": {
- "title": "standard_resolution",
- "id": 43,
- "ideas": {
- "1": {
- "title": "height",
- "id": 70
- },
- "2": {
- "title": "width",
- "id": 71
- },
- "3": {
- "title": "url",
- "id": 72
+ }
+ },
+ {
+ "ideaIdFrom": 12,
+ "ideaIdTo": 25,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
}
- }
},
- "13": {
- "title": "tags",
- "id": 45,
- "ideas": {}
- },
- "14": {
- "title": "users_in_photo",
- "id": 95,
- "ideas": {
- "1": {
- "title": "id",
- "id": 96,
- "ideas": {}
- },
- "2": {
- "title": "profile_picture",
- "id": 98
- },
- "3": {
- "title": "username",
- "id": 97,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "11.5": {
- "title": "images",
- "id": 14,
- "ideas": {
- "1": {
- "title": "low_resolution",
- "id": 15,
- "ideas": {
- "1": {
- "title": "url",
- "id": 18
- },
- "2": {
- "title": "height",
- "id": 58
- },
- "3": {
- "title": "width",
- "id": 59
+ {
+ "ideaIdFrom": 21,
+ "ideaIdTo": 38,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
- },
- "2": {
- "title": "thumbnail",
- "id": 16,
- "ideas": {
- "1": {
- "title": "url",
- "id": 19
- },
- "2": {
- "title": "height",
- "id": 60
- },
- "3": {
- "title": "width",
- "id": 61
+ }
+ },
+ {
+ "ideaIdFrom": 33,
+ "ideaIdTo": 48,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
- },
- "3": {
- "title": "standard_resolution",
- "id": 17,
- "ideas": {
- "1": {
- "title": "url",
- "id": 20
- },
- "2": {
- "title": "height",
- "id": 73
- },
- "3": {
- "title": "width",
- "id": 74
+ }
+ },
+ {
+ "ideaIdFrom": 50,
+ "ideaIdTo": 34,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
}
- }
}
- }
},
- "6.5": {
- "title": "id",
- "id": 23
- },
- "6.25": {
- "title": "created_time",
- "id": 12
- },
- "12.5": {
- "title": "likes",
- "id": 6,
- "ideas": {
- "1": {
- "title": "count",
- "id": 89
+ {
+ "ideaIdFrom": 83,
+ "ideaIdTo": 82,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
}
- },
- "attr": {
- "style": {}
- }
},
- "12.25": {
- "title": "location",
- "id": 24,
- "ideas": {
- "1": {
- "title": "latitude",
- "id": 83
- },
- "2": {
- "title": "longitude",
- "id": 84
+ {
+ "ideaIdFrom": 84,
+ "ideaIdTo": 82,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
}
- },
- "attr": {
- "style": {}
- }
+ },
+ {
+ "ideaIdFrom": 45,
+ "ideaIdTo": 76,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 89,
+ "ideaIdTo": 90,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 91,
+ "ideaIdTo": 4,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 40,
+ "ideaIdTo": 10,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 97,
+ "ideaIdTo": 94,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 96,
+ "ideaIdTo": 93,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 64,
+ "ideaIdTo": 20,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 65,
+ "ideaIdTo": 73,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 66,
+ "ideaIdTo": 74,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 66,
+ "ideaIdTo": 71,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 65,
+ "ideaIdTo": 70,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 64,
+ "ideaIdTo": 72,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 55,
+ "ideaIdTo": 19,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 56,
+ "ideaIdTo": 60,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 61,
+ "ideaIdTo": 57,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 103,
+ "ideaIdTo": 18,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 104,
+ "ideaIdTo": 58,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 59,
+ "ideaIdTo": 105,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 110,
+ "ideaIdTo": 67,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 111,
+ "ideaIdTo": 68,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 112,
+ "ideaIdTo": 69,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 7,
+ "ideaIdTo": 114,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
+ },
+ {
+ "ideaIdFrom": 113,
+ "ideaIdTo": 7,
+ "attr": {
+ "style": {
+ "color": "#FF0000",
+ "lineStyle": "dashed"
+ }
+ }
}
- }
- }
- },
- "links": [
- {
- "ideaIdFrom": 23,
- "ideaIdTo": 26,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 33,
- "ideaIdTo": 36,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 37,
- "ideaIdTo": 35,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 12,
- "ideaIdTo": 25,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 21,
- "ideaIdTo": 38,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 33,
- "ideaIdTo": 48,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 50,
- "ideaIdTo": 34,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 83,
- "ideaIdTo": 82,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 84,
- "ideaIdTo": 82,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 45,
- "ideaIdTo": 76,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 89,
- "ideaIdTo": 90,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 91,
- "ideaIdTo": 4,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 40,
- "ideaIdTo": 10,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 97,
- "ideaIdTo": 94,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 96,
- "ideaIdTo": 93,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 64,
- "ideaIdTo": 20,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 65,
- "ideaIdTo": 73,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 66,
- "ideaIdTo": 74,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 66,
- "ideaIdTo": 71,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 65,
- "ideaIdTo": 70,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 64,
- "ideaIdTo": 72,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 55,
- "ideaIdTo": 19,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 56,
- "ideaIdTo": 60,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 61,
- "ideaIdTo": 57,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 103,
- "ideaIdTo": 18,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 104,
- "ideaIdTo": 58,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 59,
- "ideaIdTo": 105,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 110,
- "ideaIdTo": 67,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 111,
- "ideaIdTo": 68,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 112,
- "ideaIdTo": 69,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 7,
- "ideaIdTo": 114,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- },
- {
- "ideaIdFrom": 113,
- "ideaIdTo": 7,
- "attr": {
- "style": {
- "color": "#FF0000",
- "lineStyle": "dashed"
- }
- }
- }
- ]
+ ]
}
\ No newline at end of file
diff --git a/streams-contrib/streams-provider-instagram/pom.xml b/streams-contrib/streams-provider-instagram/pom.xml
index faf997d..f7d54c1 100644
--- a/streams-contrib/streams-provider-instagram/pom.xml
+++ b/streams-contrib/streams-provider-instagram/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/InstagramUserInfoSerializer.java b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/InstagramUserInfoSerializer.java
index 055169b..648c798 100644
--- a/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/InstagramUserInfoSerializer.java
+++ b/streams-contrib/streams-provider-instagram/src/main/java/org/apache/streams/instagram/serializer/InstagramUserInfoSerializer.java
@@ -1,3 +1,21 @@
+/*
+ * 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.instagram.serializer;
import com.google.common.collect.Lists;
diff --git a/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramConfiguration.json b/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramConfiguration.json
index bcb5fd7..891c1da 100644
--- a/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramConfiguration.json
+++ b/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.instagram.InstagramConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramUserInformationConfiguration.json b/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramUserInformationConfiguration.json
index b6a8c6b..42eb5d6 100644
--- a/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramUserInformationConfiguration.json
+++ b/streams-contrib/streams-provider-instagram/src/main/jsonschema/com/instagram/InstagramUserInformationConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.instagram.InstagramUserInformationConfiguration",
"extends": {"$ref":"InstagramConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-provider-moreover/README.md b/streams-contrib/streams-provider-moreover/README.md
new file mode 100644
index 0000000..d7fcbfb
--- /dev/null
+++ b/streams-contrib/streams-provider-moreover/README.md
@@ -0,0 +1,17 @@
+streams-provider-moreover
+==========================
+
+Purpose
+
+ Module connects to moreover API, collects events, converts to activity, and passes each activity downstream.
+
+Example configuration
+
+ moreover {
+ apiKeys {
+ key {
+ key = ""
+ startingSequence = ""
+ }
+ }
+ }
\ No newline at end of file
diff --git a/streams-contrib/streams-provider-moreover/pom.xml b/streams-contrib/streams-provider-moreover/pom.xml
index e047ae1..60611ff 100644
--- a/streams-contrib/streams-provider-moreover/pom.xml
+++ b/streams-contrib/streams-provider-moreover/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/Moreover.json b/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/Moreover.json
index 9ecf328..8708e82 100644
--- a/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/Moreover.json
+++ b/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/Moreover.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
- "javaType": "com.moreover.Moreover",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
+ "javaType": "com.moreover.Moreover",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"tags": {
"type": "string"
diff --git a/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/MoreoverConfiguration.json b/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/MoreoverConfiguration.json
index d88f28c..bbbda5d 100644
--- a/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/MoreoverConfiguration.json
+++ b/streams-contrib/streams-provider-moreover/src/main/jsonschema/com/moreover/MoreoverConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.moreover.MoreoverConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/articles10.xsd b/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/articles10.xsd
index 629719a..f95a891 100644
--- a/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/articles10.xsd
+++ b/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/articles10.xsd
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="response" type="articlesResponse"/>
diff --git a/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/binding.xjb b/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/binding.xjb
index 0f31d3c..d94a76b 100644
--- a/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/binding.xjb
+++ b/streams-contrib/streams-provider-moreover/src/main/xmlschema/com/moreover/binding.xjb
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
diff --git a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/util/MoreoverTestUtil.java b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/util/MoreoverTestUtil.java
index e676b4f..a8cd816 100644
--- a/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/util/MoreoverTestUtil.java
+++ b/streams-contrib/streams-provider-moreover/src/test/java/org/apache/streams/data/util/MoreoverTestUtil.java
@@ -1,5 +1,22 @@
-package org.apache.streams.data.util;
+/*
+ * 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.data.util;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.streams.pojo.json.Activity;
diff --git a/streams-contrib/streams-provider-rss/README.markdown b/streams-contrib/streams-provider-rss/README.markdown
index e31b5ce..7199fe9 100644
--- a/streams-contrib/streams-provider-rss/README.markdown
+++ b/streams-contrib/streams-provider-rss/README.markdown
@@ -1,4 +1,5 @@
streams-provider-rss
+====================
Purpose
diff --git a/streams-contrib/streams-provider-rss/pom.xml b/streams-contrib/streams-provider-rss/pom.xml
index 665e2a0..1f7602e 100644
--- a/streams-contrib/streams-provider-rss/pom.xml
+++ b/streams-contrib/streams-provider-rss/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-rss/src/main/jsonschema/RssStreamConfiguration.json b/streams-contrib/streams-provider-rss/src/main/jsonschema/RssStreamConfiguration.json
index ac12d27..5365aed 100644
--- a/streams-contrib/streams-provider-rss/src/main/jsonschema/RssStreamConfiguration.json
+++ b/streams-contrib/streams-provider-rss/src/main/jsonschema/RssStreamConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.rss.RssStreamConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-provider-rss/src/main/xmlschema/contents.xsd b/streams-contrib/streams-provider-rss/src/main/xmlschema/contents.xsd
index 5844f9a..b3ce748 100644
--- a/streams-contrib/streams-provider-rss/src/main/xmlschema/contents.xsd
+++ b/streams-contrib/streams-provider-rss/src/main/xmlschema/contents.xsd
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: contents.xsd,v 1.3 2009/12/17 22:02:23 ginger Exp $ -->
+<!--
+ ~ 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.
+ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>**********************</xs:documentation>
diff --git a/streams-contrib/streams-provider-rss/src/main/xmlschema/opml.xsd b/streams-contrib/streams-provider-rss/src/main/xmlschema/opml.xsd
index 6f7f325..2cc3ce1 100644
--- a/streams-contrib/streams-provider-rss/src/main/xmlschema/opml.xsd
+++ b/streams-contrib/streams-provider-rss/src/main/xmlschema/opml.xsd
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+~ 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.
+-->
<xs:schema targetNamespace="http://www.dlese.org/Metadata/opml" xmlns="http://www.dlese.org/Metadata/opml" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>**********************</xs:documentation>
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
index 1cce391..40aa376 100644
--- a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
+++ b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.rss.provider;
import com.carrotsearch.randomizedtesting.RandomizedTest;
diff --git a/streams-contrib/streams-provider-sysomos/README.md b/streams-contrib/streams-provider-sysomos/README.md
new file mode 100644
index 0000000..9b25f55
--- /dev/null
+++ b/streams-contrib/streams-provider-sysomos/README.md
@@ -0,0 +1,19 @@
+streams-provider-sysomos
+==========================
+
+Purpose
+
+ Module connects to sysomos API, collects events, converts to activity, and passes each activity downstream.
+
+Example configuration
+
+ sysomos {
+ heartbeatIds = [
+ HBID
+ ]
+ apiBatchSize = 500
+ apiKey = KEY
+ minDelayMs = 10000
+ scheduledDelayMs = 120000
+ maxBatchSize = 10000
+ }
\ No newline at end of file
diff --git a/streams-contrib/streams-provider-sysomos/pom.xml b/streams-contrib/streams-provider-sysomos/pom.xml
index 965aa7e..9124458 100644
--- a/streams-contrib/streams-provider-sysomos/pom.xml
+++ b/streams-contrib/streams-provider-sysomos/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/Sysomos.json b/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/Sysomos.json
index 35424a2..d9080e8 100644
--- a/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/Sysomos.json
+++ b/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/Sysomos.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
- "javaType": "com.sysomos.json.Sysomos",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
+ "javaType": "com.sysomos.json.Sysomos",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"tweetJsonLink": {
"type": "string"
diff --git a/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/SysomosConfiguration.json b/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/SysomosConfiguration.json
index f8563ef..4ce336e 100644
--- a/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/SysomosConfiguration.json
+++ b/streams-contrib/streams-provider-sysomos/src/main/jsonschema/com/sysomos/SysomosConfiguration.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "com.sysomos.SysomosConfiguration",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"apiKey": {
"type": "string"
diff --git a/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/binding.xjb b/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/binding.xjb
index 0f31d3c..d94a76b 100644
--- a/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/binding.xjb
+++ b/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/binding.xjb
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
diff --git a/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/sysomos.xsd b/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/sysomos.xsd
index 904cade..d5b949b 100644
--- a/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/sysomos.xsd
+++ b/streams-contrib/streams-provider-sysomos/src/main/xmlschema/com/sysomos/sysomos.xsd
@@ -1,3 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ ~ 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.
+ -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.blogscope.net/api/namespace/schema/SearchResponse" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="beatApi">
<xs:complexType>
diff --git a/streams-contrib/streams-provider-twitter/pom.xml b/streams-contrib/streams-provider-twitter/pom.xml
index 9df8220..84ef313 100644
--- a/streams-contrib/streams-provider-twitter/pom.xml
+++ b/streams-contrib/streams-provider-twitter/pom.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Delete.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Delete.json
index 6b2efb0..03b801d 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Delete.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Delete.json
@@ -1,12 +1,16 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
"javaType" : "org.apache.streams.twitter.pojo.Delete",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"delete": {
"type": "object",
"javaType" : "org.apache.streams.twitter.pojo.DeleteDetails",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"status": {
"type": "object",
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/FriendList.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/FriendList.json
index 5dd7687..ae7a021 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/FriendList.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/FriendList.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.pojo.FriendList",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"friends": {
"type": "array",
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Retweet.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Retweet.json
index 018a263..a449525 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Retweet.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/Retweet.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.pojo.Retweet",
+ "javaInterfaces": ["java.io.Serializable"],
"extends": {"$ref":"tweet.json"},
"properties": {
"retweeted_status": {
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterConfiguration.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterConfiguration.json
index 9e22b93..884603a 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterConfiguration.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.TwitterConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterStreamConfiguration.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterStreamConfiguration.json
index 2ff7362..6fa2a73 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterStreamConfiguration.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterStreamConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.TwitterStreamConfiguration",
"extends": {"$ref":"TwitterConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterUserInformationConfiguration.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterUserInformationConfiguration.json
index afd203f..b31a6a3 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterUserInformationConfiguration.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/TwitterUserInformationConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.TwitterUserInformationConfiguration",
"extends": {"$ref":"TwitterConfiguration.json"},
"javaInterfaces": ["java.io.Serializable"],
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/UserstreamEvent.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/UserstreamEvent.json
index 07b5883..1fa6df7 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/UserstreamEvent.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/UserstreamEvent.json
@@ -1,8 +1,12 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.pojo.UserstreamEvent",
+ "javaInterfaces": ["java.io.Serializable"],
"properties": {
"created_at": {
"type": "string",
diff --git a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/tweet.json b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/tweet.json
index dee4fe0..cfdc35d 100644
--- a/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/tweet.json
+++ b/streams-contrib/streams-provider-twitter/src/main/jsonschema/com/twitter/tweet.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.twitter.pojo.Tweet",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-core/README.md b/streams-core/README.md
new file mode 100644
index 0000000..3201490
--- /dev/null
+++ b/streams-core/README.md
@@ -0,0 +1,4 @@
+streams-core
+==============
+
+streams-core contains core classes and interfaces.
\ No newline at end of file
diff --git a/streams-core/src/main/java/org/apache/streams/core/util/DatumUtils.java b/streams-core/src/main/java/org/apache/streams/core/util/DatumUtils.java
index eedbb07..b751b2a 100644
--- a/streams-core/src/main/java/org/apache/streams/core/util/DatumUtils.java
+++ b/streams-core/src/main/java/org/apache/streams/core/util/DatumUtils.java
@@ -22,7 +22,10 @@
import com.google.common.collect.Maps;
import org.apache.streams.core.StreamsDatum;
import org.apache.streams.core.StreamsOperation;
+import org.joda.time.DateTime;
+import java.math.BigInteger;
+import java.util.HashMap;
import java.util.Map;
/**
@@ -46,4 +49,13 @@
Map<String, Throwable> errors = (Map)datum.getMetadata().get("errors");
errors.put(operationClass.getCanonicalName(), e);
}
+
+ public static StreamsDatum cloneDatum(StreamsDatum datum) {
+ StreamsDatum clone = new StreamsDatum(datum.getDocument());
+ clone.setId(datum.getId() == null ? null : new String(datum.getId()));
+ clone.setTimestamp(datum.getTimestamp() == null ? null : new DateTime(datum.getTimestamp()));
+ clone.setSequenceid(datum.getSequenceid() == null ? null : datum.getSequenceid());
+ clone.setMetadata(datum.getMetadata() == null ? null : new HashMap<>(datum.getMetadata()));
+ return clone;
+ }
}
diff --git a/streams-monitoring/README.md b/streams-monitoring/README.md
new file mode 100644
index 0000000..153b0d4
--- /dev/null
+++ b/streams-monitoring/README.md
@@ -0,0 +1,4 @@
+streams-monitoring
+==============
+
+streams-monitoring contains classes and interfaces for monitoring executing streams.
\ No newline at end of file
diff --git a/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java b/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
index b44c36b..19c36f2 100644
--- a/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
+++ b/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
@@ -1,3 +1,21 @@
+/*
+ * 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.monitoring.persist.impl;
import org.apache.streams.monitoring.persist.MessagePersister;
diff --git a/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java b/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
index 6f6dda5..ea7edd1 100644
--- a/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
+++ b/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
@@ -123,8 +123,11 @@
Thread.sleep(waitTime);
} catch (InterruptedException e) {
LOGGER.error("Interrupted!: {}", e);
+ Thread.currentThread().interrupt();
+ this.keepRunning = false;
} catch (Exception e) {
LOGGER.error("Exception: {}", e);
+ this.keepRunning = false;
}
}
}
diff --git a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/Broadcast.json b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/Broadcast.json
index 687ef9c..6bd7ad6 100644
--- a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/Broadcast.json
+++ b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/Broadcast.json
@@ -1,21 +1,26 @@
{
- "type" : "object",
- "title" : "object",
- "javaType": "org.apache.streams.pojo.json.Broadcast",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "Base Broadcast class",
- "properties" : {
- "name": {
- "type": "string",
- "description": "Name of the MBean"
- },
- "streamIdentifier": {
- "type": "string",
- "description": "The name of the Stream that is currently executing"
- },
- "startedAt": {
- "type": "integer",
- "description": "Milliseconds since epoch when this Stream was started"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "javaType": "org.apache.streams.pojo.json.Broadcast",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "Base Broadcast class",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the MBean"
+ },
+ "streamIdentifier": {
+ "type": "string",
+ "description": "The name of the Stream that is currently executing"
+ },
+ "startedAt": {
+ "type": "integer",
+ "description": "Milliseconds since epoch when this Stream was started"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/DatumStatusCounterBroadcast.json b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/DatumStatusCounterBroadcast.json
index ac86d21..21d9f6a 100644
--- a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/DatumStatusCounterBroadcast.json
+++ b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/DatumStatusCounterBroadcast.json
@@ -1,22 +1,29 @@
{
- "type" : "object",
- "title" : "object",
- "extends" : {"$ref": "./Broadcast.json"},
- "javaType": "org.apache.streams.pojo.json.DatumStatusCounterBroadcast",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "Snapshot of the DatumStatusCounter",
- "properties" : {
- "passed": {
- "type": "boolean",
- "description": "Number of objects that have passed"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "extends": {
+ "$ref": "./Broadcast.json"
},
- "failed": {
- "type": "boolean",
- "description": "Number of objects that have faile"
- },
- "name": {
- "type": "string",
- "description": "Name of the MBean"
+ "javaType": "org.apache.streams.pojo.json.DatumStatusCounterBroadcast",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "Snapshot of the DatumStatusCounter",
+ "properties": {
+ "passed": {
+ "type": "boolean",
+ "description": "Number of objects that have passed"
+ },
+ "failed": {
+ "type": "boolean",
+ "description": "Number of objects that have faile"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the MBean"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/MemoryUsageBroadcast.json b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/MemoryUsageBroadcast.json
index 4a17d41..b29284e 100644
--- a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/MemoryUsageBroadcast.json
+++ b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/MemoryUsageBroadcast.json
@@ -1,30 +1,37 @@
{
- "type" : "object",
- "title" : "object",
- "extends" : {"$ref": "./Broadcast.json"},
- "javaType": "org.apache.streams.pojo.json.MemoryUsageBroadcast",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "Snapshot of current memory usage",
- "properties" : {
- "verbose" : {
- "type" : "boolean",
- "description": "Whether or not this is verbose"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "extends": {
+ "$ref": "./Broadcast.json"
},
- "objectPendingFinalizationCount": {
- "type": "integer",
- "description": "The number of objects that are pending finalization"
- },
- "heapMemoryUsage": {
- "type": "integer",
- "description": "The amount of heap memory we are currently using"
- },
- "nonHeapMemoryUsage": {
- "type": "integer",
- "description": "The amount of non-heap memory we are using"
- },
- "name": {
- "type": "string",
- "description": "The name of this MBean"
+ "javaType": "org.apache.streams.pojo.json.MemoryUsageBroadcast",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "Snapshot of current memory usage",
+ "properties": {
+ "verbose": {
+ "type": "boolean",
+ "description": "Whether or not this is verbose"
+ },
+ "objectPendingFinalizationCount": {
+ "type": "integer",
+ "description": "The number of objects that are pending finalization"
+ },
+ "heapMemoryUsage": {
+ "type": "integer",
+ "description": "The amount of heap memory we are currently using"
+ },
+ "nonHeapMemoryUsage": {
+ "type": "integer",
+ "description": "The amount of non-heap memory we are using"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of this MBean"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/StreamsTaskCounterBroadcast.json b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/StreamsTaskCounterBroadcast.json
index d599697..bfb7817 100644
--- a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/StreamsTaskCounterBroadcast.json
+++ b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/StreamsTaskCounterBroadcast.json
@@ -1,38 +1,45 @@
{
- "type" : "object",
- "title" : "object",
- "javaType": "org.apache.streams.pojo.json.StreamsTaskCounterBroadcast",
- "javaInterfaces": ["java.io.Serializable"],
- "extends" : {"$ref": "./Broadcast.json"},
- "description" : "Snapshot of a Stream Task Counter",
- "properties" : {
- "errorRate": {
- "type": "double",
- "description": "Rate of failed items"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "javaType": "org.apache.streams.pojo.json.StreamsTaskCounterBroadcast",
+ "javaInterfaces": ["java.io.Serializable"],
+ "extends": {
+ "$ref": "./Broadcast.json"
},
- "numEmitted": {
- "type": "integer",
- "description": "Number of items that have been emitted"
- },
- "numReceived": {
- "type": "integer",
- "description": "Number of items this Task has received"
- },
- "numUnhandledErrors": {
- "type": "integer",
- "description": "Number of unhandled errors"
- },
- "avgTime": {
- "type": "double",
- "description": "Average amount of time an item spent in this Task"
- },
- "maxTime": {
- "type": "integer",
- "description": "Longest amount of time an item spent in this Task"
- },
- "name": {
- "type": "string",
- "description": "Name of the MBean"
+ "description": "Snapshot of a Stream Task Counter",
+ "properties": {
+ "errorRate": {
+ "type": "double",
+ "description": "Rate of failed items"
+ },
+ "numEmitted": {
+ "type": "integer",
+ "description": "Number of items that have been emitted"
+ },
+ "numReceived": {
+ "type": "integer",
+ "description": "Number of items this Task has received"
+ },
+ "numUnhandledErrors": {
+ "type": "integer",
+ "description": "Number of unhandled errors"
+ },
+ "avgTime": {
+ "type": "double",
+ "description": "Average amount of time an item spent in this Task"
+ },
+ "maxTime": {
+ "type": "integer",
+ "description": "Longest amount of time an item spent in this Task"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the MBean"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/ThroughputQueueBroadcast.json b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/ThroughputQueueBroadcast.json
index 60796db..14f949d 100644
--- a/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/ThroughputQueueBroadcast.json
+++ b/streams-monitoring/src/main/jsonschema/org/apache/streams/pojo/json/ThroughputQueueBroadcast.json
@@ -1,38 +1,45 @@
{
- "type" : "object",
- "title" : "object",
- "extends" : {"$ref": "./Broadcast.json"},
- "javaType": "org.apache.streams.pojo.json.ThroughputQueueBroadcast",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "Snapshot of a ThroughputQueue's performance",
- "properties" : {
- "currentSize": {
- "type": "integer",
- "description": "Current size of the queue"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "extends": {
+ "$ref": "./Broadcast.json"
},
- "avgWait": {
- "type": "double",
- "description": "Average wait time"
- },
- "maxWait": {
- "type": "double",
- "description": "Maximum wait time"
- },
- "removed": {
- "type": "integer",
- "description": "Number of elements removed from the queue"
- },
- "added": {
- "type": "integer",
- "description": "Number of elements added to the queue"
- },
- "throughput": {
- "type": "double",
- "description": "Number of elements that have passed through the queue per second"
- },
- "name": {
- "type": "string",
- "description": "Name of the MBean"
+ "javaType": "org.apache.streams.pojo.json.ThroughputQueueBroadcast",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "Snapshot of a ThroughputQueue's performance",
+ "properties": {
+ "currentSize": {
+ "type": "integer",
+ "description": "Current size of the queue"
+ },
+ "avgWait": {
+ "type": "double",
+ "description": "Average wait time"
+ },
+ "maxWait": {
+ "type": "double",
+ "description": "Maximum wait time"
+ },
+ "removed": {
+ "type": "integer",
+ "description": "Number of elements removed from the queue"
+ },
+ "added": {
+ "type": "integer",
+ "description": "Number of elements added to the queue"
+ },
+ "throughput": {
+ "type": "double",
+ "description": "Number of elements that have passed through the queue per second"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the MBean"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-osgi-components/activity-consumer/osgi.bnd b/streams-osgi-components/activity-consumer/osgi.bnd
index 55bbd6d..53f60f9 100644
--- a/streams-osgi-components/activity-consumer/osgi.bnd
+++ b/streams-osgi-components/activity-consumer/osgi.bnd
@@ -1,3 +1,7 @@
+#--------------------------------------------------------------------------------
+# Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
+#--------------------------------------------------------------------------------
+
#-----------------------------------------------------------------
# Use this file to add customized Bnd instructions for the bundle
#-----------------------------------------------------------------
diff --git a/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-context.xml b/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-context.xml
index 3507e27..f12ab82 100644
--- a/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-context.xml
+++ b/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-context.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
diff --git a/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-osgi.xml b/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-osgi.xml
index 2c46c12..408ce95 100644
--- a/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-osgi.xml
+++ b/streams-osgi-components/activity-consumer/src/main/resources/META-INF/spring/activity-consumer-osgi.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
diff --git a/streams-osgi-components/activity-registration/osgi.bnd b/streams-osgi-components/activity-registration/osgi.bnd
index 55bbd6d..53f60f9 100644
--- a/streams-osgi-components/activity-registration/osgi.bnd
+++ b/streams-osgi-components/activity-registration/osgi.bnd
@@ -1,3 +1,7 @@
+#--------------------------------------------------------------------------------
+# Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
+#--------------------------------------------------------------------------------
+
#-----------------------------------------------------------------
# Use this file to add customized Bnd instructions for the bundle
#-----------------------------------------------------------------
diff --git a/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityPublisherRegistrationImpl.java b/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityPublisherRegistrationImpl.java
index f0b8649..e621f43 100644
--- a/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityPublisherRegistrationImpl.java
+++ b/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityPublisherRegistrationImpl.java
@@ -1,3 +1,21 @@
+/*
+ * 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.osgi.components.impl;
import java.util.Date;
diff --git a/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityStreamsSubscriberRegistrationImpl.java b/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityStreamsSubscriberRegistrationImpl.java
index 0992cbe..6a270d6 100644
--- a/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityStreamsSubscriberRegistrationImpl.java
+++ b/streams-osgi-components/activity-registration/src/main/java/org/apache/streams/osgi/components/impl/ActivityStreamsSubscriberRegistrationImpl.java
@@ -1,3 +1,21 @@
+/*
+ * 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.osgi.components.impl;
import org.apache.commons.logging.Log;
diff --git a/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context-osgi.xml b/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context-osgi.xml
index f4d0cb7..af9e3b7 100644
--- a/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context-osgi.xml
+++ b/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context-osgi.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
diff --git a/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context.xml b/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context.xml
index 287053d..4e58ace 100644
--- a/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context.xml
+++ b/streams-osgi-components/activity-registration/src/main/resources/META-INF/spring/activity-registration-context.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
diff --git a/streams-osgi-components/activity-subscriber/osgi.bnd b/streams-osgi-components/activity-subscriber/osgi.bnd
index 55bbd6d..53f60f9 100644
--- a/streams-osgi-components/activity-subscriber/osgi.bnd
+++ b/streams-osgi-components/activity-subscriber/osgi.bnd
@@ -1,3 +1,7 @@
+#--------------------------------------------------------------------------------
+# Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
+#--------------------------------------------------------------------------------
+
#-----------------------------------------------------------------
# Use this file to add customized Bnd instructions for the bundle
#-----------------------------------------------------------------
diff --git a/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-context.xml b/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-context.xml
index 7fff1ec..65c58bd 100644
--- a/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-context.xml
+++ b/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-context.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
diff --git a/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-osgi.xml b/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-osgi.xml
index c83f8b3..8988824 100644
--- a/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-osgi.xml
+++ b/streams-osgi-components/activity-subscriber/src/main/resources/META-INF/spring/activity-subscriber-osgi.xml
@@ -1,4 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
diff --git a/streams-pojo-extensions/README.md b/streams-pojo-extensions/README.md
new file mode 100644
index 0000000..dd46309
--- /dev/null
+++ b/streams-pojo-extensions/README.md
@@ -0,0 +1,4 @@
+streams-pojo-extensions
+==============
+
+Support for adding and modifying extension properties.
\ No newline at end of file
diff --git a/streams-pojo/README.md b/streams-pojo/README.md
new file mode 100644
index 0000000..2642093
--- /dev/null
+++ b/streams-pojo/README.md
@@ -0,0 +1,4 @@
+streams-pojo
+==============
+
+streams-pojo contains ActivityStream json schema definitions and utility classes.
\ No newline at end of file
diff --git a/streams-pojo/metadata/Serializer.mup b/streams-pojo/metadata/Serializer.mup
index e8f88ca..8552b3b 100644
--- a/streams-pojo/metadata/Serializer.mup
+++ b/streams-pojo/metadata/Serializer.mup
@@ -1,371 +1,374 @@
{
- "title": "Serializer",
- "id": 1,
- "formatVersion": 2,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "Activity",
- "id": 2,
- "ideas": {
- "1": {
- "title": "actor",
- "id": 4,
- "ideas": {
- "1": {
- "title": "summary",
- "id": 28
- },
- "7": {
- "title": "url",
- "id": 41
- },
- "0.5": {
- "title": "displayName",
- "id": 32,
- "attr": {
- "style": {}
- }
- },
- "0.75": {
- "title": "extensions",
- "id": 33,
- "ideas": {
- "1": {
- "title": "followers",
- "id": 34
- },
- "2": {
- "title": "handle",
- "id": 35
- },
- "3": {
- "title": "location",
- "id": 36
- },
- "4": {
- "title": "location",
- "id": 37
- },
- "5": {
- "title": "screenName",
- "id": 38
- },
- "6": {
- "title": "posts",
- "id": 39
- },
- "7": {
- "title": "favorites",
- "id": 40
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.875": {
- "title": "handle",
- "id": 30,
- "attr": {
- "style": {}
- }
- },
- "0.9375": {
- "title": "id",
- "id": 29,
- "attr": {
- "style": {}
- }
- },
- "0.96875": {
- "title": "image",
- "id": 31,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2": {
- "title": "id",
- "id": 5
- },
- "3": {
- "title": "verb",
- "id": 6
- },
- "1.5": {
- "title": "content",
- "id": 16,
- "attr": {
- "style": {}
- }
- },
- "2.5": {
- "title": "icon",
- "id": 13,
- "attr": {
- "style": {}
- }
- },
- "1.75": {
- "title": "generator",
- "id": 12,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 62
- },
- "0.5": {
- "title": "displayName",
- "id": 63,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.75": {
- "title": "links",
- "id": 18,
- "attr": {
- "style": {}
- }
- },
- "2.875": {
- "title": "object",
- "id": 8,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "content",
- "id": 22
- },
- "2": {
- "title": "id",
- "id": 23
- },
- "4": {
- "title": "objectType",
- "id": 25
- },
- "1.5": {
- "title": "geo",
- "id": 24,
- "ideas": {
- "1": {
- "title": "coordinates",
- "id": 26
- }
- },
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.9375": {
- "title": "published",
- "id": 10,
- "attr": {
- "style": {}
- },
- "ideas": {}
- },
- "2.90625": {
- "title": "provider",
- "id": 14,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 20
- },
- "0.5": {
- "title": "displayName",
- "id": 21,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.96875": {
- "title": "target",
- "id": 9,
- "attr": {
- "style": {}
- },
- "ideas": {
- "1": {
- "title": "id",
- "id": 64
- },
- "2": {
- "title": "image",
- "id": 65
- },
- "4": {
- "title": "summary",
- "id": 67
- },
- "0.5": {
- "title": "displayName",
- "id": 66,
- "attr": {
- "style": {}
- }
- },
- "0.25": {
- "title": "content",
- "id": 68,
- "attr": {
- "style": {}
- }
- }
- }
- },
- "2.984375": {
- "title": "updated",
- "id": 11,
- "attr": {
- "style": {}
- }
- },
- "2.9765625": {
- "title": "title",
- "id": 15,
- "attr": {
- "style": {}
- }
- },
- "2.9921875": {
- "title": "url",
- "id": 17,
- "attr": {
- "style": {}
- }
- },
- "1.625": {
- "title": "extensions",
- "id": 42,
- "ideas": {
- "1": {
- "title": "source",
- "id": 43,
- "ideas": {
- "1": {
- "title": "source json",
- "id": 44
- }
- }
- },
- "6": {
- "title": "user_mentions",
- "id": 58,
- "ideas": {
- "1": {
- "title": "id",
- "id": 59
- },
- "2": {
- "title": "handle",
- "id": 60
- },
- "3": {
- "title": "displayName",
- "id": 61
- }
- }
- },
- "0.5": {
- "title": "hashtags",
- "id": 57,
- "attr": {
- "style": {}
- }
- },
- "0.75": {
- "title": "location",
- "id": 48,
- "ideas": {
- "1": {
- "title": "id",
- "id": 49
- },
- "2": {
- "title": "coordinates",
- "id": 50,
- "ideas": {
- "1": {
- "title": "type",
- "id": 52
- },
- "2": {
- "title": "coordinates",
- "id": 53
- }
- }
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.625": {
- "title": "likes",
- "id": 54,
- "ideas": {
- "1": {
- "title": "perspectival",
- "id": 55
- },
- "2": {
- "title": "count",
- "id": 56
- }
- },
- "attr": {
- "style": {}
- }
- },
- "0.875": {
- "title": "rebroadcasts",
- "id": 45,
- "ideas": {
- "1": {
- "title": "perspectival",
- "id": 46
- },
- "2": {
- "title": "count",
- "id": 47
- }
- },
- "attr": {
- "style": {}
- }
- }
- },
- "attr": {
- "style": {}
- }
- }
- }
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "title": "Serializer",
+ "id": 1,
+ "formatVersion": 2,
+ "attr": {
+ "style": {}
},
- "-1": {
- "title": "Source Data",
- "id": 3
+ "ideas": {
+ "1": {
+ "title": "Activity",
+ "id": 2,
+ "ideas": {
+ "1": {
+ "title": "actor",
+ "id": 4,
+ "ideas": {
+ "1": {
+ "title": "summary",
+ "id": 28
+ },
+ "7": {
+ "title": "url",
+ "id": 41
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 32,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.75": {
+ "title": "extensions",
+ "id": 33,
+ "ideas": {
+ "1": {
+ "title": "followers",
+ "id": 34
+ },
+ "2": {
+ "title": "handle",
+ "id": 35
+ },
+ "3": {
+ "title": "location",
+ "id": 36
+ },
+ "4": {
+ "title": "location",
+ "id": 37
+ },
+ "5": {
+ "title": "screenName",
+ "id": 38
+ },
+ "6": {
+ "title": "posts",
+ "id": 39
+ },
+ "7": {
+ "title": "favorites",
+ "id": 40
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.875": {
+ "title": "handle",
+ "id": 30,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.9375": {
+ "title": "id",
+ "id": 29,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.96875": {
+ "title": "image",
+ "id": 31,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2": {
+ "title": "id",
+ "id": 5
+ },
+ "3": {
+ "title": "verb",
+ "id": 6
+ },
+ "1.5": {
+ "title": "content",
+ "id": 16,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.5": {
+ "title": "icon",
+ "id": 13,
+ "attr": {
+ "style": {}
+ }
+ },
+ "1.75": {
+ "title": "generator",
+ "id": 12,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 62
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 63,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.75": {
+ "title": "links",
+ "id": 18,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.875": {
+ "title": "object",
+ "id": 8,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "content",
+ "id": 22
+ },
+ "2": {
+ "title": "id",
+ "id": 23
+ },
+ "4": {
+ "title": "objectType",
+ "id": 25
+ },
+ "1.5": {
+ "title": "geo",
+ "id": 24,
+ "ideas": {
+ "1": {
+ "title": "coordinates",
+ "id": 26
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.9375": {
+ "title": "published",
+ "id": 10,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {}
+ },
+ "2.90625": {
+ "title": "provider",
+ "id": 14,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 20
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 21,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.96875": {
+ "title": "target",
+ "id": 9,
+ "attr": {
+ "style": {}
+ },
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 64
+ },
+ "2": {
+ "title": "image",
+ "id": 65
+ },
+ "4": {
+ "title": "summary",
+ "id": 67
+ },
+ "0.5": {
+ "title": "displayName",
+ "id": 66,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.25": {
+ "title": "content",
+ "id": 68,
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "2.984375": {
+ "title": "updated",
+ "id": 11,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.9765625": {
+ "title": "title",
+ "id": 15,
+ "attr": {
+ "style": {}
+ }
+ },
+ "2.9921875": {
+ "title": "url",
+ "id": 17,
+ "attr": {
+ "style": {}
+ }
+ },
+ "1.625": {
+ "title": "extensions",
+ "id": 42,
+ "ideas": {
+ "1": {
+ "title": "source",
+ "id": 43,
+ "ideas": {
+ "1": {
+ "title": "source json",
+ "id": 44
+ }
+ }
+ },
+ "6": {
+ "title": "user_mentions",
+ "id": 58,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 59
+ },
+ "2": {
+ "title": "handle",
+ "id": 60
+ },
+ "3": {
+ "title": "displayName",
+ "id": 61
+ }
+ }
+ },
+ "0.5": {
+ "title": "hashtags",
+ "id": 57,
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.75": {
+ "title": "location",
+ "id": 48,
+ "ideas": {
+ "1": {
+ "title": "id",
+ "id": 49
+ },
+ "2": {
+ "title": "coordinates",
+ "id": 50,
+ "ideas": {
+ "1": {
+ "title": "type",
+ "id": 52
+ },
+ "2": {
+ "title": "coordinates",
+ "id": 53
+ }
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.625": {
+ "title": "likes",
+ "id": 54,
+ "ideas": {
+ "1": {
+ "title": "perspectival",
+ "id": 55
+ },
+ "2": {
+ "title": "count",
+ "id": 56
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ },
+ "0.875": {
+ "title": "rebroadcasts",
+ "id": 45,
+ "ideas": {
+ "1": {
+ "title": "perspectival",
+ "id": 46
+ },
+ "2": {
+ "title": "count",
+ "id": 47
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ },
+ "attr": {
+ "style": {}
+ }
+ }
+ }
+ },
+ "-1": {
+ "title": "Source Data",
+ "id": 3
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/pom.xml b/streams-pojo/pom.xml
index e02d183..426d9f2 100644
--- a/streams-pojo/pom.xml
+++ b/streams-pojo/pom.xml
@@ -93,6 +93,13 @@
<artifactId>guava</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections</artifactId>
+ <version>${reflections.version}</version>
+ </dependency>
+
+
</dependencies>
<build>
@@ -140,6 +147,18 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.reflections</groupId>
+ <artifactId>reflections-maven</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>reflections</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<configuration>
diff --git a/streams-pojo/src/main/java/org/apache/streams/data/ActivityConverter.java b/streams-pojo/src/main/java/org/apache/streams/data/ActivityConverter.java
new file mode 100644
index 0000000..4d6d759
--- /dev/null
+++ b/streams-pojo/src/main/java/org/apache/streams/data/ActivityConverter.java
@@ -0,0 +1,87 @@
+/*
+ * 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.data;
+
+import org.apache.streams.exceptions.ActivityConversionException;
+import org.apache.streams.pojo.json.Activity;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Converts non-Activity documents to Activities and back.
+ *
+ * Each converter may one, several, or zero activities.
+ *
+ * The recommended approach for deriving multiple activities from a source document is:
+ *
+ * 1) Return one activity for each occurance of a verb, from the same ActivityConverter, if the activities are of like type.
+ *
+ * For example, BlogShareConverter would convert a blog containing two shares into two Activities with verb: share
+ *
+ * 2) Create multiple ActivityConverters, if the activities are not of like type.
+ *
+ * For example, a blog post that is both a post and a share should be transformed by two seperate Converters, individually
+ * or simultaneously applied.
+ */
+public interface ActivityConverter<T> extends Serializable {
+
+ /**
+ * What class does this ActivityConverter require?
+ *
+ * @return The class the ActivityConverter requires. Should always return the templated class.
+ */
+ Class requiredClass();
+
+ /**
+ * Gets the supported content type that can be deserialized/serialized
+ *
+ * @return A string representing the format name. Can be an IETF MIME type or other
+ */
+ String serializationFormat();
+
+ /**
+ * Converts the activity to a POJO representation.
+ *
+ * @param deserialized the string
+ * @return a fully populated Activity object
+ */
+ T fromActivity(Activity deserialized) throws ActivityConversionException;
+
+ /**
+ * Converts a POJO into one or more Activities
+ * @param serialized the string representation
+ * @return a fully populated Activity object
+ */
+ List<Activity> toActivityList(T serialized) throws ActivityConversionException;
+
+ /**
+ * Converts multiple Activities into a list of source documents
+ * @param list a typed List of documents
+ * @return a list of source documents
+ */
+ List<T> fromActivityList(List<Activity> list) throws ActivityConversionException;
+
+ /**
+ * Converts multiple documents into a list of Activity objects
+ * @param list a typed List of documents
+ * @return a list of fully populated activities
+ */
+ List<Activity> toActivityList(List<T> list) throws ActivityConversionException;
+}
diff --git a/streams-pojo/src/main/java/org/apache/streams/data/ActivitySerializer.java b/streams-pojo/src/main/java/org/apache/streams/data/ActivitySerializer.java
index 23903e5..8ca0c04 100644
--- a/streams-pojo/src/main/java/org/apache/streams/data/ActivitySerializer.java
+++ b/streams-pojo/src/main/java/org/apache/streams/data/ActivitySerializer.java
@@ -23,10 +23,12 @@
import java.util.List;
-//TODO: Change the name of this class to ActivityConverter STREAMS-68
/**
* Serializes and deserializes Activities
+ *
+ * Deprecated: Switch all modules to use {@link org.apache.streams.data.ActivityConverter}
*/
+@Deprecated
public interface ActivitySerializer<T> {
/**
diff --git a/streams-pojo/src/main/java/org/apache/streams/data/DocumentClassifier.java b/streams-pojo/src/main/java/org/apache/streams/data/DocumentClassifier.java
new file mode 100644
index 0000000..bcb14b7
--- /dev/null
+++ b/streams-pojo/src/main/java/org/apache/streams/data/DocumentClassifier.java
@@ -0,0 +1,39 @@
+/*
+ * 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.data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * DocumentClassifier assists with ActivityConversion, by determining whether a document may be
+ * parseable into a POJO for which an ActivityConverter exists.
+ */
+public interface DocumentClassifier extends Serializable {
+
+ /**
+ * Assess the structure of the document, and identify whether the provided document is
+ * a structural match for one or more typed forms.
+ *
+ * @param document the document
+ * @return a serializable pojo class this document matches
+ */
+ List<Class> detectClasses(Object document);
+
+}
diff --git a/streams-pojo/src/main/java/org/apache/streams/data/util/ActivityUtil.java b/streams-pojo/src/main/java/org/apache/streams/data/util/ActivityUtil.java
index 9d1e7b2..8c6774a 100644
--- a/streams-pojo/src/main/java/org/apache/streams/data/util/ActivityUtil.java
+++ b/streams-pojo/src/main/java/org/apache/streams/data/util/ActivityUtil.java
@@ -123,4 +123,11 @@
return String.format("id:%s:activities:%s", providerName, activityId);
}
+ public static boolean isValid(Activity activity) {
+ return activity != null
+ && activity.getId() != null
+ && activity.getVerb() != null
+ && activity.getProvider() != null
+ && activity.getProvider().getId() != null;
+ }
}
diff --git a/streams-pojo/src/main/java/org/apache/streams/exceptions/ActivityConversionException.java b/streams-pojo/src/main/java/org/apache/streams/exceptions/ActivityConversionException.java
new file mode 100644
index 0000000..a03ec87
--- /dev/null
+++ b/streams-pojo/src/main/java/org/apache/streams/exceptions/ActivityConversionException.java
@@ -0,0 +1,42 @@
+/*
+ * 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.exceptions;
+
+/**
+ * ActivityConversionException is a typed exception appropriate when a valid Activity
+ * cannot be created from a given document.
+ */
+public class ActivityConversionException extends Exception {
+
+ public ActivityConversionException() {
+ }
+
+ public ActivityConversionException(String message) {
+ super(message);
+ }
+
+ public ActivityConversionException(Throwable cause) {
+ super(cause);
+ }
+
+ public ActivityConversionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeDeserializer.java b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeDeserializer.java
index 8f53954..639c5ad 100644
--- a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeDeserializer.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeDeserializer.java
@@ -29,12 +29,15 @@
import java.io.IOException;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
- * Created by sblackmon on 3/27/14.
+ * StreamsDateTimeDeserializer is a supporting class for
+ * @see {@link org.apache.streams.jackson.StreamsJacksonMapper}
+ *
+ * Converting date-time strings other than RFC3339 to joda DateTime objects requires
+ * additional formats to be provided when instantiating StreamsJacksonMapper.
*/
public class StreamsDateTimeDeserializer extends StdDeserializer<DateTime> implements Serializable {
@@ -50,6 +53,9 @@
formatters.add(DateTimeFormat.forPattern(format));
}
+ /**
+ * Applies each additional format in turn, until it can provide a non-null DateTime
+ */
@Override
public DateTime deserialize(JsonParser jpar, DeserializationContext context) throws IOException {
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeFormat.java
similarity index 75%
rename from streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java
rename to streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeFormat.java
index 190be54..e9cab58 100644
--- a/streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeFormat.java
@@ -16,16 +16,15 @@
* under the License.
*/
-package org.apache.streams.data.data.util;
+package org.apache.streams.jackson;
+/**
+ * Supplies a custom date-time format to StreamsJacksonModule
+ *
+ * Implementations must have a no-argument constructor
+ */
+public interface StreamsDateTimeFormat {
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class JsonUtilTest {
-
- @Ignore @Test
- public void testJsonToObject(){
- }
+ public String getFormat();
}
diff --git a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeSerializer.java b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeSerializer.java
index 1e9c895..fff314d 100644
--- a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeSerializer.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsDateTimeSerializer.java
@@ -28,12 +28,11 @@
import java.io.Serializable;
/**
- * Created by sblackmon on 3/27/14.
+ * StreamsDateTimeSerializer is a supporting class for
+ * @see {@link org.apache.streams.jackson.StreamsJacksonMapper}
*/
public class StreamsDateTimeSerializer extends StdSerializer<DateTime> implements Serializable {
-
-
protected StreamsDateTimeSerializer(Class<DateTime> dateTimeClass) {
super(dateTimeClass);
}
diff --git a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
index 8a74caa..f5eace1 100644
--- a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonMapper.java
@@ -24,11 +24,16 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.common.collect.Lists;
import java.util.List;
/**
- * Created by sblackmon on 3/27/14.
+ * StreamsJacksonMapper is the recommended interface to jackson for any streams component.
+ *
+ * Date-time formats that must be supported can be specified with constructor arguments.
+ *
+ * If no Date-time formats are specified, streams will use reflection to find formats.
*/
public class StreamsJacksonMapper extends ObjectMapper {
@@ -38,6 +43,13 @@
return INSTANCE;
}
+ public static StreamsJacksonMapper getInstance(String format){
+
+ StreamsJacksonMapper instance = new StreamsJacksonMapper(Lists.newArrayList(format));
+
+ return instance;
+
+ }
public static StreamsJacksonMapper getInstance(List<String> formats){
StreamsJacksonMapper instance = new StreamsJacksonMapper(formats);
@@ -52,6 +64,12 @@
configure();
}
+ public StreamsJacksonMapper(String format) {
+ super();
+ registerModule(new StreamsJacksonModule(Lists.newArrayList(format)));
+ configure();
+ }
+
public StreamsJacksonMapper(List<String> formats) {
super();
registerModule(new StreamsJacksonModule(formats));
diff --git a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonModule.java b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonModule.java
index 8b44b0f..4e02441 100644
--- a/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonModule.java
+++ b/streams-pojo/src/main/java/org/apache/streams/jackson/StreamsJacksonModule.java
@@ -22,17 +22,47 @@
import org.joda.time.DateTime;
import org.joda.time.Period;
+import org.reflections.Reflections;
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.util.ClasspathHelper;
+import org.reflections.util.ConfigurationBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
/**
- * Created by sblackmon on 3/27/14.
+ * StreamsJacksonModule is a supporting class for
+ * @see {@link org.apache.streams.jackson.StreamsJacksonMapper}
+ *
+ * RFC3339 dates are supported by default.
*/
public class StreamsJacksonModule extends SimpleModule {
+ private final static Logger LOGGER = LoggerFactory.getLogger(StreamsJacksonModule.class);
+
public StreamsJacksonModule() {
super();
+
+ Reflections reflections = new Reflections(new ConfigurationBuilder()
+ .setUrls(ClasspathHelper.forPackage("org.apache.streams.jackson"))
+ .setScanners(new SubTypesScanner()));
+
+ Set<Class<? extends StreamsDateTimeFormat>> dateTimeFormatClasses = reflections.getSubTypesOf(StreamsDateTimeFormat.class);
+
+ List<String> dateTimeFormats = new ArrayList<>();
+ for (Class dateTimeFormatClass : dateTimeFormatClasses) {
+ try {
+ dateTimeFormats.add(((StreamsDateTimeFormat) (dateTimeFormatClass.newInstance())).getFormat());
+ } catch (Exception e) {
+ LOGGER.warn("Exception getting format from " + dateTimeFormatClass);
+ }
+ }
+
addSerializer(DateTime.class, new StreamsDateTimeSerializer(DateTime.class));
- addDeserializer(DateTime.class, new StreamsDateTimeDeserializer(DateTime.class));
+ addDeserializer(DateTime.class, new StreamsDateTimeDeserializer(DateTime.class, dateTimeFormats));
addSerializer(Period.class, new StreamsPeriodSerializer(Period.class));
addDeserializer(Period.class, new StreamsPeriodDeserializer(Period.class));
@@ -40,6 +70,7 @@
public StreamsJacksonModule(List<String> formats) {
super();
+
addSerializer(DateTime.class, new StreamsDateTimeSerializer(DateTime.class));
addDeserializer(DateTime.class, new StreamsDateTimeDeserializer(DateTime.class, formats));
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/activity.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/activity.json
index a68ce00..4f7ad28 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/activity.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/activity.json
@@ -1,90 +1,107 @@
{
- "type" : "object",
- "title" : "activity",
- "javaType": "org.apache.streams.pojo.json.Activity",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "An activity construct recounts what an actor did to an object in the past. If there is no actor it simply describes the change.",
- "additionalProperties": true,
- "properties": {
- "id" :{
- "type" : "string",
- "description" : "Uniquely identifies each activity within the service",
- "required" : true
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "activity",
+ "javaType": "org.apache.streams.pojo.json.Activity",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "An activity construct recounts what an actor did to an object in the past. If there is no actor it simply describes the change.",
+ "additionalProperties": true,
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Uniquely identifies each activity within the service",
+ "required": true
+ },
+ "actor": {
+ "type": "object",
+ "required": true,
+ "description": "Describes the entity that performed the activity. An activity MUST contain one actor property whose value is a single Object.",
+ "extends": {
+ "$ref": "./object.json"
+ }
+ },
+ "verb": {
+ "title": "verb",
+ "type": "string",
+ "default": "post",
+ "required": true,
+ "description": "Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed."
+ },
+ "object": {
+ "type": "object",
+ "required": true,
+ "description": "Describes the primary object of the activity. For instance, in the activity, \"John saved a movie to his wishlist\", the object of the activity is \"movie\". An activity SHOULD contain an object property whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context.",
+ "$ref": "./object.json"
+ },
+ "target": {
+ "type": "object",
+ "description": "Describes the target of the activity. The precise meaning of the activity's target is dependent on the activities verb, but will often be the object the English preposition \"to\". For instance, in the activity, \"John saved a movie to his wishlist\", the target of the activity is \"wishlist\". The activity target MUST NOT be used to identity an indirect object that is not a target of the activity. An activity MAY contain a target property whose value is a single Object.",
+ "$ref": "./object.json"
+ },
+ "published": {
+ "type": "string",
+ "description": "The date and time at which the activity occurred. It is important to note that this is not necessarily the same as the time at which the activity was published. An activity MUST contain a postedTime property.",
+ "format": "date-time"
+ },
+ "updated": {
+ "type": "string",
+ "description": "The date and time at which a previously published activity has been modified. An Activity MAY contain an updatedTime property",
+ "format": "date-time"
+ },
+ "generator": {
+ "type": "object",
+ "description": "Describes the application that generated the activity. An activity MAY contain a generator property whose value is a single Object.",
+ "extends": {
+ "$ref": "./object.json"
+ }
+ },
+ "icon": {
+ "type": "object",
+ "properties": {
+ "$ref": "./media_link.json#properties"
+ },
+ "description": "An IRI[RFC3987] identifying an image resource provides a visual representation of the activity, intended for human consumption. The image SHOULD have an aspect ratio of one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size. An activity MAY have an icon property"
+ },
+ "provider": {
+ "type": "object",
+ "description": "Describes the application that published the activity. Note that this is not necessarily the same entity that generated the activity. An activity MAY contain a provider property whose value is a single Object",
+ "extends": {
+ "$ref": "./object.json"
+ }
+ },
+ "title": {
+ "type": "string",
+ "description": "Natural-language title or headline for the activity encoded as a single JSON String containing HTML markup. An activity MAY contain a title property",
+ "format": "html"
+ },
+ "content": {
+ "type": "string",
+ "description": "Natural-language description of the activity encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a content property",
+ "format": "html"
+ },
+ "url": {
+ "type": "string",
+ "description": "An IRI [RFC3987] identifying a resource providing an HTML representation of the activity. An activity MAY contain a url property",
+ "format": "url"
+ },
+ "links": {
+ "type": "array",
+ "description": "Links between this object and other resources as defined in Web Linking",
+ "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema#properties",
+ "items": {
+ "type": "string"
+ }
+ }
},
- "actor" : {
- "type": "object",
- "required": true,
- "description": "Describes the entity that performed the activity. An activity MUST contain one actor property whose value is a single Object.",
- "extends" : { "$ref" : "./object.json" }
- },
- "verb" : {
- "title" : "verb",
- "type" : "string",
- "default": "post",
- "required": true,
- "description" :"Identifies the action that the activity describes. An activity MUST contain a verb property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed."
- },
- "object" : {
- "type": "object",
- "required" : true,
- "description" : "Describes the primary object of the activity. For instance, in the activity, \"John saved a movie to his wishlist\", the object of the activity is \"movie\". An activity SHOULD contain an object property whose value is a single Object. If the object property is not contained, the primary object of the activity MAY be implied by context.",
- "$ref" : "./object.json"
- },
- "target" : {
- "type": "object",
- "description" : "Describes the target of the activity. The precise meaning of the activity's target is dependent on the activities verb, but will often be the object the English preposition \"to\". For instance, in the activity, \"John saved a movie to his wishlist\", the target of the activity is \"wishlist\". The activity target MUST NOT be used to identity an indirect object that is not a target of the activity. An activity MAY contain a target property whose value is a single Object.",
- "$ref" : "./object.json"
- },
- "published" : {
- "type" : "string",
- "description": "The date and time at which the activity occurred. It is important to note that this is not necessarily the same as the time at which the activity was published. An activity MUST contain a postedTime property.",
- "format" : "date-time"
- },
- "updated" : {
- "type" : "string",
- "description": "The date and time at which a previously published activity has been modified. An Activity MAY contain an updatedTime property",
- "format" : "date-time"
- },
- "generator" : {
- "type": "object",
- "description": "Describes the application that generated the activity. An activity MAY contain a generator property whose value is a single Object.",
- "extends" : { "$ref" : "./object.json" }
- },
- "icon" : {
- "type": "object",
- "properties" :{"$ref":"./media_link.json#properties"},
- "description": "An IRI[RFC3987] identifying an image resource provides a visual representation of the activity, intended for human consumption. The image SHOULD have an aspect ratio of one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size. An activity MAY have an icon property"
- },
- "provider" : {
- "type": "object",
- "description" : "Describes the application that published the activity. Note that this is not necessarily the same entity that generated the activity. An activity MAY contain a provider property whose value is a single Object",
- "extends" : { "$ref" : "./object.json" }
- },
- "title" : {
- "type" : "string",
- "description" : "Natural-language title or headline for the activity encoded as a single JSON String containing HTML markup. An activity MAY contain a title property",
- "format": "html"
- },
- "content" : {
- "type" : "string",
- "description" : "Natural-language description of the activity encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a content property",
- "format" : "html"
- },
- "url" : {
- "type" : "string",
- "description" : "An IRI [RFC3987] identifying a resource providing an HTML representation of the activity. An activity MAY contain a url property",
- "format" : "url"
- },
- "links" : {
- "type" : "array",
- "description" :"Links between this object and other resources as defined in Web Linking",
- "note": "Tell JSON schema team to not put links inside http://json-schema.org/hyper-schema#properties",
- "items": {
- "type" : "string"
- }
- }
- },
- "links": [
- {"rel": "describedby", "href": "./verbs/{verb}.json"}
- ]
+ "links": [
+ {
+ "rel": "describedby",
+ "href": "./verbs/{verb}.json"
+ }
+ ]
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/collection.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/collection.json
index b9bdd76..3833009 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/collection.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/collection.json
@@ -1,34 +1,47 @@
{
- "type" : "object",
- "title" : "collection",
- "javaType": "org.apache.streams.pojo.json.Collection",
- "description" : "A collection is a generic list of Objects of any object type. The objectType of each item in the collection MAY be omitted if the type of object can be established through context. The collection is used primarily as the root of an Activity Streams document, but can be used as the value of extension properties in a variety of situations. ",
- "properties" : {
- "url" : {
- "type" : "string",
- "description": "An IRI [RFC3987] referencing a JSON document containing the full listing of objects in the collection."
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "collection",
+ "javaType": "org.apache.streams.pojo.json.Collection",
+ "description": "A collection is a generic list of Objects of any object type. The objectType of each item in the collection MAY be omitted if the type of object can be established through context. The collection is used primarily as the root of an Activity Streams document, but can be used as the value of extension properties in a variety of situations. ",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "An IRI [RFC3987] referencing a JSON document containing the full listing of objects in the collection."
+ },
+ "totalItems": {
+ "type": "number",
+ "description": "Non-negative integer specifying the total number of activities within the stream. The Stream serialization MAY contain a count property."
+ },
+ "items": {
+ "type": "array",
+ "required": true,
+ "description": "An array containing a listing of Objects of any object type. If used in combination with the url property, the items array can be used to provide a subset of the objects that may be found in the resource identified by the url.",
+ "items": {
+ "type": "object",
+ "extends": {
+ "$ref": "./object.json"
+ }
+ }
+ },
+ "links": {
+ "type": "array",
+ "optional": true,
+ "description": "Links between an this object and other resources as defined in Web Linking",
+ "extends": {
+ "$ref": "http://json-schema.org/links#properties"
+ }
+ }
},
- "totalItems": {
- "type" : "number",
- "description" : "Non-negative integer specifying the total number of activities within the stream. The Stream serialization MAY contain a count property."
- },
- "items" : {
- "type" : "array",
- "required" : true,
- "description" : "An array containing a listing of Objects of any object type. If used in combination with the url property, the items array can be used to provide a subset of the objects that may be found in the resource identified by the url.",
- "items": {
- "type" : "object",
- "extends" :{"$ref":"./object.json"}
- }
- },
- "links" : {
- "type" : "array",
- "optional" : true,
- "description" :"Links between an this object and other resources as defined in Web Linking",
- "extends" : {"$ref" : "http://json-schema.org/links#properties"}
- }
- },
- "links": [
- {"rel": "describedby", "href": "http://json-schema.org/schema"}
- ]
+ "links": [
+ {
+ "rel": "describedby",
+ "href": "http://json-schema.org/schema"
+ }
+ ]
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/media_link.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/media_link.json
index 2d8e31f..056d467 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/media_link.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/media_link.json
@@ -1,28 +1,34 @@
{
- "type" : "object",
- "title" : "media_link",
- "javaType": "org.apache.streams.pojo.json.MediaLink",
- "description" : "Visual representation of an object in the form of an image, video or embedded HTML fragments",
- "properties": {
- "duration" : {
- "title" : "duration",
- "type" : "number",
- "description" :"A hint to the consumer about the length, in seconds, of the media resource identified by the url property. A media link MAY contain a \"duration\" property when the target resource is a time-based media item such as an audio or video."
- },
- "height" : {
- "title" : "height",
- "type" : "number",
- "description" :"A hint to the consumer about the height, in pixels, of the media resource identified by the url property. A media link MAY contain a height property when the target resource is a visual media item such as an image, video or embeddable HTML page."
- },
- "width" : {
- "title" : "width",
- "type" : "number",
- "description" :"A hint to the consumer about the width, in pixels, of the media resource identified by the url property. A media link MAY contain a width property when the target resource is a visual media item such as an image, video or embeddable HTML page."
- },
- "url" : {
- "type": "string",
- "required" : true,
- "description" : "The IRI of the media resource being linked. A media link MUST have a url property."
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "media_link",
+ "javaType": "org.apache.streams.pojo.json.MediaLink",
+ "description": "Visual representation of an object in the form of an image, video or embedded HTML fragments",
+ "properties": {
+ "duration": {
+ "title": "duration",
+ "type": "number",
+ "description": "A hint to the consumer about the length, in seconds, of the media resource identified by the url property. A media link MAY contain a \"duration\" property when the target resource is a time-based media item such as an audio or video."
+ },
+ "height": {
+ "title": "height",
+ "type": "number",
+ "description": "A hint to the consumer about the height, in pixels, of the media resource identified by the url property. A media link MAY contain a height property when the target resource is a visual media item such as an image, video or embeddable HTML page."
+ },
+ "width": {
+ "title": "width",
+ "type": "number",
+ "description": "A hint to the consumer about the width, in pixels, of the media resource identified by the url property. A media link MAY contain a width property when the target resource is a visual media item such as an image, video or embeddable HTML page."
+ },
+ "url": {
+ "type": "string",
+ "required": true,
+ "description": "The IRI of the media resource being linked. A media link MUST have a url property."
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/object.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/object.json
index eec09a8..be9b7cd 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/object.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/object.json
@@ -1,79 +1,96 @@
{
- "type" : "object",
- "title" : "object",
- "javaType": "org.apache.streams.pojo.json.ActivityObject",
- "javaInterfaces": ["java.io.Serializable"],
- "description" : "Basic object on the web. The only required property is the id",
- "properties" : {
- "id" : {
- "type" : "string",
- "description" : "Provides a permanent, universally unique identifier for the object in the form of an absolute IRI [RFC3987]. An object SHOULD contain a single id property. If an object does not contain an id property, consumers MAY use the value of the url property as a less-reliable, non-unique identifier.",
- "required" : true
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "object",
+ "javaType": "org.apache.streams.pojo.json.ActivityObject",
+ "javaInterfaces": ["java.io.Serializable"],
+ "description": "Basic object on the web. The only required property is the id",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Provides a permanent, universally unique identifier for the object in the form of an absolute IRI [RFC3987]. An object SHOULD contain a single id property. If an object does not contain an id property, consumers MAY use the value of the url property as a less-reliable, non-unique identifier.",
+ "required": true
+ },
+ "image": {
+ "format": "image",
+ "type": "object",
+ "extends": {
+ "$ref": "./media_link.json"
+ },
+ "description": "Description of a resource providing a visual representation of the object, intended for human consumption. An object MAY contain an image property whose value is a Media Link."
+ },
+ "displayName": {
+ "type": "string",
+ "description": "A natural-language, human-readable and plain-text name for the object. HTML markup MUST NOT be included. An object MAY contain a displayName property. If the object does not specify an objectType property, the object SHOULD specify a displayName"
+ },
+ "summary": {
+ "type": "string",
+ "description": "Natural-language summary of the object encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a summary property"
+ },
+ "content": {
+ "type": "string",
+ "description": "Natural-language description of the object encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An object MAY contain a content property"
+ },
+ "url": {
+ "type": "string",
+ "format": "url",
+ "description": "An IRI [RFC3987] identifying a resource providing an HTML representation of the object. An object MAY contain a url property"
+ },
+ "objectType": {
+ "type": "string",
+ "description": "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type."
+ },
+ "author": {
+ "type": "object",
+ "description": "Describes the entity that created or authored the object. An object MAY contain a single author property whose value is an Object of any type. Note that the author field identifies the entity that created the object and does not necessarily identify the entity that published the object. For instance, it may be the case that an object created by one person is posted and published to a system by an entirely different entity",
+ "extends": {
+ "$ref": "./object.json"
+ }
+ },
+ "published": {
+ "type": "string",
+ "description": "[RFC3339] date-time. The date and time at which the object was published. An object MAY contain a published property",
+ "format": "date-time"
+ },
+ "updated": {
+ "type": "string",
+ "description": "[RFC3339] date-time. The date and time at which a previously published object has been modified. An Object MAY contain an updated property.",
+ "format": "date-time"
+ },
+ "attachments": {
+ "title": "Related objects",
+ "description": "A collection of one or more additional, associated objects, similar to the concept of attached files in an email message. An object MAY have an attachedObjects property whose value is a JSON Array of Objects.",
+ "type": "array",
+ "items": {
+ "type": "object",
+ "$ref": "./object.json"
+ }
+ },
+ "upstreamDuplicates": {
+ "type": "array",
+ "description": "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain an upstreamDuplicates property when a publisher is knowingly duplicating with a new ID the content from another object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources",
+ "items": {
+ "type": "string"
+ }
+ },
+ "downstreamDuplicates": {
+ "type": "array",
+ "description": "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain a downstreamDuplicates property when there are known objects, possibly in a different system, that duplicate the content in this object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources.",
+ "items": {
+ "type": "string"
+ }
+ }
},
- "image" : {
- "format":"image",
- "type":"object",
- "extends" :{"$ref":"./media_link.json"},
- "description" : "Description of a resource providing a visual representation of the object, intended for human consumption. An object MAY contain an image property whose value is a Media Link."
- },
- "displayName" : {
- "type":"string",
- "description" : "A natural-language, human-readable and plain-text name for the object. HTML markup MUST NOT be included. An object MAY contain a displayName property. If the object does not specify an objectType property, the object SHOULD specify a displayName"
- },
- "summary" : {
- "type" : "string",
- "description" : "Natural-language summary of the object encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An activity MAY contain a summary property"
- },
- "content" : {
- "type" : "string",
- "description" : "Natural-language description of the object encoded as a single JSON String containing HTML markup. Visual elements such as thumbnail images MAY be included. An object MAY contain a content property"
- },
- "url" : {
- "type" : "string",
- "format" : "url",
- "description" : "An IRI [RFC3987] identifying a resource providing an HTML representation of the object. An object MAY contain a url property"
- },
- "objectType" :{
- "type" : "string",
- "description" : "Identifies the type of object. An object MAY contain an objectType property whose value is a JSON String that is non-empty and matches either the \"isegment-nz-nc\" or the \"IRI\" production in [RFC3987]. Note that the use of a relative reference other than a simple name is not allowed. If no objectType property is contained, the object has no specific type."
- },
- "author" : {
- "type" : "object",
- "description" : "Describes the entity that created or authored the object. An object MAY contain a single author property whose value is an Object of any type. Note that the author field identifies the entity that created the object and does not necessarily identify the entity that published the object. For instance, it may be the case that an object created by one person is posted and published to a system by an entirely different entity",
- "extends" : { "$ref": "./object.json" }
- },
- "published" : {
- "type" : "string",
- "description": "[RFC3339] date-time. The date and time at which the object was published. An object MAY contain a published property",
- "format" : "date-time"
- },
- "updated" : {
- "type" : "string",
- "description": "[RFC3339] date-time. The date and time at which a previously published object has been modified. An Object MAY contain an updated property.",
- "format" : "date-time"
- },
- "attachments":{
- "title" : "Related objects",
- "description" : "A collection of one or more additional, associated objects, similar to the concept of attached files in an email message. An object MAY have an attachedObjects property whose value is a JSON Array of Objects.",
- "type" : "array",
- "items": {
- "type" : "object",
- "$ref" : "./object.json"
- }
- },
- "upstreamDuplicates":{
- "type" : "array",
- "description" : "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain an upstreamDuplicates property when a publisher is knowingly duplicating with a new ID the content from another object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources",
- "items": {"type" : "string"}
- },
- "downstreamDuplicates":{
- "type" : "array",
- "description" : "A JSON Array of one or more absolute IRI's [RFC3987] identifying objects that duplicate this object's content. An object SHOULD contain a downstreamDuplicates property when there are known objects, possibly in a different system, that duplicate the content in this object. This MAY be used as a hint for consumers to use when resolving duplicates between objects received from different sources.",
- "items": {"type" : "string"}
- }
- },
- "additionalProperties" : true,
- "links": [
- {"rel": "describedby", "href": "./objectType/{objectType}.json"}
- ]
+ "additionalProperties": true,
+ "links": [
+ {
+ "rel": "describedby",
+ "href": "./objectType/{objectType}.json"
+ }
+ ]
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/article.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/article.json
index f02394e..8abc7f7 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/article.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/article.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "article",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "article"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "article",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "article"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/audio.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/audio.json
index e2818df..92cef7f 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/audio.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/audio.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "audio",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "audio"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "audio",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "audio"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/bookmark.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/bookmark.json
index ee6f4b2..3d3e3f1 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/bookmark.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/bookmark.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "bookmark",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "bookmark"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "bookmark",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "bookmark"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/comment.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/comment.json
index 0a4857d..90249c4 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/comment.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/comment.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "comment",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "comment"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "comment",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "comment"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/event.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/event.json
index a116516..4338955 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/event.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/event.json
@@ -1,13 +1,25 @@
{
- "type" : "object",
- "title" : "event",
- "description" : "xCal fromat for vevent",
- "extends": [{"$ref":"../object.json"},
- {"$ref":"http://www.json-schema.org/calendar"}],
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "event"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "event",
+ "description": "xCal fromat for vevent",
+ "extends": [
+ {
+ "$ref": "../object.json"
+ },
+ {
+ "$ref": "http://www.json-schema.org/calendar"
+ }
+ ],
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "event"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/file.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/file.json
index b3514a3..5a5392b 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/file.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/file.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "file",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "file"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "file",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "file"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/folder.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/folder.json
index a4db729..a319efe 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/folder.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/folder.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "folder",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "folder"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "folder",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "folder"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/group.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/group.json
index 58c7dd3..b67d88d 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/group.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/group.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "group",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "group"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "group",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "group"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/list.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/list.json
index ca48eab..d7c164a 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/list.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/list.json
@@ -1,18 +1,28 @@
{
- "type" : "object",
- "title" : "list",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "list"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "list",
+ "extends": {
+ "$ref": "../object.json"
},
- "items" : {
- "type" : "array",
- "items" : {
- "type" : "object",
- "properties" : {"$ref":"../object.json"}
- }
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "list"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "$ref": "../object.json"
+ }
+ }
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/note.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/note.json
index 127efd9..09de97c 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/note.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/note.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "note",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "note"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "note",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "note"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/person.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/person.json
index 43eab84..f42eb8e 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/person.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/person.json
@@ -1,13 +1,25 @@
{
- "type" : "object",
- "title" : "person",
- "description" : "vCard Format. Does not match PoCO",
- "extends": [{"$ref":"../object.json"},
- {"$ref":"http://www.json-schema.org/card"}],
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "person"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "person",
+ "description": "vCard Format. Does not match PoCO",
+ "extends": [
+ {
+ "$ref": "../object.json"
+ },
+ {
+ "$ref": "http://www.json-schema.org/card"
+ }
+ ],
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "person"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo-album.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo-album.json
index 69db681..933804b 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo-album.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo-album.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "article",
- "extends": {"$ref":"../objectTypes/list.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "photo-album"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "article",
+ "extends": {
+ "$ref": "../objectTypes/list.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "photo-album"
+ }
}
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo.json
index 8fc608f..347f25c 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/photo.json
@@ -1,15 +1,23 @@
{
- "type" : "object",
- "title" : "photo",
- "extends": {"$ref":"../objectTypes/file.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "photo"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "photo",
+ "extends": {
+ "$ref": "../objectTypes/file.json"
},
- "displayName" : {
- "type" : "string",
- "default" : "a photo"
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "photo"
+ },
+ "displayName": {
+ "type": "string",
+ "default": "a photo"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/place.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/place.json
index d3dfb49..80af383 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/place.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/place.json
@@ -1,11 +1,24 @@
{
- "type" : "object",
- "title" : "place",
- "extends": [{"$ref":"../object.json"},{"$ref":"http://www.json-schema.org/address"}],
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "photo"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "place",
+ "extends": [
+ {
+ "$ref": "../object.json"
+ },
+ {
+ "$ref": "http://www.json-schema.org/address"
+ }
+ ],
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "photo"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/playlist.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/playlist.json
index 073e961..6ce9dd2 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/playlist.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/playlist.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "playlist",
- "extends": {"$ref":"../objectTypes/list.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "playlist"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "playlist",
+ "extends": {
+ "$ref": "../objectTypes/list.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "playlist"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/product.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/product.json
index b7a5c02..055b695 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/product.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/product.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "product",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "product"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "product",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "product"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/property.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/property.json
index d99725d..0cd630e 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/property.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/property.json
@@ -1,38 +1,48 @@
{
- "type" : "object",
- "title" : "property",
- "description" : "A property describes name, path and value. Can be used with delete, update or post verbs",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "property"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "property",
+ "description": "A property describes name, path and value. Can be used with delete, update or post verbs",
+ "extends": {
+ "$ref": "../object.json"
},
- "displayName" : {
- "type" : "string",
- "description" : "The human readable name of the property in the appropriate language",
- "optional" : true
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "property"
+ },
+ "displayName": {
+ "type": "string",
+ "description": "The human readable name of the property in the appropriate language",
+ "optional": true
+ },
+ "path": {
+ "type": "string",
+ "description": "dot delimited path to the property in the target. Ex: streetAddress"
+ }
},
- "path" : {
- "type" : "string",
- "description" : "dot delimited path to the property in the target. Ex: streetAddress"
+ "example": {
+ "actor": {
+ "id": 1212,
+ "displayName": "Peter"
+ },
+ "verb": "update",
+ "time": "2010-08-02T15:29:00Z",
+ "object": {
+ "objectType": "property",
+ "displayName": "street address",
+ "path": "streetAddress",
+ "content": "234 Amazing St"
+ },
+ "target": {
+ "id": 12121,
+ "time": "2010-08-02T15:29:00Z",
+ "displayName": "Peter's House"
+ }
}
- },
- "example" : {
- "actor" : {"id":1212, "displayName" : "Peter"},
- "verb" : "update",
- "time" : "2010-08-02T15:29:00Z",
- "object" :
- {
- "objectType" : "property",
- "displayName" : "street address",
- "path" : "streetAddress",
- "content" : "234 Amazing St"
- },
- "target" : {
- "id": 12121,
- "time" : "2010-08-02T15:29:00Z",
- "displayName" : "Peter's House"
- }
- }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/review.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/review.json
index 5705746..a3956e6 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/review.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/review.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "review",
- "extends": {"$ref":"../objectTypes/article.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "review"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "review",
+ "extends": {
+ "$ref": "../objectTypes/article.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "review"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/service.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/service.json
index 92544f4..3d4a496 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/service.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/service.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "service",
- "extends": {"$ref":"../object.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "service"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "service",
+ "extends": {
+ "$ref": "../object.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "service"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/song.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/song.json
index 9ebe7f2..46d6eb0 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/song.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/song.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "song",
- "extends": {"$ref":"../objectTypes/audio.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "song"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "song",
+ "extends": {
+ "$ref": "../objectTypes/audio.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "song"
+ }
+ }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/status.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/status.json
index 3309510..a029f19 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/status.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/status.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "status",
- "extends": {"$ref":"../objectTypes/note.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "song"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "status",
+ "extends": {
+ "$ref": "../objectTypes/note.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "song"
+ }
+ }
}
\ No newline at end of file
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/video.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/video.json
index 21f32a4..7ac63d8 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/video.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/objectTypes/video.json
@@ -1,11 +1,19 @@
{
- "type" : "object",
- "title" : "video",
- "extends": {"$ref":"../objectTypes/file.json"},
- "properties" :{
- "objectType" :{
- "type" :"string",
- "default" : "video"
- }
- }
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "video",
+ "extends": {
+ "$ref": "../objectTypes/file.json"
+ },
+ "properties": {
+ "objectType": {
+ "type": "string",
+ "default": "video"
+ }
+ }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/favorite.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/favorite.json
index e2fad27..ab07e6e 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/favorite.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/favorite.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Favorite",
- "description" : "To mark an object as a favorite",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "favorite"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Favorite",
+ "description": "To mark an object as a favorite",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} marked {object.displayName} as a favorite"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "favorite"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} marked {object.displayName} as a favorite"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/follow.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/follow.json
index b82f5c8..fcae35a 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/follow.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/follow.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Follow",
- "description" : "To start following an object",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "follow"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Follow",
+ "description": "To start following an object",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} started following {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "follow"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} started following {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/join.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/join.json
index bf912fb..9efd513 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/join.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/join.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Join",
- "description" : "To join an object. Usually a group",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "join"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Join",
+ "description": "To join an object. Usually a group",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} joined {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "join"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} joined {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/like.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/like.json
index 1da03bc..12cab08 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/like.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/like.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Like",
- "description" : "To like an object",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "like"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Like",
+ "description": "To like an object",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} likes {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "like"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} likes {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/make-friend.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/make-friend.json
index b9bb15d..edd1c46 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/make-friend.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/make-friend.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Befriend",
- "description" : "To friend an object. Usually a person",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "make-friend"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Befriend",
+ "description": "To friend an object. Usually a person",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} is now friends with {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "make-friend"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} is now friends with {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/play.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/play.json
index 242a8ac..95c8e9a 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/play.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/play.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Play",
- "description" : "To play an object",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "play"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Play",
+ "description": "To play an object",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} played {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "play"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} played {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/post.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/post.json
index e1d2b05..ea1ad39 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/post.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/post.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Post",
- "description" : "To publish an object",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "post"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Post",
+ "description": "To publish an object",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} posted {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "post"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} posted {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-maybe.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-maybe.json
index 5510e4b..5abf795 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-maybe.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-maybe.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Rsvp Maybe",
- "description" : "To indicate that the actor may attend an event",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "rsvp-maybe"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Rsvp Maybe",
+ "description": "To indicate that the actor may attend an event",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} may be attending {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "rsvp-maybe"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} may be attending {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-no.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-no.json
index 59a08cd..dc36ee3 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-no.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-no.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Rsvp No",
- "description" : "To indicate that the actor will not attend an event",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "rsvp-no"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Rsvp No",
+ "description": "To indicate that the actor will not attend an event",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} will not attend {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "rsvp-no"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} will not attend {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-yes.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-yes.json
index 7eb5eee..f62141e 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-yes.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/rsvp-yes.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Rsvp Yes",
- "description" : "To indicate that the actor will attend an event",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "rsvp-yes"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Rsvp Yes",
+ "description": "To indicate that the actor will attend an event",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} is attending {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "rsvp-yes"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} is attending {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/save.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/save.json
index 65ceb70..f9cfd33 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/save.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/save.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Save",
- "description" : "To save an object",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "save"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Save",
+ "description": "To save an object",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} saved {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "save"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} saved {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/share.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/share.json
index 8825008..18c0aea 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/share.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/share.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Share",
- "description" : "To share an object.",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "share"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Share",
+ "description": "To share an object.",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} shared {object.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "share"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} shared {object.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/tag.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/tag.json
index dfefbd2..0d19f07 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/tag.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/tag.json
@@ -1,16 +1,24 @@
{
- "type" : "object",
- "title" : "Tag",
- "description" : "To tag an object. Ex: A person being tagged in a photo",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "tag"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Tag",
+ "description": "To tag an object. Ex: A person being tagged in a photo",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} tagged {object.displayName} in {target.displayName}"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "tag"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} tagged {object.displayName} in {target.displayName}"
+ }
}
- }
}
diff --git a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/update.json b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/update.json
index bf25485..237ef04 100644
--- a/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/update.json
+++ b/streams-pojo/src/main/jsonschema/org/apache/streams/pojo/json/verbs/update.json
@@ -1,26 +1,34 @@
{
- "type" : "object",
- "title" : "Update",
- "description" : "To update a property on an object. Ex: Monica updated her street address to 234 Awesome St.",
- "notes" : "The new property value can be a scalar value or an object. See the property object type",
- "extends": {"$ref":"../activity.json"},
- "properties" :{
- "verb" :{
- "type" : "string",
- "default" : "update"
+ "$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0",
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
+ "id": "#",
+ "type": "object",
+ "title": "Update",
+ "description": "To update a property on an object. Ex: Monica updated her street address to 234 Awesome St.",
+ "notes": "The new property value can be a scalar value or an object. See the property object type",
+ "extends": {
+ "$ref": "../activity.json"
},
- "title" : {
- "type" : "string",
- "default" : "{actor.displayName} updated {target.displayName}'s {object.displayName} to {object.value}"
- },
- "object" : {
- "type" : "object",
- "$ref" : "../object.json"
- },
- "target" : {
- "type" : "object",
- "optional" : true,
- "$ref" : "../object.json"
+ "properties": {
+ "verb": {
+ "type": "string",
+ "default": "update"
+ },
+ "title": {
+ "type": "string",
+ "default": "{actor.displayName} updated {target.displayName}'s {object.displayName} to {object.value}"
+ },
+ "object": {
+ "type": "object",
+ "$ref": "../object.json"
+ },
+ "target": {
+ "type": "object",
+ "optional": true,
+ "$ref": "../object.json"
+ }
}
- }
}
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java b/streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormat.java
similarity index 71%
copy from streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java
copy to streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormat.java
index 190be54..ee111e1 100644
--- a/streams-pojo/src/test/java/org/apache/streams/data/data/util/JsonUtilTest.java
+++ b/streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormat.java
@@ -18,14 +18,15 @@
package org.apache.streams.data.data.util;
+import org.apache.streams.jackson.StreamsDateTimeFormat;
-import org.junit.Ignore;
-import org.junit.Test;
+/**
+ * Supporting class for {@link org.apache.streams.data.data.util.CustomDateTimeFormatTest}
+ */
+public class CustomDateTimeFormat implements StreamsDateTimeFormat {
-public class JsonUtilTest {
-
- @Ignore @Test
- public void testJsonToObject(){
+ @Override
+ public String getFormat() {
+ return "EEE MMM dd HH:mm:ss Z yyyy";
}
-
}
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormatTest.java b/streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormatTest.java
new file mode 100644
index 0000000..0163db5
--- /dev/null
+++ b/streams-pojo/src/test/java/org/apache/streams/data/data/util/CustomDateTimeFormatTest.java
@@ -0,0 +1,79 @@
+/*
+ * 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.data.data.util;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.apache.streams.jackson.StreamsJacksonMapper;
+import org.apache.streams.pojo.json.Activity;
+import org.joda.time.DateTime;
+import org.junit.Assert;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Testing {@link org.apache.streams.jackson.StreamsJacksonMapper} ability to bind
+ * custom DateTime formats.
+ */
+public class CustomDateTimeFormatTest {
+
+ @Test
+ public void testCustomDateTimeFormatExplicit() {
+ String format = "EEE MMM dd HH:mm:ss Z yyyy";
+ String input = "Tue Jan 17 21:21:46 Z 2012";
+ Long outputMillis = 1326835306000L;
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance(format);
+ DateTime time;
+ try {
+ String json = "{\"published\":\"" + input + "\"}";
+ Activity activity = mapper.readValue(json, Activity.class);
+
+ //Writes out value as a String including quotes
+ Long result = activity.getPublished().getMillis();
+
+ assertEquals(result, outputMillis);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+
+ @Test
+ public void testCustomDateTimeFormatReflection() {
+ String input = "Tue Jan 17 21:21:46 Z 2012";
+ Long outputMillis = 1326835306000L;
+ ObjectMapper mapper = StreamsJacksonMapper.getInstance();
+ DateTime time;
+ try {
+ String json = "{\"published\":\"" + input + "\"}";
+ Activity activity = mapper.readValue(json, Activity.class);
+
+ //Writes out value as a String including quotes
+ Long result = activity.getPublished().getMillis();
+
+ assertEquals(result, outputMillis);
+ } catch (Exception e) {
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+
+
+}
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/DateTimeSerDeTest.java b/streams-pojo/src/test/java/org/apache/streams/data/data/util/DateTimeSerDeTest.java
index b9c5635..d882450 100644
--- a/streams-pojo/src/test/java/org/apache/streams/data/data/util/DateTimeSerDeTest.java
+++ b/streams-pojo/src/test/java/org/apache/streams/data/data/util/DateTimeSerDeTest.java
@@ -30,7 +30,8 @@
import static org.junit.Assert.assertEquals;
/**
- * Created by sblackmon on 3/31/14.
+ * Testing {@link org.apache.streams.jackson.StreamsJacksonMapper} ability to read and write
+ * RFC3339 format.
*/
public class DateTimeSerDeTest {
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java b/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
index d9069c6..5d1a922 100644
--- a/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
+++ b/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
@@ -15,8 +15,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.streams.data.data.util;
+package org.apache.streams.data.data.util;
import org.apache.streams.data.util.RFC3339Utils;
import org.joda.time.DateTime;
@@ -33,6 +33,9 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
+/**
+ * Testing {@link org.apache.streams.data.util.RFC3339Utils}
+ */
public class RFC3339UtilsTest {
@Test
diff --git a/streams-runtimes/README.md b/streams-runtimes/README.md
new file mode 100644
index 0000000..97e412a
--- /dev/null
+++ b/streams-runtimes/README.md
@@ -0,0 +1,7 @@
+streams-runtimes
+==============
+
+These modules contain builders and helpers that support instantiation,
+setup, execution, and cleanup of streams in a specific runtime context.
+
+Please help improve these packages, or create new ones!
\ No newline at end of file
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
index 7938247..ae519e1 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/LocalStreamBuilder.java
@@ -22,10 +22,7 @@
import org.apache.streams.local.counters.StreamsTaskCounter;
import org.apache.streams.local.executors.ShutdownStreamOnUnhandleThrowableThreadPoolExecutor;
import org.apache.streams.local.queues.ThroughputQueue;
-import org.apache.streams.local.tasks.LocalStreamProcessMonitorThread;
-import org.apache.streams.local.tasks.StatusCounterMonitorThread;
-import org.apache.streams.local.tasks.StreamsProviderTask;
-import org.apache.streams.local.tasks.StreamsTask;
+import org.apache.streams.local.tasks.*;
import org.apache.streams.monitoring.tasks.BroadcastMonitorThread;
import org.joda.time.DateTime;
import org.slf4j.Logger;
@@ -69,6 +66,7 @@
private int maxQueueCapacity;
private String streamIdentifier = DEFAULT_STREAM_IDENTIFIER;
private DateTime startedAt = new DateTime();
+ private boolean useDeprecatedMonitors;
/**
* Creates a local stream builder with no config object and default maximum internal queue size of 500
@@ -120,18 +118,22 @@
if(this.streamConfig != null) {
this.streamConfig.put(DEFAULT_STARTED_AT_KEY, startedAt.getMillis());
}
-
+ this.useDeprecatedMonitors = false;
this.broadcastMonitor = new BroadcastMonitorThread(this.streamConfig);
this.futures = new HashMap<>();
}
+ public void setUseDeprecatedMonitors(boolean useDeprecatedMonitors) {
+ this.useDeprecatedMonitors = useDeprecatedMonitors;
+ }
+
@Override
public StreamBuilder newPerpetualStream(String id, StreamsProvider provider) {
validateId(id);
this.providers.put(id, new StreamComponent(id, provider, true, streamConfig));
++this.totalTasks;
- if( provider instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && provider instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -141,7 +143,7 @@
validateId(id);
this.providers.put(id, new StreamComponent(id, provider, false, streamConfig));
++this.totalTasks;
- if( provider instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && provider instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -151,7 +153,7 @@
validateId(id);
this.providers.put(id, new StreamComponent(id, provider, sequence, streamConfig));
++this.totalTasks;
- if( provider instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && provider instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -161,7 +163,7 @@
validateId(id);
this.providers.put(id, new StreamComponent(id, provider, start, end, streamConfig));
++this.totalTasks;
- if( provider instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && provider instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -173,7 +175,7 @@
this.components.put(id, comp);
connectToOtherComponents(inBoundIds, comp);
this.totalTasks += numTasks;
- if( processor instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && processor instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -185,7 +187,7 @@
this.components.put(id, comp);
connectToOtherComponents(inBoundIds, comp);
this.totalTasks += numTasks;
- if( writer instanceof DatumStatusCountable )
+ if(this.useDeprecatedMonitors && writer instanceof DatumStatusCountable )
++this.monitorTasks;
return this;
}
@@ -198,14 +200,16 @@
attachShutdownHandler();
boolean isRunning = true;
this.executor = new ShutdownStreamOnUnhandleThrowableThreadPoolExecutor(this.totalTasks, this);
- this.monitor = Executors.newFixedThreadPool(this.monitorTasks+1);
+ this.monitor = Executors.newCachedThreadPool();
Map<String, StreamsProviderTask> provTasks = new HashMap<String, StreamsProviderTask>();
tasks = new HashMap<String, List<StreamsTask>>();
boolean forcedShutDown = false;
try {
- monitorThread = new LocalStreamProcessMonitorThread(executor, 10);
- this.monitor.submit(monitorThread);
+ if (this.useDeprecatedMonitors) {
+ monitorThread = new LocalStreamProcessMonitorThread(executor, 10);
+ this.monitor.submit(monitorThread);
+ }
setupComponentTasks(tasks);
setupProviderTasks(provTasks);
LOGGER.info("Started stream with {} components", tasks.size());
@@ -215,7 +219,13 @@
isRunning = isRunning || task.isRunning();
}
for(StreamComponent task: components.values()) {
- isRunning = isRunning || task.getInBoundQueue().size() > 0;
+ boolean tasksRunning = false;
+ for(StreamsTask t : task.getStreamsTasks()) {
+ if(t instanceof BaseStreamsTask) {
+ tasksRunning = tasksRunning || ((BaseStreamsTask) t).isRunning();
+ }
+ }
+ isRunning = isRunning || (tasksRunning && task.getInBoundQueue().size() > 0);
}
if(isRunning) {
Thread.sleep(3000);
@@ -271,7 +281,9 @@
protected void shutdown(Map<String, List<StreamsTask>> streamsTasks) throws InterruptedException {
LOGGER.info("Attempting to shutdown tasks");
- this.monitorThread.shutdown();
+ if (this.monitorThread != null) {
+ this.monitorThread.shutdown();
+ }
this.executor.shutdown();
//complete stream shut down gracfully
for(StreamComponent prov : this.providers.values()) {
@@ -296,7 +308,7 @@
task.setStreamsTaskCounter(counter);
this.executor.submit(task);
provTasks.put(prov.getId(), (StreamsProviderTask) task);
- if( prov.isOperationCountable() ) {
+ if(this.useDeprecatedMonitors && prov.isOperationCountable() ) {
this.monitor.submit(new StatusCounterMonitorThread((DatumStatusCountable) prov.getOperation(), 10));
this.monitor.submit(new StatusCounterMonitorThread((DatumStatusCountable) task, 10));
}
@@ -314,11 +326,11 @@
task.setStreamConfig(this.streamConfig);
this.futures.put(task, this.executor.submit(task));
compTasks.add(task);
- if( comp.isOperationCountable() ) {
- this.monitor.submit(broadcastMonitor);
+ if(this.useDeprecatedMonitors && comp.isOperationCountable() ) {
this.monitor.submit(new StatusCounterMonitorThread((DatumStatusCountable) comp.getOperation(), 10));
this.monitor.submit(new StatusCounterMonitorThread((DatumStatusCountable) task, 10));
}
+ this.monitor.submit(broadcastMonitor);
}
streamsTasks.put(comp.getId(), compTasks);
}
@@ -385,6 +397,7 @@
try {
shutdown(tasks);
} catch (Exception e) {
+ LOGGER.error("Exception while trying to shutdown Stream: {}", e);
forceShutdown(tasks);
} finally {
if(!systemExiting) {
@@ -419,7 +432,7 @@
}
protected int getTimeout() {
- //Set the timeout of it is configured, otherwise signal downstream components to use their default
+ //Set the timeout of it is configured, otherwise signal downstream components to use their default
return streamConfig != null && streamConfig.containsKey(TIMEOUT_KEY) ? (Integer)streamConfig.get(TIMEOUT_KEY) : -1;
}
@@ -434,4 +447,4 @@
}
}
-}
+}
\ No newline at end of file
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/StreamComponent.java b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/StreamComponent.java
index 0dcc4d0..31c5981 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/StreamComponent.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/builders/StreamComponent.java
@@ -18,6 +18,7 @@
package org.apache.streams.local.builders;
+import com.google.common.collect.Lists;
import org.apache.streams.core.*;
import org.apache.streams.local.tasks.StreamsPersistWriterTask;
import org.apache.streams.local.tasks.StreamsProcessorTask;
@@ -51,6 +52,8 @@
private int numTasks = 1;
private boolean perpetual;
+ private List<StreamsTask> tasks;
+
private Map<String, Object> streamConfig;
/**
@@ -132,6 +135,7 @@
private void initializePrivateVariables() {
this.inBound = new HashSet<StreamComponent>();
this.outBound = new HashMap<StreamComponent, BlockingQueue<StreamsDatum>>();
+ this.tasks = Lists.newArrayList();
}
/**
@@ -240,9 +244,18 @@
else {
throw new InvalidStreamException("Underlying StreamComponoent was NULL.");
}
+
+ if(task != null) {
+ tasks.add(task);
+ }
+
return task;
}
+ public List<StreamsTask> getStreamsTasks() {
+ return this.tasks;
+ }
+
/**
* The unique of this component
* @return
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandleThrowableThreadPoolExecutor.java b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandleThrowableThreadPoolExecutor.java
index ea65ac2..c9cfec4 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandleThrowableThreadPoolExecutor.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandleThrowableThreadPoolExecutor.java
@@ -15,6 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.streams.local.executors;
import org.apache.streams.local.builders.LocalStreamBuilder;
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsPersistWriterTask.java b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsPersistWriterTask.java
index 050e297..5d75368 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsPersistWriterTask.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsPersistWriterTask.java
@@ -114,6 +114,9 @@
} catch (InterruptedException ie) {
LOGGER.debug("Received InterruptedException. Shutting down and re-applying interrupt status.");
this.keepRunning.set(false);
+ if(!this.inQueue.isEmpty()) {
+ LOGGER.error("Received InteruptedException and input queue still has data, count={}, processor={}",this.inQueue.size(), this.writer.getClass().getName());
+ }
Thread.currentThread().interrupt();
} finally {
this.blocked.set(false);
diff --git a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsProcessorTask.java b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsProcessorTask.java
index 2ec6336..d03dfa3 100644
--- a/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsProcessorTask.java
+++ b/streams-runtimes/streams-runtime-local/src/main/java/org/apache/streams/local/tasks/StreamsProcessorTask.java
@@ -123,6 +123,9 @@
} catch (InterruptedException ie) {
LOGGER.debug("Received InteruptedException, shutting down and re-applying interrupt status.");
this.keepRunning.set(false);
+ if(!this.inQueue.isEmpty()) {
+ LOGGER.error("Received InteruptedException and input queue still has data, count={}, processor={}",this.inQueue.size(), this.processor.getClass().getName());
+ }
Thread.currentThread().interrupt();
} finally {
this.blocked.set(false);
diff --git a/streams-runtimes/streams-runtime-local/src/main/jsonschema/LocalRuntimeConfiguration.json b/streams-runtimes/streams-runtime-local/src/main/jsonschema/LocalRuntimeConfiguration.json
index 3432318..c7f79a0 100644
--- a/streams-runtimes/streams-runtime-local/src/main/jsonschema/LocalRuntimeConfiguration.json
+++ b/streams-runtimes/streams-runtime-local/src/main/jsonschema/LocalRuntimeConfiguration.json
@@ -1,7 +1,10 @@
{
- "type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
+ "$license": [
+ "http://www.apache.org/licenses/LICENSE-2.0"
+ ],
"id": "#",
+ "type": "object",
"javaType" : "org.apache.streams.local.LocalRuntimeConfiguration",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
diff --git a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandledThrowableThreadPoolExecutorTest.java b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandledThrowableThreadPoolExecutorTest.java
index f6dd70d..7e33ab9 100644
--- a/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandledThrowableThreadPoolExecutorTest.java
+++ b/streams-runtimes/streams-runtime-local/src/test/java/org/apache/streams/local/executors/ShutdownStreamOnUnhandledThrowableThreadPoolExecutorTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.local.executors;
import org.apache.streams.local.builders.LocalStreamBuilder;
diff --git a/streams-util/README.md b/streams-util/README.md
new file mode 100644
index 0000000..6ec1d51
--- /dev/null
+++ b/streams-util/README.md
@@ -0,0 +1,4 @@
+streams-util
+==============
+
+streams-util contains utility classes and testing support classes.
\ No newline at end of file
diff --git a/streams-util/pom.xml b/streams-util/pom.xml
index fce6858..26c6193 100644
--- a/streams-util/pom.xml
+++ b/streams-util/pom.xml
@@ -53,4 +53,19 @@
<version>2.1.2</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/AbstractBackOffStrategy.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/AbstractBackOffStrategy.java
index a68a94a..7fbfc6b 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/AbstractBackOffStrategy.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/AbstractBackOffStrategy.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff;
import java.util.concurrent.atomic.AtomicInteger;
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffException.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffException.java
index a38e55d..223303c 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffException.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffException.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff;
/**
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffStrategy.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffStrategy.java
index a132e02..a0d80e8 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffStrategy.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/BackOffStrategy.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff;
/**
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ConstantTimeBackOffStrategy.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ConstantTimeBackOffStrategy.java
index cc70fe1..b3fd3f2 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ConstantTimeBackOffStrategy.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ConstantTimeBackOffStrategy.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff.impl;
import org.apache.streams.util.api.requests.backoff.AbstractBackOffStrategy;
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ExponentialBackOffStrategy.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ExponentialBackOffStrategy.java
index 65616e0..a5a9656 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ExponentialBackOffStrategy.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/ExponentialBackOffStrategy.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff.impl;
import org.apache.streams.util.api.requests.backoff.AbstractBackOffStrategy;
diff --git a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/LinearTimeBackOffStrategy.java b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/LinearTimeBackOffStrategy.java
index 3443c9c..38d05a1 100644
--- a/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/LinearTimeBackOffStrategy.java
+++ b/streams-util/src/main/java/org/apache/streams/util/api/requests/backoff/impl/LinearTimeBackOffStrategy.java
@@ -12,6 +12,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+
package org.apache.streams.util.api.requests.backoff.impl;
import org.apache.streams.util.api.requests.backoff.AbstractBackOffStrategy;
diff --git a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/BackOffStrategyTest.java b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/BackOffStrategyTest.java
index a97fea9..108813e 100644
--- a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/BackOffStrategyTest.java
+++ b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/BackOffStrategyTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.util.api.requests.backoff;
import org.junit.Test;
diff --git a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ConstantTimeBackOffStrategyTest.java b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ConstantTimeBackOffStrategyTest.java
index 4c59277..0eedaa0 100644
--- a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ConstantTimeBackOffStrategyTest.java
+++ b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ConstantTimeBackOffStrategyTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.util.api.requests.backoff;
import com.carrotsearch.randomizedtesting.RandomizedTest;
diff --git a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ExponentialBackOffStrategyTest.java b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ExponentialBackOffStrategyTest.java
index e0744ca..d595254 100644
--- a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ExponentialBackOffStrategyTest.java
+++ b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/ExponentialBackOffStrategyTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.util.api.requests.backoff;
import org.apache.streams.util.api.requests.backoff.impl.ExponentialBackOffStrategy;
diff --git a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/LinearTimeBackOffStartegyTest.java b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/LinearTimeBackOffStartegyTest.java
index ad7cf10..8b3f384 100644
--- a/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/LinearTimeBackOffStartegyTest.java
+++ b/streams-util/src/test/java/org/apache/streams/util/api/requests/backoff/LinearTimeBackOffStartegyTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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.util.api.requests.backoff;
import org.apache.streams.util.api.requests.backoff.impl.LinearTimeBackOffStrategy;
diff --git a/streams-util/src/test/java/org/apache/streams/util/files/StreamsScannerUtil.java b/streams-util/src/test/java/org/apache/streams/util/files/StreamsScannerUtil.java
new file mode 100644
index 0000000..576cef0
--- /dev/null
+++ b/streams-util/src/test/java/org/apache/streams/util/files/StreamsScannerUtil.java
@@ -0,0 +1,39 @@
+/*
+ * 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.util.files;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+/**
+ * Test Utility for acquiring a Scanner that won't choke on unicode or odd line-breaks.
+ */
+public class StreamsScannerUtil {
+
+ protected static Pattern newLinePattern = Pattern.compile("(\\r\\n?|\\n)", Pattern.MULTILINE);
+
+ public static Scanner getInstance(String resourcePath) {
+
+ InputStream testFileStream = StreamsScannerUtil.class.getResourceAsStream(resourcePath);
+ return new Scanner(testFileStream, "UTF-8").useDelimiter(newLinePattern);
+
+ };
+}
diff --git a/streams-util/src/test/java/org/apache/streams/util/oauth/tokens/tokenmanager/TestBasicTokenManager.java b/streams-util/src/test/java/org/apache/streams/util/oauth/tokens/tokenmanager/TestBasicTokenManager.java
index cd9ed18..c08b68b 100644
--- a/streams-util/src/test/java/org/apache/streams/util/oauth/tokens/tokenmanager/TestBasicTokenManager.java
+++ b/streams-util/src/test/java/org/apache/streams/util/oauth/tokens/tokenmanager/TestBasicTokenManager.java
@@ -1,5 +1,22 @@
-package org.apache.streams.util.oauth.tokens.tokenmanager;
+/*
+ * 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.util.oauth.tokens.tokenmanager;
import org.apache.streams.util.oauth.tokens.AbstractOauthToken;
import org.apache.streams.util.oauth.tokens.tokenmanager.impl.BasicTokenManger;
diff --git a/streams-web/src/main/webapp/demo/activityDemo.html b/streams-web/src/main/webapp/demo/activityDemo.html
index 452bc61..c8e3a1d 100644
--- a/streams-web/src/main/webapp/demo/activityDemo.html
+++ b/streams-web/src/main/webapp/demo/activityDemo.html
@@ -1,8 +1,25 @@
+<!--
+ ~ 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.
+ -->
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/html">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
- <script type="text/javascript" src="js/handlebars.js"></script>
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js"></script>
<script type="text/javascript" src="js/activityDemo.js"></script>
<link rel="stylesheet" type="text/css" href="css/activityStyles.css" />
<title>Activity Streams Demo</title>
diff --git a/streams-web/src/main/webapp/demo/css/activityStyles.css b/streams-web/src/main/webapp/demo/css/activityStyles.css
index b8b0e55..a496f2e 100644
--- a/streams-web/src/main/webapp/demo/css/activityStyles.css
+++ b/streams-web/src/main/webapp/demo/css/activityStyles.css
@@ -1,3 +1,20 @@
+/*<license>
+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.
+</license>*/
.activity {
-moz-box-shadow: 3px 3px 5px 6px #ccc;
-webkit-box-shadow: 3px 3px 5px 6px #ccc;
diff --git a/streams-web/src/main/webapp/demo/js/activityDemo.js b/streams-web/src/main/webapp/demo/js/activityDemo.js
index 17c1e7b..2d5421d 100644
--- a/streams-web/src/main/webapp/demo/js/activityDemo.js
+++ b/streams-web/src/main/webapp/demo/js/activityDemo.js
@@ -1,3 +1,20 @@
+/*
+ ~ 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.
+ */
var activityDemo = activityDemo || (function(){
var subscriberURL = "";
var registerUrl = "/streams-web/apps/subscriber/register";
diff --git a/streams-web/src/main/webapp/demo/js/handlebars.js b/streams-web/src/main/webapp/demo/js/handlebars.js
deleted file mode 100644
index 560c34c..0000000
--- a/streams-web/src/main/webapp/demo/js/handlebars.js
+++ /dev/null
@@ -1,2278 +0,0 @@
-/*
-
- Copyright (C) 2011 by Yehuda Katz
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-
- */
-
-// lib/handlebars/browser-prefix.js
-var Handlebars = {};
-
-(function(Handlebars, undefined) {
- ;
-// lib/handlebars/base.js
-
- Handlebars.VERSION = "1.0.0";
- Handlebars.COMPILER_REVISION = 4;
-
- Handlebars.REVISION_CHANGES = {
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
- 2: '== 1.0.0-rc.3',
- 3: '== 1.0.0-rc.4',
- 4: '>= 1.0.0'
- };
-
- Handlebars.helpers = {};
- Handlebars.partials = {};
-
- var toString = Object.prototype.toString,
- functionType = '[object Function]',
- objectType = '[object Object]';
-
- Handlebars.registerHelper = function(name, fn, inverse) {
- if (toString.call(name) === objectType) {
- if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
- Handlebars.Utils.extend(this.helpers, name);
- } else {
- if (inverse) { fn.not = inverse; }
- this.helpers[name] = fn;
- }
- };
-
- Handlebars.registerPartial = function(name, str) {
- if (toString.call(name) === objectType) {
- Handlebars.Utils.extend(this.partials, name);
- } else {
- this.partials[name] = str;
- }
- };
-
- Handlebars.registerHelper('helperMissing', function(arg) {
- if(arguments.length === 2) {
- return undefined;
- } else {
- throw new Error("Missing helper: '" + arg + "'");
- }
- });
-
- Handlebars.registerHelper('blockHelperMissing', function(context, options) {
- var inverse = options.inverse || function() {}, fn = options.fn;
-
- var type = toString.call(context);
-
- if(type === functionType) { context = context.call(this); }
-
- if(context === true) {
- return fn(this);
- } else if(context === false || context == null) {
- return inverse(this);
- } else if(type === "[object Array]") {
- if(context.length > 0) {
- return Handlebars.helpers.each(context, options);
- } else {
- return inverse(this);
- }
- } else {
- return fn(context);
- }
- });
-
- Handlebars.K = function() {};
-
- Handlebars.createFrame = Object.create || function(object) {
- Handlebars.K.prototype = object;
- var obj = new Handlebars.K();
- Handlebars.K.prototype = null;
- return obj;
- };
-
- Handlebars.logger = {
- DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
-
- methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
-
- // can be overridden in the host environment
- log: function(level, obj) {
- if (Handlebars.logger.level <= level) {
- var method = Handlebars.logger.methodMap[level];
- if (typeof console !== 'undefined' && console[method]) {
- console[method].call(console, obj);
- }
- }
- }
- };
-
- Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
-
- Handlebars.registerHelper('each', function(context, options) {
- var fn = options.fn, inverse = options.inverse;
- var i = 0, ret = "", data;
-
- var type = toString.call(context);
- if(type === functionType) { context = context.call(this); }
-
- if (options.data) {
- data = Handlebars.createFrame(options.data);
- }
-
- if(context && typeof context === 'object') {
- if(context instanceof Array){
- for(var j = context.length; i<j; i++) {
- if (data) { data.index = i; }
- ret = ret + fn(context[i], { data: data });
- }
- } else {
- for(var key in context) {
- if(context.hasOwnProperty(key)) {
- if(data) { data.key = key; }
- ret = ret + fn(context[key], {data: data});
- i++;
- }
- }
- }
- }
-
- if(i === 0){
- ret = inverse(this);
- }
-
- return ret;
- });
-
- Handlebars.registerHelper('if', function(conditional, options) {
- var type = toString.call(conditional);
- if(type === functionType) { conditional = conditional.call(this); }
-
- if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
-
- Handlebars.registerHelper('unless', function(conditional, options) {
- return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
- });
-
- Handlebars.registerHelper('with', function(context, options) {
- var type = toString.call(context);
- if(type === functionType) { context = context.call(this); }
-
- if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
- });
-
- Handlebars.registerHelper('log', function(context, options) {
- var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
- Handlebars.log(level, context);
- });
- ;
-// lib/handlebars/compiler/parser.js
- /* Jison generated parser */
- var handlebars = (function(){
- var parser = {trace: function trace() { },
- yy: {},
- symbols_: {"error":2,"root":3,"program":4,"EOF":5,"simpleInverse":6,"statements":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"params":27,"hash":28,"dataName":29,"param":30,"STRING":31,"INTEGER":32,"BOOLEAN":33,"hashSegments":34,"hashSegment":35,"ID":36,"EQUALS":37,"DATA":38,"pathSegments":39,"SEP":40,"$accept":0,"$end":1},
- terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",31:"STRING",32:"INTEGER",33:"BOOLEAN",36:"ID",37:"EQUALS",38:"DATA",40:"SEP"},
- productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[27,2],[27,1],[30,1],[30,1],[30,1],[30,1],[30,1],[28,1],[34,2],[34,1],[35,3],[35,3],[35,3],[35,3],[35,3],[26,1],[26,1],[26,1],[29,2],[21,1],[39,3],[39,1]],
- performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
-
- var $0 = $$.length - 1;
- switch (yystate) {
- case 1: return $$[$0-1];
- break;
- case 2: this.$ = new yy.ProgramNode([], $$[$0]);
- break;
- case 3: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
- break;
- case 4: this.$ = new yy.ProgramNode($$[$0-1], []);
- break;
- case 5: this.$ = new yy.ProgramNode($$[$0]);
- break;
- case 6: this.$ = new yy.ProgramNode([], []);
- break;
- case 7: this.$ = new yy.ProgramNode([]);
- break;
- case 8: this.$ = [$$[$0]];
- break;
- case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
- break;
- case 10: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
- break;
- case 11: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
- break;
- case 12: this.$ = $$[$0];
- break;
- case 13: this.$ = $$[$0];
- break;
- case 14: this.$ = new yy.ContentNode($$[$0]);
- break;
- case 15: this.$ = new yy.CommentNode($$[$0]);
- break;
- case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
- break;
- case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
- break;
- case 18: this.$ = $$[$0-1];
- break;
- case 19:
- // Parsing out the '&' escape token at this level saves ~500 bytes after min due to the removal of one parser node.
- this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], $$[$0-2][2] === '&');
-
- break;
- case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
- break;
- case 21: this.$ = new yy.PartialNode($$[$0-1]);
- break;
- case 22: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
- break;
- case 23:
- break;
- case 24: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
- break;
- case 25: this.$ = [[$$[$0-1]].concat($$[$0]), null];
- break;
- case 26: this.$ = [[$$[$0-1]], $$[$0]];
- break;
- case 27: this.$ = [[$$[$0]], null];
- break;
- case 28: this.$ = [[$$[$0]], null];
- break;
- case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
- break;
- case 30: this.$ = [$$[$0]];
- break;
- case 31: this.$ = $$[$0];
- break;
- case 32: this.$ = new yy.StringNode($$[$0]);
- break;
- case 33: this.$ = new yy.IntegerNode($$[$0]);
- break;
- case 34: this.$ = new yy.BooleanNode($$[$0]);
- break;
- case 35: this.$ = $$[$0];
- break;
- case 36: this.$ = new yy.HashNode($$[$0]);
- break;
- case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
- break;
- case 38: this.$ = [$$[$0]];
- break;
- case 39: this.$ = [$$[$0-2], $$[$0]];
- break;
- case 40: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
- break;
- case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
- break;
- case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
- break;
- case 43: this.$ = [$$[$0-2], $$[$0]];
- break;
- case 44: this.$ = new yy.PartialNameNode($$[$0]);
- break;
- case 45: this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0]));
- break;
- case 46: this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0]));
- break;
- case 47: this.$ = new yy.DataNode($$[$0]);
- break;
- case 48: this.$ = new yy.IdNode($$[$0]);
- break;
- case 49: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
- break;
- case 50: this.$ = [{part: $$[$0]}];
- break;
- }
- },
- table: [{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],25:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],25:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],25:[1,16]},{17:23,18:[1,22],21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],25:[2,8]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{4:30,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{17:31,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:32,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:33,21:24,29:25,36:[1,28],38:[1,27],39:26},{21:35,26:34,31:[1,36],32:[1,37],36:[1,28],39:26},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],25:[1,16]},{17:23,21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,4],7:38,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],25:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{18:[1,39]},{18:[2,27],21:44,24:[2,27],27:40,28:41,29:48,30:42,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,28],24:[2,28]},{18:[2,48],24:[2,48],31:[2,48],32:[2,48],33:[2,48],36:[2,48],38:[2,48],40:[1,51]},{21:52,36:[1,28],39:26},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],38:[2,50],40:[2,50]},{10:53,20:[1,54]},{10:55,20:[1,54]},{18:[1,56]},{18:[1,57]},{24:[1,58]},{18:[1,59],21:60,36:[1,28],39:26},{18:[2,44],36:[2,44]},{18:[2,45],36:[2,45]},{18:[2,46],36:[2,46]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],25:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{18:[2,25],21:44,24:[2,25],28:61,29:48,30:62,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,26],24:[2,26]},{18:[2,30],24:[2,30],31:[2,30],32:[2,30],33:[2,30],36:[2,30],38:[2,30]},{18:[2,36],24:[2,36],35:63,36:[1,64]},{18:[2,31],24:[2,31],31:[2,31],32:[2,31],33:[2,31],36:[2,31],38:[2,31]},{18:[2,32],24:[2,32],31:[2,32],32:[2,32],33:[2,32],36:[2,32],38:[2,32]},{18:[2,33],24:[2,33],31:[2,33],32:[2,33],33:[2,33],36:[2,33],38:[2,33]},{18:[2,34],24:[2,34],31:[2,34],32:[2,34],33:[2,34],36:[2,34],38:[2,34]},{18:[2,35],24:[2,35],31:[2,35],32:[2,35],33:[2,35],36:[2,35],38:[2,35]},{18:[2,38],24:[2,38],36:[2,38]},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],37:[1,65],38:[2,50],40:[2,50]},{36:[1,66]},{18:[2,47],24:[2,47],31:[2,47],32:[2,47],33:[2,47],36:[2,47],38:[2,47]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{21:67,36:[1,28],39:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,68]},{18:[2,24],24:[2,24]},{18:[2,29],24:[2,29],31:[2,29],32:[2,29],33:[2,29],36:[2,29],38:[2,29]},{18:[2,37],24:[2,37],36:[2,37]},{37:[1,65]},{21:69,29:73,31:[1,70],32:[1,71],33:[1,72],36:[1,28],38:[1,27],39:26},{18:[2,49],24:[2,49],31:[2,49],32:[2,49],33:[2,49],36:[2,49],38:[2,49],40:[2,49]},{18:[1,74]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{18:[2,39],24:[2,39],36:[2,39]},{18:[2,40],24:[2,40],36:[2,40]},{18:[2,41],24:[2,41],36:[2,41]},{18:[2,42],24:[2,42],36:[2,42]},{18:[2,43],24:[2,43],36:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]}],
- defaultActions: {17:[2,1]},
- parseError: function parseError(str, hash) {
- throw new Error(str);
- },
- parse: function parse(input) {
- var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
- this.lexer.setInput(input);
- this.lexer.yy = this.yy;
- this.yy.lexer = this.lexer;
- this.yy.parser = this;
- if (typeof this.lexer.yylloc == "undefined")
- this.lexer.yylloc = {};
- var yyloc = this.lexer.yylloc;
- lstack.push(yyloc);
- var ranges = this.lexer.options && this.lexer.options.ranges;
- if (typeof this.yy.parseError === "function")
- this.parseError = this.yy.parseError;
- function popStack(n) {
- stack.length = stack.length - 2 * n;
- vstack.length = vstack.length - n;
- lstack.length = lstack.length - n;
- }
- function lex() {
- var token;
- token = self.lexer.lex() || 1;
- if (typeof token !== "number") {
- token = self.symbols_[token] || token;
- }
- return token;
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
- while (true) {
- state = stack[stack.length - 1];
- if (this.defaultActions[state]) {
- action = this.defaultActions[state];
- } else {
- if (symbol === null || typeof symbol == "undefined") {
- symbol = lex();
- }
- action = table[state] && table[state][symbol];
- }
- if (typeof action === "undefined" || !action.length || !action[0]) {
- var errStr = "";
- if (!recovering) {
- expected = [];
- for (p in table[state])
- if (this.terminals_[p] && p > 2) {
- expected.push("'" + this.terminals_[p] + "'");
- }
- if (this.lexer.showPosition) {
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
- } else {
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
- }
- this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
- }
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol);
- vstack.push(this.lexer.yytext);
- lstack.push(this.lexer.yylloc);
- stack.push(action[1]);
- symbol = null;
- if (!preErrorSymbol) {
- yyleng = this.lexer.yyleng;
- yytext = this.lexer.yytext;
- yylineno = this.lexer.yylineno;
- yyloc = this.lexer.yylloc;
- if (recovering > 0)
- recovering--;
- } else {
- symbol = preErrorSymbol;
- preErrorSymbol = null;
- }
- break;
- case 2:
- len = this.productions_[action[1]][1];
- yyval.$ = vstack[vstack.length - len];
- yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
- if (ranges) {
- yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
- }
- r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
- if (typeof r !== "undefined") {
- return r;
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2);
- vstack = vstack.slice(0, -1 * len);
- lstack = lstack.slice(0, -1 * len);
- }
- stack.push(this.productions_[action[1]][0]);
- vstack.push(yyval.$);
- lstack.push(yyval._$);
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
- stack.push(newState);
- break;
- case 3:
- return true;
- }
- }
- return true;
- }
- };
- /* Jison generated lexer */
- var lexer = (function(){
- var lexer = ({EOF:1,
- parseError:function parseError(str, hash) {
- if (this.yy.parser) {
- this.yy.parser.parseError(str, hash);
- } else {
- throw new Error(str);
- }
- },
- setInput:function (input) {
- this._input = input;
- this._more = this._less = this.done = false;
- this.yylineno = this.yyleng = 0;
- this.yytext = this.matched = this.match = '';
- this.conditionStack = ['INITIAL'];
- this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
- if (this.options.ranges) this.yylloc.range = [0,0];
- this.offset = 0;
- return this;
- },
- input:function () {
- var ch = this._input[0];
- this.yytext += ch;
- this.yyleng++;
- this.offset++;
- this.match += ch;
- this.matched += ch;
- var lines = ch.match(/(?:\r\n?|\n).*/g);
- if (lines) {
- this.yylineno++;
- this.yylloc.last_line++;
- } else {
- this.yylloc.last_column++;
- }
- if (this.options.ranges) this.yylloc.range[1]++;
-
- this._input = this._input.slice(1);
- return ch;
- },
- unput:function (ch) {
- var len = ch.length;
- var lines = ch.split(/(?:\r\n?|\n)/g);
-
- this._input = ch + this._input;
- this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
- //this.yyleng -= len;
- this.offset -= len;
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
- this.match = this.match.substr(0, this.match.length-1);
- this.matched = this.matched.substr(0, this.matched.length-1);
-
- if (lines.length-1) this.yylineno -= lines.length-1;
- var r = this.yylloc.range;
-
- this.yylloc = {first_line: this.yylloc.first_line,
- last_line: this.yylineno+1,
- first_column: this.yylloc.first_column,
- last_column: lines ?
- (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
- this.yylloc.first_column - len
- };
-
- if (this.options.ranges) {
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
- }
- return this;
- },
- more:function () {
- this._more = true;
- return this;
- },
- less:function (n) {
- this.unput(this.match.slice(n));
- },
- pastInput:function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length);
- return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
- },
- upcomingInput:function () {
- var next = this.match;
- if (next.length < 20) {
- next += this._input.substr(0, 20-next.length);
- }
- return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
- },
- showPosition:function () {
- var pre = this.pastInput();
- var c = new Array(pre.length + 1).join("-");
- return pre + this.upcomingInput() + "\n" + c+"^";
- },
- next:function () {
- if (this.done) {
- return this.EOF;
- }
- if (!this._input) this.done = true;
-
- var token,
- match,
- tempMatch,
- index,
- col,
- lines;
- if (!this._more) {
- this.yytext = '';
- this.match = '';
- }
- var rules = this._currentRules();
- for (var i=0;i < rules.length; i++) {
- tempMatch = this._input.match(this.rules[rules[i]]);
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
- match = tempMatch;
- index = i;
- if (!this.options.flex) break;
- }
- }
- if (match) {
- lines = match[0].match(/(?:\r\n?|\n).*/g);
- if (lines) this.yylineno += lines.length;
- this.yylloc = {first_line: this.yylloc.last_line,
- last_line: this.yylineno+1,
- first_column: this.yylloc.last_column,
- last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
- this.yytext += match[0];
- this.match += match[0];
- this.matches = match;
- this.yyleng = this.yytext.length;
- if (this.options.ranges) {
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
- }
- this._more = false;
- this._input = this._input.slice(match[0].length);
- this.matched += match[0];
- token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
- if (this.done && this._input) this.done = false;
- if (token) return token;
- else return;
- }
- if (this._input === "") {
- return this.EOF;
- } else {
- return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
- {text: "", token: null, line: this.yylineno});
- }
- },
- lex:function lex() {
- var r = this.next();
- if (typeof r !== 'undefined') {
- return r;
- } else {
- return this.lex();
- }
- },
- begin:function begin(condition) {
- this.conditionStack.push(condition);
- },
- popState:function popState() {
- return this.conditionStack.pop();
- },
- _currentRules:function _currentRules() {
- return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
- },
- topState:function () {
- return this.conditionStack[this.conditionStack.length-2];
- },
- pushState:function begin(condition) {
- this.begin(condition);
- }});
- lexer.options = {};
- lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
-
- var YYSTATE=YY_START
- switch($avoiding_name_collisions) {
- case 0: yy_.yytext = "\\"; return 14;
- break;
- case 1:
- if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
- if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
- if(yy_.yytext) return 14;
-
- break;
- case 2: return 14;
- break;
- case 3:
- if(yy_.yytext.slice(-1) !== "\\") this.popState();
- if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
- return 14;
-
- break;
- case 4: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
- break;
- case 5: return 25;
- break;
- case 6: return 16;
- break;
- case 7: return 20;
- break;
- case 8: return 19;
- break;
- case 9: return 19;
- break;
- case 10: return 23;
- break;
- case 11: return 22;
- break;
- case 12: this.popState(); this.begin('com');
- break;
- case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
- break;
- case 14: return 22;
- break;
- case 15: return 37;
- break;
- case 16: return 36;
- break;
- case 17: return 36;
- break;
- case 18: return 40;
- break;
- case 19: /*ignore whitespace*/
- break;
- case 20: this.popState(); return 24;
- break;
- case 21: this.popState(); return 18;
- break;
- case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 31;
- break;
- case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 31;
- break;
- case 24: return 38;
- break;
- case 25: return 33;
- break;
- case 26: return 33;
- break;
- case 27: return 32;
- break;
- case 28: return 36;
- break;
- case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 36;
- break;
- case 30: return 'INVALID';
- break;
- case 31: return 5;
- break;
- }
- };
- lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
- lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"INITIAL":{"rules":[0,1,2,31],"inclusive":true}};
- return lexer;})()
- parser.lexer = lexer;
- function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
- return new Parser;
- })();;
-// lib/handlebars/compiler/base.js
-
- Handlebars.Parser = handlebars;
-
- Handlebars.parse = function(input) {
-
- // Just return if an already-compile AST was passed in.
- if(input.constructor === Handlebars.AST.ProgramNode) { return input; }
-
- Handlebars.Parser.yy = Handlebars.AST;
- return Handlebars.Parser.parse(input);
- };
- ;
-// lib/handlebars/compiler/ast.js
- Handlebars.AST = {};
-
- Handlebars.AST.ProgramNode = function(statements, inverse) {
- this.type = "program";
- this.statements = statements;
- if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
- };
-
- Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
- this.type = "mustache";
- this.escaped = !unescaped;
- this.hash = hash;
-
- var id = this.id = rawParams[0];
- var params = this.params = rawParams.slice(1);
-
- // a mustache is an eligible helper if:
- // * its id is simple (a single part, not `this` or `..`)
- var eligibleHelper = this.eligibleHelper = id.isSimple;
-
- // a mustache is definitely a helper if:
- // * it is an eligible helper, and
- // * it has at least one parameter or hash segment
- this.isHelper = eligibleHelper && (params.length || hash);
-
- // if a mustache is an eligible helper but not a definite
- // helper, it is ambiguous, and will be resolved in a later
- // pass or at runtime.
- };
-
- Handlebars.AST.PartialNode = function(partialName, context) {
- this.type = "partial";
- this.partialName = partialName;
- this.context = context;
- };
-
- Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
- var verifyMatch = function(open, close) {
- if(open.original !== close.original) {
- throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
- }
- };
-
- verifyMatch(mustache.id, close);
- this.type = "block";
- this.mustache = mustache;
- this.program = program;
- this.inverse = inverse;
-
- if (this.inverse && !this.program) {
- this.isInverse = true;
- }
- };
-
- Handlebars.AST.ContentNode = function(string) {
- this.type = "content";
- this.string = string;
- };
-
- Handlebars.AST.HashNode = function(pairs) {
- this.type = "hash";
- this.pairs = pairs;
- };
-
- Handlebars.AST.IdNode = function(parts) {
- this.type = "ID";
-
- var original = "",
- dig = [],
- depth = 0;
-
- for(var i=0,l=parts.length; i<l; i++) {
- var part = parts[i].part;
- original += (parts[i].separator || '') + part;
-
- if (part === ".." || part === "." || part === "this") {
- if (dig.length > 0) { throw new Handlebars.Exception("Invalid path: " + original); }
- else if (part === "..") { depth++; }
- else { this.isScoped = true; }
- }
- else { dig.push(part); }
- }
-
- this.original = original;
- this.parts = dig;
- this.string = dig.join('.');
- this.depth = depth;
-
- // an ID is simple if it only has one part, and that part is not
- // `..` or `this`.
- this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
-
- this.stringModeValue = this.string;
- };
-
- Handlebars.AST.PartialNameNode = function(name) {
- this.type = "PARTIAL_NAME";
- this.name = name.original;
- };
-
- Handlebars.AST.DataNode = function(id) {
- this.type = "DATA";
- this.id = id;
- };
-
- Handlebars.AST.StringNode = function(string) {
- this.type = "STRING";
- this.original =
- this.string =
- this.stringModeValue = string;
- };
-
- Handlebars.AST.IntegerNode = function(integer) {
- this.type = "INTEGER";
- this.original =
- this.integer = integer;
- this.stringModeValue = Number(integer);
- };
-
- Handlebars.AST.BooleanNode = function(bool) {
- this.type = "BOOLEAN";
- this.bool = bool;
- this.stringModeValue = bool === "true";
- };
-
- Handlebars.AST.CommentNode = function(comment) {
- this.type = "comment";
- this.comment = comment;
- };
- ;
-// lib/handlebars/utils.js
-
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
-
- Handlebars.Exception = function(message) {
- var tmp = Error.prototype.constructor.apply(this, arguments);
-
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
- for (var idx = 0; idx < errorProps.length; idx++) {
- this[errorProps[idx]] = tmp[errorProps[idx]];
- }
- };
- Handlebars.Exception.prototype = new Error();
-
-// Build out our basic SafeString type
- Handlebars.SafeString = function(string) {
- this.string = string;
- };
- Handlebars.SafeString.prototype.toString = function() {
- return this.string.toString();
- };
-
- var escape = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'",
- "`": "`"
- };
-
- var badChars = /[&<>"'`]/g;
- var possible = /[&<>"'`]/;
-
- var escapeChar = function(chr) {
- return escape[chr] || "&";
- };
-
- Handlebars.Utils = {
- extend: function(obj, value) {
- for(var key in value) {
- if(value.hasOwnProperty(key)) {
- obj[key] = value[key];
- }
- }
- },
-
- escapeExpression: function(string) {
- // don't escape SafeStrings, since they're already safe
- if (string instanceof Handlebars.SafeString) {
- return string.toString();
- } else if (string == null || string === false) {
- return "";
- }
-
- // Force a string conversion as this will be done by the append regardless and
- // the regex test will do this transparently behind the scenes, causing issues if
- // an object's to string has escaped characters in it.
- string = string.toString();
-
- if(!possible.test(string)) { return string; }
- return string.replace(badChars, escapeChar);
- },
-
- isEmpty: function(value) {
- if (!value && value !== 0) {
- return true;
- } else if(toString.call(value) === "[object Array]" && value.length === 0) {
- return true;
- } else {
- return false;
- }
- }
- };
- ;
-// lib/handlebars/compiler/compiler.js
-
- /*jshint eqnull:true*/
- var Compiler = Handlebars.Compiler = function() {};
- var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
-
-// the foundHelper register will disambiguate helper lookup from finding a
-// function in a context. This is necessary for mustache compatibility, which
-// requires that context functions in blocks are evaluated by blockHelperMissing,
-// and then proceed as if the resulting value was provided to blockHelperMissing.
-
- Compiler.prototype = {
- compiler: Compiler,
-
- disassemble: function() {
- var opcodes = this.opcodes, opcode, out = [], params, param;
-
- for (var i=0, l=opcodes.length; i<l; i++) {
- opcode = opcodes[i];
-
- if (opcode.opcode === 'DECLARE') {
- out.push("DECLARE " + opcode.name + "=" + opcode.value);
- } else {
- params = [];
- for (var j=0; j<opcode.args.length; j++) {
- param = opcode.args[j];
- if (typeof param === "string") {
- param = "\"" + param.replace("\n", "\\n") + "\"";
- }
- params.push(param);
- }
- out.push(opcode.opcode + " " + params.join(" "));
- }
- }
-
- return out.join("\n");
- },
- equals: function(other) {
- var len = this.opcodes.length;
- if (other.opcodes.length !== len) {
- return false;
- }
-
- for (var i = 0; i < len; i++) {
- var opcode = this.opcodes[i],
- otherOpcode = other.opcodes[i];
- if (opcode.opcode !== otherOpcode.opcode || opcode.args.length !== otherOpcode.args.length) {
- return false;
- }
- for (var j = 0; j < opcode.args.length; j++) {
- if (opcode.args[j] !== otherOpcode.args[j]) {
- return false;
- }
- }
- }
-
- len = this.children.length;
- if (other.children.length !== len) {
- return false;
- }
- for (i = 0; i < len; i++) {
- if (!this.children[i].equals(other.children[i])) {
- return false;
- }
- }
-
- return true;
- },
-
- guid: 0,
-
- compile: function(program, options) {
- this.children = [];
- this.depths = {list: []};
- this.options = options;
-
- // These changes will propagate to the other compiler components
- var knownHelpers = this.options.knownHelpers;
- this.options.knownHelpers = {
- 'helperMissing': true,
- 'blockHelperMissing': true,
- 'each': true,
- 'if': true,
- 'unless': true,
- 'with': true,
- 'log': true
- };
- if (knownHelpers) {
- for (var name in knownHelpers) {
- this.options.knownHelpers[name] = knownHelpers[name];
- }
- }
-
- return this.program(program);
- },
-
- accept: function(node) {
- return this[node.type](node);
- },
-
- program: function(program) {
- var statements = program.statements, statement;
- this.opcodes = [];
-
- for(var i=0, l=statements.length; i<l; i++) {
- statement = statements[i];
- this[statement.type](statement);
- }
- this.isSimple = l === 1;
-
- this.depths.list = this.depths.list.sort(function(a, b) {
- return a - b;
- });
-
- return this;
- },
-
- compileProgram: function(program) {
- var result = new this.compiler().compile(program, this.options);
- var guid = this.guid++, depth;
-
- this.usePartial = this.usePartial || result.usePartial;
-
- this.children[guid] = result;
-
- for(var i=0, l=result.depths.list.length; i<l; i++) {
- depth = result.depths.list[i];
-
- if(depth < 2) { continue; }
- else { this.addDepth(depth - 1); }
- }
-
- return guid;
- },
-
- block: function(block) {
- var mustache = block.mustache,
- program = block.program,
- inverse = block.inverse;
-
- if (program) {
- program = this.compileProgram(program);
- }
-
- if (inverse) {
- inverse = this.compileProgram(inverse);
- }
-
- var type = this.classifyMustache(mustache);
-
- if (type === "helper") {
- this.helperMustache(mustache, program, inverse);
- } else if (type === "simple") {
- this.simpleMustache(mustache);
-
- // now that the simple mustache is resolved, we need to
- // evaluate it by executing `blockHelperMissing`
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
- this.opcode('emptyHash');
- this.opcode('blockValue');
- } else {
- this.ambiguousMustache(mustache, program, inverse);
-
- // now that the simple mustache is resolved, we need to
- // evaluate it by executing `blockHelperMissing`
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
- this.opcode('emptyHash');
- this.opcode('ambiguousBlockValue');
- }
-
- this.opcode('append');
- },
-
- hash: function(hash) {
- var pairs = hash.pairs, pair, val;
-
- this.opcode('pushHash');
-
- for(var i=0, l=pairs.length; i<l; i++) {
- pair = pairs[i];
- val = pair[1];
-
- if (this.options.stringParams) {
- if(val.depth) {
- this.addDepth(val.depth);
- }
- this.opcode('getContext', val.depth || 0);
- this.opcode('pushStringParam', val.stringModeValue, val.type);
- } else {
- this.accept(val);
- }
-
- this.opcode('assignToHash', pair[0]);
- }
- this.opcode('popHash');
- },
-
- partial: function(partial) {
- var partialName = partial.partialName;
- this.usePartial = true;
-
- if(partial.context) {
- this.ID(partial.context);
- } else {
- this.opcode('push', 'depth0');
- }
-
- this.opcode('invokePartial', partialName.name);
- this.opcode('append');
- },
-
- content: function(content) {
- this.opcode('appendContent', content.string);
- },
-
- mustache: function(mustache) {
- var options = this.options;
- var type = this.classifyMustache(mustache);
-
- if (type === "simple") {
- this.simpleMustache(mustache);
- } else if (type === "helper") {
- this.helperMustache(mustache);
- } else {
- this.ambiguousMustache(mustache);
- }
-
- if(mustache.escaped && !options.noEscape) {
- this.opcode('appendEscaped');
- } else {
- this.opcode('append');
- }
- },
-
- ambiguousMustache: function(mustache, program, inverse) {
- var id = mustache.id,
- name = id.parts[0],
- isBlock = program != null || inverse != null;
-
- this.opcode('getContext', id.depth);
-
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
-
- this.opcode('invokeAmbiguous', name, isBlock);
- },
-
- simpleMustache: function(mustache) {
- var id = mustache.id;
-
- if (id.type === 'DATA') {
- this.DATA(id);
- } else if (id.parts.length) {
- this.ID(id);
- } else {
- // Simplified ID for `this`
- this.addDepth(id.depth);
- this.opcode('getContext', id.depth);
- this.opcode('pushContext');
- }
-
- this.opcode('resolvePossibleLambda');
- },
-
- helperMustache: function(mustache, program, inverse) {
- var params = this.setupFullMustacheParams(mustache, program, inverse),
- name = mustache.id.parts[0];
-
- if (this.options.knownHelpers[name]) {
- this.opcode('invokeKnownHelper', params.length, name);
- } else if (this.options.knownHelpersOnly) {
- throw new Error("You specified knownHelpersOnly, but used the unknown helper " + name);
- } else {
- this.opcode('invokeHelper', params.length, name);
- }
- },
-
- ID: function(id) {
- this.addDepth(id.depth);
- this.opcode('getContext', id.depth);
-
- var name = id.parts[0];
- if (!name) {
- this.opcode('pushContext');
- } else {
- this.opcode('lookupOnContext', id.parts[0]);
- }
-
- for(var i=1, l=id.parts.length; i<l; i++) {
- this.opcode('lookup', id.parts[i]);
- }
- },
-
- DATA: function(data) {
- this.options.data = true;
- if (data.id.isScoped || data.id.depth) {
- throw new Handlebars.Exception('Scoped data references are not supported: ' + data.original);
- }
-
- this.opcode('lookupData');
- var parts = data.id.parts;
- for(var i=0, l=parts.length; i<l; i++) {
- this.opcode('lookup', parts[i]);
- }
- },
-
- STRING: function(string) {
- this.opcode('pushString', string.string);
- },
-
- INTEGER: function(integer) {
- this.opcode('pushLiteral', integer.integer);
- },
-
- BOOLEAN: function(bool) {
- this.opcode('pushLiteral', bool.bool);
- },
-
- comment: function() {},
-
- // HELPERS
- opcode: function(name) {
- this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
- },
-
- declare: function(name, value) {
- this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
- },
-
- addDepth: function(depth) {
- if(isNaN(depth)) { throw new Error("EWOT"); }
- if(depth === 0) { return; }
-
- if(!this.depths[depth]) {
- this.depths[depth] = true;
- this.depths.list.push(depth);
- }
- },
-
- classifyMustache: function(mustache) {
- var isHelper = mustache.isHelper;
- var isEligible = mustache.eligibleHelper;
- var options = this.options;
-
- // if ambiguous, we can possibly resolve the ambiguity now
- if (isEligible && !isHelper) {
- var name = mustache.id.parts[0];
-
- if (options.knownHelpers[name]) {
- isHelper = true;
- } else if (options.knownHelpersOnly) {
- isEligible = false;
- }
- }
-
- if (isHelper) { return "helper"; }
- else if (isEligible) { return "ambiguous"; }
- else { return "simple"; }
- },
-
- pushParams: function(params) {
- var i = params.length, param;
-
- while(i--) {
- param = params[i];
-
- if(this.options.stringParams) {
- if(param.depth) {
- this.addDepth(param.depth);
- }
-
- this.opcode('getContext', param.depth || 0);
- this.opcode('pushStringParam', param.stringModeValue, param.type);
- } else {
- this[param.type](param);
- }
- }
- },
-
- setupMustacheParams: function(mustache) {
- var params = mustache.params;
- this.pushParams(params);
-
- if(mustache.hash) {
- this.hash(mustache.hash);
- } else {
- this.opcode('emptyHash');
- }
-
- return params;
- },
-
- // this will replace setupMustacheParams when we're done
- setupFullMustacheParams: function(mustache, program, inverse) {
- var params = mustache.params;
- this.pushParams(params);
-
- this.opcode('pushProgram', program);
- this.opcode('pushProgram', inverse);
-
- if(mustache.hash) {
- this.hash(mustache.hash);
- } else {
- this.opcode('emptyHash');
- }
-
- return params;
- }
- };
-
- var Literal = function(value) {
- this.value = value;
- };
-
- JavaScriptCompiler.prototype = {
- // PUBLIC API: You can override these methods in a subclass to provide
- // alternative compiled forms for name lookup and buffering semantics
- nameLookup: function(parent, name /* , type*/) {
- if (/^[0-9]+$/.test(name)) {
- return parent + "[" + name + "]";
- } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
- return parent + "." + name;
- }
- else {
- return parent + "['" + name + "']";
- }
- },
-
- appendToBuffer: function(string) {
- if (this.environment.isSimple) {
- return "return " + string + ";";
- } else {
- return {
- appendToBuffer: true,
- content: string,
- toString: function() { return "buffer += " + string + ";"; }
- };
- }
- },
-
- initializeBuffer: function() {
- return this.quotedString("");
- },
-
- namespace: "Handlebars",
- // END PUBLIC API
-
- compile: function(environment, options, context, asObject) {
- this.environment = environment;
- this.options = options || {};
-
- Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + "\n\n");
-
- this.name = this.environment.name;
- this.isChild = !!context;
- this.context = context || {
- programs: [],
- environments: [],
- aliases: { }
- };
-
- this.preamble();
-
- this.stackSlot = 0;
- this.stackVars = [];
- this.registers = { list: [] };
- this.compileStack = [];
- this.inlineStack = [];
-
- this.compileChildren(environment, options);
-
- var opcodes = environment.opcodes, opcode;
-
- this.i = 0;
-
- for(l=opcodes.length; this.i<l; this.i++) {
- opcode = opcodes[this.i];
-
- if(opcode.opcode === 'DECLARE') {
- this[opcode.name] = opcode.value;
- } else {
- this[opcode.opcode].apply(this, opcode.args);
- }
- }
-
- return this.createFunctionContext(asObject);
- },
-
- nextOpcode: function() {
- var opcodes = this.environment.opcodes;
- return opcodes[this.i + 1];
- },
-
- eat: function() {
- this.i = this.i + 1;
- },
-
- preamble: function() {
- var out = [];
-
- if (!this.isChild) {
- var namespace = this.namespace;
-
- var copies = "helpers = this.merge(helpers, " + namespace + ".helpers);";
- if (this.environment.usePartial) { copies = copies + " partials = this.merge(partials, " + namespace + ".partials);"; }
- if (this.options.data) { copies = copies + " data = data || {};"; }
- out.push(copies);
- } else {
- out.push('');
- }
-
- if (!this.environment.isSimple) {
- out.push(", buffer = " + this.initializeBuffer());
- } else {
- out.push("");
- }
-
- // track the last context pushed into place to allow skipping the
- // getContext opcode when it would be a noop
- this.lastContext = 0;
- this.source = out;
- },
-
- createFunctionContext: function(asObject) {
- var locals = this.stackVars.concat(this.registers.list);
-
- if(locals.length > 0) {
- this.source[1] = this.source[1] + ", " + locals.join(", ");
- }
-
- // Generate minimizer alias mappings
- if (!this.isChild) {
- for (var alias in this.context.aliases) {
- if (this.context.aliases.hasOwnProperty(alias)) {
- this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
- }
- }
- }
-
- if (this.source[1]) {
- this.source[1] = "var " + this.source[1].substring(2) + ";";
- }
-
- // Merge children
- if (!this.isChild) {
- this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
- }
-
- if (!this.environment.isSimple) {
- this.source.push("return buffer;");
- }
-
- var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
-
- for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
- params.push("depth" + this.environment.depths.list[i]);
- }
-
- // Perform a second pass over the output to merge content when possible
- var source = this.mergeSource();
-
- if (!this.isChild) {
- var revision = Handlebars.COMPILER_REVISION,
- versions = Handlebars.REVISION_CHANGES[revision];
- source = "this.compilerInfo = ["+revision+",'"+versions+"'];\n"+source;
- }
-
- if (asObject) {
- params.push(source);
-
- return Function.apply(this, params);
- } else {
- var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + source + '}';
- Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
- return functionSource;
- }
- },
- mergeSource: function() {
- // WARN: We are not handling the case where buffer is still populated as the source should
- // not have buffer append operations as their final action.
- var source = '',
- buffer;
- for (var i = 0, len = this.source.length; i < len; i++) {
- var line = this.source[i];
- if (line.appendToBuffer) {
- if (buffer) {
- buffer = buffer + '\n + ' + line.content;
- } else {
- buffer = line.content;
- }
- } else {
- if (buffer) {
- source += 'buffer += ' + buffer + ';\n ';
- buffer = undefined;
- }
- source += line + '\n ';
- }
- }
- return source;
- },
-
- // [blockValue]
- //
- // On stack, before: hash, inverse, program, value
- // On stack, after: return value of blockHelperMissing
- //
- // The purpose of this opcode is to take a block of the form
- // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
- // replace it on the stack with the result of properly
- // invoking blockHelperMissing.
- blockValue: function() {
- this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
-
- var params = ["depth0"];
- this.setupParams(0, params);
-
- this.replaceStack(function(current) {
- params.splice(1, 0, current);
- return "blockHelperMissing.call(" + params.join(", ") + ")";
- });
- },
-
- // [ambiguousBlockValue]
- //
- // On stack, before: hash, inverse, program, value
- // Compiler value, before: lastHelper=value of last found helper, if any
- // On stack, after, if no lastHelper: same as [blockValue]
- // On stack, after, if lastHelper: value
- ambiguousBlockValue: function() {
- this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
-
- var params = ["depth0"];
- this.setupParams(0, params);
-
- var current = this.topStack();
- params.splice(1, 0, current);
-
- // Use the options value generated from the invocation
- params[params.length-1] = 'options';
-
- this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
- },
-
- // [appendContent]
- //
- // On stack, before: ...
- // On stack, after: ...
- //
- // Appends the string value of `content` to the current buffer
- appendContent: function(content) {
- this.source.push(this.appendToBuffer(this.quotedString(content)));
- },
-
- // [append]
- //
- // On stack, before: value, ...
- // On stack, after: ...
- //
- // Coerces `value` to a String and appends it to the current buffer.
- //
- // If `value` is truthy, or 0, it is coerced into a string and appended
- // Otherwise, the empty string is appended
- append: function() {
- // Force anything that is inlined onto the stack so we don't have duplication
- // when we examine local
- this.flushInline();
- var local = this.popStack();
- this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
- if (this.environment.isSimple) {
- this.source.push("else { " + this.appendToBuffer("''") + " }");
- }
- },
-
- // [appendEscaped]
- //
- // On stack, before: value, ...
- // On stack, after: ...
- //
- // Escape `value` and append it to the buffer
- appendEscaped: function() {
- this.context.aliases.escapeExpression = 'this.escapeExpression';
-
- this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));
- },
-
- // [getContext]
- //
- // On stack, before: ...
- // On stack, after: ...
- // Compiler value, after: lastContext=depth
- //
- // Set the value of the `lastContext` compiler value to the depth
- getContext: function(depth) {
- if(this.lastContext !== depth) {
- this.lastContext = depth;
- }
- },
-
- // [lookupOnContext]
- //
- // On stack, before: ...
- // On stack, after: currentContext[name], ...
- //
- // Looks up the value of `name` on the current context and pushes
- // it onto the stack.
- lookupOnContext: function(name) {
- this.push(this.nameLookup('depth' + this.lastContext, name, 'context'));
- },
-
- // [pushContext]
- //
- // On stack, before: ...
- // On stack, after: currentContext, ...
- //
- // Pushes the value of the current context onto the stack.
- pushContext: function() {
- this.pushStackLiteral('depth' + this.lastContext);
- },
-
- // [resolvePossibleLambda]
- //
- // On stack, before: value, ...
- // On stack, after: resolved value, ...
- //
- // If the `value` is a lambda, replace it on the stack by
- // the return value of the lambda
- resolvePossibleLambda: function() {
- this.context.aliases.functionType = '"function"';
-
- this.replaceStack(function(current) {
- return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;
- });
- },
-
- // [lookup]
- //
- // On stack, before: value, ...
- // On stack, after: value[name], ...
- //
- // Replace the value on the stack with the result of looking
- // up `name` on `value`
- lookup: function(name) {
- this.replaceStack(function(current) {
- return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
- });
- },
-
- // [lookupData]
- //
- // On stack, before: ...
- // On stack, after: data[id], ...
- //
- // Push the result of looking up `id` on the current data
- lookupData: function(id) {
- this.push('data');
- },
-
- // [pushStringParam]
- //
- // On stack, before: ...
- // On stack, after: string, currentContext, ...
- //
- // This opcode is designed for use in string mode, which
- // provides the string value of a parameter along with its
- // depth rather than resolving it immediately.
- pushStringParam: function(string, type) {
- this.pushStackLiteral('depth' + this.lastContext);
-
- this.pushString(type);
-
- if (typeof string === 'string') {
- this.pushString(string);
- } else {
- this.pushStackLiteral(string);
- }
- },
-
- emptyHash: function() {
- this.pushStackLiteral('{}');
-
- if (this.options.stringParams) {
- this.register('hashTypes', '{}');
- this.register('hashContexts', '{}');
- }
- },
- pushHash: function() {
- this.hash = {values: [], types: [], contexts: []};
- },
- popHash: function() {
- var hash = this.hash;
- this.hash = undefined;
-
- if (this.options.stringParams) {
- this.register('hashContexts', '{' + hash.contexts.join(',') + '}');
- this.register('hashTypes', '{' + hash.types.join(',') + '}');
- }
- this.push('{\n ' + hash.values.join(',\n ') + '\n }');
- },
-
- // [pushString]
- //
- // On stack, before: ...
- // On stack, after: quotedString(string), ...
- //
- // Push a quoted version of `string` onto the stack
- pushString: function(string) {
- this.pushStackLiteral(this.quotedString(string));
- },
-
- // [push]
- //
- // On stack, before: ...
- // On stack, after: expr, ...
- //
- // Push an expression onto the stack
- push: function(expr) {
- this.inlineStack.push(expr);
- return expr;
- },
-
- // [pushLiteral]
- //
- // On stack, before: ...
- // On stack, after: value, ...
- //
- // Pushes a value onto the stack. This operation prevents
- // the compiler from creating a temporary variable to hold
- // it.
- pushLiteral: function(value) {
- this.pushStackLiteral(value);
- },
-
- // [pushProgram]
- //
- // On stack, before: ...
- // On stack, after: program(guid), ...
- //
- // Push a program expression onto the stack. This takes
- // a compile-time guid and converts it into a runtime-accessible
- // expression.
- pushProgram: function(guid) {
- if (guid != null) {
- this.pushStackLiteral(this.programExpression(guid));
- } else {
- this.pushStackLiteral(null);
- }
- },
-
- // [invokeHelper]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of helper invocation
- //
- // Pops off the helper's parameters, invokes the helper,
- // and pushes the helper's return value onto the stack.
- //
- // If the helper is not found, `helperMissing` is called.
- invokeHelper: function(paramSize, name) {
- this.context.aliases.helperMissing = 'helpers.helperMissing';
-
- var helper = this.lastHelper = this.setupHelper(paramSize, name, true);
- var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
-
- this.push(helper.name + ' || ' + nonHelper);
- this.replaceStack(function(name) {
- return name + ' ? ' + name + '.call(' +
- helper.callParams + ") " + ": helperMissing.call(" +
- helper.helperMissingParams + ")";
- });
- },
-
- // [invokeKnownHelper]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of helper invocation
- //
- // This operation is used when the helper is known to exist,
- // so a `helperMissing` fallback is not required.
- invokeKnownHelper: function(paramSize, name) {
- var helper = this.setupHelper(paramSize, name);
- this.push(helper.name + ".call(" + helper.callParams + ")");
- },
-
- // [invokeAmbiguous]
- //
- // On stack, before: hash, inverse, program, params..., ...
- // On stack, after: result of disambiguation
- //
- // This operation is used when an expression like `{{foo}}`
- // is provided, but we don't know at compile-time whether it
- // is a helper or a path.
- //
- // This operation emits more code than the other options,
- // and can be avoided by passing the `knownHelpers` and
- // `knownHelpersOnly` flags at compile-time.
- invokeAmbiguous: function(name, helperCall) {
- this.context.aliases.functionType = '"function"';
-
- this.pushStackLiteral('{}'); // Hash value
- var helper = this.setupHelper(0, name, helperCall);
-
- var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
-
- var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
- var nextStack = this.nextStack();
-
- this.source.push('if (' + nextStack + ' = ' + helperName + ') { ' + nextStack + ' = ' + nextStack + '.call(' + helper.callParams + '); }');
- this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '.apply(depth0) : ' + nextStack + '; }');
- },
-
- // [invokePartial]
- //
- // On stack, before: context, ...
- // On stack after: result of partial invocation
- //
- // This operation pops off a context, invokes a partial with that context,
- // and pushes the result of the invocation back.
- invokePartial: function(name) {
- var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
-
- if (this.options.data) {
- params.push("data");
- }
-
- this.context.aliases.self = "this";
- this.push("self.invokePartial(" + params.join(", ") + ")");
- },
-
- // [assignToHash]
- //
- // On stack, before: value, hash, ...
- // On stack, after: hash, ...
- //
- // Pops a value and hash off the stack, assigns `hash[key] = value`
- // and pushes the hash back onto the stack.
- assignToHash: function(key) {
- var value = this.popStack(),
- context,
- type;
-
- if (this.options.stringParams) {
- type = this.popStack();
- context = this.popStack();
- }
-
- var hash = this.hash;
- if (context) {
- hash.contexts.push("'" + key + "': " + context);
- }
- if (type) {
- hash.types.push("'" + key + "': " + type);
- }
- hash.values.push("'" + key + "': (" + value + ")");
- },
-
- // HELPERS
-
- compiler: JavaScriptCompiler,
-
- compileChildren: function(environment, options) {
- var children = environment.children, child, compiler;
-
- for(var i=0, l=children.length; i<l; i++) {
- child = children[i];
- compiler = new this.compiler();
-
- var index = this.matchExistingProgram(child);
-
- if (index == null) {
- this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
- index = this.context.programs.length;
- child.index = index;
- child.name = 'program' + index;
- this.context.programs[index] = compiler.compile(child, options, this.context);
- this.context.environments[index] = child;
- } else {
- child.index = index;
- child.name = 'program' + index;
- }
- }
- },
- matchExistingProgram: function(child) {
- for (var i = 0, len = this.context.environments.length; i < len; i++) {
- var environment = this.context.environments[i];
- if (environment && environment.equals(child)) {
- return i;
- }
- }
- },
-
- programExpression: function(guid) {
- this.context.aliases.self = "this";
-
- if(guid == null) {
- return "self.noop";
- }
-
- var child = this.environment.children[guid],
- depths = child.depths.list, depth;
-
- var programParams = [child.index, child.name, "data"];
-
- for(var i=0, l = depths.length; i<l; i++) {
- depth = depths[i];
-
- if(depth === 1) { programParams.push("depth0"); }
- else { programParams.push("depth" + (depth - 1)); }
- }
-
- return (depths.length === 0 ? "self.program(" : "self.programWithDepth(") + programParams.join(", ") + ")";
- },
-
- register: function(name, val) {
- this.useRegister(name);
- this.source.push(name + " = " + val + ";");
- },
-
- useRegister: function(name) {
- if(!this.registers[name]) {
- this.registers[name] = true;
- this.registers.list.push(name);
- }
- },
-
- pushStackLiteral: function(item) {
- return this.push(new Literal(item));
- },
-
- pushStack: function(item) {
- this.flushInline();
-
- var stack = this.incrStack();
- if (item) {
- this.source.push(stack + " = " + item + ";");
- }
- this.compileStack.push(stack);
- return stack;
- },
-
- replaceStack: function(callback) {
- var prefix = '',
- inline = this.isInline(),
- stack;
-
- // If we are currently inline then we want to merge the inline statement into the
- // replacement statement via ','
- if (inline) {
- var top = this.popStack(true);
-
- if (top instanceof Literal) {
- // Literals do not need to be inlined
- stack = top.value;
- } else {
- // Get or create the current stack name for use by the inline
- var name = this.stackSlot ? this.topStackName() : this.incrStack();
-
- prefix = '(' + this.push(name) + ' = ' + top + '),';
- stack = this.topStack();
- }
- } else {
- stack = this.topStack();
- }
-
- var item = callback.call(this, stack);
-
- if (inline) {
- if (this.inlineStack.length || this.compileStack.length) {
- this.popStack();
- }
- this.push('(' + prefix + item + ')');
- } else {
- // Prevent modification of the context depth variable. Through replaceStack
- if (!/^stack/.test(stack)) {
- stack = this.nextStack();
- }
-
- this.source.push(stack + " = (" + prefix + item + ");");
- }
- return stack;
- },
-
- nextStack: function() {
- return this.pushStack();
- },
-
- incrStack: function() {
- this.stackSlot++;
- if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
- return this.topStackName();
- },
- topStackName: function() {
- return "stack" + this.stackSlot;
- },
- flushInline: function() {
- var inlineStack = this.inlineStack;
- if (inlineStack.length) {
- this.inlineStack = [];
- for (var i = 0, len = inlineStack.length; i < len; i++) {
- var entry = inlineStack[i];
- if (entry instanceof Literal) {
- this.compileStack.push(entry);
- } else {
- this.pushStack(entry);
- }
- }
- }
- },
- isInline: function() {
- return this.inlineStack.length;
- },
-
- popStack: function(wrapped) {
- var inline = this.isInline(),
- item = (inline ? this.inlineStack : this.compileStack).pop();
-
- if (!wrapped && (item instanceof Literal)) {
- return item.value;
- } else {
- if (!inline) {
- this.stackSlot--;
- }
- return item;
- }
- },
-
- topStack: function(wrapped) {
- var stack = (this.isInline() ? this.inlineStack : this.compileStack),
- item = stack[stack.length - 1];
-
- if (!wrapped && (item instanceof Literal)) {
- return item.value;
- } else {
- return item;
- }
- },
-
- quotedString: function(str) {
- return '"' + str
- .replace(/\\/g, '\\\\')
- .replace(/"/g, '\\"')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r')
- .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
- .replace(/\u2029/g, '\\u2029') + '"';
- },
-
- setupHelper: function(paramSize, name, missingParams) {
- var params = [];
- this.setupParams(paramSize, params, missingParams);
- var foundHelper = this.nameLookup('helpers', name, 'helper');
-
- return {
- params: params,
- name: foundHelper,
- callParams: ["depth0"].concat(params).join(", "),
- helperMissingParams: missingParams && ["depth0", this.quotedString(name)].concat(params).join(", ")
- };
- },
-
- // the params and contexts arguments are passed in arrays
- // to fill in
- setupParams: function(paramSize, params, useRegister) {
- var options = [], contexts = [], types = [], param, inverse, program;
-
- options.push("hash:" + this.popStack());
-
- inverse = this.popStack();
- program = this.popStack();
-
- // Avoid setting fn and inverse if neither are set. This allows
- // helpers to do a check for `if (options.fn)`
- if (program || inverse) {
- if (!program) {
- this.context.aliases.self = "this";
- program = "self.noop";
- }
-
- if (!inverse) {
- this.context.aliases.self = "this";
- inverse = "self.noop";
- }
-
- options.push("inverse:" + inverse);
- options.push("fn:" + program);
- }
-
- for(var i=0; i<paramSize; i++) {
- param = this.popStack();
- params.push(param);
-
- if(this.options.stringParams) {
- types.push(this.popStack());
- contexts.push(this.popStack());
- }
- }
-
- if (this.options.stringParams) {
- options.push("contexts:[" + contexts.join(",") + "]");
- options.push("types:[" + types.join(",") + "]");
- options.push("hashContexts:hashContexts");
- options.push("hashTypes:hashTypes");
- }
-
- if(this.options.data) {
- options.push("data:data");
- }
-
- options = "{" + options.join(",") + "}";
- if (useRegister) {
- this.register('options', options);
- params.push('options');
- } else {
- params.push(options);
- }
- return params.join(", ");
- }
- };
-
- var reservedWords = (
- "break else new var" +
- " case finally return void" +
- " catch for switch while" +
- " continue function this with" +
- " default if throw" +
- " delete in try" +
- " do instanceof typeof" +
- " abstract enum int short" +
- " boolean export interface static" +
- " byte extends long super" +
- " char final native synchronized" +
- " class float package throws" +
- " const goto private transient" +
- " debugger implements protected volatile" +
- " double import public let yield"
- ).split(" ");
-
- var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
-
- for(var i=0, l=reservedWords.length; i<l; i++) {
- compilerWords[reservedWords[i]] = true;
- }
-
- JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
- if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
- return true;
- }
- return false;
- };
-
- Handlebars.precompile = function(input, options) {
- if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
- throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
- }
-
- options = options || {};
- if (!('data' in options)) {
- options.data = true;
- }
- var ast = Handlebars.parse(input);
- var environment = new Compiler().compile(ast, options);
- return new JavaScriptCompiler().compile(environment, options);
- };
-
- Handlebars.compile = function(input, options) {
- if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
- throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
- }
-
- options = options || {};
- if (!('data' in options)) {
- options.data = true;
- }
- var compiled;
- function compile() {
- var ast = Handlebars.parse(input);
- var environment = new Compiler().compile(ast, options);
- var templateSpec = new JavaScriptCompiler().compile(environment, options, undefined, true);
- return Handlebars.template(templateSpec);
- }
-
- // Template is only compiled on first use and cached after that point.
- return function(context, options) {
- if (!compiled) {
- compiled = compile();
- }
- return compiled.call(this, context, options);
- };
- };
-
- ;
-// lib/handlebars/runtime.js
-
- Handlebars.VM = {
- template: function(templateSpec) {
- // Just add water
- var container = {
- escapeExpression: Handlebars.Utils.escapeExpression,
- invokePartial: Handlebars.VM.invokePartial,
- programs: [],
- program: function(i, fn, data) {
- var programWrapper = this.programs[i];
- if(data) {
- programWrapper = Handlebars.VM.program(i, fn, data);
- } else if (!programWrapper) {
- programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
- }
- return programWrapper;
- },
- merge: function(param, common) {
- var ret = param || common;
-
- if (param && common) {
- ret = {};
- Handlebars.Utils.extend(ret, common);
- Handlebars.Utils.extend(ret, param);
- }
- return ret;
- },
- programWithDepth: Handlebars.VM.programWithDepth,
- noop: Handlebars.VM.noop,
- compilerInfo: null
- };
-
- return function(context, options) {
- options = options || {};
- var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
-
- var compilerInfo = container.compilerInfo || [],
- compilerRevision = compilerInfo[0] || 1,
- currentRevision = Handlebars.COMPILER_REVISION;
-
- if (compilerRevision !== currentRevision) {
- if (compilerRevision < currentRevision) {
- var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
- compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
- throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
- } else {
- // Use the embedded version info since the runtime doesn't know about this revision yet
- throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
- "Please update your runtime to a newer version ("+compilerInfo[1]+").";
- }
- }
-
- return result;
- };
- },
-
- programWithDepth: function(i, fn, data /*, $depth */) {
- var args = Array.prototype.slice.call(arguments, 3);
-
- var program = function(context, options) {
- options = options || {};
-
- return fn.apply(this, [context, options.data || data].concat(args));
- };
- program.program = i;
- program.depth = args.length;
- return program;
- },
- program: function(i, fn, data) {
- var program = function(context, options) {
- options = options || {};
-
- return fn(context, options.data || data);
- };
- program.program = i;
- program.depth = 0;
- return program;
- },
- noop: function() { return ""; },
- invokePartial: function(partial, name, context, helpers, partials, data) {
- var options = { helpers: helpers, partials: partials, data: data };
-
- if(partial === undefined) {
- throw new Handlebars.Exception("The partial " + name + " could not be found");
- } else if(partial instanceof Function) {
- return partial(context, options);
- } else if (!Handlebars.compile) {
- throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
- } else {
- partials[name] = Handlebars.compile(partial, {data: data !== undefined});
- return partials[name](context, options);
- }
- }
- };
-
- Handlebars.template = Handlebars.VM.template;
- ;
-// lib/handlebars/browser-suffix.js
-})(Handlebars);
-;
diff --git a/streams-web/src/main/webapp/demo/js/publisher.js b/streams-web/src/main/webapp/demo/js/publisher.js
index 8b7809d..15d2c0e 100644
--- a/streams-web/src/main/webapp/demo/js/publisher.js
+++ b/streams-web/src/main/webapp/demo/js/publisher.js
@@ -1,3 +1,20 @@
+/*
+ ~ 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.
+ */
var publisher = publisher || (function(){
//registers a new publisher, and returns the publisher's unique URL that you can use to POST activities
diff --git a/streams-web/src/main/webapp/demo/js/subscriber.js b/streams-web/src/main/webapp/demo/js/subscriber.js
index 127d12f..c2e7d4d 100644
--- a/streams-web/src/main/webapp/demo/js/subscriber.js
+++ b/streams-web/src/main/webapp/demo/js/subscriber.js
@@ -1,3 +1,20 @@
+/*
+ ~ 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.
+ */
var subscriber = subscriber || (function(){
//registers a new subscriber, and returns the subscriber's unique URL
diff --git a/streams-web/src/main/webapp/demo/publisher.html b/streams-web/src/main/webapp/demo/publisher.html
index f1940d8..9fe42a2 100644
--- a/streams-web/src/main/webapp/demo/publisher.html
+++ b/streams-web/src/main/webapp/demo/publisher.html
@@ -1,3 +1,20 @@
+<!--
+ ~ 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.
+ -->
<!DOCTYPE HTML>
<html>
<head>
diff --git a/streams-web/src/main/webapp/demo/subscriber.html b/streams-web/src/main/webapp/demo/subscriber.html
index ee3133d..b5b1466 100644
--- a/streams-web/src/main/webapp/demo/subscriber.html
+++ b/streams-web/src/main/webapp/demo/subscriber.html
@@ -1,3 +1,20 @@
+<!--
+ ~ 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.
+ -->
<!DOCTYPE HTML>
<html>
<head>
diff --git a/streams-web/src/main/webapp/index.html b/streams-web/src/main/webapp/index.html
index 3053f1c..5653542 100644
--- a/streams-web/src/main/webapp/index.html
+++ b/streams-web/src/main/webapp/index.html
@@ -1,3 +1,20 @@
+<!--
+ ~ 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.
+ -->
<!DOCTYPE HTML>
<html>
<head>