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.String
DEFAULT_DATA_KEY
static java.lang.String
LEGACY_FOLDER_RESOURCE_TYPE
Deprecated.static java.lang.String
PLATFORM_MODULE_ID
The 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 ProjectResource
copy()
Create a copy of thisProjectResource
.default ProjectResource
copy(java.util.function.Consumer<ProjectResourceBuilder> consumer)
Create a copy of thisProjectResource
, allowing for modifications to take place prior via the consumedProjectResourceBuilder
.int
getApplicationScope()
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.String
getDocumentation()
default java.lang.String
getFolderPath()
java.lang.String
getProjectName()
Get the name of theProject
this resource belongs to.default ProjectResourceId
getResourceId()
default java.lang.String
getResourceName()
ResourcePath
getResourcePath()
ResourceSignature
getResourceSignature()
Get theResourceSignature
for this resource.default ResourceType
getResourceType()
int
getVersion()
Get the version of this resource.boolean
isFolder()
boolean
isLocked()
default boolean
isModuleFolder()
boolean
isOverridable()
default boolean
isResourceTypeFolder()
boolean
isRestricted()
default boolean
isSingletonResource()
static ProjectResourceBuilder
newBuilder()
Create a newProjectResourceBuilder
.default ProjectResourceBuilder
toBuilder()
Create a newProjectResourceBuilder
pre-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 theProject
this resource belongs to.- Returns:
- the name of the
Project
this 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:
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
ResourceSignature getResourceSignature()
Get theResourceSignature
for this resource.- Returns:
- the
ResourceSignature
for 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
- theProjectResourceBuilder
consumer.- Returns:
- a copy of this
ProjectResource
.
-
toBuilder
default ProjectResourceBuilder 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
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
.
-
-