protected void repositoryAdded(final RepositoryEvent event) { makeRepositoryVisible(event.getRepositoryLocation()); }
protected void repositoryAdded(RepositoryEvent e) { fillRepoCombo(getSiteString(e.getRepositoryLocation())); }
public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (RepositoryEvent.REMOVED == event.getKind() && IRepository.TYPE_METADATA == event.getRepositoryType()) { deleteCache(event.getRepositoryLocation()); } } } };
public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (RepositoryEvent.REMOVED == event.getKind() && IRepository.TYPE_METADATA == event.getRepositoryType()) { deleteCache(event.getRepositoryLocation()); } } } };
/** * Removes the repository corresponding to the given event from the currently running instance. */ protected void removeFromSelf(IProvisioningAgent agent, IAgentLocation agentLocation, RepositoryEvent event) { IRepositoryManager<?> manager = getRepositoryManager(agent, event.getRepositoryType()); Preferences node = getRepositoryPreferenceNode(agentLocation, null, event.getRepositoryLocation(), event.getRepositoryType()); int count = getRepositoryCount(node); // modify the repository count before (potentially) removing the preference node setRepositoryCount(node, --count); if (count < 1 && manager != null) manager.removeRepository(event.getRepositoryLocation()); }
/** * Removes the repository corresponding to the given event from the currently running instance. */ protected void removeFromSelf(IProvisioningAgent agent, IAgentLocation agentLocation, RepositoryEvent event) { IRepositoryManager<?> manager = getRepositoryManager(agent, event.getRepositoryType()); Preferences node = getRepositoryPreferenceNode(agentLocation, null, event.getRepositoryLocation(), event.getRepositoryType()); int count = getRepositoryCount(node); // modify the repository count before (potentially) removing the preference node setRepositoryCount(node, --count); if (count < 1 && manager != null) manager.removeRepository(event.getRepositoryLocation()); }
public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (event.getKind() == RepositoryEvent.DISCOVERED && event.getRepositoryType() == getRepositoryType()) addRepository(event.getRepositoryLocation(), event.isRepositoryEnabled(), true); } }
public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (event.getKind() == RepositoryEvent.DISCOVERED && event.getRepositoryType() == getRepositoryType()) addRepository(event.getRepositoryLocation(), event.isRepositoryEnabled(), true); } }
public IStatus execute(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) removeRepositoryFromProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryType()); //if we are provisioning into the self profile, update the current set of repositories in this configuration if (isSelfProfile(registry, profile)) removeFromSelf(agent, agentLocation, event); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }
public IStatus undo(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); final RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) removeRepositoryFromProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryType()); //if provisioning into the current profile, broadcast an event to add this repository directly to the current repository managers. if (isSelfProfile(registry, profile)) removeFromSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } } }
public IStatus undo(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); final RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) removeRepositoryFromProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryType()); //if provisioning into the current profile, broadcast an event to add this repository directly to the current repository managers. if (isSelfProfile(registry, profile)) removeFromSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } } }
public IStatus execute(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) removeRepositoryFromProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryType()); //if we are provisioning into the self profile, update the current set of repositories in this configuration if (isSelfProfile(registry, profile)) removeFromSelf(agent, agentLocation, event); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }
public IStatus undo(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) addRepositoryToProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryNickname(), event.getRepositoryType(), event.isRepositoryEnabled()); //if we are provisioning into the self profile, update the current set of repositories in this configuration if (isSelfProfile(registry, profile)) addToSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
public IStatus execute(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); final RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) addRepositoryToProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryNickname(), event.getRepositoryType(), event.isRepositoryEnabled()); //if provisioning into the current profile, broadcast an event to add this repository directly to the current repository managers. if (isSelfProfile(registry, profile)) addToSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
public IStatus execute(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); final RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) addRepositoryToProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryNickname(), event.getRepositoryType(), event.isRepositoryEnabled()); //if provisioning into the current profile, broadcast an event to add this repository directly to the current repository managers. if (isSelfProfile(registry, profile)) addToSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
public IStatus undo(Map<String, Object> parameters) { try { IProvisioningAgent agent = getAgent(parameters); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IAgentLocation agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); RepositoryEvent event = createEvent(parameters); IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); if (profile != null) addRepositoryToProfile(agentLocation, profile, event.getRepositoryLocation(), event.getRepositoryNickname(), event.getRepositoryType(), event.isRepositoryEnabled()); //if we are provisioning into the self profile, update the current set of repositories in this configuration if (isSelfProfile(registry, profile)) addToSelf(agent, agentLocation, event); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
/** * Adds the repository corresponding to the given event to the currently running instance. */ protected void addToSelf(IProvisioningAgent agent, IAgentLocation agentLocation, RepositoryEvent event) { IRepositoryManager<?> manager = getRepositoryManager(agent, event.getRepositoryType()); final URI location = event.getRepositoryLocation(); Preferences node = getRepositoryPreferenceNode(agentLocation, null, location, event.getRepositoryType()); int count = getRepositoryCount(node); if (manager.contains(location)) { // If a user as added a repository we need to set the initial count manually if (count == 0) count = 1; } else { if (manager != null) manager.addRepository(location); } // increment the counter & send to preferences count++; setRepositoryCount(node, count); if (!event.isRepositoryEnabled()) manager.setEnabled(location, false); final String name = event.getRepositoryNickname(); if (name != null) manager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, name); }
/** * Adds the repository corresponding to the given event to the currently running instance. */ protected void addToSelf(IProvisioningAgent agent, IAgentLocation agentLocation, RepositoryEvent event) { IRepositoryManager<?> manager = getRepositoryManager(agent, event.getRepositoryType()); final URI location = event.getRepositoryLocation(); Preferences node = getRepositoryPreferenceNode(agentLocation, null, location, event.getRepositoryType()); int count = getRepositoryCount(node); if (manager.contains(location)) { // If a user as added a repository we need to set the initial count manually if (count == 0) count = 1; } else { if (manager != null) manager.addRepository(location); } // increment the counter & send to preferences count++; setRepositoryCount(node, count); if (!event.isRepositoryEnabled()) manager.setEnabled(location, false); final String name = event.getRepositoryNickname(); if (name != null) manager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, name); }