X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fstaticrouting%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fforwarding%2Fstaticrouting%2Fnorthbound%2FStaticRoutingNorthbound.java;fp=opendaylight%2Fnorthbound%2Fstaticrouting%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fforwarding%2Fstaticrouting%2Fnorthbound%2FStaticRoutingNorthbound.java;h=b85f5641c73ea9af99fd3b201909220367c8240b;hb=541d0a36997f292bb037a2199463431eee538358;hp=c48d7ec02684463962909ec2d60b600e3b270167;hpb=fad07e38e57f1c0d8d687e3bae01532196d6e99d;p=controller.git
diff --git a/opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java b/opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
index c48d7ec026..b85f5641c7 100644
--- a/opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
+++ b/opendaylight/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
@@ -51,7 +51,7 @@ import org.opendaylight.controller.sal.utils.Status;
* Authentication realm : opendaylight
* Transport : HTTP and HTTPS
*
- * HTTPS Authentication is disabled by default. Administrator can enable it in tomcat-server.xml after adding
+ * HTTPS Authentication is disabled by default. Administrator can enable it in tomcat-server.xml after adding
* a proper keystore / SSL certificate from a trusted authority.
* More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
*/
@@ -59,18 +59,18 @@ import org.opendaylight.controller.sal.utils.Status;
public class StaticRoutingNorthbound {
- private String username;
-
+ private String username;
+
@Context
public void setSecurityContext(SecurityContext context) {
- username = context.getUserPrincipal().getName();
+ username = context.getUserPrincipal().getName();
}
protected String getUserName() {
return username;
}
-
-
+
+
private List getStaticRoutesInternal(String containerName) {
IForwardingStaticRouting staticRouting = (IForwardingStaticRouting) ServiceHelper
@@ -109,9 +109,9 @@ public class StaticRoutingNorthbound {
public StaticRoutes getStaticRoutes(
@PathParam("containerName") String containerName) {
- if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
+ if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
Privilege.WRITE, this)){
- throw new
+ throw new
UnauthorizedException("User is not authorized to perform this operation on container "
+ containerName);
}
@@ -136,9 +136,9 @@ public class StaticRoutingNorthbound {
@PathParam("containerName") String containerName,
@PathParam("name") String name) {
- if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
+ if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
Privilege.WRITE, this)){
- throw new
+ throw new
UnauthorizedException("User is not authorized to perform this operation on container "
+ containerName);
}
@@ -174,10 +174,10 @@ public class StaticRoutingNorthbound {
@PathParam(value = "name") String name,
@TypeHint(StaticRoute.class) JAXBElement staticRouteData) {
-
- if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
+
+ if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
Privilege.WRITE, this)){
- throw new
+ throw new
UnauthorizedException("User is not authorized to perform this operation on container "
+ containerName);
}
@@ -221,10 +221,10 @@ public class StaticRoutingNorthbound {
public Response removeStaticRoute(
@PathParam(value = "containerName") String containerName,
@PathParam(value = "name") String name) {
-
- if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
+
+ if(!NorthboundUtils.isAuthorized(getUserName(), containerName,
Privilege.WRITE, this)){
- throw new
+ throw new
UnauthorizedException("User is not authorized to perform this operation on container "
+ containerName);
}