@Test public void testRetrieve() throws ApiException { List<Id> ids = new ArrayList<Id>(); ids.add(new Id("0035000000km1oh")); List<SObject> results = this.conn.retrieve("Contact", ids, Arrays.asList("FirstName", "LastName")); assertEquals(1, results.size()); SObject contact = results.get(0); assertEquals("0035000000km1oh", contact.getId().toString()); assertEquals("Rose", contact.getField("FirstName")); assertEquals("Gonzalez", contact.getField("LastName")); assertEquals(2, contact.getAllFields().size()); assertEquals("Contact", contact.getType()); }
@Nonnull @Override public synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids, @Nonnull List<String> fieldList) throws ApiException { logger.entry(sObjectType, fieldList, ids); Retrieve retrieveParam = new Retrieve(); retrieveParam.setFieldList(StringUtils.join(fieldList, ",")); retrieveParam.setSObjectType(sObjectType); @SuppressWarnings("TypeMayBeWeakened") List<String> idStrings = new ArrayList<String>(); for (Id id : ids) { idStrings.add(id.toString()); } retrieveParam.getIds().addAll(idStrings); logger.trace("retrieving fields <{}> for ids <{}>", fieldList, ids); RetrieveOp op = new RetrieveOp(); RetrieveResponse response = op.execute(retrieveParam); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = response.getResult(); List<PartnerSObject> facadeSObjects = getSObjectsFromStubs(stubSObjects); logger.exit(facadeSObjects); return new ArrayList<SObject>(facadeSObjects); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids, @Nonnull List<String> fieldList) throws ApiException { logger.entry(sObjectType, fieldList, ids); Retrieve retrieveParam = new Retrieve(); retrieveParam.setFieldList(StringUtils.join(fieldList, ",")); retrieveParam.setSObjectType(sObjectType); @SuppressWarnings("TypeMayBeWeakened") List<String> idStrings = new ArrayList<String>(); for (Id id : ids) { idStrings.add(id.toString()); } retrieveParam.getIds().addAll(idStrings); logger.trace("retrieving fields <{}> for ids <{}>", fieldList, ids); RetrieveOp op = new RetrieveOp(); RetrieveResponse response = op.execute(retrieveParam); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = response.getResult(); List<PartnerSObject> facadeSObjects = getSObjectsFromStubs(stubSObjects); logger.exit(facadeSObjects); return new ArrayList<SObject>(facadeSObjects); } }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids, @Nonnull List<String> fieldList) throws ApiException { logger.entry(sObjectType, fieldList, ids); Retrieve retrieveParam = new Retrieve(); retrieveParam.setFieldList(StringUtils.join(fieldList, ",")); retrieveParam.setSObjectType(sObjectType); @SuppressWarnings("TypeMayBeWeakened") List<String> idStrings = new ArrayList<String>(); for (Id id : ids) { idStrings.add(id.toString()); } retrieveParam.getIds().addAll(idStrings); logger.trace("retrieving fields <{}> for ids <{}>", fieldList, ids); RetrieveOp op = new RetrieveOp(); RetrieveResponse response = op.execute(retrieveParam); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = response.getResult(); List<PartnerSObject> facadeSObjects = getSObjectsFromStubs(stubSObjects); logger.exit(facadeSObjects); return new ArrayList<SObject>(facadeSObjects); } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids, @Nonnull List<String> fieldList) throws ApiException { logger.entry(sObjectType, fieldList, ids); Retrieve retrieveParam = new Retrieve(); retrieveParam.setFieldList(StringUtils.join(fieldList, ",")); retrieveParam.setSObjectType(sObjectType); @SuppressWarnings("TypeMayBeWeakened") List<String> idStrings = new ArrayList<String>(); for (Id id : ids) { idStrings.add(id.toString()); } retrieveParam.getIds().addAll(idStrings); logger.trace("retrieving fields <{}> for ids <{}>", fieldList, ids); RetrieveOp op = new RetrieveOp(); RetrieveResponse response = op.execute(retrieveParam); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = response.getResult(); List<PartnerSObject> facadeSObjects = getSObjectsFromStubs(stubSObjects); logger.exit(facadeSObjects); return new ArrayList<SObject>(facadeSObjects); } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects); }
PartnerConnectionImpl extends AbstractSalesforceConnection implements PartnerConnection { @Nonnull @Override public synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids, @Nonnull List<String> fieldList) throws ApiException { logger.entry(sObjectType, fieldList, ids); Retrieve retrieveParam = new Retrieve(); retrieveParam.setFieldList(StringUtils.join(fieldList, ",")); retrieveParam.setSObjectType(sObjectType); @SuppressWarnings("TypeMayBeWeakened") List<String> idStrings = new ArrayList<String>(); for (Id id : ids) { idStrings.add(id.toString()); } retrieveParam.getIds().addAll(idStrings); logger.trace("retrieving fields <{}> for ids <{}>", fieldList, ids); RetrieveOp op = new RetrieveOp(); RetrieveResponse response = op.execute(retrieveParam); List<com.palominolabs.crm.sf.soap.jaxwsstub.partner.SObject> stubSObjects = response.getResult(); List<PartnerSObject> facadeSObjects = getSObjectsFromStubs(stubSObjects); logger.exit(facadeSObjects); return new ArrayList<SObject>(facadeSObjects); } private  PartnerConnectionImpl(@Nonnull CallSemaphore semaphore, @Nonnull ConnectionBundleImpl bundle,
            MetricRegistry metricRegistry); @Override synchronized int count(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int count(@Nonnull String sObjectType); @Override synchronized int countAll(@Nonnull String sObjectType, @Nonnull String condition); @Override synchronized int countAll(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SaveResult> create(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<DeleteResult> delete(@Nonnull List<Id> ids); @Nonnull @Override synchronized DescribeGlobalResult describeGlobal(); @Nonnull @Override synchronized SObjectDescription describeSObject(@Nonnull String sObjectType); @Nonnull @Override synchronized List<SObjectDescription> describeSObjects(@Nonnull List<String> sObjectTypes); @Nonnull @Override synchronized List<EmptyRecycleBinResult> emptyRecycleBin(@Nonnull List<Id> ids); @Nonnull @Override synchronized DateTime getServerTimestamp(); @Nonnull @Override synchronized UserInfo getUserInfo(); @Nonnull @Override synchronized PartnerQueryResult query(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryAll(@Nonnull String queryStr); @Nonnull @Override synchronized PartnerQueryResult queryMore(@Nonnull PartnerQueryLocator locator); @Nonnull @Override synchronized List<SObject> retrieve(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fieldList); @Nonnull @Override synchronized Map<Id, SObject> retrieveExtended(@Nonnull String sObjectType, @Nonnull List<Id> ids,
            @Nonnull List<String> fields,
            int maxFieldNameChunkSize); @Nonnull @Override synchronized List<UndeleteResult> undelete(@Nonnull List<Id> ids); @Nonnull @Override synchronized List<SaveResult> update(@Nonnull List<SObject> sObjects); @Nonnull @Override synchronized List<UpsertResult> upsert(@Nonnull String externalIdFieldName, @Nonnull List<SObject> sObjects);  }