Class EffectiveResource
java.lang.Object
com.inductiveautomation.ignition.common.resourcecollection.EffectiveResource
- All Implemented Interfaces:
Resource
Delegate resource implementation that overrides the collection name, so that all resources,
inherited or otherwise, share the same resource id.
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.resourcecollection.Resource
DEFAULT_BACKUP_JSON_KEY, DEFAULT_DATA_KEY, DEFAULT_JSON_KEY, PLATFORM_MODULE_ID, UNARY_RESOURCE_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionEffectiveResource
(String collectionName, Resource delegateResource) EffectiveResource
(String collectionName, Resource delegateResource, List<String> definingCollectionNames) -
Method Summary
Modifier and TypeMethodDescriptionint
Get the application scope of this resource.Optional<com.inductiveautomation.ignition.common.gson.JsonElement>
getAttribute
(String key) Get an immutable view of the attributes map.Get the name of theResourceCollection
this resource belongs to.Get the SHA-256 digest of the content of this resource.getData()
Returns the data for the legacy "default" file.Retrieve the data for the given key (filename) as anImmutableBytes
.getDataDigest
(String key) The "digest" is a unique fingerprint for the data file.com.google.common.collect.ImmutableSet<String>
Get an immutable view of the data key set.getDataReader
(String key) Retrieve the data for the given key (filename) as a reader.getDataStream
(String key) Retrieve the data for the given key (filename) as an input stream.Get theResourceSignature
for this resource.int
Get the version of this resource.boolean
isFolder()
boolean
boolean
boolean
isUnary()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.resourcecollection.Resource
copy, copy, copyWithAttribute, getFolderPath, isModuleFolder, isResourceTypeFolder, isSingletonResource, toBuilder
-
Constructor Details
-
EffectiveResource
-
EffectiveResource
-
-
Method Details
-
getCollectionName
Description copied from interface:Resource
Get the name of theResourceCollection
this resource belongs to. Note that if this resource was inherited, this collection name will be the name of the collection that was loaded up, not necessarily the collection that actually holds the definition of this resource.- Specified by:
getCollectionName
in interfaceResource
-
getDefiningCollectionName
- Specified by:
getDefiningCollectionName
in interfaceResource
- Returns:
- The name of the resource collection that holds the definition of this resource. By comparing this to getCollectionName, you can determine if this resource is inherited or not.
-
getDefiningCollectionNames
- Specified by:
getDefiningCollectionNames
in interfaceResource
- Returns:
- All collections in the inheritance chain that define this resource.
-
getResourceId
- Specified by:
getResourceId
in interfaceResource
-
getContentDigest
Description copied from interface:Resource
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.
- Specified by:
getContentDigest
in interfaceResource
- Returns:
- the SHA-256 digest of the content of this resource.
- See Also:
-
getResourceSignature
Description copied from interface:Resource
Get theResourceSignature
for this resource.- Specified by:
getResourceSignature
in interfaceResource
- Returns:
- the
ResourceSignature
for this resource.
-
getResourceName
- Specified by:
getResourceName
in interfaceResource
-
getResourceType
- Specified by:
getResourceType
in interfaceResource
-
getResourcePath
- Specified by:
getResourcePath
in interfaceResource
-
getDocumentation
- Specified by:
getDocumentation
in interfaceResource
-
getApplicationScope
public int getApplicationScope()Description copied from interface:Resource
Get the application scope of this resource.- Specified by:
getApplicationScope
in interfaceResource
- Returns:
- the application scope of this resource.
- See Also:
-
getVersion
public int getVersion()Description copied from interface:Resource
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.
- Specified by:
getVersion
in interfaceResource
- Returns:
- the version of this resource.
-
isFolder
public boolean isFolder() -
isUnary
public boolean isUnary() -
isRestricted
public boolean isRestricted()- Specified by:
isRestricted
in interfaceResource
- Returns:
true
if this resource is restricted to users of a certain role. Formerly known as "protected".
-
isOverridable
public boolean isOverridable()- Specified by:
isOverridable
in interfaceResource
- Returns:
true
if this resource can be overridden by child projects.
-
getData
Description copied from interface:Resource
Returns the data for the legacy "default" file. Equivalent to calling:getData("data.bin");
-
getData
Description copied from interface:Resource
Retrieve the data for the given key (filename) as anImmutableBytes
. Consider usingResource.getDataStream(String)
instead. -
getDataStream
Description copied from interface:Resource
Retrieve the data for the given key (filename) as an input stream. Depending on the Resource implementation, this may be more memory efficient thanResource.getData(String)
.- Specified by:
getDataStream
in interfaceResource
-
getDataReader
Description copied from interface:Resource
Retrieve the data for the given key (filename) as a reader. Reader will be opened with UTF-8 encoding. This may be more memory efficient than usingResource.getData(String)
, especially for parsing large JSON files, for example.- Specified by:
getDataReader
in interfaceResource
-
getDataDigest
Description copied from interface:Resource
The "digest" is a unique fingerprint for the data file. Calculated as a sha-256 hash and then encoded to a string as hex. Reference implementation looks like:getData(key).map(bytes -> DigestBuilder.sha256().update(bytes).buildHexString());
- Specified by:
getDataDigest
in interfaceResource
-
getDataKeys
Description copied from interface:Resource
Get an immutable view of the data key set.- Specified by:
getDataKeys
in interfaceResource
- Returns:
- an immutable view of the data key set.
-
getAttributes
@Nonnull public Map<String,com.inductiveautomation.ignition.common.gson.JsonElement> getAttributes()Description copied from interface:Resource
Get an immutable view of the attributes map.- Specified by:
getAttributes
in interfaceResource
- Returns:
- an immutable view of the attributes map.
-
getAttribute
- Specified by:
getAttribute
in interfaceResource
-
getDelegateResource
-