Package com.sforce.soap.tooling

Examples of com.sforce.soap.tooling.QueryResult


    private void attemptToDeleteDuplicate() {
        try {
            String projectIdentifier = forceProject.getProjectIdentifier();
            String soql = String.format("SELECT Id FROM MetadataContainer WHERE name = '%s'", projectIdentifier);
            QueryResult queryResult = stub.query(soql);
            MetadataContainer duplicateContainer = (MetadataContainer) queryResult.getRecords()[0];
            stub.delete(new String[] { duplicateContainer.getId() });
        } catch (ForceRemoteException e) {
            // Let's not try to do nested recovery from a failure handler. Log it.
            logger.debug(e);
        }
View Full Code Here


        return saveResults;
    }

    public QueryResult query(String queryString) throws ForceRemoteException {
        QueryResult result = null;

        try {
            result = toolingConnection.query(queryString);
        } catch (ConnectionException e) {
            ForceExceptionUtils.throwTranslatedException(e, connection);
View Full Code Here

            throws ForceRemoteException {
        String requestId = requestResults[0].getId();
        String soql =
                String.format("SELECT Id, State, ErrorMsg, DeployDetails FROM ContainerAsyncRequest where id = '%s'",
                    requestId);
        QueryResult queryResult = stub.query(soql);

        ContainerAsyncRequest onGoingRequest = (ContainerAsyncRequest) queryResult.getRecords()[0];

        return pollUntilUnqueuedOrCancelled(stub, monitor, soql, onGoingRequest);
    }
View Full Code Here

        return pollUntilUnqueuedOrCancelled(stub, monitor, soql, onGoingRequest);
    }

    ContainerAsyncRequest pollUntilUnqueuedOrCancelled(ToolingStubExt stub, IProgressMonitor monitor, String soql,
            ContainerAsyncRequest onGoingRequest) throws ForceRemoteException {
        QueryResult queryResult;
        int delayMultipler = 1;
        while (onGoingRequest.getState().equalsIgnoreCase("queued")) {
            try {
                Thread.sleep(POLL_INTERVAL * delayMultipler++);
                if (monitor.isCanceled()) { // The user has canceled the task
                    ContainerAsyncRequest abortedRequest = new ContainerAsyncRequest();
                    abortedRequest.setId(onGoingRequest.getId());
                    abortedRequest.setState("Aborted");
                    stub.update(new SObject[] { abortedRequest });
                    return abortedRequest;
                }
            } catch (InterruptedException e) {
                logger.debug("Exception while polling for ContainerAsyncRequest: ", e);
            }

            queryResult = stub.query(soql);
            onGoingRequest = (ContainerAsyncRequest) queryResult.getRecords()[0];

        }
        return onGoingRequest;
    }
View Full Code Here

TOP

Related Classes of com.sforce.soap.tooling.QueryResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.