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 (a JsonPointer) in the Resources of a PolicyEntry. A Resource has a Type which determines the entity governed by this policy and Permissions 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 known JsonFields 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 the EffectedPermissions (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 new Resource with the specified resourceType, resourcePath and effectedPermissions.
      static Resource newInstance​(ResourceKey resourceKey, org.eclipse.ditto.json.JsonValue effectedPermissions)
      Returns a new Resource with the specified resourceKey and effectedPermissions.
      static Resource newInstance​(ResourceKey resourceKey, EffectedPermissions effectedPermissions)
      Returns a new Resource with the specified resourceKey and effectedPermissions.
      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
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithPointer

        toJsonString, toJsonString
      • Methods inherited from interface org.eclipse.ditto.model.base.json.Jsonifiable.WithPredicate

        toJson, toJson, toJsonString, toJsonString
    • Method Detail

      • newInstance

        static Resource newInstance​(ResourceKey resourceKey,
                                    EffectedPermissions effectedPermissions)
        Returns a new Resource with the specified resourceKey and effectedPermissions.
        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 is null.
      • newInstance

        static Resource newInstance​(ResourceKey resourceKey,
                                    org.eclipse.ditto.json.JsonValue effectedPermissions)
        Returns a new Resource with the specified resourceKey and effectedPermissions.
        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 is null.
      • newInstance

        static Resource newInstance​(CharSequence resourceType,
                                    CharSequence resourcePath,
                                    EffectedPermissions effectedPermissions)
        Returns a new Resource with the specified resourceType, resourcePath and effectedPermissions.
        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 is null.
        IllegalArgumentException - if resourceType 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 interface org.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 the EffectedPermissions (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 interface org.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 interface org.eclipse.ditto.model.base.json.Jsonifiable.WithFieldSelector