@Override
    public void plugin(PluginBean plugin) {
        try {
            logger.info(Messages.i18n.format("StorageImportDispatcher.ImportingPlugin") + plugin.getGroupId() + '/' + plugin.getArtifactId() + '/' + plugin.getVersion()); //$NON-NLS-1$
            mapPluginIds(plugin);
            // Check if the plugin exists,
            // if there is more then one plugin of same type (different IDs) a new one will be generated
            PluginBean pluginBean = storage.getPlugin(plugin.getGroupId(), plugin.getArtifactId());
            if (pluginBean != null) {
                // Set the id explicit because the update method will not check if the id really exists
                // The update method will create a new plugin if the element not exists!
                plugin.setId(pluginBean.getId());
                storage.updatePlugin(plugin);
            } else {
                plugin.setId(null);
                storage.createPlugin(plugin);
            }
        } catch (StorageException e) {
            error(e);
        }
    }
@see io.apiman.manager.api.exportimport.read.IImportReaderDispatcher#plugin(io.apiman.manager.api.beans.plugins.PluginBean)
manager/api/export-import/src/main/java/io/apiman/manager/api/exportimport/manager/StorageImportDispatcher.java