protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy,
String errorOnUpdatePolicy, boolean disabled )
{
ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
connectorConfig.setSourceRepoId( sourceRepoId );
connectorConfig.setTargetRepoId( targetRepoId );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, checksumPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasePolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, cacheFailuresPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS, errorPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS_ON_UPDATE, errorOnUpdatePolicy );
connectorConfig.setDisabled( disabled );
int count = config.getConfiguration().getProxyConnectors().size();
config.getConfiguration().addProxyConnector( connectorConfig );
// Proper Triggering ...
String prefix = "proxyConnectors.proxyConnector(" + count + ")";
config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() );
config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() );
config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() );
config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) );
config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
config.triggerChange( prefix + ".policies.propagate-errors",
connectorConfig.getPolicy( "propagate-errors", "" ) );
config.triggerChange( prefix + ".policies.propagate-errors-on-update",
connectorConfig.getPolicy( "propagate-errors-on-update", "" ) );
}