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$
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$
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); } }
@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)); }
@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)); } }
/** * 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)); } }
/** * 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)); } }