[ONOS-1925]
1.fix javadocs bugs.
2.add pcep tunnel provider;
3.change pcep to pcep app;
4.fix some bugs according to review suggestions.

Change-Id: I4b90d9bf871dee3be70615d66db3d74f2fd85389
diff --git a/apps/pcep-api/pom.xml b/apps/pcep-api/pom.xml
new file mode 100644
index 0000000..0e2e03d
--- /dev/null
+++ b/apps/pcep-api/pom.xml
@@ -0,0 +1,10 @@
+<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.onosproject</groupId>
+    <artifactId>onos-apps</artifactId>
+    <version>1.2.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>onos-app-pcep-api</artifactId>
+  <packaging>bundle</packaging>
+</project>
\ No newline at end of file
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepController.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepController.java
new file mode 100644
index 0000000..c28841b
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepController.java
@@ -0,0 +1,115 @@
+/*
+ * 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.api;
+
+import org.onosproject.net.DeviceId;
+
+/**
+ * Abstraction of an PCEP controller. Serves as a one stop shop for obtaining
+ * PCEP devices and (un)register listeners on PCEP events
+ */
+public interface PcepController {
+
+    /**
+     * Returns all switches known to this PCEP controller.
+     *
+     * @return Iterable of did elements
+     */
+    public Iterable<PcepSwitch> getSwitches();
+
+    /**
+     * Return a switch with a specified did.
+     *
+     * @param did of a device
+     * @return a pcep device
+     */
+    public PcepSwitch getSwitch(PcepDpid did);
+
+    /**
+     * Register a listener for meta events that occur to PCEP devices.
+     *
+     * @param listener the listener to notify
+     */
+    public void addListener(PcepSwitchListener listener);
+
+    /**
+     * Unregister a listener.
+     *
+     * @param listener the listener to unregister
+     */
+    public void removeListener(PcepSwitchListener listener);
+
+    /**
+     * Register a listener for meta events that occur to PCEP links.
+     *
+     * @param listener the listener to notify
+     */
+    public void addLinkListener(PcepLinkListener listener);
+
+    /**
+     * Unregister a link listener.
+     *
+     * @param listener the listener to unregister
+     */
+    public void removeLinkListener(PcepLinkListener listener);
+
+    /**
+     * Register a listener for meta events that occur to PCEP tunnel.
+     *
+     * @param listener the listener to notify
+     */
+    public void addTunnelListener(PcepTunnelListener listener);
+
+    /**
+     * Unregister a tunnel listener.
+     *
+     * @param listener the listener to unregister
+     */
+    public void removeTunnelListener(PcepTunnelListener listener);
+
+    /**
+     * Setup a tunnel through pcep controller.
+     *
+     * @param srcDid src deviceId of tunnel
+     * @param dstDid dst deviceId of tunnel
+     * @param srcPort src port
+     * @param dstPort dst port
+     * @param bandwidth andwidth of tunnel
+     * @param name tunnel name
+     * @return pcep tunnel
+     */
+    public PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid,
+                                  long srcPort, long dstPort, long bandwidth,
+                                  String name);
+
+    /**
+     * Delete tunnel by id.
+     *
+     * @param id pcep tunnel id.
+     * @return true or false
+     */
+    public Boolean deleteTunnel(String id);
+
+    /**
+     * Update tunnel bandwidth by tunnel id.
+     *
+     * @param id tunnel id
+     * @param bandwidth bandwidth of a tunnel
+     * @return true or false
+     */
+    public Boolean updateTunnelBandwidth(String id, long bandwidth);
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepDpid.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepDpid.java
new file mode 100644
index 0000000..9d324e7
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepDpid.java
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+package org.onosproject.pcep.api;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.onosproject.pcep.tools.PcepTools;
+
+/**
+ * The class representing a network switch PCEPDid. This class is immutable.
+ */
+public final class PcepDpid {
+
+    private static final String SCHEME = "pcep";
+    private static final long UNKNOWN = 0;
+    private long nodeId;
+
+    /**
+     * Default constructor.
+     */
+    public PcepDpid() {
+        this.nodeId = PcepDpid.UNKNOWN;
+    }
+
+    /**
+     * Constructor from a long value.
+     *
+     * @param value long value for construct
+     */
+    public PcepDpid(long value) {
+        this.nodeId = value;
+    }
+
+    /**
+     * Constructor from a String.
+     *
+     * @param value string value for construct
+     */
+    public PcepDpid(String value) {
+        this.nodeId = Long.parseLong(value, 16);
+    }
+
+    /**
+     * Produces device URI from the given DPID.
+     *
+     * @param dpid device dpid
+     * @return device URI
+     */
+    public static URI uri(PcepDpid dpid) {
+        return uri(dpid.nodeId);
+    }
+
+    /**
+     * Produces device long from the given string which comes from the uri
+     * method.
+     *
+     * @param value string value which produced by uri method.
+     * @return a long value.
+     */
+    public static long toLong(String value) {
+        return PcepTools.ipToLong(value.replace(SCHEME, ""));
+    }
+
+    /**
+     * Produces device URI from the given DPID long.
+     *
+     * @param value device dpid as long
+     * @return device URI
+     */
+    public static URI uri(long value) {
+        try {
+            return new URI(SCHEME, PcepTools.longToIp(value), null);
+        } catch (URISyntaxException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Return a device id with the form of long.
+     *
+     * @return long value
+     */
+    public long value() {
+        return this.nodeId;
+    }
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepHopNodeDescription.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepHopNodeDescription.java
new file mode 100644
index 0000000..281f32f
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepHopNodeDescription.java
@@ -0,0 +1,62 @@
+/*
+ * 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.api;
+
+/**
+ * Description of a pcep tunnel hop node.a hop list consists of a number of hop
+ * node.
+ */
+public class PcepHopNodeDescription {
+    private PcepDpid deviceId;
+    private long portNum;
+
+    /**
+     * Get the pcepdpid of a node.
+     *
+     * @return device pcepdpid.
+     */
+    public PcepDpid getDeviceId() {
+        return deviceId;
+    }
+
+    /**
+     * Set the pcepdpid of a node.
+     *
+     * @param deviceId pcep dpid of a node.
+     */
+    public void setDeviceId(PcepDpid deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    /**
+     * Get the port number of a node.
+     *
+     * @return port number.
+     */
+    public long getPortNum() {
+        return portNum;
+    }
+
+    /**
+     * Set the port number of a node.
+     *
+     * @param portNum port number of a node.
+     */
+    public void setPortNum(long portNum) {
+        this.portNum = portNum;
+    }
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLink.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLink.java
new file mode 100644
index 0000000..d4db519
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLink.java
@@ -0,0 +1,133 @@
+/*
+ * 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.api;
+
+/**
+ * Abstraction of a huawei network infrastructure link.
+ */
+public interface PcepLink extends PcepOperator {
+
+    public enum SubType {
+        /**
+         * Optical Transmission Section Link.
+         */
+        OTS,
+
+        /**
+         * Optical Physical Section Link.
+         */
+        OPS,
+
+        /**
+         * User-to-Network Interface Link.
+         */
+        UNI,
+
+        /**
+         * Optical channel Data Unit-k link.
+         */
+        ODUk,
+
+        /**
+         * Optical Transport Network link.
+         */
+        OTU,
+    }
+
+
+
+    /**
+     * Get the link endpoint port type.
+     *
+     * @return endpoint port type
+     */
+    public String portType();
+
+    /**
+     * Get the link sub type,OTS,OPS,PKT_OPTICAL or ODUK.
+     *
+     * @return link subType
+     */
+
+    public SubType linkSubType();
+
+    /**
+     * Get the link state, up or down.
+     *
+     * @return link state
+     */
+    public String linkState();
+
+    /**
+     * Get the distance of a link.
+     *
+     * @return distance
+     */
+    public int linkDistance();
+
+    /**
+     * Get the capacity type of a link,1: WAVELENGTHNUM, 2:SLOTNUM, 3,
+     * BANDWIDTH.
+     *
+     * @return capacity type
+     */
+    public String linkCapacityType();
+
+    /**
+     * Get the available capacity value ,such as available bandwidth.
+     *
+     * @return availValue
+     */
+    public int linkAvailValue();
+
+    /**
+     * Get the max capacity value ,such as max bandwidth.
+     *
+     * @return maxValue
+     */
+    public int linkMaxValue();
+
+    /**
+     * Get the source device did of a link.
+     *
+     * @return source did
+     */
+    public PcepDpid linkSrcDeviceID();
+
+    /**
+     * Get the destination device did of a link.
+     *
+     * @return destination did
+     */
+    public PcepDpid linkDstDeviceId();
+
+    /**
+     * Get the source port number of a link,the port consists of shelf id, sub
+     * card id, board id, and port id of a Huawei Device.
+     *
+     * @return port number
+     */
+    public long linkSrcPort();
+
+    /**
+     * Get the destination port number of a link,the port consists of shelf id,
+     * sub card id, board id, and port id of a Huawei Device.
+     *
+     * @return port number
+     */
+    public long linkDstPort();
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLinkListener.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLinkListener.java
new file mode 100644
index 0000000..39730f4
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepLinkListener.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api;
+
+/**
+ * Allows for providers interested in Link events to be notified.
+ */
+public interface PcepLinkListener {
+
+    /**
+     * Notify that get a packet of link from network and need do some
+     * processing.
+     *
+     * @param link pcep link
+     */
+    public void handlePCEPlink(PcepLink link);
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepOperator.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepOperator.java
new file mode 100644
index 0000000..8bdcd67
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepOperator.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.api;
+
+/**
+ * A interface defined operator type, and provide a method to get the operator
+ * type.
+ *
+ */
+public interface PcepOperator {
+
+    public enum OperationType {
+
+        ADD, UPDATE, DELETE,
+    }
+
+    /**
+     * Get operate type of a event,such as device add ,device update.
+     *
+     * @return operation type.
+     */
+    public OperationType getOperationType();
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitch.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitch.java
new file mode 100644
index 0000000..e6c994e
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitch.java
@@ -0,0 +1,92 @@
+/*
+ * 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.api;
+
+/*
+ * Represent to provider facing side of a switch
+ */
+public interface PcepSwitch extends PcepOperator {
+
+    public static enum SubDeviceType {
+        /* optical device */
+        ROADM,
+
+        /* electronic device */
+        OTN,
+
+        /* router */
+        ROUTER,
+
+        /* unkown type */
+        UNKNOW,
+    }
+
+    /**
+     * Gets a string version of the ID for this switch.
+     * @return string version of the ID
+     */
+    public String getStringId();
+
+    /**
+     * Gets the datapathId of the switch.
+     * @return the switch dpid in long format
+     */
+    public long getId();
+
+    public long getNeId();
+
+    /**
+     * Gets the sub type of the device.
+     * @return the sub type
+     */
+    public SubDeviceType getDeviceSubType();
+
+    /**
+     * fetch the manufacturer description.
+     * @return the description
+     */
+    public String manufacturerDescription();
+
+    /**
+     * fetch the datapath description.
+     * @return the description
+     */
+    public String datapathDescription();
+
+    /**
+     * fetch the hardware description.
+     * @return the description
+     */
+    public String hardwareDescription();
+
+    /**
+     * fetch the software description.
+     * @return the description
+     */
+    public String softwareDescription();
+
+    /**
+     * fetch the serial number.
+     * @return the serial
+     */
+    public String serialNumber();
+
+    /**
+     * Indicates if this switch is optical.
+     * @return true if optical
+     */
+    public boolean isOptical();
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitchListener.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitchListener.java
new file mode 100644
index 0000000..01eaaa5
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepSwitchListener.java
@@ -0,0 +1,44 @@
+/*
+ * 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.api;
+
+/**
+ * Notifies providers about switch in events.
+ */
+public interface PcepSwitchListener {
+
+    /**
+     * Notify that the switch was added.
+     *
+     * @param dpid the switch where the event occurred
+     */
+    public void switchAdded(PcepDpid dpid);
+
+    /**
+     * Notify that the switch was removed.
+     *
+     * @param dpid the switch where the event occurred.
+     */
+    public void switchRemoved(PcepDpid dpid);
+
+    /**
+     * Notify that the switch has changed in some way.
+     *
+     * @param dpid the switch that changed
+     */
+    public void switchChanged(PcepDpid dpid);
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnel.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnel.java
new file mode 100644
index 0000000..c66a6cc
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnel.java
@@ -0,0 +1,177 @@
+/*
+ * 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.api;
+
+import java.util.List;
+
+/**
+ * Abstraction of a generalized  PCEP Tunnel entity (bandwidth pipe) for
+ * L2 networks or L1/L0 networks, representation of e.g., VLAN, L1 ODUk
+ * connection, WDM OCH, etc..
+ */
+public interface PcepTunnel extends PcepOperator {
+
+    /**
+     * Describe the type of a tunnel.
+     */
+    public static enum Type {
+
+        /**
+         * Signifies that this is a L0 OCH tunnel.
+         */
+        OCH,
+
+        /**
+         * Signifies that this is a L1 OTN tunnel.
+         */
+        OTN,
+
+        /**
+         * Signifies that this is a L2 tunnel.
+         */
+        UNI,
+    }
+
+    /**
+     * The ability of a tunnel.
+     */
+    public static enum Ability {
+        /**
+         * no protected tunnel,if the tunnel is broken ,then the user is out of
+         * service.
+         */
+        NOPROTECTED,
+
+        /**
+         * tunnel with rerouter ability.if a tunnel is broken, the tunnel will
+         * try to find another path to provider service.
+         */
+        SILVER,
+
+        /**
+         * tunnel with 1 + 1 rerouter ability.if a tunnel is broken, there'll be
+         * another tunnel providing service at once.
+         */
+        DIAMOND
+    }
+
+    public static enum PATHTYPE {
+
+        /**
+         * the preferred path.
+         */
+        FIRST,
+
+        /**
+         * the alternate path.
+         */
+        SECOND
+    }
+
+    /**
+     * Get the type of a tunnel.
+     *
+     * @return tunnel type
+     */
+    public Type type();
+
+    /**
+     * Get the name of a tunnel.
+     *
+     * @return tunnel name
+     */
+    public String name();
+
+    /**
+     * Get the device id of destination endpoint of a tunnel.
+     *
+     * @return device id
+     */
+    public PcepDpid srcDeviceID();
+
+    /**
+     * Get the device id of source endpoint of a tunnel.
+     *
+     * @return device id
+     */
+    public PcepDpid dstDeviceId();
+
+    /**
+     * Get source port of a tunnel.
+     *
+     * @return port number
+     */
+    public long srcPort();
+
+    /**
+     * Get destination port of a tunnel.
+     *
+     * @return port number
+     */
+    public long dstPort();
+
+    /**
+     * Get the bandwidth of a tunnel.
+     *
+     * @return bandwidth
+     */
+    public long bandWidth();
+
+    /**
+     * Get the tunnel id.
+     *
+     * @return id of the PCEP tunnel
+     */
+    public long id();
+
+    /**
+     * Get the detail hop list of a tunnel.
+     *
+     * @return hop list
+     */
+    public List<PcepHopNodeDescription> getHopList();
+
+    /**
+     * Get the instance of a pcep tunnel,a instance is used to mark the times of a tunnel created.
+     * instance and id identify a tunnel together.
+     *
+     * @return the instance of a tunnel.
+     */
+    public int getInstance();
+
+    /**
+     * Get the ability of a tunnel.NOPROTECTED,SILVER,or DIAMOND.
+     *
+     * @return ability of the tunenl
+     */
+    public Ability getSla();
+
+    /**
+     * Get the path type of a path if the tunnel's ability is diamond .
+     *
+     * @return the type of a path, the preferred or alternate.
+     */
+    public PATHTYPE getPathType();
+
+    /**
+     * Get the under lay tunnel id of VLAN tunnel.
+     *
+     * @return the tunnel id of a OCH tunnel under lay of a VLAN tunnel.
+     */
+    public long underLayTunnelId();
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnelListener.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnelListener.java
new file mode 100644
index 0000000..2cbe15a
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepTunnelListener.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.api;
+
+/**
+ * Allows for providers interested in tunnel events to be notified.
+ */
+public interface PcepTunnelListener {
+
+    /**
+     * Notify that get a packet of tunnel from network and need do some
+     * processing.
+     *
+     * @param tunnel a pceptunnel.
+     */
+    public void handlePCEPTunnel(PcepTunnel tunnel);
+
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/api/package-info.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/package-info.java
new file mode 100644
index 0000000..61c8290
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/api/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.api;
\ No newline at end of file
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/PcepTools.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/PcepTools.java
new file mode 100644
index 0000000..28eaebd
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/PcepTools.java
@@ -0,0 +1,119 @@
+/*
+ * 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.tools;
+
+import javax.xml.bind.DatatypeConverter;
+
+/**
+ * tools fo pcep app.
+ */
+public abstract class PcepTools {
+
+    private PcepTools() {
+
+    }
+
+    /**
+     * Converts decimal byte array to a hex string.
+     *
+     * @param byteArray byte array
+     * @return a hex string
+     */
+    public static String toHexString(byte[] byteArray) {
+        return DatatypeConverter.printHexBinary(byteArray);
+    }
+
+    /**
+     * Converts a hex string to a decimal byte array.
+     *
+     * @param hexString a hex string
+     * @return byte array
+     */
+    public static byte[] toByteArray(String hexString) {
+        return DatatypeConverter.parseHexBinary(hexString);
+    }
+
+    /**
+     * Converts a byte array to a decimal string.
+     *
+     * @param bytes a byte array
+     * @return a decimal string
+     */
+    public static String toDecimalString(byte[] bytes) {
+        String str = "";
+        for (int i = 0; i < bytes.length; i++) {
+            str += String.valueOf(bytes[i]);
+        }
+        return str;
+    }
+
+    /**
+     * convert a string to the form of ip address.
+     *
+     * @param str a string
+     * @return a string with ip format
+     */
+    public static String stringToIp(String str) {
+        long ipInt = Long.parseLong(str, 16);
+        return longToIp(ipInt);
+    }
+
+    /**
+     * convert a long to ip format.
+     *
+     * @param ipLong a decimal number.
+     * @return a ip format string
+     */
+    public static String longToIp(long ipLong) {
+        StringBuilder sb = new StringBuilder();
+        sb.append((ipLong >> 24) & 0xFF).append(".");
+        sb.append((ipLong >> 16) & 0xFF).append(".");
+        sb.append((ipLong >> 8) & 0xFF).append(".");
+        sb.append(ipLong & 0xFF);
+        return sb.toString();
+    }
+
+    /**
+     * convert a string with ip format to a long.
+     *
+     * @param strIp a string with ip format
+     * @return a long number
+     */
+    public static long ipToLong(String strIp) {
+        long[] ip = new long[4];
+        int position1 = strIp.indexOf(".");
+        int position2 = strIp.indexOf(".", position1 + 1);
+        int position3 = strIp.indexOf(".", position2 + 1);
+        ip[0] = Long.parseLong(strIp.substring(0, position1));
+        ip[1] = Long.parseLong(strIp.substring(position1 + 1, position2));
+        ip[2] = Long.parseLong(strIp.substring(position2 + 1, position3));
+        ip[3] = Long.parseLong(strIp.substring(position3 + 1));
+        return (ip[0] << 24) + (ip[1] << 16) + (ip[2] << 8) + ip[3];
+    }
+
+    /**
+     * get a integer value from a cut string.
+     *
+     * @param str a whole string
+     * @param base cut the string from this index
+     * @param offset the offset when execute the cut
+     * @return a integer value
+     */
+    public static int tranferHexStringToInt(String str, int base, int offset) {
+        return Integer.parseInt(str.substring(base, offset), 16);
+
+    }
+}
diff --git a/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/package-info.java b/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/package-info.java
new file mode 100644
index 0000000..8358a45
--- /dev/null
+++ b/apps/pcep-api/src/main/java/org/onosproject/pcep/tools/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+/**
+ * tools for pcep app.
+ */
+package org.onosproject.pcep.tools;
\ No newline at end of file
diff --git a/apps/pom.xml b/apps/pom.xml
index 4b88dfa..69f767b 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -49,6 +49,7 @@
         <module>segmentrouting</module>
         <module>cordfabric</module>
         <module>xos-integration</module>
+        <module>pcep-api</module>
     </modules>
 
     <properties>