/** * Returns a Force.com API {@code MetadataConnection}. * <p> * This connection type can be use to make Force.com Metadata API calls. * The {@code MetadataConnection} will be lazily constructed and * stored in this {@code ForceServiceConnector}'s state. This state * can be cleared with a call to {@code close} * * @return a Force.com API {@code MetadataConnection} from the {@code ForceConnectorConfig} * state found in this {@code ForceServiceConnector} * @throws ConnectionException if the {@code ForceConnectorConfig} state cannot be found * or otherwise constructed * @throws ConnectionException if this {@code ForceServiceConnector} cannot get a connection * to the Force.com service with its {@code ForceConnectorConfig} state * @see ForceServiceConnector#renewSession(ConnectorConfig) * @see ForceServiceConnector#close */ public MetadataConnection getMetadataConnection() throws ConnectionException { if (this.metadataConnection == null) { initMetadataConnection(); } return this.metadataConnection; }
/** * Returns a Force.com API {@code MetadataConnection}. * <p> * This connection type can be use to make Force.com Metadata API calls. * The {@code MetadataConnection} will be lazily constructed and * stored in this {@code ForceServiceConnector}'s state. This state * can be cleared with a call to {@code close} * * @return a Force.com API {@code MetadataConnection} from the {@code ForceConnectorConfig} * state found in this {@code ForceServiceConnector} * @throws ConnectionException if the {@code ForceConnectorConfig} state cannot be found * or otherwise constructed * @throws ConnectionException if this {@code ForceServiceConnector} cannot get a connection * to the Force.com service with its {@code ForceConnectorConfig} state * @see ForceServiceConnector#renewSession(ConnectorConfig) * @see ForceServiceConnector#close */ public MetadataConnection getMetadataConnection() throws ConnectionException { if (this.metadataConnection == null) { initMetadataConnection(); } return this.metadataConnection; }
/** * Returns the namespace of the Force.com store to which this {@code ForceServiceConnector} * is getting a connection. * <p> * A namespace uniquely identifies a Force.com store on the Force.com service. This {@code ForceServiceConnector} * will retrieve the namespace by getting a Force.com connection with its {@code ForceConnectorConfig} state. * * @return the unique Force.com store namespace; {@code null} is no such namespace exists * @throws ConnectionException if the {@code ForceConnectorConfig} state cannot be found * or otherwise constructed * @throws ConnectionException if this {@code ForceServiceConnector} cannot get a connection * to the Force.com service with its {@code ForceConnectorConfig} state * @throws ConnectionException if the namespace cannot be retrieved over the Force.com connection */ public String getNamespace() throws ConnectionException { if (metadataConnection == null) { initMetadataConnection(); } if (!config.isNamespaceInitialized()) { DescribeMetadataResult result = metadataConnection.describeMetadata(DESCRIBE_METADATA_VERSION); String organizationNamespace = result.getOrganizationNamespace(); config.setNamespace(organizationNamespace != null && organizationNamespace.length() > 0 ? organizationNamespace : null); } return config.getNamespace(); }
/** * Returns the namespace of the Force.com store to which this {@code ForceServiceConnector} * is getting a connection. * <p> * A namespace uniquely identifies a Force.com store on the Force.com service. This {@code ForceServiceConnector} * will retrieve the namespace by getting a Force.com connection with its {@code ForceConnectorConfig} state. * * @return the unique Force.com store namespace; {@code null} is no such namespace exists * @throws ConnectionException if the {@code ForceConnectorConfig} state cannot be found * or otherwise constructed * @throws ConnectionException if this {@code ForceServiceConnector} cannot get a connection * to the Force.com service with its {@code ForceConnectorConfig} state * @throws ConnectionException if the namespace cannot be retrieved over the Force.com connection */ public String getNamespace() throws ConnectionException { if (metadataConnection == null) { initMetadataConnection(); } if (!config.isNamespaceInitialized()) { DescribeMetadataResult result = metadataConnection.describeMetadata(DESCRIBE_METADATA_VERSION); String organizationNamespace = result.getOrganizationNamespace(); config.setNamespace(organizationNamespace != null && organizationNamespace.length() > 0 ? organizationNamespace : null); } return config.getNamespace(); }