Interface RequestInfo
-
- All Known Implementing Classes:
BaseRequestInfo
public interface RequestInfoClient-side configuration model for Resource Registry request parameters. Provides methods to configure pagination, metadata inclusion, and context behavior for Resource Registry operations.includeMeta()/allMeta()are a convenience, two-boolean shape for the caller; client implementations combine them into the single wire-levelmetadataPolicyquery parameter (seeMetadataPolicy) before issuing the request:includeMeta=false→metadataPolicy=none,includeMeta=true, allMeta=false→metadataPolicy=root,includeMeta=true, allMeta=true→metadataPolicy=all.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static IntegerDEFAULT_LIMITThe Constant DEFAULT_LIMIT.static IntegerDEFAULT_OFFSETThe Constant DEFAULT_OFFSET.static IntegerUNBOUNDED_LIMITThe Constant UNBOUNDED_LIMIT.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleanallMeta()Checks whether to include metadata for all nested instances in the response.ContextsPolicygetContextsPolicy()Returns where thecontextsmembership map (Context UUID to Context path) appears in the response.IntegergetLimit()Gets the maximum number of instances to return in a single response.MembershipScopegetMembershipScope()Returns the Context boundary of the memberships listed by everycontextsmap.IntegergetOffset()Gets the number of instances to skip from the beginning of the result set.booleanincludeMeta()Checks whether to include metadata in the response instance.booleanisHierarchicalMode()Checks whether to include instances from child contexts of the current context.default ResourceRegistryResponsesserverResponses()Returns the opt-in response executor.voidsetAllMeta(boolean allMeta)Sets whether to include metadata for all nested instances (ConsistsOf relations, Facets, etc.) in the response.voidsetContextsPolicy(ContextsPolicy contextsPolicy)Sets where thecontextsmembership map appears in the response.voidsetHierarchicalMode(boolean hierarchicalMode)Sets whether to include instances from child contexts of the current context.voidsetIncludeMeta(boolean includeMeta)Sets whether to include metadata in the response instance.voidsetLimit(Integer limit)Sets the maximum number of instances to return in a single response.voidsetMembershipScope(MembershipScope membershipScope)Sets the Context boundary of the memberships listed by everycontextsmap.voidsetOffset(Integer offset)Sets the number of instances to skip from the beginning of the result set.
-
-
-
Method Detail
-
serverResponses
default ResourceRegistryResponses serverResponses()
Returns the opt-in response executor. It runs an ordinary client method through the same transport path and associates its value with immutable HTTP metadata. Cache-only calls are explicitly identified and do not fabricate status codes or headers.- Returns:
- stateless response executor
-
getLimit
Integer getLimit()
Gets the maximum number of instances to return in a single response.- Returns:
- the limit value for pagination, or null if not set (uses server default)
-
setLimit
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
UNBOUNDED_LIMIT(-1) for unlimited results (may cause timeout if results are too many) - Query parameter: limit
- Parameters:
limit- Maximum number of instances to return, orUNBOUNDED_LIMITfor unlimited results
-
getOffset
Integer getOffset()
Gets the number of instances to skip from the beginning of the result set.- Returns:
- the offset value for pagination, or null if not set (defaults to 0)
-
setOffset
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
- Parameters:
offset- Number of instances to skip from the beginning
-
includeMeta
boolean includeMeta()
Checks whether to include metadata in the response instance.- Returns:
- true if metadata should be included, false for basic information only
-
setIncludeMeta
void setIncludeMeta(boolean includeMeta)
Sets whether to include metadata in the response instance. Controls whether to includeMetadatain 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
allMeta()intometadataPolicy(see the class Javadoc) — there is no standaloneincludeMetaquery parameter on the wire.
- IS-Manager, Infrastructure-Manager, and Context-Manager: See complete metadata including sensitive information (createdBy, lastUpdatedBy)
- Other users: See filtered metadata with sensitive fields obfuscated
- Parameters:
includeMeta- Whether to include metadata in the response instance
-
allMeta
boolean allMeta()
Checks whether to include metadata for all nested instances in the response.- Returns:
- true if metadata should be included for all nested elements, false for main instance only
-
setAllMeta
void setAllMeta(boolean allMeta)
Sets whether to include metadata for all nested instances (ConsistsOf relations, Facets, etc.) in the response. Controls whether to includeMetadatain allIdentifiableElementor 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
includeMeta()intometadataPolicy(see the class Javadoc) — there is no standaloneallMetaquery parameter on the wire.
- Parameters:
allMeta- Whether to include metadata for all nested instances in the response
-
isHierarchicalMode
boolean isHierarchicalMode()
Checks whether to include instances from child contexts of the current context. Restricted to IS-Manager, Infrastructure-Manager, and Context-Manager (seesetHierarchicalMode(boolean)for the full per-role breakdown).- Returns:
- true if hierarchical mode is enabled, false for current context only
-
setHierarchicalMode
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
- 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
- Parameters:
hierarchicalMode- Whether to include instances from child contexts of the current context
-
getContextsPolicy
ContextsPolicy getContextsPolicy()
Returns where thecontextsmembership map (Context UUID to Context path) appears in the response.- Returns:
- the contexts policy, never
null
-
setContextsPolicy
void setContextsPolicy(ContextsPolicy contextsPolicy)
Sets where thecontextsmembership map appears in the response.- Default value:
ContextsPolicy.NONE(no membership map) - Values:
ContextsPolicy.ROOT: only on top-level response elementsContextsPolicy.ALL: also on nested elements and on the source/target endpoint references of Relations- Query parameter:
contextsPolicy
- 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
- Parameters:
contextsPolicy- the contexts policy;nullrestores the default
- Default value:
-
getMembershipScope
MembershipScope getMembershipScope()
Returns the Context boundary of the memberships listed by everycontextsmap.- Returns:
- the membership scope, never
null
-
setMembershipScope
void setMembershipScope(MembershipScope membershipScope)
Sets the Context boundary of the memberships listed by everycontextsmap. 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 receives403 Forbidden- Query parameter:
membershipScope
- Parameters:
membershipScope- the membership scope;nullrestores the default
- Default value:
-
-