List of usage examples for java.util Iterator remove
default void remove()
From source file:com.streamsets.datacollector.definition.StageDefinitionExtractor.java
private List<ConfigDefinition> extractConfigDefinitions(StageLibraryDefinition libraryDef, Class<? extends Stage> klass, HideConfigs hideConfigs, Object contextMsg) { List<String> stageGroups = getGroups(klass); List<ConfigDefinition> cDefs = ConfigDefinitionExtractor.get().extract(klass, stageGroups, contextMsg); Set<String> hideConfigSet = (hideConfigs != null) ? ImmutableSet.copyOf(hideConfigs.value()) : Collections.<String>emptySet(); if (!hideConfigSet.isEmpty()) { Iterator<ConfigDefinition> iterator = cDefs.iterator(); while (iterator.hasNext()) { if (hideConfigSet.contains(iterator.next().getName())) { iterator.remove(); }/*from w w w . j av a2 s . c o m*/ } } return cDefs; }
From source file:com.appdynamics.extensions.solr.SolrMonitor.java
/** * Gets list of cores. First tries to retrieve from config file. If no cores * are configured in config file, then gets the default core. * /* w ww . j av a2 s. c o m*/ * @param helper * * @param config * @return */ public List<Core> getCores(SolrHelper helper, Configuration config) { List<Core> cores = new ArrayList<Core>(); if (config != null && config.getCores() != null) { cores = config.getCores(); } Iterator<Core> iterator = cores.iterator(); while (iterator.hasNext()) { if (Strings.isNullOrEmpty(iterator.next().getName())) { iterator.remove(); } } if (cores.size() == 0) { String defaultCore = helper.getDefaultCore(context_root + CORE_URI); logger.info( "Cores not configured in config.yml, default core " + defaultCore + " to be used for stats"); Core core = new Core(); core.setName(defaultCore); core.setQueryHandlers(new ArrayList<String>()); cores.add(core); } return cores; }
From source file:com.sonymobile.jenkins.plugins.gitlab.gitlabauth.folder.GroupFolderManager.java
/** * Filters group folders excluded by the predicate. * * @param groupFolders the group folders * @return the group folders/* www . j a v a 2 s . c om*/ * @throws GitLabApiException if the connection against GitLab failed */ private Map<Integer, GroupFolderInfo> filterGroupFoldersMap(Map<Integer, GroupFolderInfo> groupFolders) throws GitLabApiException { Iterator<GroupFolderInfo> iterator = groupFolders.values().iterator(); while (iterator.hasNext()) { if (!managesGroupFolder(iterator.next())) { iterator.remove(); } } return groupFolders; }
From source file:com.puppetlabs.geppetto.forge.impl.ForgeServiceImpl.java
@Override public Set<Metadata> resolveDependencies(Iterable<Metadata> metadatas, Set<Dependency> unresolvedCollector) throws IOException { // Resolve missing dependencies Set<Dependency> deps = new HashSet<Dependency>(); for (Metadata metadata : metadatas) deps.addAll(metadata.getDependencies()); // Remove the dependencies that appoints modules that we have in the // workspace// ww w .j a v a 2s . c om Iterator<Dependency> depsItor = deps.iterator(); nextDep: while (depsItor.hasNext()) { Dependency dep = depsItor.next(); for (Metadata metadata : metadatas) if (dep.matches(metadata)) { depsItor.remove(); continue nextDep; } } // Resolve remaining dependencies Set<Metadata> releasesToDownload = new HashSet<Metadata>(); if (!deps.isEmpty()) { if (metadataRepo == null) throw new UnsupportedOperationException( "Unable to resolve dependencies since no forge service is configured. Was a serviceURL provided in the preferences?"); for (Dependency dep : deps) releasesToDownload.addAll(metadataRepo.deepResolve(dep, unresolvedCollector)); } return releasesToDownload; }
From source file:com.dragome.compiler.writer.Assembly.java
private Signature popSignature() { Iterator<Signature> iter = unprocessedTaintedSignatures.iterator(); Signature signature = iter.next(); iter.remove(); return signature; }
From source file:simMPLS.scenario.TInternalLink.java
/** * Este mtodo reinicia los atributos de la clase, dejando la instancia como si se * acabase de crear por el constructor.//from ww w . j a va2s .c o m * @since 1.0 */ public void reset() { this.cerrojo.lock(); Iterator it = this.getBuffer().iterator(); while (it.hasNext()) { it.next(); it.remove(); } this.cerrojo.unLock(); this.cerrojoLlegados.lock(); it = this.bufferLlegadosADestino.iterator(); while (it.hasNext()) { it.next(); it.remove(); } this.cerrojoLlegados.unLock(); numeroDeLSPs = 0; numeroDeLSPsDeBackup = 0; ponerEnlaceCaido(false); }
From source file:nl.npcf.eav.store.EntityAttributeValueStore.java
@Transactional(rollbackFor = EAVValidationException.class) public Entity setValues(String entityKey, Map<Path, String> valueMap, Principal createdBy) throws EAVValidationException { Query query = entityManager.createQuery("select entity from EAVEntity entity where entity.key = :key"); query.setParameter("key", entityKey); EAVEntity entity = (EAVEntity) query.getSingleResult(); entity.setSchema(getSchema());// ww w . j a va 2 s. co m for (Map.Entry<Path, String> entry : valueMap.entrySet()) { EAVAttribute attribute = (EAVAttribute) getEAVSchema().getAttribute(entry.getKey(), true); if (attribute.isAggregate()) { throw EAVValidationException.cannotBeSet(attribute); } Iterator<EAVValue> valueIterator = entity.getValues().iterator(); while (valueIterator.hasNext()) { // clear any existing value EAVValue existing = valueIterator.next(); if (existing.getPath().equals(entry.getKey())) { valueIterator.remove(); entityManager.remove(existing); } } if (!entry.getValue().isEmpty()) { Object value = attribute.stringToValue(entry.getValue()); //validate first EAVValue eavValue = attribute.instantiate(entity, (EAVPath) entry.getKey(), value, createdBy); entity.getValues().add(eavValue); eavValue.getPath(); } } entity.validate(); entity.sortValues(); return entity; }
From source file:org.n52.sensorweb.series.policy.editor.srv.impl.XmlFileSimplePermissionService.java
@Override public void deletePermission(String permissionSetName, Permission permission) throws PermissionManagementException { Iterator<Permission> itp = getPermissionSet(permissionSetName).getSubPermissions().iterator(); while (itp.hasNext()) { Permission subPermission = itp.next(); if (subPermission.getName().equals(permission.getName())) { itp.remove(); break; }/*from ww w . j a v a2s.c o m*/ } savePermissionFile(); }
From source file:com.taobao.gecko.service.impl.ReconnectManager.java
public void cancelReconnectGroup(final String group) { this.canceledGroupSet.add(group); final Iterator<ReconnectTask> it = this.tasks.iterator(); while (it.hasNext()) { final ReconnectTask task = it.next(); if (task.getGroupSet().contains(group)) { log.warn("Invalid reconnect request,it is removed,the group set is:" + task.getGroupSet()); it.remove(); }/*from ww w.j a va2 s .c o m*/ } }
From source file:io.hops.erasure_coding.MapReduceEncodingManager.java
private void cleanRecovery() throws IOException { new LightWeightRequestHandler(HDFSOperationType.DELETE_ENCODING_JOBS) { @Override// www . j av a 2 s .c om public Object performTask() throws IOException { EncodingJobsDataAccess da = (EncodingJobsDataAccess) HdfsStorageFactory .getDataAccess(EncodingJobsDataAccess.class); Iterator<MapReduceEncoder> it = completedJobs.iterator(); while (it.hasNext()) { MapReduceEncoder job = it.next(); JobID jobId = job.getJobID(); da.delete(new EncodingJob(jobId.getJtIdentifier(), jobId.getId())); it.remove(); } return null; } }.handle(); }