String name = PropertiesUtil.toString(properties.get(COMPONENT_NAME), null);
return componentProvider.getComponent(ReplicationPackageExporter.class, name);
} else if (PACKAGE_EXPORTER_LOCAL.equals(factory)) {
Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);
return new LocalReplicationPackageExporter(packageBuilder);
} else if (PACKAGE_EXPORTER_REMOTE.equals(factory)) {
Map<String, Object> authenticationProviderProperties = extractMap(COMPONENT_TRANSPORT_AUTHENTICATION_PROVIDER, properties);
TransportAuthenticationProvider authenticationProvider = createTransportAuthenticationProvider(authenticationProviderProperties, componentProvider);
Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);
String[] endpoints = PropertiesUtil.toStringArray(properties.get(PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS), new String[0]);
String endpointStrategyName = PropertiesUtil.toString(properties.get(PACKAGE_EXPORTER_REMOTE_PROPERTY_ENDPOINTS_STRATEGY), "One");
int pollItems = PropertiesUtil.toInteger(properties.get(PACKAGE_EXPORTER_REMOTE_PROPERTY_POLL_ITEMS), Integer.MAX_VALUE);
return new RemoteReplicationPackageExporter(packageBuilder, authenticationProvider, endpoints, endpointStrategyName, pollItems);
} else if (PACKAGE_EXPORTER_AGENT.equals(factory)) {
Map<String, Object> builderProperties = extractMap(COMPONENT_PACKAGE_BUILDER, properties);
ReplicationPackageBuilder packageBuilder = createBuilder(builderProperties);
ReplicationAgent agent = componentProvider.getComponent(ReplicationAgent.class, null);
return new AgentReplicationPackageExporter(properties, agent, packageBuilder);
}