Class BaseRequestInfo

  • All Implemented Interfaces:
    RequestInfo

    public class BaseRequestInfo
    extends Object
    implements RequestInfo
    The Class BaseRequestInfo.
    Author:
    Luca Frosini (ISTI - CNR)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean allMeta
      Track if the request requested to include Metadata in all IdentifiableElement or just in the root instance
      protected ContextsPolicy contextsPolicy
      Track where the request asked the contexts membership map to appear
      protected boolean hierarchicalMode
      Track if hierarchicalMode has been requested
      protected boolean includeMeta
      Track if the request requested to include Metadata
      protected Integer limit
      To get unlimited results, the limit query parameter must be set to -1.
      protected MembershipScope membershipScope
      Track the Context boundary the request asked for the memberships listed by every contexts map
      protected Integer offset
      The offset parameter indicates the starting position of the result.
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseRequestInfo()
      Instantiates a new base request info.
    • Field Detail

      • offset

        protected Integer offset
        The offset parameter indicates the starting position of the result.
      • limit

        protected Integer limit
        To get unlimited results, the limit query parameter must be set to -1. If the results are too many, the operation could have a timeout.
      • includeMeta

        protected boolean includeMeta
        Track if the request requested to include Metadata
      • allMeta

        protected boolean allMeta
        Track if the request requested to include Metadata in all IdentifiableElement or just in the root instance
      • hierarchicalMode

        protected boolean hierarchicalMode
        Track if hierarchicalMode has been requested
      • contextsPolicy

        protected ContextsPolicy contextsPolicy
        Track where the request asked the contexts membership map to appear
      • membershipScope

        protected MembershipScope membershipScope
        Track the Context boundary the request asked for the memberships listed by every contexts map
    • Constructor Detail

      • BaseRequestInfo

        public BaseRequestInfo()
        Instantiates a new base request info.
    • Method Detail

      • getLimit

        public Integer getLimit()
        Gets the maximum number of instances to return in a single response.
        Specified by:
        getLimit in interface RequestInfo
        Returns:
        the limit value for pagination, or null if not set (uses server default)
      • setLimit

        public void setLimit​(Integer limit)
        Sets the maximum number of instances to return in a single response. Used for pagination to control response size and manage memory usage.
        • Default value: Server configuration dependent
        • Example: Set to 50 to get at most 50 instances per request
        • Unlimited results: Set to RequestInfo.UNBOUNDED_LIMIT (-1) for unlimited results (may cause timeout if results are too many)
        • Query parameter: limit
        Specified by:
        setLimit in interface RequestInfo
        Parameters:
        limit - Maximum number of instances to return, or RequestInfo.UNBOUNDED_LIMIT for unlimited results
      • getOffset

        public Integer getOffset()
        Gets the number of instances to skip from the beginning of the result set.
        Specified by:
        getOffset in interface RequestInfo
        Returns:
        the offset value for pagination, or null if not set (defaults to 0)
      • setOffset

        public void setOffset​(Integer offset)
        Sets the number of instances to skip from the beginning of the result set. Used for pagination to navigate through large result sets.
        • Default value: 0
        • Example: Set to 10 to skip the first 10 instances (useful for pagination)
        • Query parameter: offset
        Specified by:
        setOffset in interface RequestInfo
        Parameters:
        offset - Number of instances to skip from the beginning
      • includeMeta

        public boolean includeMeta()
        Checks whether to include metadata in the response instance.
        Specified by:
        includeMeta in interface RequestInfo
        Returns:
        true if metadata should be included, false for basic information only
      • setIncludeMeta

        public void setIncludeMeta​(boolean includeMeta)
        Sets whether to include metadata in the response instance. Controls whether to include Metadata in the response.
        • Default value: false (basic information only)
        • Values:
        • true: includes metadata with role-based filtering
        • false: basic information only
        • Wire-level query parameter: combined with RequestInfo.allMeta() into metadataPolicy (see the class Javadoc) — there is no standalone includeMeta query parameter on the wire.
        Authorization Restriction:
        • IS-Manager, Infrastructure-Manager, and Context-Manager: See complete metadata including sensitive information (createdBy, lastUpdatedBy)
        • Other users: See filtered metadata with sensitive fields obfuscated
        Specified by:
        setIncludeMeta in interface RequestInfo
        Parameters:
        includeMeta - Whether to include metadata in the response instance
      • allMeta

        public boolean allMeta()
        Checks whether to include metadata for all nested instances in the response.
        Specified by:
        allMeta in interface RequestInfo
        Returns:
        true if metadata should be included for all nested elements, false for main instance only
      • setAllMeta

        public void setAllMeta​(boolean allMeta)
        Sets whether to include metadata for all nested instances (ConsistsOf relations, Facets, etc.) in the response. Controls whether to include Metadata in all IdentifiableElement or just in the root instance. Must be used in conjunction with includeMeta=true.
        • Default value: false (metadata only for main instance, more human-readable)
        • Values:
        • true: complete metadata for all nested IdentifiableElement instances
        • false: metadata only in the root instance, more readable
        • Purpose: When false, produces more human-readable responses with less JSON to process
        • Wire-level query parameter: combined with RequestInfo.includeMeta() into metadataPolicy (see the class Javadoc) — there is no standalone allMeta query parameter on the wire.
        Specified by:
        setAllMeta in interface RequestInfo
        Parameters:
        allMeta - Whether to include metadata for all nested instances in the response
      • isHierarchicalMode

        public boolean isHierarchicalMode()
        Checks whether to include instances from child contexts of the current context. Restricted to IS-Manager, Infrastructure-Manager, and Context-Manager (see RequestInfo.setHierarchicalMode(boolean) for the full per-role breakdown).
        Specified by:
        isHierarchicalMode in interface RequestInfo
        Returns:
        true if hierarchical mode is enabled, false for current context only
      • setHierarchicalMode

        public void setHierarchicalMode​(boolean hierarchicalMode)
        Sets whether to include instances from child contexts of the current context.
        • Default value: false (child contexts not included)
        • Values:
        • true: includes child contexts
        • false: current context only
        • Query parameter: hierarchical
        Authorization Restriction:
        • IS-Manager and Infrastructure-Manager: Global roles, can use hierarchical mode in any context
        • Context-Manager: Context-specific role, can use hierarchical mode only in contexts where they have this role
        • Other users: Not available
        Specified by:
        setHierarchicalMode in interface RequestInfo
        Parameters:
        hierarchicalMode - Whether to include instances from child contexts of the current context
      • getContextsPolicy

        public ContextsPolicy getContextsPolicy()
        Returns where the contexts membership map (Context UUID to Context path) appears in the response.
        Specified by:
        getContextsPolicy in interface RequestInfo
        Returns:
        the contexts policy, never null
      • setContextsPolicy

        public void setContextsPolicy​(ContextsPolicy contextsPolicy)
        Sets where the contexts membership map appears in the response. Context Rules:
        • Resources: Present in all contexts that form the union of contexts of all their Facets
        • ConsistsOf relations: Present in all contexts where their target Facets are present
        • Facets: Context availability depends on the Resources that include them via ConsistsOf relations
        Specified by:
        setContextsPolicy in interface RequestInfo
        Parameters:
        contextsPolicy - the contexts policy; null restores the default
      • getMembershipScope

        public MembershipScope getMembershipScope()
        Returns the Context boundary of the memberships listed by every contexts map.
        Specified by:
        getMembershipScope in interface RequestInfo
        Returns:
        the membership scope, never null
      • setMembershipScope

        public void setMembershipScope​(MembershipScope membershipScope)
        Sets the Context boundary of the memberships listed by every contexts map. It does not select instances and does not make the map appear.
        • Default value: MembershipScope.SUBTREE (the token Context and its descendants), for every role
        • Values:
        • MembershipScope.GLOBAL: every membership; restricted to IS-Manager, Infrastructure-Manager and IS-Admin, any other role receives 403 Forbidden
        • Query parameter: membershipScope
        Specified by:
        setMembershipScope in interface RequestInfo
        Parameters:
        membershipScope - the membership scope; null restores the default