Package org.eclipse.ditto.model.policies
Interface Resource
-
- All Superinterfaces:
org.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
,org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<org.eclipse.ditto.json.JsonObject>
,org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>
public interface Resource extends org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
Represents a single Resource (aJsonPointer
) in theResources
of aPolicyEntry
. A Resource has aType
which determines the entity governed by this policy andPermissions
which are granted or revoked on this Resource.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Resource.JsonFields
An enumeration of the knownJsonField
s of a Resource.-
Nested classes/interfaces inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EffectedPermissions
getEffectedPermissions()
Returns theEffectedPermissions
(containing granted and revoked ones) for this Resource.String
getFullQualifiedPath()
Returns the full qualified path (type:path) of this Resource.org.eclipse.ditto.json.JsonPointer
getPath()
Returns the path of this Resource.ResourceKey
getResourceKey()
Returns the ResourceKey of this Resource.default org.eclipse.ditto.model.base.json.JsonSchemaVersion[]
getSupportedSchemaVersions()
Returns the supported JSON schema versions of this resource.String
getType()
Returns the type of this Resource.static Resource
newInstance(CharSequence resourceType, CharSequence resourcePath, EffectedPermissions effectedPermissions)
Returns a newResource
with the specifiedresourceType
,resourcePath
andeffectedPermissions
.static Resource
newInstance(ResourceKey resourceKey, org.eclipse.ditto.json.JsonValue effectedPermissions)
Returns a newResource
with the specifiedresourceKey
andeffectedPermissions
.static Resource
newInstance(ResourceKey resourceKey, EffectedPermissions effectedPermissions)
Returns a newResource
with the specifiedresourceKey
andeffectedPermissions
.default org.eclipse.ditto.json.JsonObject
toJson()
Returns all non hidden marked fields of this Resource.default org.eclipse.ditto.json.JsonObject
toJson(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable
getImplementedSchemaVersion, getLatestSchemaVersion, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
toJson, toJson, toJson, toJsonString, toJsonString
-
Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelectorAndPredicate
toJson, toJson, toJsonString, toJsonString
-
-
-
-
Method Detail
-
newInstance
static Resource newInstance(ResourceKey resourceKey, EffectedPermissions effectedPermissions)
Returns a newResource
with the specifiedresourceKey
andeffectedPermissions
.- Parameters:
resourceKey
- the ResourceKey of the new Resource to create.effectedPermissions
- the EffectedPermissions of the new Resource to create.- Returns:
- the new
Resource
. - Throws:
NullPointerException
- if any argument isnull
.
-
newInstance
static Resource newInstance(ResourceKey resourceKey, org.eclipse.ditto.json.JsonValue effectedPermissions)
Returns a newResource
with the specifiedresourceKey
andeffectedPermissions
.- Parameters:
resourceKey
- the ResourceKey of the new Resource to create.effectedPermissions
- the EffectedPermissions of the new Resource to create.- Returns:
- the new
Resource
. - Throws:
NullPointerException
- if any argument isnull
.
-
newInstance
static Resource newInstance(CharSequence resourceType, CharSequence resourcePath, EffectedPermissions effectedPermissions)
Returns a newResource
with the specifiedresourceType
,resourcePath
andeffectedPermissions
.- Parameters:
resourceType
- the type of the new Resource to create.resourcePath
- the path of the new Resource to create.effectedPermissions
- the EffectedPermissions of the new Resource to create.- Returns:
- the new
Resource
. - Throws:
NullPointerException
- if any argument isnull
.IllegalArgumentException
- ifresourceType
is empty.
-
getSupportedSchemaVersions
default org.eclipse.ditto.model.base.json.JsonSchemaVersion[] getSupportedSchemaVersions()
Returns the supported JSON schema versions of this resource. Resource is only available in JsonSchemaVersion V_2.- Specified by:
getSupportedSchemaVersions
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
- Returns:
- the supported schema versions.
-
getResourceKey
ResourceKey getResourceKey()
Returns the ResourceKey of this Resource.- Returns:
- the resource key.
-
getType
String getType()
Returns the type of this Resource.- Returns:
- the type.
-
getPath
org.eclipse.ditto.json.JsonPointer getPath()
Returns the path of this Resource.- Returns:
- the path.
-
getFullQualifiedPath
String getFullQualifiedPath()
Returns the full qualified path (type:path) of this Resource.- Returns:
- the full qualified path.
-
getEffectedPermissions
EffectedPermissions getEffectedPermissions()
Returns theEffectedPermissions
(containing granted and revoked ones) for this Resource.- Returns:
- the effected permissions.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson()
Returns all non hidden marked fields of this Resource.- Specified by:
toJson
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
- Returns:
- a JSON object representation of this Resource including only non hidden marked fields.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson(org.eclipse.ditto.model.base.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)
- Specified by:
toJson
in interfaceorg.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector
-
-