diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/events/SystemRemoteChangeEvent.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/events/SystemRemoteChangeEvent.java index dd09c9d76b8..3e6992a95b8 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/events/SystemRemoteChangeEvent.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/events/SystemRemoteChangeEvent.java @@ -7,10 +7,10 @@ * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * + * * Contributors: * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields @@ -21,9 +21,13 @@ package org.eclipse.rse.core.events; import org.eclipse.rse.core.subsystems.ISubSystem; /** - * For listeners interested in changes with remote resources. - * These events are designed to state what the change to the resource was, not to - * optimize those events for a GUI (eg, a delete event versus a refresh event) + * For listeners interested in changes with remote resources. These events are + * designed to state what the change to the resource was, not to optimize those + * events for a GUI (eg, a delete event versus a refresh event). + * + * In RSE 3.0, the concept of Operation type was added (See + * {@link #setOperation(String)} and the new Constructors, and the oldNames + * property was extended from a single String into a String array. */ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { @@ -33,17 +37,17 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent private ISubSystem subsystem; private Object originatingViewer; private String operation; - + /** * Constructor for non-rename event * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} - * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, - * or List of absoluteNames + * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, + * or List of absoluteNames * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent. - * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be + * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be * limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection. */ - public SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem) + public SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem) { super(); this.eventType = eventType; @@ -51,34 +55,54 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent this.parent = resourceParent; this.subsystem = subsystem; } - + + /** * Constructor for a rename event. - * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} - * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, - * or List of absoluteNames - * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent. - * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be - * limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection. - * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation + * + * @param eventType - one of the constants from + * {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} + * @param resource - the remote resource object, or absolute name of the + * resource as would be given by calling getAbsoluteName on its + * remote adapter, or List of absoluteNames + * @param resourceParent - the remote resource's parent object, or absolute + * name, if that is known. If it is non-null, this will aid in + * refreshing occurrences of that parent. + * @param subsystem - the subsystem which contains this remote resource. + * This allows the search for impacts to be limited to subsystems + * of the same parent factory, and to connections with the same + * hostname as the subsystem's connection. + * @param oldNames - on a rename, copy or move operation, these are the + * absolute names of the resources prior to the operation + * @since 3.0 replaced String oldName by String[] oldNames */ - public SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames) + public SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames) { this(eventType, resource, resourceParent, subsystem); this.oldNames = oldNames; } - + /** * Constructor for non-rename event - * @param operation - the operation for which this event was fired - * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} - * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, - * or List of absoluteNames - * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent. - * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be - * limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection. + * + * @param operation - the operation for which this event was fired. From + * {@link ISystemRemoteChangeEvents#SYSTEM_REMOTE_OPERATION_COPY} + * and related String constants + * @param eventType - one of the constants from + * {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} + * @param resource - the remote resource object, or absolute name of the + * resource as would be given by calling getAbsoluteName on its + * remote adapter, or List of absoluteNames + * @param resourceParent - the remote resource's parent object, or absolute + * name, if that is known. If it is non-null, this will aid in + * refreshing occurrences of that parent. + * @param subsystem - the subsystem which contains this remote resource. + * This allows the search for impacts to be limited to subsystems + * of the same parent factory, and to connections with the same + * hostname as the subsystem's connection. + * @since 3.0 */ - public SystemRemoteChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem) + public SystemRemoteChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem) { super(); this.eventType = eventType; @@ -87,19 +111,30 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent this.subsystem = subsystem; this.operation = operation; } - + /** * Constructor for a rename event. - * @param operation - the operation for which this event was fired - * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} - * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, - * or List of absoluteNames - * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent. - * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be - * limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection. - * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation + * + * @param operation - the operation for which this event was fired. From + * {@link ISystemRemoteChangeEvents#SYSTEM_REMOTE_OPERATION_COPY} + * and related String constants + * @param eventType - one of the constants from + * {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents} + * @param resource - the remote resource object, or absolute name of the + * resource as would be given by calling getAbsoluteName on its + * remote adapter, or List of absoluteNames + * @param resourceParent - the remote resource's parent object, or absolute + * name, if that is known. If it is non-null, this will aid in + * refreshing occurrences of that parent. + * @param subsystem - the subsystem which contains this remote resource. + * This allows the search for impacts to be limited to subsystems + * of the same parent factory, and to connections with the same + * hostname as the subsystem's connection. + * @param oldNames - on a rename, copy or move operation, these are the + * absolute names of the resources prior to the operation + * @since 3.0 */ - public SystemRemoteChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames) + public SystemRemoteChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames) { this(operation, eventType, resource, resourceParent, subsystem); this.oldNames = oldNames; @@ -110,7 +145,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent public SystemRemoteChangeEvent() { } - + /** * Reset the event type */ @@ -118,7 +153,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { this.eventType = eventType; } - + /** * Reset the resource */ @@ -126,7 +161,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { this.resource = resource; } - + /** * Reset the resource's remote resource parent */ @@ -142,15 +177,17 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { this.subsystem = subsystem; } - + /** * Reset the old names on a rename, move or copy event + * + * @since 3.0 */ public void setOldNames(String[] oldNames) { this.oldNames = oldNames; } - + /** * Get the event type, such as {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents#SYSTEM_REMOTE_RESOURCE_CREATED}. * @see org.eclipse.rse.core.events.ISystemRemoteChangeEvents @@ -159,7 +196,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { return eventType; } - + /** * Get the resource that this event applies to * It must either be the binary object of the resource, or the absolute name of the resource, @@ -169,7 +206,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { return resource; } - + /** * Get the parent remote object for the affected remote object. This is not always known, * but when it is (ie, non null) then it can be used to refresh all expanded occurrences of that parent @@ -178,9 +215,9 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { return parent; } - + /** - * Get the subsystem in which this resource resides. + * Get the subsystem in which this resource resides. * This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections * with the same hostname as the subsystem's connection. */ @@ -188,9 +225,12 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent { return subsystem; } - + /** - * Get the old name of the resource, in the event of a resource rename. Null for other event types. + * Get the old name of the resource, in the event of a resource rename. Null + * for other event types. + * + * @since 3.0 */ public String[] getOldNames() { @@ -199,8 +239,8 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent /** * Set the originating viewer. - * Only this viewer is candidate for updating the selection. Eg, on a - * create event, if this and the resource parent is set, the newly + * Only this viewer is candidate for updating the selection. Eg, on a + * create event, if this and the resource parent is set, the newly * created object is selected after the parent's contents are refreshed, * for the originating viewer. */ @@ -218,21 +258,28 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent return originatingViewer; } - + + /** + * @since 3.0 + * @param operation from + * {@link ISystemRemoteChangeEvents#SYSTEM_REMOTE_OPERATION_COPY} + * and related String constants + */ public void setOperation(String operation){ this.operation = operation; } - + /** - * Returns the operation of this event if it's not implied by the event itself. - * The operation can be optionally specified when the event is constructed. - * By default this will return null. - * + * Returns the operation of this event if it's not implied by the event + * itself. The operation can be optionally specified when the event is + * constructed. By default this will return null. + * * @return the operation that triggered this event + * @since 3.0 */ public String getOperation() { return operation; } - - + + } diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLauncher.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLauncher.java index c8a2a1f583a..0172b878bd6 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLauncher.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ServerLauncher.java @@ -1,15 +1,15 @@ /******************************************************************************** * Copyright (c) 2004, 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html - * + * * Initial Contributors: * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, + * component that contains this file: David McKnight, Kushal Munir, + * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * + * * Contributors: * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 142806: refactoring persistence framework @@ -27,14 +27,17 @@ import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.internal.core.RSECoreMessages; /** - * Abstract class intended to be extended to provide a means for starting a remote server from - * the client. DStore-based connector services use this to determine whether to start a sever via daemon, REXEC, or - * some other mechanism. For systems that don't need to start remote servers from RSE, this is not - * needed. + * Abstract class intended to be extended to provide a means for starting a + * remote server from the client. DStore-based connector services use this to + * determine whether to start a sever via daemon, REXEC, or some other + * mechanism. For systems that don't need to start remote servers from RSE, this + * is not needed. + * + * @since 3.0 moved from non-API to API */ public abstract class ServerLauncher extends RSEModelObject implements IServerLauncherProperties, ILabeledObject { - + protected String _name; private String _label = null; protected IConnectorService _connectorService; @@ -48,9 +51,9 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa { super(); _name = name; - _connectorService = service; + _connectorService = service; } - + /** * Returns the name of the server launcher */ @@ -58,7 +61,7 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa { return _name; } - + /** * Returns the label to display in a ui for the server launcher */ @@ -66,7 +69,7 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa if (_label != null) return _label; return _name; } - + /** * Sets the label to use for display in a ui for the server launcher */ @@ -74,7 +77,7 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa _label = label; setDirty(true); } - + /** * Returns the description of the server launcher */ @@ -82,7 +85,7 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa { return RSECoreMessages.RESID_MODELOBJECTS_SERVERLAUNCHER_DESCRIPTION; } - + /** * Returns the associated connector service */ @@ -90,11 +93,11 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa { return _connectorService; } - + public IRSEPersistableContainer getPersistableParent() { return _connectorService; } - + public IRSEPersistableContainer[] getPersistableChildren() { List children = Arrays.asList(getPropertySets()); IRSEPersistableContainer[] result = new IRSEPersistableContainer[children.size()]; @@ -111,17 +114,17 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa public IServerLauncherProperties cloneServerLauncher(IServerLauncherProperties newOne) { newOne.addPropertySets(getPropertySets()); - return newOne; + return newOne; } - + /** * Commits the associated connector service to be persisted */ - public boolean commit() + public boolean commit() { return getConnectorService().getHost().commit(); } - - + + } //ServerLauncherImpl \ No newline at end of file