com.ibm.ftt.resources.core.physical
Interface IPhysicalResource

All Superinterfaces:
IAdaptable
All Known Subinterfaces:
IPhysicalContainer, IPhysicalFile, IResourceRoot, ZOSCatalog, ZOSDataSet, ZOSDataSetMember, ZOSGenerationDataGroup, ZOSPartitionedDataSet, ZOSResource, ZOSSequentialDataSet, ZOSVsamDataSet

public interface IPhysicalResource
extends IAdaptable

The IPhysicalResource provides a generic interface for a resource in the physical model layer. The physical model layer represents the physical resource tree in a remote file system such as the z/OS file system.

The IPhysicalResource has two generic subinterfaces - IPhysicalFile and IPhysicalContainer. The IPhysicalFile represents a physical resource that holds data, and the IPhysicalContainer contains other physical resources. Each file system provides more interfaces that extend the IPhysicalResource. For example, ZOSResource for the z/OS file system, etc.


Field Summary
static String COPY_RIGHT
           
 
Method Summary
 void delete(boolean force, IProgressMonitor monitor)
          Deletes this resource.
 void deleteOverriddenPropertiesInCategory(ICategory category)
          Deletes the overridden properties for the given category for the current property group of this resource.
 void deleteOverride(IProperty property)
          Deletes the override for the given property.
 boolean exists()
          Determines whether this resource actually exists in the system.
 IPropertyGroup getCurrentPropertyGroup()
          Returns the current property group for the resource.
 IPath getFullPath()
          Returns the full path of this resource, relative to the containing IResourceRoot.
 long getModificationStamp()
          Returns the time when the resource was last modified.
 long getModificationStamp(boolean force)
          Returns the time when the resource was last modified.
 String getName()
          Returns the name of this resource.
 List getOverriddenProperties()
          Returns the overridden properties for this resource.
 IContainer getParent()
          Gets the resource which is the parent of this resource.
 String getPersistentProperty(String key)
          Returns the value of the persistent property of this resource identified by the given key.
 IResourcePublisher getResourcePublisher()
          Returns the resource publisher that manages subscriptions for this specific resource.
 Object getSessionProperty(QualifiedName key)
          Returns the value of the session property of this resource identified by the given key.
 void refresh(int depth, IProgressMonitor monitor)
          Refreshes the resource hierarchy from this resource and its children to the specified depth.
 void rename(String name)
          Renames this resource.
 void setCurrentPropertyGroup(IPropertyGroup propertyGroup)
          Sets the current property group for the resource.
 void setOverride(IProperty property, String newValue)
          Overrides the given property value with the new value for the given resource.
 void setPersistentProperty(String key, String value)
          Sets the value of the persistent property of this resource identified by the given key.
 void setSessionProperty(QualifiedName key, Object value)
          Sets the value of the session property of this resource identified by the given key.
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

COPY_RIGHT

static final String COPY_RIGHT
See Also:
Constant Field Values
Method Detail

delete

void delete(boolean force,
            IProgressMonitor monitor)
            throws OperationFailedException
Deletes this resource.

Parameters:
force - Currently not used. It is recommended to set this to true for now.
monitor - a progress monitor, or null if progress reporting is not desired
Throws:
OperationFailedException - if the delete operation fails

exists

boolean exists()
Determines whether this resource actually exists in the system.

Returns:
true if the resource exists; false otherwise

getFullPath

IPath getFullPath()
Returns the full path of this resource, relative to the containing IResourceRoot.

Returns:
the full path of this resource

getModificationStamp

long getModificationStamp()
Returns the time when the resource was last modified.

Returns:
the modification stamp, which is a millisecond value relative to the Epoch, January 1, 1970 00:00:00.000 GMT (Gregorian), or 0 if it could not obtain the information.

getModificationStamp

long getModificationStamp(boolean force)
Returns the time when the resource was last modified.

Parameters:
force - true if you want a fresh time stamp from the remote system, false if you want a cached value
Returns:
the modification stamp, which is a millisecond value relative to the Epoch, January 1, 1970 00:00:00.000 GMT (Gregorian), or 0 if it could not obtain the information.

getParent

IContainer getParent()
Gets the resource which is the parent of this resource.

Returns:
the parent resource of this resource, or null if it has no parent (that is, this resource is the root of the resource model).

refresh

void refresh(int depth,
             IProgressMonitor monitor)
Refreshes the resource hierarchy from this resource and its children to the specified depth.

Parameters:
depth - one of the following values:
monitor - a progress monitor, or null if progress reporting is not desired
See Also:
IPhysicalResource.isRefreshing()

getName

String getName()
Returns the name of this resource.

Returns:
the name of the resource

rename

void rename(String name)
            throws OperationFailedException
Renames this resource.

Parameters:
name - the new name for this resource
Throws:
OperationFailedException - if the rename operation fails

getResourcePublisher

IResourcePublisher getResourcePublisher()
Returns the resource publisher that manages subscriptions for this specific resource.

This method should not return null. Implementer should create a new instance if it was not created yet.

Returns:
the resource publisher instance. Never returns null.

getPersistentProperty

String getPersistentProperty(String key)
Returns the value of the persistent property of this resource identified by the given key.

If the resource's property value is null, then tries to get a value from its container. The search is continued up the tree until a non-null value is returned or reached to the top of the tree. Note that an empty string is treated as a valid value so that a resource can override its parent property with a blank.

The persistent properties will persist across workbench shut down and restart.

Parameters:
key - the name of the property to be retrieved
Returns:
the property value, or null if no value is found
See Also:
IPhysicalResource.setPersistentProperty(String, String)

setPersistentProperty

void setPersistentProperty(String key,
                           String value)
Sets the value of the persistent property of this resource identified by the given key. If the specified value is null, then the persistent property is removed from the resource.

The persistent properties will persist across workbench shut down and restart.

Parameters:
key - the name of the property
value - the value of the property, or null if the property is to be removed
See Also:
IPhysicalResource.getPersistentProperty(String)

getSessionProperty

Object getSessionProperty(QualifiedName key)
Returns the value of the session property of this resource identified by the given key.

If the resource's property value is null, then tries to get a value from its container. The search is continued up the tree until a non-null value is returned or reached to the top of the tree. Note that an empty string is treated as a valid value so that a resource can override its parent property with a blank.

The session properties will not be retained after the workbench has been shut down.

Parameters:
key - the qualified name of the property to be retrieved
Returns:
an object representing the property value, or null if no value is found
See Also:
IPhysicalResource.setSessionProperty(QualifiedName, Object)

setSessionProperty

void setSessionProperty(QualifiedName key,
                        Object value)
Sets the value of the session property of this resource identified by the given key. If the specified value is null, then the persistent property is removed from the resource.

The session properties will not be retained after the workbench has been shut down.

Parameters:
key - the qualified name of the property
value - the value of the property, or null if the property is to be removed
See Also:
IPhysicalResource.getSessionProperty(QualifiedName)

setCurrentPropertyGroup

void setCurrentPropertyGroup(IPropertyGroup propertyGroup)
Sets the current property group for the resource.

Parameters:
propertyGroup - The property group that will be the current property group, or null to remove the current property group.
See Also:
IPhysicalResource.getCurrentPropertyGroup()

getCurrentPropertyGroup

IPropertyGroup getCurrentPropertyGroup()
Returns the current property group for the resource. If there is no current property group for this resource, the parents of the resource are checked. If one of the parents has a current property group, that property group is returned. If there is no current property group for this resource or any parent, null is returned.

Returns:
The current property group. This can be null if this resource and all of its parents do not have a current property group.

setOverride

void setOverride(IProperty property,
                 String newValue)
                 throws UnsupportedOperationException,
                        IllegalPropertyException
Overrides the given property value with the new value for the given resource.

Parameters:
property - The property to be overridden.
newValue - The new value.

Throws:
UnsupportedOperationException - If the resource does not support property overrides.
IllegalPropertyException - If the current property group for this resource does not have a category instance with the given property, or if the current property group is null.

deleteOverride

void deleteOverride(IProperty property)
                    throws UnsupportedOperationException,
                           NoOverrideException
Deletes the override for the given property. The original property value will be used rather than the overridden value.

Parameters:
property - The property that was overridden.

Throws:
UnsupportedOperationException - If the resource does not support property overrides.
NoOverrideException - If there is no override for the given property for this resource.

getOverriddenProperties

List getOverriddenProperties()
                             throws UnsupportedOperationException
Returns the overridden properties for this resource. If there are no overrides, an empty list is returned.

Returns:
An unmodifiable list of the overridden values; the list is empty if there are no property overrides.

Throws:
UnsupportedOperationException - If the resource does not support property overrides.

deleteOverriddenPropertiesInCategory

void deleteOverriddenPropertiesInCategory(ICategory category)
                                          throws UnsupportedOperationException,
                                                 NoOverrideException
Deletes the overridden properties for the given category for the current property group of this resource.

Parameters:
category - The overridden properties of the category instance for this category are deleted.
Throws:
UnsupportedOperationException - If this resource does not support overrides for properties.
NoOverrideException