/** * @see io.apiman.manager.api.core.IStorage#getPlugin(long) */ @Override public PluginBean getPlugin(long id) throws StorageException { return this.delegate.getPlugin(id); }
/** * @see io.apiman.manager.api.core.IStorage#getPlugin(java.lang.String, java.lang.String) */ @Override public PluginBean getPlugin(String groupId, String artifactId) throws StorageException { refresh(); return this.delegate.getPlugin(groupId, artifactId); }
/** * Update the pluginID in the policyDefinition to the new generated pluginID * @param policyDef * @return updated PolicyDefinitionBean policyDef */ private PolicyDefinitionBean updatePluginIdInPolicyDefinition(PolicyDefinitionBean policyDef) { if (pluginBeanIdMap.containsKey(policyDef.getPluginId())){ try { Map.Entry<String, String> pluginCoordinates = pluginBeanIdMap.get(policyDef.getPluginId()); PluginBean plugin = storage.getPlugin(pluginCoordinates.getKey(), pluginCoordinates.getValue()); policyDef.setPluginId(plugin.getId()); } catch (StorageException e) { error(e); } } return policyDef; }
/** * @see io.apiman.manager.api.rest.contract.IPluginResource#get(java.lang.Long) */ @Override public PluginBean get(Long pluginId) throws PluginNotFoundException, NotAuthorizedException { if (!securityContext.isAdmin()) throw ExceptionFactory.notAuthorizedException(); try { storage.beginTx(); PluginBean bean = storage.getPlugin(pluginId); if (bean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId); } storage.commitTx(); return bean; } catch (AbstractRestException e) { storage.rollbackTx(); throw e; } catch (Exception e) { storage.rollbackTx(); throw new SystemErrorException(e); } }
/** * @see io.apiman.manager.api.rest.contract.IPluginResource#get(java.lang.Long) */ @Override public PluginBean get(Long pluginId) throws PluginNotFoundException, NotAuthorizedException { if (!securityContext.isAdmin()) throw ExceptionFactory.notAuthorizedException(); try { storage.beginTx(); PluginBean bean = storage.getPlugin(pluginId); if (bean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId); } storage.commitTx(); return bean; } catch (AbstractRestException e) { storage.rollbackTx(); throw e; } catch (Exception e) { storage.rollbackTx(); throw new SystemErrorException(e); } }
try { storage.beginTx(); pbean = storage.getPlugin(pluginId); if (pbean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId);
try { storage.beginTx(); pbean = storage.getPlugin(pluginId); if (pbean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId);
PluginBean pbean = storage.getPlugin(pluginId); if (pbean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId);
PluginBean pbean = storage.getPlugin(pluginId); if (pbean == null) { throw ExceptionFactory.pluginNotFoundException(pluginId);
try { storage.beginTx(); PluginBean existingPlugin = storage.getPlugin(bean.getGroupId(), bean.getArtifactId());
try { storage.beginTx(); PluginBean existingPlugin = storage.getPlugin(bean.getGroupId(), bean.getArtifactId());