org.identityconnectors.framework.common.objects
Class OperationOptionsBuilder

java.lang.Object
  extended by org.identityconnectors.framework.common.objects.OperationOptionsBuilder

public final class OperationOptionsBuilder
extends Object

Builder for OperationOptions.


Constructor Summary
OperationOptionsBuilder()
          Create a builder with an empty set of options.
OperationOptionsBuilder(OperationOptions options)
          Create a builder from an existing set of options.
 
Method Summary
 OperationOptions build()
          Creates the OperationOptions.
 Map<String,Object> getOptions()
          Returns a mutable reference of the options map.
 OperationOptionsBuilder setAttributesToGet(Collection<String> attrNames)
          Sets the OperationOptions.OP_ATTRIBUTES_TO_GET option.
 OperationOptionsBuilder setAttributesToGet(String... attrNames)
          Sets the OperationOptions.OP_ATTRIBUTES_TO_GET option.
 OperationOptionsBuilder setContainer(QualifiedUid container)
          Convenience method to set OperationOptions.OP_CONTAINER
 OperationOptionsBuilder setOption(String name, Object value)
          Sets a given option and a value for that option.
 OperationOptionsBuilder setRunAsUser(String user)
          Set the run as user option.
 OperationOptionsBuilder setRunWithPassword(GuardedString password)
          Set the run with password option.
 OperationOptionsBuilder setScope(String scope)
          Convenience method to set OperationOptions.OP_SCOPE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

setOption

public OperationOptionsBuilder setOption(String name,
                                         Object value)
Sets a given option and a value for that option.

Parameters:
name - The name of the option
value - The value of the option. Must be one of the types that we can serialize. See ObjectSerializerFactory for a list of supported types.

setAttributesToGet

public OperationOptionsBuilder setAttributesToGet(String... attrNames)
Sets the OperationOptions.OP_ATTRIBUTES_TO_GET option.

Parameters:
attrNames - list of Attribute names.

setAttributesToGet

public OperationOptionsBuilder setAttributesToGet(Collection<String> attrNames)
Sets the OperationOptions.OP_ATTRIBUTES_TO_GET option.

Parameters:
attrNames - list of Attribute names.

setRunWithPassword

public OperationOptionsBuilder setRunWithPassword(GuardedString password)
Set the run with password option.


setRunAsUser

public OperationOptionsBuilder setRunAsUser(String user)
Set the run as user option.


setScope

public OperationOptionsBuilder setScope(String scope)
Convenience method to set OperationOptions.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 set OperationOptions.OP_CONTAINER

Parameters:
container - The container. May not be null.
Returns:
A this reference to allow chaining

getOptions

public Map<String,Object> getOptions()
Returns a mutable reference of the options map.

Returns:
A mutable reference of the options map.

build

public OperationOptions build()
Creates the OperationOptions.

Returns:
The newly-created OperationOptions


Copyright © 2012. All Rights Reserved.