示例#1
0
  public String getParameter(String input) {

    // <Begin_getParameter_String>
    String value = null;
    if (applet != null) {
      value = applet.getParameter(input);
    } else {
      value = (String) com.adventnet.apiutils.Utility.getParameter(input);
    }
    if (value == null) {
      if (input.equals("HOST")) value = "localhost"; // No Internationalisation
      if (input.equals("PORT")) value = "161"; // No Internationalisation
    }
    return value;

    // <End_getParameter_String>
  }
示例#2
0
  public void run() {
    String objRouter = applet.getParameter("name");
    // No Internationalisation
    try {
      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
      DataOutputStream outp = new DataOutputStream(byteStream);
      outp.writeInt(GenericConstants.ROUTER_PROPERTIES);
      outp.writeUTF(objRouter);
      outp.flush();

      byte[] bytes = byteStream.toByteArray();
      outp.close();
      byteStream.reset();
      byteStream.close();
      byte[] data = GenericSession.getInstance().syncSend(bytes);
      if (data != null) {
        DataInputStream inp = new DataInputStream(new ByteArrayInputStream(data));
        int reqId = inp.readInt();
        if (reqId == GenericConstants.ROUTER_PROPERTIES) {
          int length = inp.readInt();
          byte serverData[] = new byte[length];
          inp.readFully(serverData);
          routerobject = NmsClientUtil.deSerializeVector(serverData);
        }

        init();
        refresh();
        super.setVisible(true);
      }
      /*init();
      refresh();
      super.setVisible(true);*/

      else close();

    } catch (Exception e) {
      // NmsClientUtil.err(NmsClientUtil.getFrame(app),"IO Error sending request to server.
      // "+e);//No Internationalisation
    }
  }