public class BaseResource extends Object implements SCIMResponse
| Modifier and Type | Field and Description |
|---|---|
static ResourceFactory<BaseResource> |
BASE_RESOURCE_FACTORY
A
ResourceFactory for creating BaseResource
instances. |
| Constructor and Description |
|---|
BaseResource(ResourceDescriptor resourceDescriptor)
Construct an empty
BaseResource with the specified
ResourceDescriptor. |
BaseResource(ResourceDescriptor resourceDescriptor,
SCIMObject scimObject)
Construct a
BaseResource with the specified
ResourceDescriptor and backed by the given
SCIMObject. |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrReplaceMultiValuedValue(String name,
ComplexValue attributeValue)
Add or replace a value on a multi-valued attribute with the specified
name.
|
void |
addOrReplaceMultiValuedValue(String schema,
String name,
ComplexValue attributeValue)
Add or replace a value on a multi-valued attribute with the specified
schema and name.
|
boolean |
equals(Object o) |
<T> Collection<T> |
getAttributeValues(String schema,
String name,
AttributeValueResolver<T> resolver)
Retrieves a multi-valued attribute value.
|
ComplexValue |
getComplexAttributeValue(String name)
Get a complex attribute with the specified name.
|
ComplexValue |
getComplexAttributeValue(String schema,
String name)
Get a complex attribute with the specified name and schema.
|
String |
getExternalId()
Retrieves the unique identifier for the Resource as defined by the
Service Consumer.
|
String |
getId()
Retrieves the unique identifier for the SCIM Resource as defined by
the Service Provider.
|
Meta |
getMeta()
Retrieves the metadata about the resource.
|
Collection<ComplexValue> |
getMultiValuedAttribute(String name)
Get the values of a multi-valued attribute with the specified name.
|
Collection<ComplexValue> |
getMultiValuedAttribute(String schema,
String name)
Get the values of the multi-valued attribute specified by schema and
attribute name.
|
ResourceDescriptor |
getResourceDescriptor()
Retrieves the
ResourceDescriptor for this resource. |
SCIMObject |
getScimObject()
Retrieves the
SCIMObject wrapped by this resource. |
SimpleValue |
getSimpleAttributeValue(String name)
Get a simple attribute with the specified name.
|
SimpleValue |
getSimpleAttributeValue(String schema,
String name)
Get a simple attribute with the specified name and schema.
|
<T> T |
getSingularAttributeValue(String schema,
String name,
AttributeValueResolver<T> resolver)
Retrieves a singular attribute value.
|
int |
hashCode() |
void |
marshal(Marshaller marshaller,
OutputStream outputStream)
Marshals this response using the specified
Marshaller to the
specified OutputStream. |
<T> void |
setAttributeValues(String schema,
String name,
AttributeValueResolver<T> resolver,
Collection<T> values)
Sets a multi-valued attribute value.
|
void |
setComplexAttribute(String name,
ComplexValue attributeValue)
Set a complex attribute value with the specified name.
|
void |
setComplexAttribute(String schema,
String name,
ComplexValue attributeValue)
Set a complex attribute value with the specified schema and name.
|
void |
setExternalId(String externalId)
Sets the unique identifier for the Resource as defined by the Service
Consumer.
|
void |
setId(String id)
Sets the unique identifier for the SCIM Resource.
|
void |
setMeta(Meta meta)
Sets the metadata about the resource.
|
void |
setMultiValuedAttribute(String name,
Collection<ComplexValue> values)
Set all values of a multi-valued attribute with the specified name.
|
void |
setMultiValuedAttribute(String schema,
String name,
Collection<ComplexValue> values)
Set all values of a multi-valued attribute with the specified schema and
name.
|
void |
setSimpleAttribute(String name,
SimpleValue value)
Set a simple attribute value with the specified name, using an
AttributeValueResolver appropriate for the attribute
data type. |
void |
setSimpleAttribute(String schema,
String name,
SimpleValue value)
Set a simple attribute value with the specified schema and name,
using an
AttributeValueResolver appropriate for
the attribute data type. |
<T> void |
setSingularAttributeValue(String schema,
String name,
AttributeValueResolver<T> resolver,
T value)
Sets a singular attribute value.
|
String |
toString() |
public static final ResourceFactory<BaseResource> BASE_RESOURCE_FACTORY
ResourceFactory for creating BaseResource
instances.public BaseResource(ResourceDescriptor resourceDescriptor, SCIMObject scimObject)
BaseResource with the specified
ResourceDescriptor and backed by the given
SCIMObject.resourceDescriptor - The resource descriptor for this SCIM resource.scimObject - The SCIMObject containing all the
SCIM attributes and their values.public BaseResource(ResourceDescriptor resourceDescriptor)
BaseResource with the specified
ResourceDescriptor.resourceDescriptor - The resource descriptor for this SCIM resource.public ResourceDescriptor getResourceDescriptor()
ResourceDescriptor for this resource.ResourceDescriptor for this resource.public SCIMObject getScimObject()
SCIMObject wrapped by this resource.SCIMObject wrapped by this resource.public String getId()
public void setId(String id)
id - The unique identifier for the SCIM Resource.public String getExternalId()
public void setExternalId(String externalId)
externalId - The unique identifier for the Resource as defined by the
Service Consumer.public Meta getMeta()
public void setMeta(Meta meta)
meta - The metadata about the resource.public <T> T getSingularAttributeValue(String schema, String name, AttributeValueResolver<T> resolver)
T - The type of the resolved instance representing the value of
sub-attribute.schema - The schema URI of the attribute value to retrieve.name - The name of the attribute value to retrieve.resolver - The AttributeValueResolver the should be used
to resolve the value to an instance.null if the specified
attribute does not exist.public <T> void setSingularAttributeValue(String schema, String name, AttributeValueResolver<T> resolver, T value) throws InvalidResourceException
T - The type of the resolved instance representing the value of
sub-attribute.schema - The schema URI of the attribute value to retrieve.name - The name of the attribute value to retrieve.resolver - The AttributeValueResolver the should be used
to resolve the instance to attribute value.value - The value instance.InvalidResourceException - if the attribute is not defined by the
resource.public <T> Collection<T> getAttributeValues(String schema, String name, AttributeValueResolver<T> resolver)
T - The type of the resolved instance representing the value of
sub-attribute.schema - The schema URI of the attribute value to retrieve.name - The name of the attribute value to retrieve.resolver - The AttributeValueResolver the should be used
to resolve the value to an instance.null if
the specified attribute does not exist.public <T> void setAttributeValues(String schema, String name, AttributeValueResolver<T> resolver, Collection<T> values) throws InvalidResourceException
T - The type of the resolved instance representing the value of
sub-attribute.schema - The schema URI of the attribute value to retrieve.name - The name of the attribute value to retrieve.resolver - The AttributeValueResolver the should be used
to resolve the instance to attribute value.values - The value instances.InvalidResourceException - if the attribute is not defined by the
resource.public void setSimpleAttribute(String name, SimpleValue value) throws InvalidResourceException
AttributeValueResolver appropriate for the attribute
data type.name - the name of the attribute to be set, must be unique among all
schemas in use by the Resource.value - the new attribute value.InvalidResourceException - if no attribute with the specified name
is defined on the Resource, if the name is ambiguous, or if the
attribute is not of a simple data type.public void setSimpleAttribute(String schema, String name, SimpleValue value) throws InvalidResourceException
AttributeValueResolver appropriate for
the attribute data type.schema - Schema URI of the attribute to be set.name - the name of the attribute to be set.value - the new attribute value.InvalidResourceException - if no attribute with the specified name
is defined by the schema, or if the attribute is not of a simple data
type.public void setComplexAttribute(String name, ComplexValue attributeValue) throws InvalidResourceException
name - the name of the attribute to be set, must be unique among all
schemas in use by the Resource.attributeValue - ComplexValue object containing a map of
sub-attribute names and valuesInvalidResourceException - if no attribute with the specified name
is defined on the Resource, if the name is ambiguous, or if the
attribute is not of a complex data type.public void setComplexAttribute(String schema, String name, ComplexValue attributeValue) throws InvalidResourceException
schema - Schema URI of the attribute to be set.name - The name of the attribute to be set.attributeValue - ComplexValue object containing a map of
sub-attribute names and values.InvalidResourceException - if the name is not defined by the
specified schema or the attribute is not of a complex data type.public void setMultiValuedAttribute(String name, Collection<ComplexValue> values) throws InvalidResourceException
name - The name of the attribute to be set, must be unique among all
schemas in use by the Resource.values - A collection of complex attribute values.InvalidResourceException - if no attribute with the specified name
is defined on the Resource, if the name is ambiguous, or if the
attribute is not multi-valued.public void setMultiValuedAttribute(String schema, String name, Collection<ComplexValue> values) throws InvalidResourceException
schema - Schema URI of the attribute to be set.name - The name of the attribute to be set.values - A collection of complex attribute values.InvalidResourceException - if the name is not defined by the
specified schema or if the attribute is not multi-valued.public void addOrReplaceMultiValuedValue(String name, ComplexValue attributeValue) throws InvalidResourceException
name - The name of the attribute to be set, must be unique among all
schemas in use by the Resource.attributeValue - the complex attribute value.InvalidResourceException - if no attribute with the specified name
is defined on the Resource, if the name is ambiguous, or if the
attribute is not multi-valued.public void addOrReplaceMultiValuedValue(String schema, String name, ComplexValue attributeValue) throws InvalidResourceException
schema - Schema URI of the attribute to be set.name - The name of the attribute to be set.attributeValue - the complex attribute value .InvalidResourceException - if the attribute name is not
defined by the specified schema or if the attribute is not
multi-valued.public SimpleValue getSimpleAttributeValue(String name) throws InvalidResourceException
name - The name of the attribute to retrieve, must be unique among
all schemas in use by the Resource.InvalidResourceException - if no attribute with the specified name
is defined on the Resource, or if the name is ambiguous.public SimpleValue getSimpleAttributeValue(String schema, String name) throws InvalidResourceException
schema - The schema URI of the attribute to retrieve.name - The name of the attribute to retrieve.InvalidResourceException - if the attribute is not defined
by the resource schema or is not of a simple type.public ComplexValue getComplexAttributeValue(String name) throws InvalidResourceException
name - The name of the attribute to retrieve, must be unique among
all schemas in use by the Resource.InvalidResourceException - if no attribute with the specified name
is defined on the Resource, or if the name is ambiguous.public ComplexValue getComplexAttributeValue(String schema, String name) throws InvalidResourceException
schema - The schema URI of the attribute to retrieve.name - The name of the attribute to retrieve.InvalidResourceException - if the attribute is not defined
by the resource schema or is not complex.public Collection<ComplexValue> getMultiValuedAttribute(String name) throws InvalidResourceException
name - The name of the attribute to retrieve, must be unique among
all schemas in use by the Resource.InvalidResourceException - if the attribute is not defined by
this SCIMResource or if the attribute is not multi-valued.public Collection<ComplexValue> getMultiValuedAttribute(String schema, String name) throws InvalidResourceException
schema - The schema URI of the attribute to retrieve.name - The name of the attribute to retrieve.InvalidResourceException - if the attribute is not defined by
this SCIMResource or if the attribute is not multi-valued.public void marshal(Marshaller marshaller, OutputStream outputStream) throws Exception
Marshaller to the
specified OutputStream.marshal in interface SCIMResponsemarshaller - The Marshaller to use.outputStream - The OutputStream to write to.Exception - if an error occurs while performing the marshaling.Copyright © 2011–2016 UnboundID. All rights reserved.