Synchronization Profile

The Synchronization Profile contains information for establishing a connection with the Unwired Server's data synchronization channel where the server package has been deployed. The com.sybase.persistence.ConnectionProfileSybase.Persistence.ConnectionProfileSUPConnectionProfile class manages that information. By default, this information includes the server host, port, domain name, certificate and public key that are pushed by the message channel during the registration process.

Settings are automatically provisioned from the Unwired Server. The values of the settings are inherited from the application connection template used for the registration of the application connection (automatic or manual). You must make use of the connection and security settings that are automatically used by the Object API.

Typically, the application uses the settings as sent from the Unwired Server to connect to the Unwired Server for synchronization so that the administrator can set those at the application deployment time based on their deployment topology (for example, using Relay Server, using e2ee security, or a certificate used for the intermediary, such as a Relay Server Web server). See the Applications and Application Connection Templates topics in System Administration.

ConnectionProfile profile = SMP101DB.getSynchronizationProfile();
profile.setDomainName( "default" );
profile.setServerName( "smp.example.com" );
profile.setPortNumber( 2480 );
profile.setNetworkProtocol( "http" );
profile.getStreamParams().setTrusted_Certificates( "rsa_public_cert.crt" );
SynchronizationProfile sp = SMP101DB.getSynchronizationProfile();
sp.setDomainName( "default" );
sp.setServerName( "smp.example.com" );
sp.setPortNumber( 2480 );
sp.setNetworkProtocol( "http" );
sp.getStreamParams().setTrusted_Certificates( "rsa_public_cert.crt" );
You can allow clients to compress traffic as they communicate with the Unwired Server by including "compression=zlib" into the stream parameters:
DatabaseClass.getSynchronizationProfile().getStreamParams().setZlibCompression(true); 
Compression is disabled by default.
SUPConnectionProfile* sp = [SMP101SMP101DB getSynchronizationProfile];
[sp setDomainName:@"default"];
ConnectionProfile profile = SMP101DB.GetSynchronizationProfile();
profile.DomainName = "default";
profile.ServerName = "host-name";
profile.PortNumber = 2481;
profile.NetworkProtocol = "https";
profile.StreamParams.Trusted_Certificates = "rsa_public_cert.crt";

You can allow clients to compress traffic as they communicate with the Unwired Server by including "compression=zlib" into the sync parameters:

SMP101DB.getSynchronizationProfile().getStreamParams().setZlibCompression(true);
NetworkStreamParams streamParams = MyDatabase.GetSynchronizationProfile().StreamParams;
streamParams.Compression= "zlib";
streamParams.Zlib_Upload_Window_Size= 12;
streamParams.Zlib_Download_Window_Size= 12;

By default, compression is disabled.

You can allow clients to authenticate with a proxy server by including a username and password in the sync parameters. This feature supports Basic and Digest authentication as described in RFC 2617. With Basic authentication, passwords are included in HTTP headers in clear text; however, you can use HTTPS to encrypt the headers and protect the password. With Digest authentication, headers are not sent in clear text but are hashed.

SMP101DB.GetSynchronizationProfile().NetworkStreamParams += ";http_userid=supAdmin;http_password=supPwd";

When a Blackberry application connects to the Unwired Server through the BlackBerry BES TLS Proxy server, you must include an additional parameter, ";EndToEndRequired", as part of the url_suffix in the network stream of the synchronization profile.

DatabaseClass.getSynchronizationProfile().setNetworkStreamParams("trusted_certificates=;url_suffix=\\;EndToEndRequired");

A Blackberry application can get or set the size, in bytes, of the output buffer used to store data before it is sent to the Unwired Server during synchronization. The default value is 4096 and valid values range between 512 and 32768. When calling the setOutputBufferSize method, a ConnectionPropertyException is thrown if the value of the size parameter is not in the range between 512 and 32768.

ConnectionProfile profile = DatabaseClass.getSynchronizationProfile();
NetworkStreamParams params = profile.getStreamParams();
params.setOutputBufferSize(1024);
You can allow clients to compress traffic as they communicate with the Unwired Server by including "compression=zlib" into the stream parameters:
SMP101DB.getSynchronizationProfile().getStreamParams().setZlibCompression(true);
By default, compression is disabled.

Encryption and Trusted Certificates for Data Synchronization

When using end-to-end encryption for synchronization with Unwired Server, the public keys need to be encapsulated in a PEM encoded X.509 certificate and be supplied with an E2EE private key. For example:
SUPConnectionProfile *sp = [SUP101SUP101DB getSynchronizationProfile];
[sp setNetworkStreamParams:@"e2ee_public_key=publickeyCertificate;trusted_certificates=trustedCertificate"];

For details about encryption on iPhone, see iPhone and Mac OS X considerations in the Ultralite documentation.