/** * @see org.osgi.service.cm.Configuration#delete() */ public void delete() throws Exception { server.unregisterMBean(oname); configuration.delete(); }
@Deactivate void deactivate() throws IOException { if( config!=null ) { try { config.delete(); } catch (IllegalStateException ignore) { } } }
@Override public void delete(String pid) throws Exception { LOGGER.trace("Deleting configuration {}", pid); Configuration configuration = configAdmin.getConfiguration(pid, null); configuration.delete(); }
@Override public void delete(String name) throws Exception { String filter = String.format("(&(service.factoryPid=org.ops4j.connectionfactory)(%s=%s))", ConnectionFactoryFactory.JMS_CONNECTIONFACTORY_NAME, name); Configuration[] configs = configAdmin.listConfigurations(filter); for (Configuration config : configs) { config.delete(); } }
@Override public void delete(String name) throws Exception { String filter = String.format("(&(service.factoryPid=org.ops4j.datasource)(%s=%s))", DataSourceFactory.JDBC_DATASOURCE_NAME, name); Configuration[] configs = configAdmin.listConfigurations(filter); for (Configuration config : configs) { config.delete(); } }
@Override public void delete(String name) throws Exception { String filter = String.format("(&(service.factoryPid=org.ops4j.datasource)(%s=%s))", DataSourceFactory.JDBC_DATASOURCE_NAME, name); Configuration[] configs = configAdmin.listConfigurations(filter); for (Configuration config : configs) { config.delete(); } }
@Override protected Object doExecute() throws Exception { Configuration configuration = findOrCreateFactoryConfiguration(configAdmin, "org.jclouds.compute", id, null, null); if (configuration != null) { configuration.delete(); } else { System.out.println("No service found for provider / api"); } return null; }
@Override public void delete(String pid) throws Exception { LOGGER.trace("Deleting configuration {}", pid); Configuration configuration = configAdmin.getConfiguration(pid, null); configuration.delete(); }
public void delete(String pid) throws Exception { Configuration configuration = configurationAdmin.getConfiguration(pid, null); if (configuration == null) { throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist"); } configuration.delete(); if (storage != null) { File cfgFile = new File(storage, pid + ".cfg"); cfgFile.delete(); } }
private void deleteOsgiConfigs(List<Configuration> configurations) { for (Configuration configuration : configurations) { String pid = configuration.getPid(); try { configuration.delete(); log.info("Deleted configuration {}", pid); } catch (IOException e) { log.warn("Cannot delete configuration {}", pid, e); } } }
/** * Remove an existing wire */ @Override public boolean disconnect(int wireId) throws Exception { Configuration[] list = cm.listConfigurations("(wireId=" + wireId + ")"); if (list == null || list.length == 0) return false; list[0].delete(); return true; }
void deleteServiceGuardConfig(String originatingPid, String scope) throws IOException, InvalidSyntaxException { if (scope.contains(".")) // This is not a command scope as that should be a single word without any further dots return; // Delete all the generated configurations for this scope Configuration[] configs = configAdmin.listConfigurations("(service.pid=" + PROXY_SERVICE_ACL_PID_PREFIX + scope + ".*)"); if (configs == null) return; LOGGER.info("Config ACL deleted: {}. Deleting generated service ACL configs {}", originatingPid, configs); for (Configuration config : configs) { config.delete(); } }
/** * Remove a configuration. * * @param pid * the (instance) PID of a configuration */ public void removeConfiguration(String pid) throws IOException { cm.getConfiguration(pid, "?").delete(); }
@Override final void removeAll(final ConfigurationAdmin admin) throws IOException { getConfig(admin).delete(); }
@Override protected Object doExecute() throws Exception { if (id == null) { System.err.println("You need to either specify the service id."); return null; } Configuration configuration = findOrCreateFactoryConfiguration(configAdmin, "org.jclouds.blobstore", id, null, null); if (configuration != null) { configuration.delete(); } else { System.out.println("No service found for provider / api"); } return null; }
public void removeConfigs(Set<String> pidsToBeRemoved) throws Exception { for (String pidString : pidsToBeRemoved) { String[] pid = parsePid(pidString); Configuration config = getConfiguration(pidString, pid[0], pid[1]); config.delete(); } if (!pidsToBeRemoved.isEmpty()) { log.info("Configuration belonging to following pids have been removed {}", pidsToBeRemoved); } }
/** * Deletes a configuration for a config id. * * @param configId config id * @return old config or null if no old config existed * @throws IOException if configuration can not be removed */ public Configuration delete(String configId) throws IOException { org.osgi.service.cm.Configuration serviceConfiguration = configurationAdmin.getConfiguration(configId, null); Configuration oldConfiguration = toConfiguration(serviceConfiguration.getProperties()); serviceConfiguration.delete(); return oldConfiguration; }
protected void deleteConfiguration(File file) throws IOException, InvalidSyntaxException { String[] pid = parsePid(file); Configuration config = getConfiguration(pid[0], pid[1]); config.delete(); }
@Activate void activate(Map<String, ?> configuration) throws Exception { Properties properties = toProperties(configuration); // Make sure the original config we are linked to still exists. if( !BrokerDeployment.LOAD_TS.equals(properties.getProperty("mq.fabric.server.ts") ) ) { // Our pid is now stale. Configuration ourConfig = getConfigurationAdmin().getConfiguration(properties.getProperty("service.pid")); ourConfig.delete(); } else { pid = properties.getProperty("service.pid"); getBrokerDeploymentManager().updated(pid, properties); } }
@Descriptor("deletes configuration for service") public void delete(@Descriptor("The PID to delete") final String pid) throws IOException { final Configuration configuration = findConfiguration(this.configAdmin, pid); if (configuration != null) { configuration.delete(); } else { System.out.format("no configuration for pid '%s'", pid); } } }