Class ResourceVariantTree

    • Constructor Detail

      • ResourceVariantTree

        protected ResourceVariantTree​(ResourceVariantByteStore store)
        Create a resource variant tree that uses the provided byte store to cache the resource variant bytes.
        Parameters:
        store - the resource variant byte store used to cache resource variants
    • Method Detail

      • members

        public IResource[] members​(IResource resource)
                            throws TeamException
        Description copied from interface: IResourceVariantTree
        Returns the members of the local resource that have resource variants in this tree. The members may or may not exist locally. The resource variants corresponding to the members can be retrieved using getResourceVariant(IResource).
        Parameters:
        resource - the local resource
        Returns:
        the members of the local resource for which this tree contains resource variants
        Throws:
        TeamException
      • hasResourceVariant

        public boolean hasResourceVariant​(IResource resource)
                                   throws TeamException
        Description copied from interface: IResourceVariantTree
        Return whether the local resource has a variant in this tree.
        Parameters:
        resource - the local resource
        Returns:
        true if the tree contains a variant for the resource
        Throws:
        TeamException
      • flushVariants

        public void flushVariants​(IResource resource,
                                  int depth)
                           throws TeamException
        Description copied from interface: IResourceVariantTree
        Flush any variants in the tree for the given resource to the depth specified.
        Parameters:
        resource - the resource
        depth - the flush depth (one of IResource.DEPTH_ZERO, IResource.DEPTH_ONE, or IResource.DEPTH_INFINITE)
        Throws:
        TeamException
      • setVariant

        protected boolean setVariant​(IResource local,
                                     IResourceVariant remote)
                              throws TeamException
        Description copied from class: AbstractResourceVariantTree
        Set the variant associated with the local resource to the newly fetched resource variant. This method is invoked during change collection and should return whether the variant associated with the local resource has changed
        Specified by:
        setVariant in class AbstractResourceVariantTree
        Parameters:
        local - the local resource
        remote - the newly fetched resource variant
        Returns:
        true if the resource variant changed
        Throws:
        TeamException
      • getByteStore

        protected ResourceVariantByteStore getByteStore()
        Get the byte store that is used to cache the serialization bytes for the resource variants of this tree. A byte store is used to reduce the memory footprint of the tree.

        This method is not intended to be overridden by subclasses.

        Returns:
        the resource variant tree that is being refreshed.
      • getBytes

        protected byte[] getBytes​(IResource local,
                                  IResourceVariant remote)
                           throws TeamException
        Get the bytes to be stored in the ResourceVariantByteStore from the given resource variant. By default, the IResourceVariant#asBytes() method is used to get the bytes.
        Parameters:
        local - the local resource
        remote - the corresponding resource variant handle
        Returns:
        the bytes for the resource variant.
        Throws:
        TeamException