--- /dev/null
+<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>
+ <parent>
+ <artifactId>yang-prototype</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <version>0.5-SNAPSHOT</version>
+ </parent>
+ <artifactId>concepts-lang</artifactId>
+ <packaging>jar</packaging>
+</project>
\ No newline at end of file
--- /dev/null
+
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+
+public interface Acceptor<I> {
+
+ /**
+ *
+ * @param input
+ * @return true if input is accepted.
+ */
+ boolean isAcceptable(I input);
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+import java.util.Collection;
+/**
+ *
+ * @author Tony Tkacik
+ *
+ * @param <I>
+ * @param <P>
+ */
+public interface AggregateTransformer<I,P> extends Transformer<I,P> {
+
+ Collection<P> transformAll(Collection<? extends I> inputs);
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+
+/**
+ * Transformer which aggregates multiple implementations of
+ * {@link InputClassBasedTransformer}.
+ *
+ * The transformation process is driven by {@link Class} of input. The selection
+ * of used {@link InputClassBasedTransformer} is done by using the {@link Class}
+ * of input as a key to select the transformer.
+ *
+ * This approach provides quick resolution of transformer, but does not support
+ * registering a super type of input to provide transformation support for all
+ * subclasses, one must register a new instance of transformer for each valid
+ * input class.
+ *
+ * If you need more flexible selection of transformation consider using
+ * {@link CompositeConditionalTransformer} which is slower but most flexible or
+ * {@link RuleBasedTransformer} which provides declarative approach for
+ * transformation.
+ *
+ * See {@link #transform(Object)} for more information about tranformation
+ * process.
+ *
+ * @author Tony Tkacik <ttkacik@cisco.com>
+ *
+ * @param <I>
+ * Input super-type
+ * @param <P>
+ * Product
+ */
+public abstract class CompositeClassBasedTransformer<I, P> implements
+ InputClassBasedTransformer<I, I, P>,
+ AggregateTransformer<I, P> {
+
+ private Map<Class<? extends I>, InputClassBasedTransformer<I, ? extends I, P>> transformers = new ConcurrentHashMap<Class<? extends I>, InputClassBasedTransformer<I, ? extends I, P>>();
+
+ /**
+ * Transforms an input into instance of Product class.
+ *
+ * The final registered transformer is the one which match following
+ * condition:
+ *
+ * <code>input.getClass() == transformer.getInputClass()</code>
+ *
+ * This means that transformers are not resolved by class hierarchy, only
+ * selected based on final class of the input. If you need more flexible
+ * selection of transformation consider using
+ * {@link CompositeConditionalTransformer} which is slower but more
+ * flexible.
+ *
+ */
+ @Override
+ public P transform(I input) {
+ @SuppressWarnings("unchecked")
+ InputClassBasedTransformer<I, I, P> transformer = (InputClassBasedTransformer<I, I, P>) transformers
+ .get(input.getClass());
+ if (transformer == null)
+ throw new IllegalArgumentException("Transformation of: " + input
+ + " is not supported");
+ return transformer.transform(input);
+ }
+
+ /**
+ * Registers a new transformer.
+ *
+ * The transformer is registered for class returned by
+ * {@link InputClassBasedTransformer#getInputClass()}. Only one transformer
+ * can be registered for particular input class.
+ *
+ */
+ public void addTransformer(
+ InputClassBasedTransformer<I, ? extends I, P> transformer)
+ throws IllegalStateException {
+ if (transformer == null)
+ throw new IllegalArgumentException("Transformer should not be null");
+ if (transformer.getInputClass() == null)
+ throw new IllegalArgumentException(
+ "Transformer should specify input class.");
+ transformers.put(transformer.getInputClass(), transformer);
+ }
+
+ /**
+ * Removes an registered transformer.
+ *
+ * Note: Removal is currently unsupported.
+ *
+ * @param transformer
+ * Tranformer to be removed.
+ * @throws IllegalArgumentException
+ * If the provided transformer is null or is not registered.
+ */
+ public void removeTransformer(
+ InputClassBasedTransformer<I, ? extends I, P> transformer)
+ throws IllegalArgumentException {
+ throw new UnsupportedOperationException("Not implemented yet");
+ }
+
+ @Override
+ public Collection<P> transformAll(Collection<? extends I> inputs) {
+ Collection<P> ret = new ArrayList<P>();
+ for (I i : inputs) {
+ ret.add(transform(i));
+ }
+ return ret;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * Composite transformer which aggregates multiple implementation and selects
+ * the one which accepts the input.
+ *
+ *
+ * @author Tony Tkacik
+ *
+ * @param <I>
+ * Input class for transformation
+ * @param <P>
+ * Product of transformation
+ */
+public class CompositeConditionalTransformer<I, P> implements
+ SimpleConditionalTransformer<I, P>,
+ AggregateTransformer<I,P> {
+
+ private final Comparator<TransformerWithPriority<I, P>> comparator = new Comparator<TransformerWithPriority<I, P>>() {
+
+ @Override
+ public int compare(TransformerWithPriority<I, P> o1,
+ TransformerWithPriority<I, P> o2) {
+ return Integer.valueOf(o1.priority).compareTo(Integer.valueOf(o2.priority));
+ }
+
+ };
+ private final Set<TransformerWithPriority<I, P>> transformers;
+
+ public CompositeConditionalTransformer() {
+ // FIXME: Add Ordering
+ transformers = new TreeSet<TransformerWithPriority<I, P>>(comparator);
+ }
+
+ @Override
+ public boolean isAcceptable(I input) {
+ for (SimpleConditionalTransformer<I, P> trans : transformers) {
+ if (trans.isAcceptable(input)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public P transform(I input) {
+ for (SimpleConditionalTransformer<I, P> trans : transformers) {
+ if (trans.isAcceptable(input)) {
+ return trans.transform(input);
+ }
+ }
+ throw new IllegalStateException(
+ "Transformer for provided input is not available.");
+ }
+
+ public void addTransformer(SimpleConditionalTransformer<I, P> transformer,
+ int priority) throws IllegalStateException {
+ if (transformer == null) {
+ throw new IllegalArgumentException(
+ "transformer should not be null.");
+ }
+ TransformerWithPriority<I, P> withPriority = new TransformerWithPriority<I, P>(
+ transformer, priority);
+ if (false == transformers.add(withPriority)) {
+ throw new IllegalStateException("transformer " + transformer
+ + "already registered");
+ }
+ }
+
+ public void removeTransformer(SimpleConditionalTransformer<I, P> transformer)
+ throws IllegalArgumentException {
+ if (transformer == null) {
+ throw new IllegalArgumentException(
+ "transformer should not be null.");
+ }
+ if (false == transformers.remove(transformer)) {
+ throw new IllegalStateException("transformer " + transformer
+ + "already registered");
+ }
+ }
+
+ @Override
+ public Collection<P> transformAll(Collection<? extends I> inputs) {
+ Collection<P> ret = new ArrayList<P>();
+ for (I i : inputs) {
+ ret.add(transform(i));
+ }
+ return ret;
+ }
+
+ private static class TransformerWithPriority<I, P> implements
+ SimpleConditionalTransformer<I, P> {
+ final int priority;
+ final SimpleConditionalTransformer<I, P> transformer;
+
+ public TransformerWithPriority(
+ SimpleConditionalTransformer<I, P> transformer, int priority) {
+ this.priority = priority;
+ this.transformer = transformer;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((transformer == null) ? 0 : transformer.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ TransformerWithPriority<?,?> other = (TransformerWithPriority<?,?>) obj;
+ if (transformer == null) {
+ if (other.transformer != null)
+ return false;
+ } else if (!transformer.equals(other.transformer))
+ return false;
+ return true;
+ }
+
+ @Override
+ public boolean isAcceptable(I input) {
+ return transformer.isAcceptable(input);
+ }
+
+ @Override
+ public P transform(I input) {
+ return transformer.transform(input);
+ }
+
+
+
+
+
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+/**
+ * Input class based transformer
+ *
+ * {@link Transformer} which accepts / transforms only specific classes of
+ * input, and is useful if the selection of transformer should be based on the
+ * class of the input and there is one-to-one mapping between input class and
+ * transformer.
+ *
+ *
+ * @author Tony Tkacik
+ *
+ * @param <S>
+ * Common supertype of input
+ * @param <I>
+ * Concrete type of input
+ * @param <P>
+ * Product
+ */
+public interface InputClassBasedTransformer<S, I extends S, P> extends
+ Transformer<I, P> {
+
+ /**
+ * Returns an {@link Class} of input which is acceptable for transformation.
+ *
+ * @return {@link Class} of input which is acceptable for transformation.
+ */
+ Class<? extends S> getInputClass();
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+import java.util.Set;
+
+/**
+ * Transformer with set of acceptance rules
+ *
+ * The transformer provides a set of {@link Acceptor}s, which could be used to
+ * verify if the input will produce result using the transformer.
+ *
+ * The transormer is able to produce result if ANY of associated
+ * {@link Acceptor}s accepted result.
+ *
+ * @author Tony Tkacik
+ *
+ * @param <I>
+ * Input class for transformation
+ * @param <P>
+ * Product of transformation
+ */
+public interface RuleBasedTransformer<I, P> extends Transformer<I, P> {
+
+ /**
+ * Set of {@link Acceptor}, which could be used to verify if the input is
+ * usable by transformer.
+ *
+ * The transformer is able to produce result if ANY of associated
+ * {@link Acceptor}s accepted result.
+ *
+ * @return Set of input acceptance rules associated to this transformer.
+ */
+ Set<Acceptor<I>> getRules();
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+/**
+ * Simple condition-based transformer
+ *
+ * The transformer provides {@link #isAcceptable(Object)} method,
+ * which could be used to query transformer if the input will produce
+ * result.
+ *
+ * This interface is simplified version of {@link RuleBasedTransformer} - does not
+ * provide decoupling of Acceptance rule from transformer, and should be used only
+ * for simple use-cases.
+ *
+ * @author Tony Tkacik
+ *
+ * @param <I> Input class for transformation
+ * @param <P> Product of transformation
+ */
+public interface SimpleConditionalTransformer<I,P> extends Transformer<I, P>, Acceptor<I> {
+
+
+ /**
+ * Checks if the input is acceptable
+ * for processing by the transformer.
+ *
+ * @return true it the input is acceptable for processing by transformer.
+ */
+ @Override
+ public boolean isAcceptable(I input);
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.concepts.lang;
+/**
+ * Factory which produces product based on input object
+ *
+ * @author Tony Tkacik
+ *
+ * @param <I> Input
+ * @param <P> Product
+ */
+public interface Transformer<I,P> {
+ /**
+ * Transforms input into instance of product.
+ *
+ * @param input Input which drives transformation
+ * @return Instance of product which was created from supplied input.
+ */
+ P transform(I input);
+}
<version>0.5-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
+ <module>concepts-lang</module>
<module>yang</module>
<module>code-generator</module>
<module>model</module>
<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>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ 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>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <modules>
- <module>sal-common</module>
- <module>sal-common-util</module>
- <module>sal-core-api</module>
- <module>sal-data-api</module>
- <module>sal-binding-api</module>
- <module>sal-binding-spi</module>
- <module>sal-binding-broker-impl</module>
- <module>sal-schema-repository-api</module>
- <module>sal-core-spi</module>
- <module>sal-broker-impl</module>
- <module>sal-core-demo</module>
- </modules>
+ <modules>
+ <module>sal-common</module>
+ <module>sal-common-util</module>
+ <module>sal-core-api</module>
+ <module>sal-data-api</module>
+ <module>sal-binding-api</module>
+ <module>sal-binding-spi</module>
+ <module>sal-binding-broker-impl</module>
+ <module>sal-schema-repository-api</module>
+ <module>sal-core-spi</module>
+ <module>sal-broker-impl</module>
+ </modules>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>14.0.1</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.2</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ <properties>
+ <yang.version>0.5.3-SNAPSHOT</yang.version>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <inherited>true</inherited>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8.1</version>
- <configuration>
- <stylesheet>maven</stylesheet>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.4.0</version>
- <configuration>
- <effort>Max</effort>
- <threshold>Low</threshold>
- <goal>site</goal>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jdepend-maven-plugin</artifactId>
- <version>2.0-beta-2</version>
- </plugin>
- </plugins>
- </reporting>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>14.0.1</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-binding</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-common</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-data-api</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-model-api</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-data-util</artifactId>
+ <version>${yang.version}</version>
+ </dependency>
+ </dependencies>
+
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0</version>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.7</source>
+ <target>1.7</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.8.1</version>
+ <configuration>
+ <stylesheet>maven</stylesheet>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>site</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.4.0</version>
+ <configuration>
+ <effort>Max</effort>
+ <threshold>Low</threshold>
+ <goal>site</goal>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jdepend-maven-plugin</artifactId>
+ <version>2.0-beta-2</version>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
\ No newline at end of file
-<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">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-binding-api</artifactId>\r
- \r
- <dependencies>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-common</artifactId>\r
- <version>1.0</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-binding</artifactId>\r
- <version>1.0</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-common</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- </dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-binding-api</artifactId>\r
+\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-common</artifactId>\r
+\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-binding</artifactId>\r
+\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-common</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ </dependencies>
</project>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-binding-broker-impl</artifactId>\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-binding-broker-impl</artifactId>\r
\r
\r
\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-common-util</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-binding-api</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-binding-spi</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-core-api</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-common-util</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-binding-api</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-binding-spi</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-core-api</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- </dependency>\r
+ <dependency>\r
+ <groupId>org.slf4j</groupId>\r
+ <artifactId>slf4j-api</artifactId>\r
+ </dependency>\r
\r
- <dependency>\r
- <groupId>com.google.guava</groupId>\r
- <artifactId>guava</artifactId>\r
- <type>jar</type>\r
- </dependency>\r
- </dependencies>\r
+ <dependency>\r
+ <groupId>com.google.guava</groupId>\r
+ <artifactId>guava</artifactId>\r
+ <type>jar</type>\r
+ </dependency>\r
+ </dependencies>\r
</project>
\ No newline at end of file
-<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>
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal</artifactId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <artifactId>sal-binding-spi</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
+<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>
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>sal-binding-spi</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-core-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>concepts-lang</artifactId>
+ <version>0.5-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.binding.spi;
+
+import org.opendaylight.controller.concepts.lang.Transformer;
+import org.opendaylight.controller.yang.binding.DataObject;
+import org.opendaylight.controller.yang.common.QName;
+import org.opendaylight.controller.yang.data.api.CompositeNode;
+
+public interface DataDomToJavaTransformer<P extends DataObject> extends Transformer<CompositeNode, P> {
+
+ /**
+ * Returns a QName of valid input composite node.
+ *
+ * @return
+ */
+ QName getQName();
+}
--- /dev/null
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.binding.spi;
+
+import org.opendaylight.controller.concepts.lang.InputClassBasedTransformer;
+import org.opendaylight.controller.yang.binding.DataObject;
+import org.opendaylight.controller.yang.data.api.CompositeNode;
+
+public interface JavaToDataDomTransformer<I extends DataObject> extends
+ InputClassBasedTransformer<DataObject, I, CompositeNode> {
+}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-broker-impl</artifactId>\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-core-api</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-common-util</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-core-spi</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-api</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>com.google.guava</groupId>\r
- <artifactId>guava</artifactId>\r
- <type>jar</type>\r
- </dependency>\r
- </dependencies>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-broker-impl</artifactId>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-core-api</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-common-util</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-core-spi</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.slf4j</groupId>\r
+ <artifactId>slf4j-api</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>com.google.guava</groupId>\r
+ <artifactId>guava</artifactId>\r
+ <type>jar</type>\r
+ </dependency>\r
+ </dependencies>
</project>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-common-util</artifactId>\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-common-util</artifactId>\r
\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-common</artifactId>\r
- <version>1.0</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-common</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- </dependencies>
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-common</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-common</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ </dependencies>
</project>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-common</artifactId>\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-common</artifactId>\r
\r
- <dependencies>\r
- </dependencies>
+ <dependencies>\r
+ </dependencies>
</project>
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-core-api</artifactId>\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-core-api</artifactId>\r
\r
- <dependencies>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-common</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-common</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-data-api</artifactId>\r
- <version>1.0</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-model-api</artifactId>\r
- <version>1.0</version>\r
- </dependency>\r
- </dependencies>
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-data-api</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-model-api</artifactId>\r
+ </dependency>\r
+ </dependencies>
</project>
\ No newline at end of file
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<artifactId>yang-data-util</artifactId>\r
- <version>1.0</version>\r
</dependency>\r
<dependency>\r
<groupId>org.slf4j</groupId>\r
<dependency>\r
<groupId>org.opendaylight.controller</groupId>\r
<artifactId>yang-model-api</artifactId>\r
- <version>1.0</version>\r
</dependency>\r
</dependencies>\r
</project>
\ No newline at end of file