Interface ProjectResource
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
EffectiveProjectResource,ImmutableProjectResource
public interface ProjectResource extends java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_DATA_KEYstatic java.lang.StringLEGACY_FOLDER_RESOURCE_TYPEDeprecated.static java.lang.StringPLATFORM_MODULE_IDThe id used for moduleId when the resource type belongs to the Ignition platform.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static byte[]calculateContentDigest(ProjectResource resource)Calculate the SHA-256 content digest forresource.default ProjectResourcecopy()Create a copy of thisProjectResource.default ProjectResourcecopy(java.util.function.Consumer<ProjectResourceBuilder> consumer)Create a copy of thisProjectResource, allowing for modifications to take place prior via the consumedProjectResourceBuilder.intgetApplicationScope()Get the application scope of this resource.default java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonElement>getAttribute(java.lang.String key)java.util.Map<java.lang.String,com.inductiveautomation.ignition.common.gson.JsonElement>getAttributes()Get an immutable view of the attributes map.byte[]getContentDigest()Get the SHA-256 digest of the content of this resource.default byte[]getData()byte[]getData(java.lang.String key)com.google.common.collect.ImmutableSet<java.lang.String>getDataKeys()Get an immutable view of the data key set.java.lang.StringgetDocumentation()default java.lang.StringgetFolderPath()java.lang.StringgetProjectName()Get the name of theProjectthis resource belongs to.default ProjectResourceIdgetResourceId()default java.lang.StringgetResourceName()ResourcePathgetResourcePath()ResourceSignaturegetResourceSignature()Get theResourceSignaturefor this resource.default ResourceTypegetResourceType()intgetVersion()Get the version of this resource.booleanisFolder()booleanisLocked()default booleanisModuleFolder()booleanisOverridable()default booleanisResourceTypeFolder()booleanisRestricted()default booleanisSingletonResource()static ProjectResourceBuildernewBuilder()Create a newProjectResourceBuilder.default ProjectResourceBuildertoBuilder()Create a newProjectResourceBuilderpre-set with all the values from thisProjectResource.
-
-
-
Field Detail
-
PLATFORM_MODULE_ID
static final java.lang.String PLATFORM_MODULE_ID
The id used for moduleId when the resource type belongs to the Ignition platform.- See Also:
- Constant Field Values
-
DEFAULT_DATA_KEY
static final java.lang.String DEFAULT_DATA_KEY
- See Also:
- Constant Field Values
-
LEGACY_FOLDER_RESOURCE_TYPE
@Deprecated static final java.lang.String LEGACY_FOLDER_RESOURCE_TYPE
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
getProjectName
java.lang.String getProjectName()
Get the name of theProjectthis resource belongs to.- Returns:
- the name of the
Projectthis resource belongs to.
-
getResourcePath
ResourcePath getResourcePath()
-
getResourceName
default java.lang.String getResourceName()
-
getFolderPath
default java.lang.String getFolderPath()
-
getResourceType
default ResourceType getResourceType()
-
getDocumentation
@Nullable java.lang.String getDocumentation()
-
getData
@Nullable default byte[] getData()
-
getData
@Nullable byte[] getData(java.lang.String key)
-
getDataKeys
@Nonnull com.google.common.collect.ImmutableSet<java.lang.String> getDataKeys()
Get an immutable view of the data key set.- Returns:
- an immutable view of the data key set.
-
getAttributes
@Nonnull java.util.Map<java.lang.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 java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonElement> getAttribute(java.lang.String key)
-
getApplicationScope
int getApplicationScope()
Get the application scope of this resource.- Returns:
- the application scope of this resource.
- See Also:
ApplicationScope
-
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:
trueif this resource is a folder.
-
isModuleFolder
default boolean isModuleFolder()
-
isResourceTypeFolder
default boolean isResourceTypeFolder()
-
isSingletonResource
default boolean isSingletonResource()
-
isLocked
boolean isLocked()
- Returns:
trueif this resource is OEM locked.
-
isRestricted
boolean isRestricted()
- Returns:
trueif this resource is restricted to users of a certain role. Formerly known as "protected".
-
isOverridable
boolean isOverridable()
- Returns:
trueif 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
ResourceSignature getResourceSignature()
Get theResourceSignaturefor this resource.- Returns:
- the
ResourceSignaturefor this resource.
-
getResourceId
default ProjectResourceId getResourceId()
-
copy
default ProjectResource copy()
Create a copy of thisProjectResource.- Returns:
- a copy of this
ProjectResource.
-
copy
default ProjectResource copy(java.util.function.Consumer<ProjectResourceBuilder> consumer)
Create a copy of thisProjectResource, allowing for modifications to take place prior via the consumedProjectResourceBuilder.- Parameters:
consumer- theProjectResourceBuilderconsumer.- Returns:
- a copy of this
ProjectResource.
-
toBuilder
default ProjectResourceBuilder toBuilder()
Create a newProjectResourceBuilderpre-set with all the values from thisProjectResource.- Returns:
- a new
ProjectResourceBuilderpre-set with all the values from thisProjectResource.
-
calculateContentDigest
static byte[] calculateContentDigest(ProjectResource resource)
Calculate the SHA-256 content digest forresource.- Parameters:
resource- theProjectResource.- Returns:
- the SHA-256 content digest.
- See Also:
getContentDigest()
-
newBuilder
static ProjectResourceBuilder newBuilder()
Create a newProjectResourceBuilder.- Returns:
- a new
ProjectResourceBuilder.
-
-