com.e_c_group.bwptk
Class Request

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

public class Request
extends java.lang.Object

Creates a request to be sent to a Broadworks Server


Constructor Summary
Request(BroadWorksServer bws, java.lang.String commandType)
          Get a new request for a BroadWorksDocument with a command element within.
 
Method Summary
 Request appendChildToCommand(org.w3c.dom.Element e)
          Add an actual XML element to this command.
 Request appendChildToCommand(java.lang.String tagName)
          Append an empty tag to a command; this creates an element with no content.
 Request appendChildToCommand(java.lang.String tagName, java.lang.String value)
          Adds a text-only element to the command.
 Request appendGroupServiceAuthorization(java.lang.String serviceName)
          Given a Request, append the groupServiceAuthorization element necessary to grant unlimited service of one group service.
 Request appendTrunkGroupKey(java.lang.String serviceProviderId, java.lang.String groupId, java.lang.String trunkGroupName)
           
 Request appendUserServiceAuthorization(java.lang.String serviceName)
           
 org.w3c.dom.Element getElement(java.lang.String tagName)
          Get a new, empty element having the name specified.
 org.w3c.dom.Element getNilElement(java.lang.String tagName)
           
 Response getResponse()
           
 Response getResponse(boolean readFromCache)
           
 org.w3c.dom.Element getTextElement(java.lang.String tagName, java.lang.String value)
          Get a new, text element having the name and text value specified, BUT do not attach it to the request.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Request

public Request(BroadWorksServer bws,
               java.lang.String commandType)
        throws BwptkException
Get a new request for a BroadWorksDocument with a command element within.

Parameters:
bws - The broadworks server that this will be sent to.
commandType - The name of the command; e.g.., AuthenticationRequest
Throws:
BwptkException
Method Detail

getResponse

public Response getResponse(boolean readFromCache)
                     throws BwptkException
Throws:
BwptkException

getResponse

public Response getResponse()
                     throws BwptkException
Throws:
BwptkException

getElement

public org.w3c.dom.Element getElement(java.lang.String tagName)
Get a new, empty element having the name specified. E.g.,
is a simple empty element with tagName "foo".


getNilElement

public org.w3c.dom.Element getNilElement(java.lang.String tagName)

getTextElement

public org.w3c.dom.Element getTextElement(java.lang.String tagName,
                                          java.lang.String value)
Get a new, text element having the name and text value specified, BUT do not attach it to the request. E.g.,
bar
is a simple empty element with tagName "foo" and value "bar".


appendChildToCommand

public Request appendChildToCommand(java.lang.String tagName,
                                    java.lang.String value)
Adds a text-only element to the command. E.g., if the request is "getUserInfo" and you add elementName "userId" and value "dilbert", then the resulting request might be dilbert


appendChildToCommand

public Request appendChildToCommand(java.lang.String tagName)
Append an empty tag to a command; this creates an element with no content.


appendChildToCommand

public Request appendChildToCommand(org.w3c.dom.Element e)
Add an actual XML element to this command. The specified element, e, is appended to the command element. This allows you to add arbitrary structures inside the .


appendGroupServiceAuthorization

public Request appendGroupServiceAuthorization(java.lang.String serviceName)
                                        throws BwptkException
Given a Request, append the groupServiceAuthorization element necessary to grant unlimited service of one group service.
 Request r = new Request("GroupServiceModifyAuthorizationListRequest");
  r.appendChildToCommand("serviceProviderId", this.serviceProvider.getServiceProviderId());
  r.appendChildToCommand("groupId", this.groupId);
  r.appendGroupServiceAuthorization("Outgoing Calling Plan");
  Response resp = r.getResponse();
 
 

Throws:
BwptkException

appendUserServiceAuthorization

public Request appendUserServiceAuthorization(java.lang.String serviceName)
                                       throws BwptkException
Throws:
BwptkException

appendTrunkGroupKey

public Request appendTrunkGroupKey(java.lang.String serviceProviderId,
                                   java.lang.String groupId,
                                   java.lang.String trunkGroupName)
                            throws BwptkException
Throws:
BwptkException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the ... string representation.