static ForceConnectorConfig loadFromName(String connectionName) throws IOException { Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromName(connectionName); if (propMap == null) return null; ForceConnectorConfig config = new ForceConnectorConfig(); config.setPropsFromMap(propMap, connectionName); return config; }
private void initCacheId() { String username = getUsername(); String endpoint = getAuthEndpoint(); if (username != null && endpoint != null) { this.cacheId = username + endpoint; } else { this.cacheId = null; } }
/** * Closes all API connections (SOAP Web services API, Metadata API, and Bulk API) and resets configs. */ @Override public void close() { this.connector.close(); }
private void validateConnectorConfig(ForceConnectorConfig configToValidate) throws ConnectionException { if (configToValidate.getSessionId() == null && configToValidate.getAuthEndpoint() == null) { throw new ConnectionException("ForceConnectorConfig must have an AuthEndpoint"); } if (configToValidate.getSessionId() == null && configToValidate.getUsername() == null) { throw new ConnectionException("ForceConnectorConfig must have a Username"); } }
/** * Validates a connection property value. * <p> * Ensures that the connection property value is not {@code null}, has a length * greater than zero and matches the validation regular expression. * * @param propertyValue the connection property value * @throws IllegalArgumentException if the given {@code propertyValue} is {@code null} or zero length or * does not match the validation regular expression */ public void validateValue(String propertyValue) { validateValue(propertyValue, ""); }
static ForceOAuthConnectionInfo loadFromName(String connectionName) throws IOException { Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromName(connectionName); if (propMap == null) return null; ForceOAuthConnectionInfo connInfo = new ForceOAuthConnectionInfo(); connInfo.setPropsFromMap(propMap, connectionName); return connInfo; }
/** * Get the BulkConnection object, connection will be lazily instantiated. * * @return BulkConnection to the Force.com Bulk API * @throws ConnectionException thrown if an error occurs during initialization of the connection * @throws AsyncApiException thrown if an error occurs during initialization of the connection */ public BulkConnection getBulkConnection() throws ConnectionException, AsyncApiException { return connector.getBulkConnection(); }
/** * Get the MetadataConnection object, connection will be lazily instantiated. * * @return MetadataConnection to the Force.com Metadata API * @throws ConnectionException thrown if an error occurs during initialization of the connection */ public MetadataConnection getMetadataConnection() throws ConnectionException { return connector.getMetadataConnection(); }
/** * Retrieve the namespace of the Force.com organization. Connection will be instantiated * if it hasn't been established yet. * * @return the Salesforce namespace of the organization that is connected to Force.com * @throws ConnectionException thrown if an error occurs during initialization of the connection * (if the connection has not yet been instantiated this method will * first instantiate it) */ public String getNamespace() throws ConnectionException { return connector.getNamespace(); } }
/** * Initializes a {@code ForceConnectorConfig} object that contains no * connection properties. * <p> * This constructor will set the trace message flag to {@code true}, which means * that messaging tracing is controlled by setting the {@code com.force.sdk.connector} * log level to TRACE. * * @see ForceConnectorConfig#setTraceMessage(boolean) */ public ForceConnectorConfig() { setTraceMessage(true); // this is still subject to having logging level to trace }
private ForceConnectorConfig checkConfigCache(ForceConnectorConfig configToCheck) throws ConnectionException { return checkConfigCache(configToCheck, null); }
static ForceConnectorConfig loadFromName(String connectionName) throws IOException { Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromName(connectionName); if (propMap == null) return null; ForceConnectorConfig config = new ForceConnectorConfig(); config.setPropsFromMap(propMap, connectionName); return config; }
private void initCacheId() { String username = getUsername(); String endpoint = getAuthEndpoint(); if (username != null && endpoint != null) { this.cacheId = username + endpoint; } else { this.cacheId = null; } }
/** * Closes all API connections (SOAP Web services API, Metadata API, and Bulk API) and resets configs. */ @Override public void close() { this.connector.close(); }
/** * Validates a connection property value. * <p> * Ensures that the connection property value is not {@code null}, has a length * greater than zero and matches the validation regular expression. * * @param propertyValue the connection property value * @throws IllegalArgumentException if the given {@code propertyValue} is {@code null} or zero length or * does not match the validation regular expression */ public void validateValue(String propertyValue) { validateValue(propertyValue, ""); }
/** * Get the BulkConnection object, connection will be lazily instantiated. * * @return BulkConnection to the Force.com Bulk API * @throws ConnectionException thrown if an error occurs during initialization of the connection * @throws AsyncApiException thrown if an error occurs during initialization of the connection */ public BulkConnection getBulkConnection() throws ConnectionException, AsyncApiException { return connector.getBulkConnection(); }
/** * Get the MetadataConnection object, connection will be lazily instantiated. * * @return MetadataConnection to the Force.com Metadata API * @throws ConnectionException thrown if an error occurs during initialization of the connection */ public MetadataConnection getMetadataConnection() throws ConnectionException { return connector.getMetadataConnection(); }
/** * Retrieve the namespace of the Force.com organization. Connection will be instantiated * if it hasn't been established yet. * * @return the Salesforce namespace of the organization that is connected to Force.com * @throws ConnectionException thrown if an error occurs during initialization of the connection * (if the connection has not yet been instantiated this method will * first instantiate it) */ public String getNamespace() throws ConnectionException { return connector.getNamespace(); } }
/** * Initializes a {@code ForceConnectorConfig} object that contains no * connection properties. * <p> * This constructor will set the trace message flag to {@code true}, which means * that messaging tracing is controlled by setting the {@code com.force.sdk.connector} * log level to TRACE. * * @see ForceConnectorConfig#setTraceMessage(boolean) */ public ForceConnectorConfig() { setTraceMessage(true); // this is still subject to having logging level to trace }
private ForceConnectorConfig checkConfigCache(ForceConnectorConfig configToCheck) throws ConnectionException { return checkConfigCache(configToCheck, null); }