All Superinterfaces:
Serializable
All Known Implementing Classes:
EffectiveProjectResource, ImmutableProjectResource

public interface ProjectResource extends Serializable
  • Field Details

  • Method Details

    • getProjectName

      String getProjectName()
      Get the name of the Project this resource belongs to.
      Returns:
      the name of the Project this resource belongs to.
    • getResourcePath

      ResourcePath getResourcePath()
    • getResourceName

      default String getResourceName()
    • getFolderPath

      default String getFolderPath()
    • getResourceType

      default ResourceType getResourceType()
    • getDocumentation

      @Nullable String getDocumentation()
    • getData

      @Nullable default byte[] getData()
    • getData

      @Nullable byte[] getData(String key)
    • getDataKeys

      @Nonnull com.google.common.collect.ImmutableSet<String> getDataKeys()
      Get an immutable view of the data key set.
      Returns:
      an immutable view of the data key set.
    • getAttributes

      @Nonnull Map<String,com.inductiveautomation.ignition.common.gson.JsonElement> getAttributes()
      Get an immutable view of the attributes map.
      Returns:
      an immutable view of the attributes map.
    • getAttribute

      default Optional<com.inductiveautomation.ignition.common.gson.JsonElement> getAttribute(String key)
    • getApplicationScope

      int getApplicationScope()
      Get the application scope of this resource.
      Returns:
      the application scope of this resource.
      See Also:
    • getVersion

      int getVersion()
      Get the version of this resource.

      The version number is not intended to track mutations to the resource like the legacy edit count, but rather, its interpretation and use is for the entities this resource type belongs to and so it can be used to reason about the contents of the resource, e.g. to distinguish between serialization formats.

      Returns:
      the version of this resource.
    • isFolder

      boolean isFolder()
      Returns:
      true if this resource is a folder.
    • isModuleFolder

      default boolean isModuleFolder()
    • isResourceTypeFolder

      default boolean isResourceTypeFolder()
    • isSingletonResource

      default boolean isSingletonResource()
    • isLocked

      boolean isLocked()
      Returns:
      true if this resource is OEM locked.
    • isRestricted

      boolean isRestricted()
      Returns:
      true if this resource is restricted to users of a certain role. Formerly known as "protected".
    • isOverridable

      boolean isOverridable()
      Returns:
      true if this resource can be overridden by child projects.
    • getContentDigest

      byte[] getContentDigest()
      Get the SHA-256 digest of the content of this resource. This does not include the project name or any part of the path to this resource, but rather, it's a representation of the contents of the folder on disk.

      Any changes to any of the resource contents of that folder shall result in a change to the content digest.

      Returns:
      the SHA-256 digest of the content of this resource.
      See Also:
    • getResourceSignature

      ResourceSignature getResourceSignature()
      Get the ResourceSignature for this resource.
      Returns:
      the ResourceSignature for this resource.
    • getResourceId

      default ProjectResourceId getResourceId()
    • copy

      default ProjectResource copy()
      Create a copy of this ProjectResource.
      Returns:
      a copy of this ProjectResource.
    • copy

      Create a copy of this ProjectResource, allowing for modifications to take place prior via the consumed ProjectResourceBuilder.
      Parameters:
      consumer - the ProjectResourceBuilder consumer.
      Returns:
      a copy of this ProjectResource.
    • toBuilder

      default ProjectResourceBuilder toBuilder()
      Create a new ProjectResourceBuilder pre-set with all the values from this ProjectResource.
      Returns:
      a new ProjectResourceBuilder pre-set with all the values from this ProjectResource.
    • calculateContentDigest

      static byte[] calculateContentDigest(ProjectResource resource)
      Calculate the SHA-256 content digest for resource.
      Parameters:
      resource - the ProjectResource.
      Returns:
      the SHA-256 content digest.
      See Also:
    • newBuilder

      static ProjectResourceBuilder newBuilder()
      Returns:
      a new ProjectResourceBuilder.