QuickServer
v1.4.7

org.quickserver.net.qsadmin
Class QSAdminAPI

java.lang.Object
  extended byorg.quickserver.net.qsadmin.QSAdminAPI

public class QSAdminAPI
extends java.lang.Object

QSAdminAPI class to communicate to QsAdmin from java applications.

Eg:

        QSAdminAPI qsAdminApi = new QSAdminAPI("127.0.0.1", 9080);
        if(qsAdminApi.logon()) {
                System.out.println("Logged in");
                String info = qsAdminApi.sendCommand("info server");
                System.out.println("Info on Server :\n"+info);
                qsAdminApi.logoff();
        } else {
                System.out.println("Bad Login");
                qsAdminApi.close();
        }

Since:
1.4
Author:
Akshathkumar Shetty
See Also:
QSAdminServer

Constructor Summary
QSAdminAPI(java.lang.String host, int port)
          Creates QSAdminAPI object that will communicate with the passed host and port.
 
Method Summary
 void close()
          Closes the socket associated.
 void logoff()
          Logoff the QSAdminServer and closed the socket associated.
 boolean logon()
          Will attempt to connect and logon to the remote QsAdminServer.
 boolean logon(java.lang.String username, java.lang.String password)
          Will attempt to connect and logon to the remote QsAdminServer.
static void main(java.lang.String[] args)
           
 java.lang.String sendCommand(java.lang.String data)
          Sends the given command to QSAdmin and gives the response back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QSAdminAPI

public QSAdminAPI(java.lang.String host,
                  int port)
Creates QSAdminAPI object that will communicate with the passed host and port.

Method Detail

logon

public boolean logon()
              throws java.io.IOException
Will attempt to connect and logon to the remote QsAdminServer.

Throws:
java.io.IOException

logon

public boolean logon(java.lang.String username,
                     java.lang.String password)
              throws java.io.IOException
Will attempt to connect and logon to the remote QsAdminServer.

Throws:
java.io.IOException

sendCommand

public java.lang.String sendCommand(java.lang.String data)
                             throws java.io.IOException
Sends the given command to QSAdmin and gives the response back.

Throws:
java.io.IOException

logoff

public void logoff()
            throws java.io.IOException
Logoff the QSAdminServer and closed the socket associated.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the socket associated.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

QuickServer
v1.4.7

Copyright © 2003-2006 QuickServer.org