Class OperationOptionsBuilder
- java.lang.Object
-
- org.identityconnectors.framework.common.objects.OperationOptionsBuilder
-
public final class OperationOptionsBuilder extends java.lang.ObjectBuilder forOperationOptions.
-
-
Constructor Summary
Constructors Constructor Description OperationOptionsBuilder()Create a builder with an empty set of options.OperationOptionsBuilder(OperationOptions options)Create a builder from an existing set of options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OperationOptionsbuild()Creates theOperationOptions.static OperationOptionsBuildercreate()Create a builder with an empty set of options.java.util.Map<java.lang.String,java.lang.Object>getOptions()Returns a mutable reference of the options map.OperationOptionsBuildersetAttributesToGet(java.lang.String... attrNames)Sets theOperationOptions.OP_ATTRIBUTES_TO_GEToption.OperationOptionsBuildersetAttributesToGet(java.util.Collection<java.lang.String> attrNames)Sets theOperationOptions.OP_ATTRIBUTES_TO_GEToption.OperationOptionsBuildersetContainer(QualifiedUid container)Convenience method to setOperationOptions.OP_CONTAINEROperationOptionsBuildersetOption(java.lang.String name, java.lang.Object value)Sets a given option and a value for that option.OperationOptionsBuildersetPagedResultsCookie(java.lang.String pagedResultsCookie)Convenience method to setOperationOptions.OP_PAGED_RESULTS_COOKIEOperationOptionsBuildersetPagedResultsOffset(java.lang.Integer pagedResultsOffset)Convenience method to setOperationOptions.OP_PAGED_RESULTS_OFFSETOperationOptionsBuildersetPageSize(java.lang.Integer pageSize)Convenience method to setOperationOptions.OP_PAGE_SIZEOperationOptionsBuildersetRunAsUser(java.lang.String user)Set the run as user option.OperationOptionsBuildersetRunWithPassword(GuardedString password)Set the run with password option.OperationOptionsBuildersetScope(java.lang.String scope)Convenience method to setOperationOptions.OP_SCOPEOperationOptionsBuildersetSortKeys(java.util.List<SortKey> sortKeys)Convenience method to setOperationOptions.OP_SORT_KEYSOperationOptionsBuildersetSortKeys(SortKey... sortKeys)Convenience method to setOperationOptions.OP_SORT_KEYSOperationOptionsBuildersetTotalPagedResultsPolicy(SearchResult.CountPolicy policy)Sets the policy for calculating the total number of paged results.
-
-
-
Constructor Detail
-
OperationOptionsBuilder
public OperationOptionsBuilder()
Create a builder with an empty set of options.
-
OperationOptionsBuilder
public OperationOptionsBuilder(OperationOptions options)
Create a builder from an existing set of options.- Parameters:
options- The existing set of options. Must not be null.
-
-
Method Detail
-
create
public static OperationOptionsBuilder create()
Create a builder with an empty set of options.- Returns:
- new and empty builder
- Since:
- 1.5
-
setOption
public OperationOptionsBuilder setOption(java.lang.String name, java.lang.Object value)
Sets a given option and a value for that option.- Parameters:
name- The name of the optionvalue- The value of the option. Must be one of the types that we can serialize. SeeObjectSerializerFactoryfor a list of supported types.
-
setAttributesToGet
public OperationOptionsBuilder setAttributesToGet(java.lang.String... attrNames)
Sets theOperationOptions.OP_ATTRIBUTES_TO_GEToption.- Parameters:
attrNames- list ofAttributenames.
-
setAttributesToGet
public OperationOptionsBuilder setAttributesToGet(java.util.Collection<java.lang.String> attrNames)
Sets theOperationOptions.OP_ATTRIBUTES_TO_GEToption.- Parameters:
attrNames- list ofAttributenames.
-
setRunWithPassword
public OperationOptionsBuilder setRunWithPassword(GuardedString password)
Set the run with password option.
-
setRunAsUser
public OperationOptionsBuilder setRunAsUser(java.lang.String user)
Set the run as user option.
-
setScope
public OperationOptionsBuilder setScope(java.lang.String scope)
Convenience method to setOperationOptions.OP_SCOPE- Parameters:
scope- The scope. May not be null.- Returns:
- A this reference to allow chaining
-
setContainer
public OperationOptionsBuilder setContainer(QualifiedUid container)
Convenience method to setOperationOptions.OP_CONTAINER- Parameters:
container- The container. May not be null.- Returns:
- A this reference to allow chaining
-
setPagedResultsCookie
public OperationOptionsBuilder setPagedResultsCookie(java.lang.String pagedResultsCookie)
Convenience method to setOperationOptions.OP_PAGED_RESULTS_COOKIE- Parameters:
pagedResultsCookie- The pagedResultsCookie. May not be null.- Returns:
- A this reference to allow chaining
- Since:
- 1.4
-
setTotalPagedResultsPolicy
public OperationOptionsBuilder setTotalPagedResultsPolicy(SearchResult.CountPolicy policy)
Sets the policy for calculating the total number of paged results. If no count policy is supplied or paged results are not requested a default ofSearchResult.CountPolicy.NONEwill be used. This will result in no count being performed and no overhead incurred.- Parameters:
policy- The policy used to calculate total paged results- Returns:
- A this reference to allow chaining
- Since:
- 1.5
- See Also:
SearchResult.getTotalPagedResultsPolicy(),SearchResult.getTotalPagedResults()
-
setPagedResultsOffset
public OperationOptionsBuilder setPagedResultsOffset(java.lang.Integer pagedResultsOffset)
Convenience method to setOperationOptions.OP_PAGED_RESULTS_OFFSET- Parameters:
pagedResultsOffset- The pagedResultsOffset. May not be null.- Returns:
- A this reference to allow chaining
- Since:
- 1.4
-
setPageSize
public OperationOptionsBuilder setPageSize(java.lang.Integer pageSize)
Convenience method to setOperationOptions.OP_PAGE_SIZE- Parameters:
pageSize- The pageSize. May not be null.- Returns:
- A this reference to allow chaining
- Since:
- 1.4
-
setSortKeys
public OperationOptionsBuilder setSortKeys(java.util.List<SortKey> sortKeys)
Convenience method to setOperationOptions.OP_SORT_KEYS- Parameters:
sortKeys- The sort keys. May not be null.- Returns:
- A this reference to allow chaining
- Since:
- 1.4
-
setSortKeys
public OperationOptionsBuilder setSortKeys(SortKey... sortKeys)
Convenience method to setOperationOptions.OP_SORT_KEYS- Parameters:
sortKeys- The sort keys. May not be null.- Returns:
- A this reference to allow chaining
- Since:
- 1.4
-
getOptions
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
Returns a mutable reference of the options map.- Returns:
- A mutable reference of the options map.
-
build
public OperationOptions build()
Creates theOperationOptions.- Returns:
- The newly-created
OperationOptions
-
-