com.e_c_group.bwptk
Class ServiceProvider

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

public class ServiceProvider
extends java.lang.Object

A "service provider" or "enterprise" within the BroadWorks system.


Method Summary
 boolean addTelephoneNumber(java.lang.String telephoneNumber)
          Add a telephone number to this service provider.
 boolean authorizeUnlimitedGroupService(java.lang.String serviceName)
           
 void blockInternationalCallForwarding(java.io.PrintStream reportOutput)
          Block forwarding of calls to international destinations within this sevice provider.
 boolean deleteTelephoneNumber(java.lang.String telephoneNumber)
          Delete a telephone number from this service provider.
 void enableOutgoingCallingPlanAndBlockInternationalCallForwarding(java.io.PrintStream reportOutput)
          This enables the Outgoing Calling Plan and Block's International Call Forwarding for this Service Provider.
static void enableOutgoingCallingPlanAndBlockInternationalCallForwardingForAllServiceProviders(BroadWorksServer bws, java.io.PrintStream reportOutput)
          This enables the Outgoing Calling Plan and Block's International Call Forwarding for all Service Provider's in the BroadWorks System.
 java.lang.String getAddressLine1()
          Retrieves the Service Provider Address Line 1.
 java.lang.String getAddressLine2()
          Retrieves the Service Provider Address Line 2.
 BroadWorksServer getBroadWorksServer()
          Retrieve the BroadWorksServer object
 java.lang.String getCity()
          Retrieves the Service Provider Address City.
 Response getCommunicationBarringProfileListReponse()
          Get the list of all Communication Barring Profiles.
 Response getCommunicationsBarringAssignedCriteriaListResponse()
          Get a list of Communication Barring Criteria assigned to a service provider.
 Response getCommunicationsBarringDigitPatternCriteriaListResponse()
          Get the list of all Digit Pattern Criteria defined for the service provider.
 Response getCommunicationsBarringProfileResponse(java.lang.String profileName)
          Get an existing Communication Barring Profile.
 java.lang.String getContactEmail()
          Retrieves the Service Provider Contact Email.
 java.lang.String getContactName()
          Retrieves the Service Provider Contact Name.
 java.lang.String getContactNumber()
          Retrieves the Service Provider Contact Number.
 java.lang.String getCountry()
          Retrieves the Service Provider Address Country.
 Response getScheduleEventListResponse(java.lang.String scheduleName, java.lang.String scheduleType)
          Get the list of events of a service provider schedule.
 Response getScheduleEventResponse(java.lang.String scheduleName, java.lang.String scheduleType, java.lang.String eventName)
          Get an event from a service provider schedule.
 Response getScheduleListResponse()
          Get the list of a service provider schedules.
static ServiceProvider getServiceProvider(BroadWorksServer bws, java.lang.String serviceProviderId)
          Returns a Service Provider object given the BroadWorksServer and ID.
static ServiceProvider getServiceProvider(BroadWorksServer bws, java.lang.String serviceProviderId, java.lang.String serviceProviderName)
          Returns a Service Provider object given the BroadWorksServer and ID.
 java.lang.String getServiceProviderId()
          Retrieve the Service Provider's ID
 java.lang.String getServiceProviderName()
          Retrieves the Service Provider Name.
static java.util.List<ServiceProvider> getServiceProvidersInSystem(BroadWorksServer bws)
          Get all of the service providers in the system.
 java.lang.String getState()
          Retrieves the Service Provider Address State.
 java.lang.String getSupportEmail()
          Retrieves the Service Provider Support Email.
 java.lang.String getZipcode()
          Retrieves the Service Provider Address Zipcode.
static void listServiceProviderIdsInSystem(BroadWorksServer bws, java.io.PrintStream out)
          List the Ids of ServiceProviders in the Broadworks System
static java.util.List<ServiceProvider> searchForServiceProvider(BroadWorksServer bws, java.lang.String sp, java.lang.String mode, boolean searchByName)
          A search for Service Providers with extra features.
static java.util.List<ServiceProvider> searchServiceProviderById(BroadWorksServer bws, java.lang.String spName)
          A search that returns every Service Provider with the specified name.
static void syncAllServiceProvidersToDatabase(BroadWorksServer bws, java.sql.Connection con)
          This synchronizes every ServiceProvider in a BroadWorks Server to a SQL database
 void syncServiceProviderToDatabase(java.sql.Connection con)
          This method Synchronizes a Service Provider to a SQL database.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getServiceProviderId

public java.lang.String getServiceProviderId()
Retrieve the Service Provider's ID


getBroadWorksServer

public BroadWorksServer getBroadWorksServer()
Retrieve the BroadWorksServer object


getServiceProvider

public static ServiceProvider getServiceProvider(BroadWorksServer bws,
                                                 java.lang.String serviceProviderId)
Returns a Service Provider object given the BroadWorksServer and ID.

Parameters:
bws -
serviceProviderId -

getServiceProvider

public static ServiceProvider getServiceProvider(BroadWorksServer bws,
                                                 java.lang.String serviceProviderId,
                                                 java.lang.String serviceProviderName)
Returns a Service Provider object given the BroadWorksServer and ID. Also allows specification of the Service Provider ID.

Parameters:
bws -
serviceProviderId -
serviceProviderName -
Returns:

getServiceProviderName

public java.lang.String getServiceProviderName()
                                        throws BwptkException
Retrieves the Service Provider Name.

Throws:
BwptkException

getContactName

public java.lang.String getContactName()
                                throws BwptkException
Retrieves the Service Provider Contact Name.

Throws:
BwptkException

getContactNumber

public java.lang.String getContactNumber()
                                  throws BwptkException
Retrieves the Service Provider Contact Number.

Throws:
BwptkException

getContactEmail

public java.lang.String getContactEmail()
                                 throws BwptkException
Retrieves the Service Provider Contact Email.

Throws:
BwptkException

getAddressLine1

public java.lang.String getAddressLine1()
                                 throws BwptkException
Retrieves the Service Provider Address Line 1.

Throws:
BwptkException

getAddressLine2

public java.lang.String getAddressLine2()
                                 throws BwptkException
Retrieves the Service Provider Address Line 2.

Throws:
BwptkException

getCity

public java.lang.String getCity()
                         throws BwptkException
Retrieves the Service Provider Address City.

Throws:
BwptkException

getState

public java.lang.String getState()
                          throws BwptkException
Retrieves the Service Provider Address State.

Throws:
BwptkException

getZipcode

public java.lang.String getZipcode()
                            throws BwptkException
Retrieves the Service Provider Address Zipcode.

Throws:
BwptkException

getCountry

public java.lang.String getCountry()
                            throws BwptkException
Retrieves the Service Provider Address Country.

Throws:
BwptkException

getSupportEmail

public java.lang.String getSupportEmail()
                                 throws BwptkException
Retrieves the Service Provider Support Email.

Throws:
BwptkException

getCommunicationBarringProfileListReponse

public Response getCommunicationBarringProfileListReponse()
                                                   throws BwptkException
Get the list of all Communication Barring Profiles.

Returns:
The response is either a ServiceProviderCommunicationBarringProfileGetListResponse or an ErrorResponse.
Throws:
BwptkException

getCommunicationsBarringProfileResponse

public Response getCommunicationsBarringProfileResponse(java.lang.String profileName)
                                                 throws BwptkException
Get an existing Communication Barring Profile.

Returns:
The response is either a ServiceProviderCommunicationBarringProfileGetResponse17sp3 or an ErorResponse.
Throws:
BwptkException

getCommunicationsBarringAssignedCriteriaListResponse

public Response getCommunicationsBarringAssignedCriteriaListResponse()
                                                              throws BwptkException
Get a list of Communication Barring Criteria assigned to a service provider.

Returns:
The response is either a ServiceProviderCommunicationBarringCriteriaGetAssignedListResponse or an ErorResponse.
Throws:
BwptkException

getCommunicationsBarringDigitPatternCriteriaListResponse

public Response getCommunicationsBarringDigitPatternCriteriaListResponse()
                                                                  throws BwptkException
Get the list of all Digit Pattern Criteria defined for the service provider.

Returns:
The response is either a ServiceProviderCommunicationBarringDigitPatternCriteriaGetListResponse or an ErorResponse.
Throws:
BwptkException

getScheduleListResponse

public Response getScheduleListResponse()
                                 throws BwptkException
Get the list of a service provider schedules.

Returns:
The response is either a ServiceProviderScheduleGetListResponse or an ErorResponse.
Throws:
BwptkException

getScheduleEventListResponse

public Response getScheduleEventListResponse(java.lang.String scheduleName,
                                             java.lang.String scheduleType)
                                      throws BwptkException
Get the list of events of a service provider schedule.

Returns:
The response is either a ServiceProviderScheduleGetEventListResponse or an ErorResponse.
Throws:
BwptkException

getScheduleEventResponse

public Response getScheduleEventResponse(java.lang.String scheduleName,
                                         java.lang.String scheduleType,
                                         java.lang.String eventName)
                                  throws BwptkException
Get an event from a service provider schedule.

Returns:
The response is either a ServiceProviderScheduleGetEventResponse or an ErorResponse.
Throws:
BwptkException

authorizeUnlimitedGroupService

public boolean authorizeUnlimitedGroupService(java.lang.String serviceName)
                                       throws BwptkException
Parameters:
serviceName - The service name to authorize
Returns:
true iff this request succeeds.
Throws:
BwptkException

getServiceProvidersInSystem

public static java.util.List<ServiceProvider> getServiceProvidersInSystem(BroadWorksServer bws)
                                                                   throws BwptkException
Get all of the service providers in the system.

Parameters:
bws - The Broadworks Server
Throws:
BwptkException

searchServiceProviderById

public static java.util.List<ServiceProvider> searchServiceProviderById(BroadWorksServer bws,
                                                                        java.lang.String spName)
                                                                 throws BwptkException
A search that returns every Service Provider with the specified name.

Parameters:
bws - The BroadWorksServer
spId - The ServiceProvider name
Returns:
List - All matching Service Providers.
Throws:
BwptkException

searchForServiceProvider

public static java.util.List<ServiceProvider> searchForServiceProvider(BroadWorksServer bws,
                                                                       java.lang.String sp,
                                                                       java.lang.String mode,
                                                                       boolean searchByName)
                                                                throws BwptkException
A search for Service Providers with extra features.

Parameters:
bws - The BroadWorksServer
sp - The search term
mode - The mode of search - "Starts With", "Contains", or "Equal To"
searchByName - True to search by name, False to search by Id
maxResults - The maximum number of results returned
Returns:
List
Throws:
BwptkException

listServiceProviderIdsInSystem

public static void listServiceProviderIdsInSystem(BroadWorksServer bws,
                                                  java.io.PrintStream out)
                                           throws BwptkException
List the Ids of ServiceProviders in the Broadworks System

Parameters:
bws - The Broadworks Server
out - A PrintStream
Throws:
BwptkException

enableOutgoingCallingPlanAndBlockInternationalCallForwardingForAllServiceProviders

public static void enableOutgoingCallingPlanAndBlockInternationalCallForwardingForAllServiceProviders(BroadWorksServer bws,
                                                                                                      java.io.PrintStream reportOutput)
                                                                                               throws BwptkException
This enables the Outgoing Calling Plan and Block's International Call Forwarding for all Service Provider's in the BroadWorks System.

Parameters:
bws - The BroadWorks server
reportOutput - A PrintStream
Throws:
BwptkException

enableOutgoingCallingPlanAndBlockInternationalCallForwarding

public void enableOutgoingCallingPlanAndBlockInternationalCallForwarding(java.io.PrintStream reportOutput)
                                                                  throws BwptkException
This enables the Outgoing Calling Plan and Block's International Call Forwarding for this Service Provider.

Parameters:
reportOutput - A PrintStream
Throws:
BwptkException

blockInternationalCallForwarding

public void blockInternationalCallForwarding(java.io.PrintStream reportOutput)
                                      throws BwptkException
Block forwarding of calls to international destinations within this sevice provider. This is commonly used to prevent some types of toll fraud.

Parameters:
reportOutput - Provide a PrintStream if you want textual output reported.
Throws:
BwptkException

addTelephoneNumber

public boolean addTelephoneNumber(java.lang.String telephoneNumber)
                           throws BwptkException
Add a telephone number to this service provider.

Parameters:
telephoneNumber - The Number to be added as String
Returns:
true iff this request succeeds.
Throws:
BwptkException

deleteTelephoneNumber

public boolean deleteTelephoneNumber(java.lang.String telephoneNumber)
                              throws BwptkException
Delete a telephone number from this service provider.

Parameters:
telephoneNumber - The Number to be deleted as String
Returns:
true iff this request succeeds.
Throws:
BwptkException

syncServiceProviderToDatabase

public void syncServiceProviderToDatabase(java.sql.Connection con)
                                   throws java.sql.SQLException,
                                          BwptkException
This method Synchronizes a Service Provider to a SQL database.

Parameters:
con - The database with which to synchronize the Service Provider.
Throws:
java.sql.SQLException
BwptkException

syncAllServiceProvidersToDatabase

public static void syncAllServiceProvidersToDatabase(BroadWorksServer bws,
                                                     java.sql.Connection con)
                                              throws java.sql.SQLException,
                                                     BwptkException
This synchronizes every ServiceProvider in a BroadWorks Server to a SQL database

Parameters:
bws - The BroadWorks server to list ServiceProviders from.
con - The SQL server with which to synchronize the ServiceProviders.
Throws:
java.sql.SQLException
BwptkException

toString

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