Interface IResourceProxy


public interface IResourceProxy
A lightweight interface for requesting information about a resource. All of the "get" methods on a resource proxy have trivial performance cost. Requesting the full path or the actual resource handle will cause extra objects to be created and will thus have greater cost.

When a resource proxy is used within an IResourceProxyVisitor, it is a transient object that is only valid for the duration of a single visit method. A proxy should not be referenced once the single resource visit is complete. The equals and hashCode methods should not be relied on.

A proxy can also be created using IResource.createProxy(). In this case the proxy is valid indefinitely, but will not remain in sync with the state of the corresponding resource.

Since:
2.1
See Also:
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the modification stamp of the resource being visited.
    Returns the simple name of the resource being visited.
    Returns the value of the session property of the resource being visited, identified by the given key.
    int
    Returns the type of the resource being visited.
    boolean
    Returns whether the resource being visited is accessible.
    boolean
    Returns whether the resource being visited is derived.
    boolean
    Returns whether the resource being visited is a hidden resource.
    boolean
    Returns whether the resource being visited is a linked resource.
    boolean
    Returns whether the resource being visited is a phantom resource.
    boolean
    Returns whether the resource being visited is a team private member.
    Returns the full workspace path of the resource being visited.
    Returns the handle of the resource being visited.
  • Method Details

    • getModificationStamp

      long getModificationStamp()
      Returns the modification stamp of the resource being visited.
      Returns:
      the modification stamp, or NULL_STAMP if the resource either does not exist or exists as a closed project
      See Also:
    • isAccessible

      boolean isAccessible()
      Returns whether the resource being visited is accessible.
      Returns:
      true if the resource is accessible, and false otherwise
      See Also:
    • isDerived

      boolean isDerived()
      Returns whether the resource being visited is derived.
      Returns:
      true if the resource is marked as derived, and false otherwise
      See Also:
    • isLinked

      boolean isLinked()
      Returns whether the resource being visited is a linked resource.
      Returns:
      true if the resource is linked, and false otherwise
      See Also:
    • isPhantom

      boolean isPhantom()
      Returns whether the resource being visited is a phantom resource.
      Returns:
      true if the resource is a phantom resource, and false otherwise
      See Also:
    • isHidden

      boolean isHidden()
      Returns whether the resource being visited is a hidden resource.
      Returns:
      true if the resource is a hidden resource, and false otherwise
      Since:
      3.4
      See Also:
    • isTeamPrivateMember

      boolean isTeamPrivateMember()
      Returns whether the resource being visited is a team private member.
      Returns:
      true if the resource is a team private member, and false otherwise
      See Also:
    • getName

      String getName()
      Returns the simple name of the resource being visited.
      Returns:
      the name of the resource
      See Also:
    • getSessionProperty

      Object getSessionProperty(QualifiedName key)
      Returns the value of the session property of the resource being visited, identified by the given key. Returns null if this resource has no such property.

      Note that this method can return an out of date property value, or a value that no longer exists, if session properties are being modified concurrently with the resource visit.

      Parameters:
      key - the qualified name of the property
      Returns:
      the string value of the session property, or null if the resource has no such property
      See Also:
    • getType

      int getType()
      Returns the type of the resource being visited.
      Returns:
      the resource type
      See Also:
    • requestFullPath

      IPath requestFullPath()
      Returns the full workspace path of the resource being visited.

      Note that this is not a "free" proxy operation. This method will generally cause a path object to be created. For an optimal visitor, only call this method when absolutely necessary. Note that the simple resource name can be obtained from the proxy with no cost.

      Returns:
      the full path of the resource
      See Also:
    • requestResource

      IResource requestResource()
      Returns the handle of the resource being visited.

      Note that this is not a "free" proxy operation. This method will generally cause both a path object and a resource object to be created. For an optimal visitor, only call this method when absolutely necessary. Note that the simple resource name can be obtained from the proxy with no cost, and the full path of the resource can be obtained through the proxy with smaller cost.

      Returns:
      the resource handle