Interface ProjectResource
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
EffectiveProjectResource
,ImmutableProjectResource
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
calculateContentDigest
(ProjectResource resource) Calculate the SHA-256 content digest forresource
.default ProjectResource
copy()
Create a copy of thisProjectResource
.default ProjectResource
copy
(Consumer<ProjectResourceBuilder> consumer) Create a copy of thisProjectResource
, allowing for modifications to take place prior via the consumedProjectResourceBuilder
.int
Get the application scope of this resource.default Optional<com.inductiveautomation.ignition.common.gson.JsonElement>
getAttribute
(String key) Get an immutable view of the attributes map.byte[]
Get the SHA-256 digest of the content of this resource.default byte[]
getData()
byte[]
com.google.common.collect.ImmutableSet<String>
Get an immutable view of the data key set.default String
Get the name of theProject
this resource belongs to.default ProjectResourceId
default String
Get theResourceSignature
for this resource.default ResourceType
int
Get the version of this resource.boolean
isFolder()
boolean
isLocked()
default boolean
boolean
default boolean
boolean
default boolean
static ProjectResourceBuilder
Create a newProjectResourceBuilder
.default ProjectResourceBuilder
Create a newProjectResourceBuilder
pre-set with all the values from thisProjectResource
.
-
Field Details
-
PLATFORM_MODULE_ID
The id used for moduleId when the resource type belongs to the Ignition platform.- See Also:
-
DEFAULT_DATA_KEY
- See Also:
-
LEGACY_FOLDER_RESOURCE_TYPE
Deprecated.- See Also:
-
-
Method Details
-
getProjectName
String getProjectName()Get the name of theProject
this resource belongs to.- Returns:
- the name of the
Project
this resource belongs to.
-
getResourcePath
ResourcePath getResourcePath() -
getResourceName
-
getFolderPath
-
getResourceType
-
getDocumentation
-
getData
@Nullable default byte[] getData() -
getData
-
getDataKeys
Get an immutable view of the data key set.- Returns:
- an immutable view of the data key set.
-
getAttributes
Get an immutable view of the attributes map.- Returns:
- an immutable view of the attributes map.
-
getAttribute
-
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 theResourceSignature
for this resource.- Returns:
- the
ResourceSignature
for this resource.
-
getResourceId
-
copy
Create a copy of thisProjectResource
.- Returns:
- a copy of this
ProjectResource
.
-
copy
Create a copy of thisProjectResource
, allowing for modifications to take place prior via the consumedProjectResourceBuilder
.- Parameters:
consumer
- theProjectResourceBuilder
consumer.- Returns:
- a copy of this
ProjectResource
.
-
toBuilder
Create a newProjectResourceBuilder
pre-set with all the values from thisProjectResource
.- Returns:
- a new
ProjectResourceBuilder
pre-set with all the values from thisProjectResource
.
-
calculateContentDigest
Calculate the SHA-256 content digest forresource
.- Parameters:
resource
- theProjectResource
.- Returns:
- the SHA-256 content digest.
- See Also:
-
newBuilder
Create a newProjectResourceBuilder
.- Returns:
- a new
ProjectResourceBuilder
.
-