public class Referrals extends Object implements Cloneable
Referrals
provides methods to maintain
a collection of Referral
objects that can be
applied to a policy. This class provides methods to add, replace
and remove Referral
objects from this referrals collection.
The Policy
object provides methods to set
Referrals
, which identifies referrals to whom the
the policy applies.Modifier | Constructor and Description |
---|---|
protected |
Referrals()
Constructor used by the
Policy object
to get a default instance of the Referrals |
protected |
Referrals(PolicyManager pm,
Node referralsNode)
Constructor used by
Policy to obtain
an instance of Referrals from the
XML document |
|
Referrals(String name,
String description)
Constructor to obtain an instance of
Referrals
to hold collection of referrals represented as
Referral |
Modifier and Type | Method and Description |
---|---|
void |
addReferral(Referral referral)
Adds a
Referral object to the this instance
of user collection. |
void |
addReferral(String referralName,
Referral referral)
Adds a
Referral object to the this instance
of user collection. |
Object |
clone()
Returns a new copy of this object with the identical
set of user collections (referrals).
|
boolean |
equals(Object o)
Checks if two
Referrals are identical. |
String |
getDescription()
Returns the description for the collection of referrals
represented as
Referral |
String |
getName()
Returns the name for the collection of referrals
represented as
Referral |
Referral |
getReferral(String referralName)
Returns the
Referral object associated
with the given referral name. |
String |
getReferralName(Referral referral)
Returns the name associated with the given referral object.
|
Set |
getReferralNames()
Returns the names of
Referral objects
contained in this object. |
Referral |
removeReferral(Referral referral)
Removes the
Referral object identified by
object's equals method. |
Referral |
removeReferral(String referralName)
Removes the
Referral object identified by
the referral name. |
void |
replaceReferral(String referralName,
Referral referral)
Replaces an existing referral object having the same name
with the new one.
|
void |
setDescription(String description)
Sets the description for this instance of the
Referrals |
void |
setName(String name)
Sets the name for this instance of the
Referrals |
String |
toString()
Returns XML string representation of the referral
(user collection) object.
|
protected String |
toXML()
Returns an XML representaion of this
Referrals object |
protected Referrals()
Policy
object
to get a default instance of the Referrals
protected Referrals(PolicyManager pm, Node referralsNode) throws InvalidFormatException, InvalidNameException, NameNotFoundException, PolicyException
Policy
to obtain
an instance of Referrals
from the
XML documentpm
- PolicyManager
to initialize the
Referrals
withreferralsNode
- node that repersents the ReferralsInvalidFormatException
- if the node passed in does not
conform to expected formatInvalidNameException
- if the name specified in the
Node for Referrals
is invalidNameNotFoundException
- need to add the situations that would
cause thisPolicyException
- if can not construct Referrals
public String getName()
Referral
public String getDescription()
Referral
public void setName(String name)
Referrals which contains a collection
of referrals respresented as Referral
.
name
- for the collection of referralspublic void setDescription(String description)
Referrals which contains a collection
of referrals respresented as Referral
.
description
- description for the collection referralspublic Set getReferralNames()
Referral
objects
contained in this object.Referral
contained in
this objectpublic Referral getReferral(String referralName) throws NameNotFoundException
Referral
object associated
with the given referral name.referralName
- name of the referral objectReferral
object corresponding to referral nameNameNotFoundException
- if a referral
with the given name is not presentpublic void addReferral(Referral referral) throws NameAlreadyExistsException
Referral
object to the this instance
of user collection. Since the name is not provided it
will be dynamically assigned such that it is unique within
this instance of the user collection. However if a referral
entry with the same name already exists in the user collection
NameAlreadyExistsException
will be thrown.referral
- instance of the referral object added to this
collectionNameAlreadyExistsException
- if a
referral object is present with the same namepublic void addReferral(String referralName, Referral referral) throws NameAlreadyExistsException
Referral
object to the this instance
of user collection. If another referral with the same name
already exists in the user collection
NameAlreadyExistsException
will be thrown.referralName
- name for the referral instancereferral
- instance of the referral object added to this
collectionNameAlreadyExistsException
- if a
referral object is present with the same namepublic void replaceReferral(String referralName, Referral referral) throws NameNotFoundException
Referral
with the given
name does not exist, NameNotFoundException
will be thrown.referralName
- name for the referral instancereferral
- instance of the referral object that will
replace another referral object having the given nameNameNotFoundException
- if a referral instance
with the given name is not presentpublic Referral removeReferral(String referralName)
Referral
object identified by
the referral name. If a referral instance with the given
name does not exist, the method will return silently.referralName
- name of the referral instance that
will be removed from the user collectionpublic Referral removeReferral(Referral referral)
Referral
object identified by
object's equals
method. If a referral instance
does not exist, the method will return silently.referral
- referral object that
will be removed from the user collectionpublic String getReferralName(Referral referral)
equals
method on the referral
to determine equality. If a referral instance that matches
the given referral object is not present, the method
returns null
.referral
- referral object for which this method will
return its associated namenull
if not presentpublic boolean equals(Object o)
Referrals
are identical.
Two referrals (or user collections) are identical only
if both have the same set of Referral
objects.public Object clone()
public String toString()
protected String toXML()
Referrals
objectCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.