org.apache.directory.api.ldap.model.message
Class ReferralImpl

java.lang.Object
  extended by 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
ReferralImpl()
           
 
Method Summary
 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 referral
 String toString()
          Get a String representation of a Referral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferralImpl

public ReferralImpl()
Method Detail

getReferralLength

public int getReferralLength()

Specified by:
getReferralLength in interface Referral
Returns:
The total length of the Referral

setReferralLength

public void setReferralLength(int referralLength)
Set the length of the referral

Specified by:
setReferralLength in interface Referral
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 interface Referral
Returns:
the alternative url objects.

getLdapUrlsBytes

public Collection<byte[]> getLdapUrlsBytes()
Gets an unmodifiable set of encoded referral urls.

Specified by:
getLdapUrlsBytes in interface Referral
Returns:
the encoded url objects.

addLdapUrl

public void addLdapUrl(String url)
Adds an LDAPv3 URL to this Referral.

Specified by:
addLdapUrl in interface Referral
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 interface Referral
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 interface Referral
Parameters:
url - the LDAPv3 URL to remove

hashCode

public int hashCode()
Overrides:
hashCode in class Object
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.

Overrides:
equals in class Object
Parameters:
obj - the object to compare this ReferralImpl to
Returns:
true if both implementations contain exactly the same URLs

toString

public String toString()
Get a String representation of a Referral

Overrides:
toString in class Object
Returns:
A Referral String


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.