Interfaces added for PCEP messages and PCEP Controller

Change-Id: Id678b6832b42bcf4a437322996244d224c4052d0
diff --git a/pcep/api/pom.xml b/pcep/api/pom.xml
new file mode 100755
index 0000000..a315079
--- /dev/null
+++ b/pcep/api/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2014 Open Networking Laboratory
+  ~
+  ~ Licensed 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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-pcep-controller</artifactId>
+        <version>1.3.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-pcep-controller-api</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>ONOS Pcep controller subsystem API</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-pcepio</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-misc</artifactId>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>2.3</version>
+                <configuration>
+                    <artifactSet>
+                        <excludes>
+                            <exclude>io.netty:netty</exclude>
+                            <exclude>com.google.guava:guava</exclude>
+                            <exclude>org.slf4j:slfj-api</exclude>
+                            <exclude>ch.qos.logback:logback-core</exclude>
+                            <exclude>ch.qos.logback:logback-classic</exclude>
+                            <exclude>com.google.code.findbugs:annotations</exclude>
+                        </excludes>
+                    </artifactSet>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Export-Package>
+                            org.onosproject.pcep.*,org.onosproject.pcepio.*
+                        </Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PccId.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PccId.java
new file mode 100755
index 0000000..3ff622b
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PccId.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Objects;
+
+import org.onlab.packet.IpAddress;
+
+/**
+ * The class representing a network client pc ip.
+ * This class is immutable.
+ */
+public final class PccId {
+
+    private static final String SCHEME = "pcep";
+    private static final long UNKNOWN = 0;
+    private final IpAddress ipAddress;
+
+    /**
+     * Private constructor.
+     */
+    private PccId(IpAddress ipAddress) {
+        this.ipAddress = ipAddress;
+    }
+
+    /**
+     * Create a PccId from ip address.
+     *
+     * @param ipAddress IP address
+     * @return ipAddress
+     */
+    public static PccId pccId(IpAddress ipAddress) {
+        return new PccId(ipAddress);
+    }
+
+    /**
+     * Returns the ip address.
+     *
+     * @return ipAddress
+     */
+    public IpAddress ipAddress() {
+        return ipAddress;
+    }
+
+    /**
+     * Convert the PccId value to a ':' separated hexadecimal string.
+     *
+     * @return the PccId value as a ':' separated hexadecimal string.
+     */
+    @Override
+    public String toString() {
+        return ipAddress.toString();
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (!(other instanceof PccId)) {
+            return false;
+        }
+
+        PccId otherPccid = (PccId) other;
+        return Objects.equals(ipAddress, otherPccid.ipAddress);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(ipAddress);
+    }
+
+    /**
+     * Returns PccId created from the given client URI.
+     *
+     * @param uri device URI
+     * @return pccid
+     */
+    public static PccId pccid(URI uri) {
+        checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme");
+        return new PccId(IpAddress.valueOf(uri.getSchemeSpecificPart()));
+    }
+
+    /**
+     * Produces client URI from the given DPID.
+     *
+     * @param pccid client pccid
+     * @return client URI
+     */
+    public static URI uri(PccId pccid) {
+        return uri(pccid.ipAddress());
+    }
+
+    /**
+     * Produces client URI from the given ip address.
+     *
+     * @param ipAddress ip of client
+     * @return client URI
+     */
+    public static URI uri(IpAddress ipAddress) {
+        try {
+            return new URI(SCHEME, ipAddress.toString(), null);
+        } catch (URISyntaxException e) {
+            return null;
+        }
+    }
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClient.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClient.java
new file mode 100755
index 0000000..2c478ec
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClient.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+import java.util.List;
+
+import org.onosproject.pcepio.protocol.PcepFactory;
+import org.onosproject.pcepio.protocol.PcepMessage;
+
+/**
+ * Represents to provider facing side of a path computation client(pcc).
+ */
+public interface PcepClient {
+
+    /**
+     * Writes the message to the driver.
+     *
+     * @param msg the message to write
+     */
+    public void sendMessage(PcepMessage msg);
+
+    /**
+     * Writes the PcepMessage list to the driver.
+     *
+     * @param msgs the messages to be written
+     */
+    public void sendMessage(List<PcepMessage> msgs);
+
+    /**
+     * Handle a message from the pcc.
+     *
+     * @param fromClient the message to handle
+     */
+    public void handleMessage(PcepMessage fromClient);
+
+    /**
+     * Provides the factory for this PCEP version.
+     *
+     * @return PCEP version specific factory.
+     */
+    public PcepFactory factory();
+
+    /**
+     * Gets a string version of the ID for this pcc.
+     *
+     * @return string version of the ID
+     */
+    public String getStringId();
+
+    /**
+     * Gets the ipAddress of the client.
+     *
+     * @return the client pccId in IPAddress format
+     */
+    public PccId getPccId();
+
+    /**
+     * Checks if the pcc is still connected.
+     *
+     * @return true if client is connected, false otherwise
+     */
+    public boolean isConnected();
+
+    /**
+     * Disconnects the pcc by closing the TCP connection. Results in a call
+     * to the channel handler's channelDisconnected method for cleanup.
+     */
+    public void disconnectClient();
+
+    /**
+     * Indicates if this pcc is optical.
+     *
+     * @return true if optical
+     */
+    public boolean isOptical();
+
+    /**
+     * Identifies the channel used to communicate with the pcc.
+     *
+     * @return string representation of the connection to the client
+     */
+    public String channelId();
+
+    /**
+     * To set the status of state synchronization.
+     *
+     * @param value to set the synchronization status
+     */
+    public void setIsSyncComplete(boolean value);
+
+    /**
+     * Indicates the state synchronization status of this pcc.
+     *
+     * @return true/false if the synchronization is completed/not completed
+     */
+    public boolean isSyncComplete();
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientController.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientController.java
new file mode 100755
index 0000000..1a7cd39
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientController.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+import java.util.List;
+
+import org.onosproject.pcepio.protocol.PcepMessage;
+
+/**
+ * Abstraction of an Pcep controller. Serves as a one stop
+ * shop for obtaining Pcep devices and (un)register listeners
+ * on pcep events
+ */
+public interface PcepClientController {
+
+    /**
+     * Returns list of pcc clients connected to this Pcep controller.
+     *
+     * @return list of PcepClient elements
+     */
+    public List<PcepClient> getClients();
+
+    /**
+     * Returns the actual pcc client for the given ip address.
+     *
+     * @param pccId the id of the pcc client to fetch
+     * @return the interface to this pcc client
+     */
+    public PcepClient getClient(PccId pccId);
+
+    /**
+     * Register a listener for meta events that occur to pcep
+     * devices.
+     *
+     * @param listener the listener to notify
+     */
+    public void addListener(PcepClientListener listener);
+
+    /**
+     * Unregister a listener.
+     *
+     * @param listener the listener to unregister
+     */
+    public void removeListener(PcepClientListener listener);
+
+    /**
+     * Register a listener for OF msg events.
+     *
+     * @param listener the listener to notify
+     */
+    public void addEventListener(PcepEventListener listener);
+
+    /**
+     * Unregister a listener.
+     *
+     * @param listener the listener to unregister
+     */
+    public void removeEventListener(PcepEventListener listener);
+
+    /**
+     * Send a message to a particular pcc client.
+     *
+     * @param pccId the id of the client to send message.
+     * @param msg the message to send
+     */
+    public void writeMessage(PccId pccId, PcepMessage msg);
+
+    /**
+     * Process a message and notify the appropriate listeners.
+     *
+     * @param pccId id of the client the message arrived on
+     * @param msg the message to process.
+     */
+    public void processClientMessage(PccId pccId, PcepMessage msg);
+
+    /**
+     * Close all connected PCC clients.
+     */
+    public void closeConnectedClients();
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientListener.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientListener.java
new file mode 100755
index 0000000..3f7e0f0
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepClientListener.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+/**
+ * Allows for providers interested in PCC client events to be notified.
+ */
+public interface PcepClientListener {
+
+    /**
+     * Notify that the PCC was connected.
+     *
+     * @param pccId the id of the client that connected
+     */
+    public void clientConnected(PccId pccId);
+
+    /**
+     * Notify that the PCC was disconnected.
+     *
+     * @param pccId the id of the client that disconnected.
+     */
+    public void clientDisconnected(PccId pccId);
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepEventListener.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepEventListener.java
new file mode 100755
index 0000000..905749b
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepEventListener.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+import org.onosproject.pcepio.protocol.PcepMessage;
+/**
+ * Notifies providers about pcep msg events.
+ */
+public interface PcepEventListener {
+
+    /**
+     * Handles the message event.
+     *
+     * @param pccId id of the pcc
+     * @param msg the message
+     */
+    public void handleMessage(PccId pccId, PcepMessage msg);
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepPacketStats.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepPacketStats.java
new file mode 100755
index 0000000..92bb2db
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/PcepPacketStats.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller;
+
+/**
+ * The representation for PCEP packet statistics.
+ */
+public interface PcepPacketStats {
+
+    /**
+     * Returns the count for no of packets sent out.
+     *
+     * @return int value of no of packets sent
+     */
+    public int outPacketCount();
+
+    /**
+     * Returns the count for no of packets received.
+     *
+     * @return int value of no of packets sent
+     */
+    public int inPacketCount();
+
+    /**
+     * Returns the count for no of wrong packets received.
+     *
+     * @return int value of no of wrong packets received
+     */
+    public int wrongPacketCount();
+
+    /**
+     * Returns the time value.
+     *
+     * @return long value of time
+     */
+    public long getTime();
+
+    /**
+     * Sets the time value.
+     *
+     * @param time long value of time
+     */
+    public void setTime(long time);
+
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepAgent.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepAgent.java
new file mode 100755
index 0000000..71ed834
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepAgent.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller.driver;
+
+import org.onosproject.pcep.controller.PccId;
+import org.onosproject.pcep.controller.PcepClient;
+import org.onosproject.pcepio.protocol.PcepMessage;
+
+/**
+ * Responsible for keeping track of the current set Pcep clients
+ * connected to the system.
+ *
+ */
+public interface PcepAgent {
+
+    /**
+     * Add a pcc client that has just connected to the system.
+     *
+     * @param pccId the id of pcc client to add
+     * @param pc the actual pce client object.
+     * @return true if added, false otherwise.
+     */
+    public boolean addConnectedClient(PccId pccId, PcepClient pc);
+
+    /**
+     * Checks if the activation for this pcc client is valid.
+     *
+     * @param pccId the id of pcc client to check
+     * @return true if valid, false otherwise
+     */
+    public boolean validActivation(PccId pccId);
+
+    /**
+     * Clear all state in controller client maps for a pcc client that has
+     * disconnected from the local controller. Also release control for
+     * that pccIds client from the global repository. Notify client listeners.
+     *
+     * @param pccIds the id of pcc client to remove.
+     */
+    public void removeConnectedClient(PccId pccIds);
+
+    /**
+     * Process a message coming from a pcc client.
+     *
+     * @param pccId the id of pcc client the message was received.
+     * @param m the message to process
+     */
+    public void processPcepMessage(PccId pccId, PcepMessage m);
+
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriver.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriver.java
new file mode 100755
index 0000000..16d0b0b
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriver.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller.driver;
+
+import org.jboss.netty.channel.Channel;
+import org.onosproject.pcep.controller.PccId;
+import org.onosproject.pcep.controller.PcepClient;
+import org.onosproject.pcep.controller.PcepPacketStats;
+import org.onosproject.pcepio.protocol.PcepVersion;
+
+
+/**
+ * Represents the driver side of an Path computation client(pcc).
+ *
+ */
+public interface PcepClientDriver extends PcepClient {
+
+    /**
+     * Sets the Pcep agent to be used. This method
+     * can only be called once.
+     *
+     * @param agent the agent to set.
+     */
+    public void setAgent(PcepAgent agent);
+
+    /**
+     * Announce to the Pcep agent that this pcc client has connected.
+     *
+     * @return true if successful, false if duplicate switch.
+     */
+    public boolean connectClient();
+
+    /**
+     * Remove this pcc client from the Pcep agent.
+     */
+    public void removeConnectedClient();
+
+    /**
+     * Sets the PCEP version for this pcc.
+     *
+     * @param pcepVersion the version to set.
+     */
+    public void setPcVersion(PcepVersion pcepVersion);
+
+    /**
+     * Sets the associated Netty channel for this pcc.
+     *
+     * @param channel the Netty channel
+     */
+    public void setChannel(Channel channel);
+
+
+    /**
+     * Sets the keep alive time for this pcc.
+     *
+     * @param keepAliveTime the keep alive time to set.
+     */
+    public void setPcKeepAliveTime(byte keepAliveTime);
+
+    /**
+     * Sets the dead time for this pcc.
+     *
+     * @param deadTime the dead timer value to set.
+     */
+    public void setPcDeadTime(byte deadTime);
+
+    /**
+     * Sets the session id for this pcc.
+     *
+     * @param sessionId the session id value to set.
+     */
+    public void setPcSessionId(byte sessionId);
+
+    /**
+     * Sets whether the pcc is connected.
+     *
+     * @param connected whether the pcc is connected
+     */
+    public void setConnected(boolean connected);
+
+    /**
+     * Initializes the behavior.
+     *
+     * @param pccId id of pcc
+     * @param pcepVersion Pcep version
+     * @param pktStats Pcep Packet Stats
+     */
+    void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats);
+
+    /**
+     * Checks whether the handshake is complete.
+     *
+     * @return true is finished, false if not.
+     */
+    boolean isHandshakeComplete();
+
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriverFactory.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriverFactory.java
new file mode 100755
index 0000000..d1e4733
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriverFactory.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.onosproject.pcep.controller.driver;
+
+import org.onlab.packet.IpAddress;
+import org.onosproject.pcepio.protocol.PcepVersion;
+
+/**
+ * Pcc Client factory which returns concrete pcc client objects for the
+ * physical pcc client in use.
+ *
+ */
+public interface PcepClientDriverFactory {
+
+
+    /**
+     * Constructs the real Pcep Client representation.
+     *
+     * @param pccIpAddress the ip address for this pcc client.
+     * @param pcepVersion the Pcep version in use
+     * @return the Pcep client representation.
+     */
+    public PcepClientDriver getPcepClientImpl(IpAddress pccIpAddress,
+            PcepVersion pcepVersion);
+}
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/package-info.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/package-info.java
new file mode 100755
index 0000000..2748ecc
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/driver/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.
+ */
+
+/**
+ * PCEP controller driver API.
+ */
+package org.onosproject.pcep.controller.driver;
diff --git a/pcep/api/src/main/java/org/onosproject/pcep/controller/package-info.java b/pcep/api/src/main/java/org/onosproject/pcep/controller/package-info.java
new file mode 100755
index 0000000..547b68d
--- /dev/null
+++ b/pcep/api/src/main/java/org/onosproject/pcep/controller/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed 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.
+ */
+
+/**
+ * PCEP controller API.
+ */
+package org.onosproject.pcep.controller;