throws FeedConfigStoreException {
// Check for an instance that supports namespace
if (!(config instanceof NamespacedAdapterConfiguration)) {
logger.log(Level.SEVERE, "Expected an instance of : "
+ NamespacedAdapterConfiguration.class.getClass() + " but was : " + config.getClass());
throw new FeedConfigStoreException(Reason.INVALID_ADAPTER_CONFIGURATION,
"Please provide an instance of : " + NamespacedAdapterConfiguration.class);
}
// Create the namespace and adapter config directories if they are not
// present
createNamespaceAndAdapterConfigDir(namespace);
// Type cast to the instance with namespace adapter configuration
NamespacedAdapterConfiguration namespaceAdapterConfig = (NamespacedAdapterConfiguration) config;
// Get the adapter config file
File adapaterFile = getAdapterConfigFile(namespace, namespaceAdapterConfig.getAdapterName());
// Check if the adapter configuration already exists
if (adapaterFile.exists()) {
logger.log(Level.WARNING, "Adapter configuration already exists!!");
throw new FeedConfigStoreException(Reason.INVALID_ADAPTER_CONFIGURATION,
"Adapter configuration already exists!!");
}
// Get the adapter config properties
Properties prop = extractAdapterConfigProperties(namespaceAdapterConfig);