/** * {@inheritDoc} */ public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IRepositoryReference)) return false; IRepositoryReference other = (IRepositoryReference) obj; if (location == null) { if (other.getLocation() != null) return false; } else if (!location.equals(other.getLocation())) return false; if (type != other.getType()) return false; return true; }
@SuppressWarnings("rawtypes") private boolean isEnabled(IRepositoryManager manager, IRepositoryReference reference) { return (manager.contains(reference.getLocation()) && manager.isEnabled(reference.getLocation())) || ((!manager.contains(reference.getLocation())) && ((reference.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); }
private void writeRepositoryReference(IRepositoryReference reference) { start(REPOSITORY_REFERENCE_ELEMENT); attribute(URI_ATTRIBUTE, reference.getLocation().toString()); try { // we write the URL attribute for backwards compatibility with 3.4.x // this attribute should be removed if we make a breaking format change. attribute(URL_ATTRIBUTE, URIUtil.toURL(reference.getLocation()).toExternalForm()); } catch (MalformedURLException e) { attribute(URL_ATTRIBUTE, reference.getLocation().toString()); } attribute(TYPE_ATTRIBUTE, Integer.toString(reference.getType())); attribute(OPTIONS_ATTRIBUTE, Integer.toString(reference.getOptions())); end(REPOSITORY_REFERENCE_ELEMENT); } }
private void writeRepositoryReference(IRepositoryReference reference) { start(REPOSITORY_REFERENCE_ELEMENT); attribute(URI_ATTRIBUTE, reference.getLocation().toString()); try { // we write the URL attribute for backwards compatibility with 3.4.x // this attribute should be removed if we make a breaking format change. attribute(URL_ATTRIBUTE, URIUtil.toURL(reference.getLocation()).toExternalForm()); } catch (MalformedURLException e) { attribute(URL_ATTRIBUTE, reference.getLocation().toString()); } attribute(TYPE_ATTRIBUTE, Integer.toString(reference.getType())); attribute(OPTIONS_ATTRIBUTE, Integer.toString(reference.getOptions())); end(REPOSITORY_REFERENCE_ELEMENT); } }
private void writeRepositoryReference(IRepositoryReference reference) { start(REPOSITORY_REFERENCE_ELEMENT); attribute(URI_ATTRIBUTE, reference.getLocation().toString()); try { // we write the URL attribute for backwards compatibility with 3.4.x // this attribute should be removed if we make a breaking format change. attribute(URL_ATTRIBUTE, URIUtil.toURL(reference.getLocation()).toExternalForm()); } catch (MalformedURLException e) { attribute(URL_ATTRIBUTE, reference.getLocation().toString()); } attribute(TYPE_ATTRIBUTE, Integer.toString(reference.getType())); attribute(OPTIONS_ATTRIBUTE, Integer.toString(reference.getOptions())); end(REPOSITORY_REFERENCE_ELEMENT); } }
/** * {@inheritDoc} */ public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IRepositoryReference)) return false; IRepositoryReference other = (IRepositoryReference) obj; if (location == null) { if (other.getLocation() != null) return false; } else if (!location.equals(other.getLocation())) return false; if (type != other.getType()) return false; return true; }
@SuppressWarnings("rawtypes") private boolean isEnabled(IRepositoryManager manager, IRepositoryReference reference) { return (manager.contains(reference.getLocation()) && manager.isEnabled(reference.getLocation())) || ((!manager.contains(reference.getLocation())) && ((reference.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); }
/** * Broadcast discovery events for all repositories referenced by this repository. */ public void publishRepositoryReferences() { IProvisioningEventBus bus = (IProvisioningEventBus) getProvisioningAgent().getService(IProvisioningEventBus.SERVICE_NAME); if (bus == null) return; List<IRepositoryReference> repositoriesSnapshot = createRepositoriesSnapshot(); for (IRepositoryReference reference : repositoriesSnapshot) { boolean isEnabled = (reference.getOptions() & IRepository.ENABLED) != 0; bus.publishEvent(new RepositoryEvent(reference.getLocation(), reference.getType(), RepositoryEvent.DISCOVERED, isEnabled)); } }
for (IRepositoryReference ref : references) { try { if (ref.getType() == IRepository.TYPE_METADATA && followMetadataRepoReferences && isEnabled(manager, ref)) { loadMetadataRepository(manager, ref.getLocation(), repos, followMetadataRepoReferences, repoSubMon.newChild(100)); } else if (ref.getType() == IRepository.TYPE_ARTIFACT) { referencedArtifactRepositories.put(ref.getLocation().toString(), ref.getLocation());
/** * Broadcast discovery events for all repositories referenced by this repository. */ public void publishRepositoryReferences() { IProvisioningEventBus bus = (IProvisioningEventBus) getProvisioningAgent().getService(IProvisioningEventBus.SERVICE_NAME); if (bus == null) return; List<IRepositoryReference> repositoriesSnapshot = createRepositoriesSnapshot(); for (IRepositoryReference reference : repositoriesSnapshot) { boolean isEnabled = (reference.getOptions() & IRepository.ENABLED) != 0; bus.publishEvent(new RepositoryEvent(reference.getLocation(), reference.getType(), RepositoryEvent.DISCOVERED, isEnabled)); } }
for (IRepositoryReference ref : references) { try { if (ref.getType() == IRepository.TYPE_METADATA && followMetadataRepoReferences && isEnabled(manager, ref)) { loadMetadataRepository(manager, ref.getLocation(), repos, followMetadataRepoReferences, repoSubMon.newChild(100)); } else if (ref.getType() == IRepository.TYPE_ARTIFACT) { referencedArtifactRepositories.put(ref.getLocation().toString(), ref.getLocation());
/** * Broadcast discovery events for all repositories referenced by this repository. */ public void publishRepositoryReferences() { IProvisioningEventBus bus = (IProvisioningEventBus) getProvisioningAgent().getService(IProvisioningEventBus.SERVICE_NAME); if (bus == null) return; List<IRepositoryReference> repositoriesSnapshot = createRepositoriesSnapshot(); for (IRepositoryReference reference : repositoriesSnapshot) { boolean isEnabled = (reference.getOptions() & IRepository.ENABLED) != 0; bus.publishEvent(new RepositoryEvent(reference.getLocation(), reference.getType(), RepositoryEvent.DISCOVERED, isEnabled)); } }
if (element instanceof IRepositoryReference) { IRepositoryReference reference = (IRepositoryReference) element; if (reference.getType() == IRepository.TYPE_ARTIFACT && reference.getLocation() != null) additionalRepos.add(reference.getLocation());
for (IRepositoryReference repo : ((ProductFileAdvice) advice).getUpdateRepositories()) { Map<String, String> parameters = new LinkedHashMap<String, String>(); parameters.put("type", Integer.toString(repo.getType())); //$NON-NLS-1$ parameters.put("location", repo.getLocation().toString()); //$NON-NLS-1$ parameters.put("enabled", Boolean.toString((repo.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); //$NON-NLS-1$ configurationData += TouchpointInstruction.encodeAction("addRepository", parameters); //$NON-NLS-1$ parameters.remove("enabled"); //$NON-NLS-1$
for (IRepositoryReference repo : ((ProductFileAdvice) advice).getUpdateRepositories()) { Map<String, String> parameters = new LinkedHashMap<>(); parameters.put("type", Integer.toString(repo.getType())); //$NON-NLS-1$ parameters.put("location", repo.getLocation().toString()); //$NON-NLS-1$ parameters.put("enabled", Boolean.toString((repo.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); //$NON-NLS-1$ configurationData += TouchpointInstruction.encodeAction("addRepository", parameters); //$NON-NLS-1$ parameters.remove("enabled"); //$NON-NLS-1$