diff --git a/src/main/java/net/onrc/onos/core/newintent/PathFlowIntent.java b/src/main/java/net/onrc/onos/core/newintent/PathFlowIntent.java
new file mode 100644
index 0000000..988a8b3
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/newintent/PathFlowIntent.java
@@ -0,0 +1,63 @@
+package net.onrc.onos.core.newintent;
+
+import com.google.common.base.Objects;
+import net.onrc.onos.api.flowmanager.PathFlow;
+import net.onrc.onos.api.newintent.AbstractIntent;
+import net.onrc.onos.api.newintent.InstallableIntent;
+import net.onrc.onos.api.newintent.IntentId;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Intent containing {@link PathFlow} object, which defines an explicit path.
+ *
+ * It is intended to establish a path by using Flow Manager's API.
+ */
+public class PathFlowIntent extends AbstractIntent implements InstallableIntent {
+
+    private final PathFlow flow;
+
+    public PathFlowIntent(IntentId id, PathFlow flow) {
+        super(id);
+        this.flow = checkNotNull(flow);
+    }
+
+    /**
+     * Returns {@link PathFlow} object, which defines an explicit path.
+     *
+     * @return {@link PathFlow path}
+     */
+    public PathFlow getFlow() {
+        return flow;
+
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        if (!super.equals(o)) {
+            return false;
+        }
+
+        PathFlowIntent that = (PathFlowIntent) o;
+        return Objects.equal(this.flow, that.flow);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), flow);
+    }
+
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(getClass())
+                .add("id", getId())
+                .add("flow", flow)
+                .toString();
+    }
+}
diff --git a/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntent.java b/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntent.java
new file mode 100644
index 0000000..498eb0a
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/newintent/SingleDstTreeFlowIntent.java
@@ -0,0 +1,68 @@
+package net.onrc.onos.core.newintent;
+
+import com.google.common.base.Objects;
+import net.onrc.onos.api.flowmanager.SingleDstTreeFlow;
+import net.onrc.onos.api.newintent.AbstractIntent;
+import net.onrc.onos.api.newintent.InstallableIntent;
+import net.onrc.onos.api.newintent.IntentId;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Intent containing {@link SingleDstTreeFlow} object, which defines an explicit tree.
+ *
+ * It is intended to establish a path by using Flow Manager's API.
+ */
+public class SingleDstTreeFlowIntent extends AbstractIntent implements InstallableIntent {
+
+    private final SingleDstTreeFlow tree;
+
+    /**
+     * Constructs an intent containing the specified {@link SingleDstTreeFlow tree}.
+     *
+     * @param id intent identifier
+     * @param tree tree
+     */
+    public SingleDstTreeFlowIntent(IntentId id, SingleDstTreeFlow tree) {
+        super(id);
+        this.tree = checkNotNull(tree);
+    }
+
+    /**
+     * Returns the tree.
+     *
+     * @return tree
+     */
+    public SingleDstTreeFlow getTree() {
+        return tree;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        if (!super.equals(o)) {
+            return false;
+        }
+
+        SingleDstTreeFlowIntent that = (SingleDstTreeFlowIntent) o;
+        return Objects.equal(this.tree, that.tree);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), tree);
+    }
+
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(getClass())
+                .add("id", getId())
+                .add("tree", tree)
+                .toString();
+    }
+}
diff --git a/src/main/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntent.java b/src/main/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntent.java
new file mode 100644
index 0000000..a203605
--- /dev/null
+++ b/src/main/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntent.java
@@ -0,0 +1,68 @@
+package net.onrc.onos.core.newintent;
+
+import com.google.common.base.Objects;
+import net.onrc.onos.api.flowmanager.SingleSrcTreeFlow;
+import net.onrc.onos.api.newintent.AbstractIntent;
+import net.onrc.onos.api.newintent.InstallableIntent;
+import net.onrc.onos.api.newintent.IntentId;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Intent containing {@link  SingleSrcTreeFlow} object, which defines an explicit tree.
+ *
+ * It is intended to establish a path by using Flow Manager's API.
+ */
+public class SingleSrcTreeFlowIntent extends AbstractIntent implements InstallableIntent {
+
+    private final SingleSrcTreeFlow tree;
+
+    /**
+     * Constructs an intent containing the specified {@link SingleSrcTreeFlow tree}.
+     *
+     * @param id intent identifier
+     * @param tree tree
+     */
+    public SingleSrcTreeFlowIntent(IntentId id, SingleSrcTreeFlow tree) {
+        super(id);
+        this.tree = checkNotNull(tree);
+    }
+
+    /**
+     * Returns the tree.
+     *
+     * @return tree
+     */
+    public SingleSrcTreeFlow getTree() {
+        return tree;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        if (!super.equals(o)) {
+            return false;
+        }
+
+        SingleSrcTreeFlowIntent that = (SingleSrcTreeFlowIntent) o;
+        return Objects.equal(this.tree, that.tree);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hashCode(super.hashCode(), tree);
+    }
+
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(getClass())
+                .add("id", getId())
+                .add("tree", tree)
+                .toString();
+    }
+}
