Provides a list of public APIs in the SDMConnectivity library.
The SDMRequestManager class implements the ISDMRequestManager interface, which provides the following methods:
ISDMRequestManager void makeRequest(final ISDMRequest aRequest); void makeRequest(final ISDMBundleRequest aRequest); ConnectivityParameters getConnectivityParameter(); int getQueueSize(); Vector getAllRequests(); Object getRequest(); void setMainHandlerClassName(final String classname); void terminate(); boolean hasRequests(); void sendOnSuccess(final ISDMNetListener listener, final ISDMRequest request, finral HttpResponse response);
The number of working threads in the RequestManager class is configurable via the constructor. The number of threads is maximized by the connectivity layer because of performance related issues. If the client initializes the layer with more than the allowed threads, the implementation of the connectivity layer will decrease the thread number to the max allowed number (4).
Methods defined by the ISDMConnectivityParameters interface:
SDMConnectivityParameters void enableXsrf(Boolean isXsrfEnabled) void setUserName(String aUserName); String getUserName(); void setUserPassword(String aPassword); String getUserPassword(); void setBaseUrl(final String url); String getBaseUrl(); String getLanguage(); void setLanguage(String language); void setServerCertificate(Certificate certificate) throws KeyStoreException; final TrustManager[] getTrustManagers();
SDMBundleRequest is a special set of SDMRequest objects. It provides serial processing of the requests when the SDMRequestManager is in multithreaded mode. Because the single SDMRequest objects are processed by multiple threads, the timing of the responses are not consistent. With SDMBundleRequest, one thread processes the bundled requests, guaranteeing that the responses are arriving in the same order as the requests are added to the bundle.
An application can have more than one SDMRequestManager instances, for example, when connecting to two different servers at the same time. To support this scenario, SDMRequestManager handles ConnectionHandler as a plugin. This kind of plugin needs to implement the ISDMConnectionHandler and implement a constructor taking three parameters: SDMRequestManager, ISDMLogger implementation and ISDMPreferences implementation.
The class name with package is set by SDMRequestManager.setMainHandlerClassName(String), or in SDMPreferences by the ISDMPreferences.SDM_CONNECTIVITY_HANDLER_CLASS_NAME preference key. The default plugin is com.sybase.mobile.lib.client.IMOConnectionHandler, which handles connections through SAP Mobile Platform.