Remote Systems
v6.4.1

com.ibm.etools.systems.model.impl
Class SystemRemoteChangeEvent

java.lang.Object
  extended bycom.ibm.etools.systems.model.impl.SystemRemoteChangeEvent
All Implemented Interfaces:
ISystemRemoteChangeEvent, ISystemRemoteChangeEvents

public class SystemRemoteChangeEvent
extends Object
implements ISystemRemoteChangeEvent, ISystemRemoteChangeEvents

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)


Field Summary
static String copyright
           
 
Fields inherited from interface com.ibm.etools.systems.model.ISystemRemoteChangeEvents
SYSTEM_REMOTE_RESOURCE_CHANGED, SYSTEM_REMOTE_RESOURCE_CREATED, SYSTEM_REMOTE_RESOURCE_DELETED, SYSTEM_REMOTE_RESOURCE_RENAMED
 
Constructor Summary
SystemRemoteChangeEvent()
          Constructor you shouldn't use unless you intend to call the setters
SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, SubSystem subsystem)
          Constructor for non-rename event
SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, SubSystem subsystem, String oldName)
          Constructor for a rename event.
 
Method Summary
 int getEventType()
          Get the event type, such as ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED.
 String getOldName()
          Get the old name of the resource, in the event of a resource rename.
 Viewer getOriginatingViewer()
          Get the originating viewer from which this remote resource change event comes from.
 Object getResource()
          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.
 Object getResourceParent()
          Get the parent remote object for the affected remote object.
 SubSystem getSubSystem()
          Get the subsystem in which this resource resides.
 void setEventType(int eventType)
          Reset the event type
 void setOldName(String oldName)
          Reset the old name on a rename event
 void setOriginatingViewer(Viewer originatingViewer)
          Set the originating viewer.
 void setResource(Object resource)
          Reset the resource
 void setResourceParent(Object resourceParent)
          Reset the resource's remote resource parent
 void setSubSystem(SubSystem subsystem)
          Reset the subsystem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

SystemRemoteChangeEvent

public SystemRemoteChangeEvent(int eventType,
                               Object resource,
                               Object resourceParent,
                               SubSystem subsystem)
Constructor for non-rename event

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
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.
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.

SystemRemoteChangeEvent

public SystemRemoteChangeEvent(int eventType,
                               Object resource,
                               Object resourceParent,
                               SubSystem subsystem,
                               String oldName)
Constructor for a rename event.

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
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.
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.
oldName - - on a rename operation, this is the absolute name of the resource prior to the rename

SystemRemoteChangeEvent

public SystemRemoteChangeEvent()
Constructor you shouldn't use unless you intend to call the setters

Method Detail

setEventType

public void setEventType(int eventType)
Reset the event type


setResource

public void setResource(Object resource)
Reset the resource


setResourceParent

public void setResourceParent(Object resourceParent)
Reset the resource's remote resource parent


setSubSystem

public void setSubSystem(SubSystem subsystem)
Reset the subsystem


setOldName

public void setOldName(String oldName)
Reset the old name on a rename event


setOriginatingViewer

public void setOriginatingViewer(Viewer originatingViewer)
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 created object is selected after the parent's contents are refreshed, for the originating viewer.


getEventType

public int getEventType()
Get the event type, such as ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED.

Specified by:
getEventType in interface ISystemRemoteChangeEvent
See Also:
ISystemRemoteChangeEvents

getResource

public Object getResource()
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.

Specified by:
getResource in interface ISystemRemoteChangeEvent

getResourceParent

public Object getResourceParent()
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

Specified by:
getResourceParent in interface ISystemRemoteChangeEvent

getSubSystem

public SubSystem getSubSystem()
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.

Specified by:
getSubSystem in interface ISystemRemoteChangeEvent

getOldName

public String getOldName()
Get the old name of the resource, in the event of a resource rename. Null for other event types.

Specified by:
getOldName in interface ISystemRemoteChangeEvent

getOriginatingViewer

public Viewer getOriginatingViewer()
Get the originating viewer from which this remote resource change event comes from. The combination of this, if non-null, plus the resource parent, allows viewers to decide whether to update the selection within the parent resource, after refreshing that resource.

Specified by:
getOriginatingViewer in interface ISystemRemoteChangeEvent

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.