Package org.smpp.smscsim

Examples of org.smpp.smscsim.SimulatorPDUProcessor


  protected void stop() throws IOException {
    if (smscListener != null) {
      System.out.println("Stopping listener...");
      synchronized (processors) {
        int procCount = processors.count();
        SimulatorPDUProcessor proc;
        SMSCSession session;
        for (int i = 0; i < procCount; i++) {
          proc = (SimulatorPDUProcessor) processors.get(i);
          session = proc.getSession();
          System.out.print("Stopping session " + i + ": " + proc.getSystemId() + " ...");
          session.stop();
          System.out.println(" stopped.");
        }
      }
      smscListener.stop();
View Full Code Here


  protected void logToScreen() {
    if (smscListener != null) {
      synchronized (processors) {
        displayInfo = !displayInfo;
        int procCount = processors.count();
        SimulatorPDUProcessor proc;
        for (int i = 0; i < procCount; i++) {
          proc = (SimulatorPDUProcessor) processors.get(i);
          proc.setDisplayInfo(displayInfo);
        }
      }
      factory.setDisplayInfo(displayInfo);
    }
  }
View Full Code Here

  protected void listClients() {
    if (smscListener != null) {
      synchronized (processors) {
        int procCount = processors.count();
        if (procCount > 0) {
          SimulatorPDUProcessor proc;
          for (int i = 0; i < procCount; i++) {
            proc = (SimulatorPDUProcessor) processors.get(i);
            System.out.print(proc.getSystemId());
            if (!proc.isActive()) {
              System.out.println(" (inactive)");
            } else {
              System.out.println();
            }
          }
View Full Code Here

  protected void sendMessage() throws IOException {
    if (smscListener != null) {
      int procCount = processors.count();
      if (procCount > 0) {
        String client;
        SimulatorPDUProcessor proc;
        listClients();
        if (procCount > 1) {
          System.out.print("Type name of the destination> ");
          client = keyboard.readLine();
        } else {
          proc = (SimulatorPDUProcessor) processors.get(0);
          client = proc.getSystemId();
        }
        for (int i = 0; i < procCount; i++) {
          proc = (SimulatorPDUProcessor) processors.get(i);
          if (proc.getSystemId().equals(client)) {
            if (proc.isActive()) {
              System.out.print("Type the message> ");
              String message = keyboard.readLine();
              DeliverSM request = new DeliverSM();
              try {
                request.setShortMessage(message);
                proc.serverRequest(request);
                System.out.println("Message sent.");
              } catch (WrongLengthOfStringException e) {
                System.out.println("Message sending failed");
                event.write(e, "");
              } catch (IOException ioe) {
View Full Code Here

TOP

Related Classes of org.smpp.smscsim.SimulatorPDUProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.