Merge "AAFcli.java -Declare "value" on a separate line"
[aaf/authz.git] / auth / auth-cmd / src / main / java / org / onap / aaf / auth / cmd / ns / Attrib.java
index 77b1445..63089e4 100644 (file)
@@ -3,13 +3,15 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2018 IBM.
  * ===========================================================================
  * 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.
@@ -33,7 +35,7 @@ import org.onap.aaf.cadi.client.Retryable;
 import org.onap.aaf.misc.env.APIException;
 
 public class Attrib extends BaseCmd<NS> {
-    private final static String[] options = {"add","upd","del"};
+    private static final String[] options = {"add","upd","del"};
     private String authzString = "/authz/ns/";
     private String atrributeString = "/attrib/";
 
@@ -60,24 +62,24 @@ public class Attrib extends BaseCmd<NS> {
         } else {
             value = "";
         }
-        
+
         return same(new Retryable<Integer>() {
             @Override
-            public Integer code(Rcli<?> client) throws CadiException, APIException {    
+            public Integer code(Rcli<?> client) throws CadiException, APIException {
                 Future<Void> fp = null;
                 String message;
                 switch(option) {
-                    case 0: 
+                    case 0:
                         fp = client.create(authzString+ns+atrributeString+key+'/'+value,Void.class);
                         message = String.format("Add Attrib %s=%s to %s",
                                 key,value,ns);
                         break;
-                    case 1: 
+                    case 1:
                         fp = client.update(authzString+ns+atrributeString+key+'/'+value);
                         message = String.format("Update Attrib %s=%s for %s",
                                 key,value,ns);
                         break;
-                    case 2: 
+                    case 2:
                         fp = client.delete(authzString+ns+atrributeString+key,Void.class);
                         message = String.format("Attrib %s deleted from %s",
                                 key,ns);
@@ -93,8 +95,8 @@ public class Attrib extends BaseCmd<NS> {
                     } else {
                         error(fp);
                     }
-                        
-                    return fp.code(); 
+
+                    return fp.code();
                 }
             }
         });