com.force.sdk.jpa
Class NativeConnection

java.lang.Object
  extended by com.force.sdk.jpa.NativeConnection
All Implemented Interfaces:
org.datanucleus.store.NucleusConnection

public class NativeConnection
extends Object
implements org.datanucleus.store.NucleusConnection

Connection class that provides connections to each Force.com API (SOAP, Metadata, and Bulk).

Author:
Fiaz Hossain

Constructor Summary
NativeConnection(org.datanucleus.store.connection.ManagedConnection connection)
          Instantiate a Native connection, this must be called with a ForceManagedConnection.
 
Method Summary
 void close()
          Close all API connections and reset configs.
 com.sforce.async.BulkConnection getBulkConnection()
           
 com.sforce.soap.metadata.MetadataConnection getMetadataConnection()
           
 Object getNativeConnection()
           
 com.sforce.soap.partner.PartnerConnection getPartnerConnection()
           
 boolean isAvailable()
          Returns whether the connection has been instantiated (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeConnection

public NativeConnection(org.datanucleus.store.connection.ManagedConnection connection)
Instantiate a Native connection, this must be called with a ForceManagedConnection.

Parameters:
connection - The ForceManagedConnection object that will be used for all API connections
Method Detail

close

public void close()
Close all API connections and reset configs.

Specified by:
close in interface org.datanucleus.store.NucleusConnection

getNativeConnection

public Object getNativeConnection()
Specified by:
getNativeConnection in interface org.datanucleus.store.NucleusConnection

isAvailable

public boolean isAvailable()
Returns whether the connection has been instantiated (i.e. is not null)

Specified by:
isAvailable in interface org.datanucleus.store.NucleusConnection
Returns:
true if the connection is non null

getPartnerConnection

public com.sforce.soap.partner.PartnerConnection getPartnerConnection()
Returns:
a connection to the Force.com Partner SOAP API

getMetadataConnection

public com.sforce.soap.metadata.MetadataConnection getMetadataConnection()
                                                                  throws com.sforce.ws.ConnectionException
Returns:
a connection to the Force.com metadata API
Throws:
com.sforce.ws.ConnectionException - thrown if a connection cannot be instantiated

getBulkConnection

public com.sforce.async.BulkConnection getBulkConnection()
                                                  throws com.sforce.ws.ConnectionException,
                                                         com.sforce.async.AsyncApiException
Returns:
a connection to the Force.com Bulk API
Throws:
com.sforce.ws.ConnectionException - thrown if a connection cannot be instantiated
com.sforce.async.AsyncApiException - thrown if there are problems with the connection config


Copyright © 2011. All Rights Reserved.