

/**

 * Überschrift: JAVA based NMS<p>

 * Beschreibung: COAMS NMS JAVA Classes<p>

 * Copyright: Copyright (c) Wolfgang Scherer<p>

 * Organisation: Austria Telecommunications<p>

 * @author Wolfgang Scherer

 * @version 1.0

 */



import java.net.Socket;

import java.io.*;



// package nms;



public class gmpsclient {



  Socket cltsock;

  OutputStream outs;

  OutputStreamWriter outw;

  InputStream inps;

  InputStreamReader inpr;

  String sessid;



  public gmpsclient(String host, int sock) throws java.io.IOException {

  cltsock = new Socket(host,sock);

  inps = cltsock.getInputStream();

  inpr = new InputStreamReader(inps);

  outs = cltsock.getOutputStream();

  outw = new OutputStreamWriter(outs);

  sessid = null;

  }

  public String operation(String command) throws java.io.IOException {

    outw.write(command);

    outw.write('\n');

    return inpr.

  }



  public void login(String username, String password)

                    throws java.io.IOException {

    String resp = this.operation("USER,"+username+","+password);

  }



  public String gpms(String number) throws java.io.IOException {

    return this.operation("GPMS,"+number);

  }



  public static void main(String[] args) throws java.io.IOException {

    String usrinp;

    String resp;

    int sockno = Integer.parseInt(args[2]);

    gmpsclient gc = new gmpsclient(args[1],sockno);

    gc.login(args[3],args[4]);

    resp = gc.gpms(args[5]);

  }

}
