Class ReferralImpl
- java.lang.Object
-
- org.apache.directory.api.ldap.model.message.ReferralImpl
-
- All Implemented Interfaces:
Referral
public class ReferralImpl extends Object implements Referral
A Referral implementation. For the time being this implementation uses a String representation for LDAPURLs. In the future an LdapUrl interface with default implementations will be used once a parser for an LdapUrl is created.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description ReferralImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLdapUrl(String url)
Adds an LDAPv3 URL to this Referral.void
addLdapUrlBytes(byte[] urlBytes)
Adds an encoded LDAPv3 URL to this Referral.boolean
equals(Object obj)
Compares this Referral implementation to see if it is the same as another.Collection<String>
getLdapUrls()
Gets an unmodifiable set of alternative referral urls.Collection<byte[]>
getLdapUrlsBytes()
Gets an unmodifiable set of encoded referral urls.int
getReferralLength()
int
hashCode()
void
removeLdapUrl(String url)
Removes an LDAPv3 URL to this Referral.void
setReferralLength(int referralLength)
Set the length of the referralString
toString()
Get a String representation of a Referral
-
-
-
Constructor Detail
-
ReferralImpl
public ReferralImpl()
-
-
Method Detail
-
getReferralLength
public int getReferralLength()
- Specified by:
getReferralLength
in interfaceReferral
- Returns:
- The total length of the Referral
-
setReferralLength
public void setReferralLength(int referralLength)
Set the length of the referral- Specified by:
setReferralLength
in interfaceReferral
- Parameters:
referralLength
- The total length of the Referral
-
getLdapUrls
public Collection<String> getLdapUrls()
Gets an unmodifiable set of alternative referral urls.- Specified by:
getLdapUrls
in interfaceReferral
- Returns:
- the alternative url objects.
-
getLdapUrlsBytes
public Collection<byte[]> getLdapUrlsBytes()
Gets an unmodifiable set of encoded referral urls.- Specified by:
getLdapUrlsBytes
in interfaceReferral
- Returns:
- the encoded url objects.
-
addLdapUrl
public void addLdapUrl(String url)
Adds an LDAPv3 URL to this Referral.- Specified by:
addLdapUrl
in interfaceReferral
- Parameters:
url
- the LDAPv3 URL to add
-
addLdapUrlBytes
public void addLdapUrlBytes(byte[] urlBytes)
Adds an encoded LDAPv3 URL to this Referral.- Specified by:
addLdapUrlBytes
in interfaceReferral
- Parameters:
urlBytes
- the encoded LDAPv3 URL to add
-
removeLdapUrl
public void removeLdapUrl(String url)
Removes an LDAPv3 URL to this Referral.- Specified by:
removeLdapUrl
in interfaceReferral
- Parameters:
url
- the LDAPv3 URL to remove
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- Returns:
- the instance's hash code
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
Compares this Referral implementation to see if it is the same as another. The classes do not have to be the same implementation to return true. Both this and the compared Referral must have the same entries exactly. The order of Referral URLs does not matter.
-
-