com.e_c_group.bwptk
Class BroadWorksServer

java.lang.Object
  extended by com.e_c_group.bwptk.BroadWorksServer

public class BroadWorksServer
extends java.lang.Object

This class creates the Broadworks server connection. This might be an external web server or application server.


Method Summary
 boolean clearCache()
           
 void close()
          Closes the BroadWorksServer and frees the used socket.
 boolean deviceTypeExists(java.lang.String deviceType)
          Determine whether the specified device type exists on the system.
 java.util.Vector<java.lang.String> getAvailableDeviceTypesInSystem()
          Get a list of the access device types on the system.
static BroadWorksServer getBroadWorksServer(java.lang.String serverAddress, java.lang.String username, java.lang.String password)
          Factory method for a BroadWorks server.
 Response getResponse(Request request)
          This sends a command in to the Broadworks server or cache, and returns the full response as a string.
 Response getResponse(Request request, boolean readFromCache)
          This sends a command in to the Broadworks server, And returns the full response as a String.
 java.util.List<ServiceProvider> getServiceProvidersInSystem()
          Returns a typed List of all the Service Providers and Enterprises on this server.
static void main(java.lang.String[] args)
           
 void syncToDatabase(java.sql.Connection con)
          This method synchronizes all Groups, Users, AccessDevices, and Service Providers of this BWS to a Database
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

clearCache

public boolean clearCache()

getResponse

public Response getResponse(Request request,
                            boolean readFromCache)
                     throws BroadWorksServerException,
                            BwptkException
This sends a command in to the Broadworks server, And returns the full response as a String.

Parameters:
readFromCache - If true, this will use a value from the cache if such a value is in the cache. However, the cache is ALWAYS updated.
Throws:
BroadWorksServerException
BwptkException

getResponse

public Response getResponse(Request request)
                     throws BroadWorksServerException,
                            BwptkException
This sends a command in to the Broadworks server or cache, and returns the full response as a string. This is the equivalent of
getResponse(request,true)

Throws:
BroadWorksServerException
BwptkException

getBroadWorksServer

public static BroadWorksServer getBroadWorksServer(java.lang.String serverAddress,
                                                   java.lang.String username,
                                                   java.lang.String password)
                                            throws BroadWorksServerException
Factory method for a BroadWorks server.

Parameters:
serverAddress - is the IP address or hostname of the BroadWorks server. This might be the External Web Server, or Application Server.
username - is the username to login with. The system-level administrative username is "admin", but this can be another administrative user, or an ordinary non-admin user.
password - is the password to login with.
Throws:
BroadWorksServerException - when the connection cannot be established for some reason.

getServiceProvidersInSystem

public java.util.List<ServiceProvider> getServiceProvidersInSystem()
                                                            throws BwptkException
Returns a typed List of all the Service Providers and Enterprises on this server.

Throws:
BwptkException

getAvailableDeviceTypesInSystem

public java.util.Vector<java.lang.String> getAvailableDeviceTypesInSystem()
                                                                   throws BwptkException
Get a list of the access device types on the system.

Returns:
null if the server does not return the proper response type.
Throws:
BwptkException

deviceTypeExists

public boolean deviceTypeExists(java.lang.String deviceType)
                         throws BwptkException
Determine whether the specified device type exists on the system.

Throws:
BwptkException

syncToDatabase

public void syncToDatabase(java.sql.Connection con)
                    throws java.sql.SQLException,
                           BwptkException
This method synchronizes all Groups, Users, AccessDevices, and Service Providers of this BWS to a Database

Parameters:
con - The database connection
Throws:
java.sql.SQLException
BwptkException

close

public void close()
           throws BroadWorksServerException
Closes the BroadWorksServer and frees the used socket.

Throws:
BroadWorksServerException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

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