test_class.declarator: router = null
test_class.modifier: private
test_class.original_string: private Router router = null;
test_class.type: Router
test_class.var_name: router
test_class.declarator: sccpResource = null
test_class.modifier: private
test_class.original_string: private SccpResource sccpResource = null;
test_class.type: SccpResource
test_class.var_name: sccpResource
test_class.declarator: sccpStack = null
test_class.modifier: private
test_class.original_string: private SccpStackImpl sccpStack = null;
test_class.type: SccpStackImpl
test_class.var_name: sccpStack
test_class.declarator: sccpExecutor = null
test_class.modifier: private
test_class.original_string: private SccpExecutor sccpExecutor = null;
test_class.type: SccpExecutor
test_class.var_name: sccpExecutor
test_class.file: sccp/sccp-impl/src/test/java/org/mobicents/protocols/ss7/sccp/impl/oam/SccpExecutorTest.java
test_class.identifier: SccpExecutorTest
test_case.body: @Test(groups = { "oam", "functional.mgmt" })
      public void testManageAddress() {
          String prim_addressCmd = "sccp address create 1 71 6535 8 0 0 12 93707100007";
          String result = this.sccpExecutor.execute(prim_addressCmd.split(" "));
          assertEquals(result, String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_ADDED, this.sccpStack.getName()));
          assertEquals(this.router.getRoutingAddresses().size(), 1);
  
          // test show
          prim_addressCmd = "sccp address show";
          result = this.sccpExecutor.execute(prim_addressCmd.split(" "));
          assertEquals(result, "key=1  pc=6535,ssn=8,AI=71,gt=GlobalTitle0001Impl [digits=93707100007, natureOfAddress=SPARE_12, encodingScheme=BCDOddEncodingScheme[type=BCD_ODD, code=1]]\n");
      }
test_case.class_method_signature: SccpExecutorTest.testManageAddress()
test_case.full_signature: @Test(groups = { "oam", "functional.mgmt" }) public void testManageAddress()
test_case.identifier: testManageAddress
test_case.invocations: execute split assertEquals format getName assertEquals size getRoutingAddresses execute split assertEquals
test_case.modifiers: @Test(groups = { "oam", "functional.mgmt" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testManageAddress()
focal_class.declarator: logger = Logger.getLogger(SccpExecutor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(SccpExecutor.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: sccpStacks = new FastMap<String, SccpStackImpl>()
focal_class.modifier: private
focal_class.original_string: private FastMap<String, SccpStackImpl> sccpStacks = new FastMap<String, SccpStackImpl>();
focal_class.type: FastMap<String, SccpStackImpl>
focal_class.var_name: sccpStacks
focal_class.declarator: sccpStack = null
focal_class.modifier: private
focal_class.original_string: private SccpStackImpl sccpStack = null;
focal_class.type: SccpStackImpl
focal_class.var_name: sccpStack
focal_class.file: sccp/sccp-impl/src/main/java/org/mobicents/protocols/ss7/sccp/impl/oam/SccpExecutor.java
focal_class.identifier: SccpExecutor
focal_class.interfaces: implements ShellExecutor
focal_class.class_method_signature: SccpExecutor.SccpExecutor()
focal_class.full_signature: public  SccpExecutor()
focal_class.identifier: SccpExecutor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  SccpExecutor()
focal_class.class_method_signature: SccpExecutor.setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.full_signature: public void setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.identifier: setSccpStacks
focal_class.modifiers: public
focal_class.parameters: (Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.return: void
focal_class.signature: void setSccpStacks(Map<String, SccpStackImpl> sccpStacksTemp)
focal_class.class_method_signature: SccpExecutor.setDefaultValue()
focal_class.full_signature: private void setDefaultValue()
focal_class.identifier: setDefaultValue
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setDefaultValue()
focal_class.class_method_signature: SccpExecutor.getSccpStacks()
focal_class.full_signature: public Map<String, SccpStackImpl> getSccpStacks()
focal_class.identifier: getSccpStacks
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, SccpStackImpl>
focal_class.signature: Map<String, SccpStackImpl> getSccpStacks()
focal_class.class_method_signature: SccpExecutor.execute(String[] options)
focal_class.full_signature: public String execute(String[] options)
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String execute(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRss(String[] options)
focal_class.full_signature: private String manageRss(String[] options)
focal_class.identifier: manageRss
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRss(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRsp(String[] options)
focal_class.full_signature: private String manageRsp(String[] options)
focal_class.identifier: manageRsp
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRsp(String[] options)
focal_class.class_method_signature: SccpExecutor.manageAddress(String[] options)
focal_class.full_signature: private String manageAddress(String[] options)
focal_class.identifier: manageAddress
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageAddress(String[] options)
focal_class.class_method_signature: SccpExecutor.manageRule(String[] options)
focal_class.full_signature: private String manageRule(String[] options)
focal_class.identifier: manageRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageRule(String[] options)
focal_class.class_method_signature: SccpExecutor.createRule(String[] options)
focal_class.full_signature: private String createRule(String[] options)
focal_class.identifier: createRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String createRule(String[] options)
focal_class.class_method_signature: SccpExecutor.modifyRule(String[] options)
focal_class.full_signature: private String modifyRule(String[] options)
focal_class.identifier: modifyRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String modifyRule(String[] options)
focal_class.class_method_signature: SccpExecutor.deleteRule(String[] options)
focal_class.full_signature: private String deleteRule(String[] options)
focal_class.identifier: deleteRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String deleteRule(String[] options)
focal_class.class_method_signature: SccpExecutor.showRule(String[] options)
focal_class.full_signature: private String showRule(String[] options)
focal_class.identifier: showRule
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String showRule(String[] options)
focal_class.class_method_signature: SccpExecutor.createAddress(String[] options, int index, boolean isRule)
focal_class.full_signature: private SccpAddress createAddress(String[] options, int index, boolean isRule)
focal_class.identifier: createAddress
focal_class.modifiers: private
focal_class.parameters: (String[] options, int index, boolean isRule)
focal_class.return: SccpAddress
focal_class.signature: SccpAddress createAddress(String[] options, int index, boolean isRule)
focal_class.class_method_signature: SccpExecutor.manageLmr(String[] options)
focal_class.full_signature: private String manageLmr(String[] options)
focal_class.identifier: manageLmr
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageLmr(String[] options)
focal_class.class_method_signature: SccpExecutor.manageSap(String[] options)
focal_class.full_signature: private String manageSap(String[] options)
focal_class.identifier: manageSap
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageSap(String[] options)
focal_class.class_method_signature: SccpExecutor.manageDest(String[] options)
focal_class.full_signature: private String manageDest(String[] options)
focal_class.identifier: manageDest
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageDest(String[] options)
focal_class.class_method_signature: SccpExecutor.manageConcernedSpc(String[] options)
focal_class.full_signature: private String manageConcernedSpc(String[] options)
focal_class.identifier: manageConcernedSpc
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageConcernedSpc(String[] options)
focal_class.class_method_signature: SccpExecutor.manageSet(String[] options)
focal_class.full_signature: private String manageSet(String[] options)
focal_class.identifier: manageSet
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageSet(String[] options)
focal_class.class_method_signature: SccpExecutor.manageGet(String[] options)
focal_class.full_signature: private String manageGet(String[] options)
focal_class.identifier: manageGet
focal_class.modifiers: private
focal_class.parameters: (String[] options)
focal_class.return: String
focal_class.signature: String manageGet(String[] options)
focal_class.class_method_signature: SccpExecutor.handles(String command)
focal_class.full_signature: @Override public boolean handles(String command)
focal_class.identifier: handles
focal_class.modifiers: @Override public
focal_class.parameters: (String command)
focal_class.return: boolean
focal_class.signature: boolean handles(String command)
focal_method.body: private String manageAddress(String[] options) throws Exception {
          // Minimum 3 needed. Show
          if (options.length < 3) {
              return SccpOAMMessage.INVALID_COMMAND;
          }
  
          String command = options[2];
  
          if (command == null) {
              return SccpOAMMessage.INVALID_COMMAND;
          }
  
          if (command.equals("create")) {
              if (options.length < 4) {
                  return SccpOAMMessage.INVALID_COMMAND;
              }
              int addressId = Integer.parseInt(options[3]);
  
              int count = 11;
  
              while (count < options.length) {
                  String key = options[count++];
                  if (key == null) {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
                  if (key.equals("stackname")) {
                      String m3uaStackName = options[count++];
  
                      SccpStackImpl sccpStaclImpl = this.sccpStacks.get(m3uaStackName);
  
                      if (sccpStaclImpl == null) {
                          return String.format(SccpOAMMessage.NO_SCCP_MANAGEMENT_BEAN_FOR_NAME, m3uaStackName);
                      }
  
                      this.sccpStack = sccpStaclImpl;
                  } else {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
              }
  
              this.setDefaultValue();
              SccpAddress address = this.createAddress(options, 4, false);
  
              this.sccpStack.getRouter().addRoutingAddress(addressId, address);
              return String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_ADDED, this.sccpStack.getName());
          } else if (command.equals("modify")) {
              if (options.length < 4) {
                  return SccpOAMMessage.INVALID_COMMAND;
              }
              int addressId = Integer.parseInt(options[3]);
  
              int count = 11;
  
              while (count < options.length) {
                  String key = options[count++];
                  if (key == null) {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
                  if (key.equals("stackname")) {
                      String m3uaStackName = options[count++];
  
                      SccpStackImpl sccpStaclImpl = this.sccpStacks.get(m3uaStackName);
  
                      if (sccpStaclImpl == null) {
                          return String.format(SccpOAMMessage.NO_SCCP_MANAGEMENT_BEAN_FOR_NAME, m3uaStackName);
                      }
  
                      this.sccpStack = sccpStaclImpl;
                  } else {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
              }
  
              this.setDefaultValue();
  
              SccpAddress address = this.createAddress(options, 4, false);
  
              this.sccpStack.getRouter().modifyRoutingAddress(addressId, address);
              return String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_MODIFIED, this.sccpStack.getName());
          } else if (command.equals("delete")) {
              // sccp address delete <id> stackname <stack-name>
  
              if (options.length < 4) {
                  return SccpOAMMessage.INVALID_COMMAND;
              }
              int addressId = Integer.parseInt(options[3]);
  
              int count = 4;
  
              while (count < options.length) {
                  String key = options[count++];
                  if (key == null) {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
                  if (key.equals("stackname")) {
                      String m3uaStackName = options[count++];
  
                      SccpStackImpl sccpStaclImpl = this.sccpStacks.get(m3uaStackName);
  
                      if (sccpStaclImpl == null) {
                          return String.format(SccpOAMMessage.NO_SCCP_MANAGEMENT_BEAN_FOR_NAME, m3uaStackName);
                      }
  
                      this.sccpStack = sccpStaclImpl;
                  } else {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
              }
  
              this.setDefaultValue();
  
              this.sccpStack.getRouter().removeRoutingAddress(addressId);
              return String.format(SccpOAMMessage.ADDRESS_SUCCESSFULLY_DELETED, this.sccpStack.getName());
  
          } else if (command.equals("show")) {
              // sccp address show id <id> stackname <stack-name>
  
              int count = 3;
              int addressId = -1;
              while (count < options.length) {
                  String key = options[count++];
                  if (key == null) {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
                  if (key.equals("stackname")) {
                      String m3uaStackName = options[count++];
  
                      SccpStackImpl sccpStaclImpl = this.sccpStacks.get(m3uaStackName);
  
                      if (sccpStaclImpl == null) {
                          return String.format(SccpOAMMessage.NO_SCCP_MANAGEMENT_BEAN_FOR_NAME, m3uaStackName);
                      }
  
                      this.sccpStack = sccpStaclImpl;
                  } else if (key.equals("id")) {
                      addressId = Integer.parseInt(options[count++]);
                  } else {
                      return SccpOAMMessage.INVALID_COMMAND;
                  }
  
              }
  
              this.setDefaultValue();
  
              if (addressId != -1) {
                  SccpAddress pa = this.sccpStack.getRouter().getRoutingAddress(addressId);
                  if (pa == null) {
                      return String.format(SccpOAMMessage.ADDRESS_DOESNT_EXIST, this.sccpStack.getName());
                  }
                  return pa.toString();
              }
  
              if (this.sccpStack.getRouter().getRoutingAddresses().size() == 0) {
                  return String.format(SccpOAMMessage.ADDRESS_DOESNT_EXIST, this.sccpStack.getName());
              }
  
              StringBuffer sb = new StringBuffer();
  
              Map<Integer, SccpAddress> idVsPrimAdd = this.sccpStack.getRouter().getRoutingAddresses();
              for (Integer e : idVsPrimAdd.keySet()) {
                  SccpAddress address = idVsPrimAdd.get(e);
                  sb.append("key=");
                  sb.append(e);
                  sb.append("  ");
                  sb.append(address);
                  sb.append("\n");
              }
              return sb.toString();
          }
  
          return SccpOAMMessage.INVALID_COMMAND;
      }
focal_method.class_method_signature: SccpExecutor.manageAddress(String[] options)
focal_method.full_signature: private String manageAddress(String[] options)
focal_method.identifier: manageAddress
focal_method.invocations: equals parseInt equals get format setDefaultValue createAddress addRoutingAddress getRouter format getName equals parseInt equals get format setDefaultValue createAddress modifyRoutingAddress getRouter format getName equals parseInt equals get format setDefaultValue removeRoutingAddress getRouter format getName equals equals get format equals parseInt setDefaultValue getRoutingAddress getRouter format getName toString size getRoutingAddresses getRouter format getName getRoutingAddresses getRouter keySet get append append append append append toString
focal_method.modifiers: private
focal_method.parameters: (String[] options)
focal_method.return: String
focal_method.signature: String manageAddress(String[] options)