chengfan
Committed by Gerrit Code Review

Optimized the pcep api

1.remove the "public" in the interface
2.remove the "static" in the enum

Change-Id: I782ec94581a7f8ef08280444f237a9a21f2f1807

Optimized the pcep api

1.remove the "public" in the interface
2.remove the "static" in the enum

Change-Id: I782ec94581a7f8ef08280444f237a9a21f2f1807
......@@ -28,7 +28,7 @@ public interface PcepController {
*
* @return Iterable of did elements
*/
public Iterable<PcepSwitch> getSwitches();
Iterable<PcepSwitch> getSwitches();
/**
* Return a switch with a specified did.
......@@ -36,49 +36,49 @@ public interface PcepController {
* @param did of a device
* @return a pcep device
*/
public PcepSwitch getSwitch(PcepDpid did);
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);
void addListener(PcepSwitchListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
public void removeListener(PcepSwitchListener listener);
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);
void addLinkListener(PcepLinkListener listener);
/**
* Unregister a link listener.
*
* @param listener the listener to unregister
*/
public void removeLinkListener(PcepLinkListener listener);
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);
void addTunnelListener(PcepTunnelListener listener);
/**
* Unregister a tunnel listener.
*
* @param listener the listener to unregister
*/
public void removeTunnelListener(PcepTunnelListener listener);
void removeTunnelListener(PcepTunnelListener listener);
/**
* Setup a tunnel through pcep controller.
......@@ -91,7 +91,7 @@ public interface PcepController {
* @param name tunnel name
* @return pcep tunnel
*/
public PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid,
PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid,
long srcPort, long dstPort, long bandwidth,
String name);
......@@ -101,7 +101,7 @@ public interface PcepController {
* @param id pcep tunnel id.
* @return true or false
*/
public Boolean deleteTunnel(String id);
Boolean deleteTunnel(String id);
/**
* Update tunnel bandwidth by tunnel id.
......@@ -110,6 +110,6 @@ public interface PcepController {
* @param bandwidth bandwidth of a tunnel
* @return true or false
*/
public Boolean updateTunnelBandwidth(String id, long bandwidth);
Boolean updateTunnelBandwidth(String id, long bandwidth);
}
......
......@@ -22,7 +22,7 @@ import org.onosproject.net.Port;
*/
public interface PcepLink extends PcepOperator {
public enum SubType {
enum SubType {
/**
* Optical Transmission Section Link.
*/
......@@ -50,7 +50,7 @@ public interface PcepLink extends PcepOperator {
}
public enum PortType {
enum PortType {
ODU_PORT, OCH_PORT, OMS_PORT
}
......@@ -59,7 +59,7 @@ public interface PcepLink extends PcepOperator {
*
* @return endpoint port type
*/
public PortType portType();
PortType portType();
/**
* Returns the link sub type,OTS,OPS,PKT_OPTICAL or ODUK.
......@@ -67,21 +67,21 @@ public interface PcepLink extends PcepOperator {
* @return link subType
*/
public SubType linkSubType();
SubType linkSubType();
/**
* Returns the link state, up or down.
*
* @return link state
*/
public String linkState();
String linkState();
/**
* Returns the distance of a link.
*
* @return distance
*/
public int linkDistance();
int linkDistance();
/**
* Returns the capacity type of a link,1: WAVELENGTHNUM, 2:SLOTNUM, 3,
......@@ -89,48 +89,48 @@ public interface PcepLink extends PcepOperator {
*
* @return capacity type
*/
public String linkCapacityType();
String linkCapacityType();
/**
* Returns the available capacity value ,such as available bandwidth.
*
* @return availValue
*/
public int linkAvailValue();
int linkAvailValue();
/**
* Returns the max capacity value ,such as max bandwidth.
*
* @return maxValue
*/
public int linkMaxValue();
int linkMaxValue();
/**
* Returns the source device did of a link.
*
* @return source did
*/
public PcepDpid linkSrcDeviceID();
PcepDpid linkSrcDeviceID();
/**
* Returns the destination device did of a link.
*
* @return destination did
*/
public PcepDpid linkDstDeviceId();
PcepDpid linkDstDeviceId();
/**
* Returns the source port of a link.
*
* @return port number
*/
public Port linkSrcPort();
Port linkSrcPort();
/**
* Returns the destination port of a link.
*
* @return port number
*/
public Port linkDstPort();
Port linkDstPort();
}
......
......@@ -26,5 +26,5 @@ public interface PcepLinkListener {
*
* @param link pcep link
*/
public void handlePCEPlink(PcepLink link);
void handlePCEPlink(PcepLink link);
}
......
......@@ -18,11 +18,10 @@ 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 {
enum OperationType {
ADD, UPDATE, DELETE,
}
......@@ -32,5 +31,5 @@ public interface PcepOperator {
*
* @return operation type.
*/
public OperationType getOperationType();
OperationType getOperationType();
}
......
......@@ -20,7 +20,7 @@ package org.onosproject.pcep.api;
*/
public interface PcepSwitch extends PcepOperator {
public static enum DeviceType {
enum DeviceType {
/* optical device */
ROADM,
......@@ -38,55 +38,55 @@ public interface PcepSwitch extends PcepOperator {
* Gets a string version of the ID for this switch.
* @return string version of the ID
*/
public String getStringId();
String getStringId();
/**
* Gets the datapathId of the switch.
* @return the switch dpid in long format
*/
public long getId();
long getId();
public long getNeId();
long getNeId();
/**
* Gets the sub type of the device.
* @return the sub type
*/
public DeviceType getDeviceType();
DeviceType getDeviceType();
/**
* fetch the manufacturer description.
* @return the description
*/
public String manufacturerDescription();
String manufacturerDescription();
/**
* fetch the datapath description.
* @return the description
*/
public String datapathDescription();
String datapathDescription();
/**
* fetch the hardware description.
* @return the description
*/
public String hardwareDescription();
String hardwareDescription();
/**
* fetch the software description.
* @return the description
*/
public String softwareDescription();
String softwareDescription();
/**
* fetch the serial number.
* @return the serial
*/
public String serialNumber();
String serialNumber();
/**
* Indicates if this switch is optical.
* @return true if optical
*/
public boolean isOptical();
boolean isOptical();
}
......
......@@ -25,20 +25,20 @@ public interface PcepSwitchListener {
*
* @param dpid the switch where the event occurred
*/
public void switchAdded(PcepDpid dpid);
void switchAdded(PcepDpid dpid);
/**
* Notify that the switch was removed.
*
* @param dpid the switch where the event occurred.
*/
public void switchRemoved(PcepDpid dpid);
void switchRemoved(PcepDpid dpid);
/**
* Notify that the switch has changed in some way.
*
* @param dpid the switch that changed
*/
public void switchChanged(PcepDpid dpid);
void switchChanged(PcepDpid dpid);
}
......
......@@ -28,7 +28,7 @@ public interface PcepTunnel extends PcepOperator {
/**
* Describe the type of a tunnel.
*/
public static enum Type {
enum Type {
/**
* Signifies that this is a L0 OCH tunnel.
......@@ -49,7 +49,7 @@ public interface PcepTunnel extends PcepOperator {
/**
* The ability of a tunnel.
*/
public static enum Ability {
enum Ability {
/**
* no protected tunnel,if the tunnel is broken ,then the user is out of
* service.
......@@ -69,7 +69,7 @@ public interface PcepTunnel extends PcepOperator {
DIAMOND
}
public static enum PATHTYPE {
enum PATHTYPE {
/**
* Indicates path is the preferred path.
......@@ -84,9 +84,8 @@ public interface PcepTunnel extends PcepOperator {
/**
* Represents state of the path, work normally or broken down.
*
*/
public static enum PathState {
enum PathState {
NORMAL, BROKEN
}
......@@ -95,63 +94,63 @@ public interface PcepTunnel extends PcepOperator {
*
* @return tunnel type
*/
public Type type();
Type type();
/**
* Returns the name of a tunnel.
*
* @return tunnel name
*/
public String name();
String name();
/**
* Returns the device id of destination endpoint of a tunnel.
*
* @return device id
*/
public PcepDpid srcDeviceID();
PcepDpid srcDeviceID();
/**
* Returns the device id of source endpoint of a tunnel.
*
* @return device id
*/
public PcepDpid dstDeviceId();
PcepDpid dstDeviceId();
/**
* Returns source port of a tunnel.
*
* @return port number
*/
public long srcPort();
long srcPort();
/**
* Returns destination port of a tunnel.
*
* @return port number
*/
public long dstPort();
long dstPort();
/**
* Returns the bandwidth of a tunnel.
*
* @return bandwidth
*/
public long bandWidth();
long bandWidth();
/**
* Returns the tunnel id.
*
* @return id of the PCEP tunnel
*/
public long id();
long id();
/**
* Returns the detail hop list of a tunnel.
*
* @return hop list
*/
public List<PcepHopNodeDescription> getHopList();
List<PcepHopNodeDescription> getHopList();
/**
* Returns the instance of a pcep tunnel,a instance is used to mark the times of
......@@ -159,34 +158,34 @@ public interface PcepTunnel extends PcepOperator {
*
* @return the instance of a tunnel.
*/
public int getInstance();
int getInstance();
/**
* Returns the state of a path.
*
* @return normal or broken
*/
public PathState getPathState();
PathState getPathState();
/**
* Returns the ability of a tunnel.
*
* @return ability of the tunenl
*/
public Ability getSla();
Ability getSla();
/**
* Returns 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();
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();
long underlayTunnelId();
}
......
......@@ -26,6 +26,6 @@ public interface PcepTunnelListener {
*
* @param tunnel a pceptunnel.
*/
public void handlePCEPTunnel(PcepTunnel tunnel);
void handlePCEPTunnel(PcepTunnel tunnel);
}
......