APISonar


org.apache.camel.component.salesforce.internal.PayloadFormat.JSON

> org > apache > camel > component > salesforce > internal > PayloadFormat > JSON
org APIs apache APIs camel APIs component APIs salesforce APIs internal APIs PayloadFormat APIs JSON APIs

Example 1
public void limits(Map<String, List<String>> headers, final ResponseCallback responseCallback) {
        if (format != PayloadFormat.JSON) {
            throw new IllegalArgumentException("Using XML format for the Limits API, to use it set the `format` endpoint property to JSON");
        }

        final Request get = getRequest(HttpMethod.GET, versionUrl() + "limits/", headers);

        // requires authorization token
        setAccessToken(get);

        doHttpRequest(get, new DelegatingClientCallback(responseCallback));
    }
Example 2
ContentProvider serialize(final Object body, final Class<?>... additionalTypes) throws SalesforceException {
        final InputStream stream;
        if (format == PayloadFormat.JSON) {
            stream = toJson(body);
        } else {
            // must be XML
            stream = toXml(body, additionalTypes);
        }

        // input stream as entity content is needed for authentication retries
        return new InputStreamContentProvider(stream);
    }
Example 3
public CompositeApiProcessor(final SalesforceEndpoint endpoint) throws SalesforceException {
        super(endpoint);

        final SalesforceEndpointConfig configuration = endpoint.getConfiguration();
        final String apiVersion = configuration.getApiVersion();

        format = configuration.getFormat();

        if (!EnumSet.of(PayloadFormat.JSON, PayloadFormat.XML).contains(format)) {
            throw new SalesforceException("Unsupported format: " + format, 0);
        }

        compositeClient = new DefaultCompositeApiClient(configuration, format, apiVersion, session, httpClient);

    }