org.ldaptive.ad.handler
Class AbstractBinaryAttributeHandler

java.lang.Object
  extended by org.ldaptive.handler.AbstractSearchEntryHandler
      extended by org.ldaptive.ad.handler.AbstractBinaryAttributeHandler
All Implemented Interfaces:
Handler<SearchRequest,SearchEntry>, SearchEntryHandler
Direct Known Subclasses:
ObjectGuidHandler, ObjectSidHandler

public abstract class AbstractBinaryAttributeHandler
extends AbstractSearchEntryHandler

Base class for entry handlers that convert a binary attribute to it's string form.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
 
Fields inherited from class org.ldaptive.handler.AbstractSearchEntryHandler
logger
 
Constructor Summary
AbstractBinaryAttributeHandler()
           
 
Method Summary
protected abstract  String convertValue(byte[] value)
          Converts the supplied binary value to it's string form.
 String getAttributeName()
          Returns the attribute name to convert from binary to string.
protected  void handleAttributes(Connection conn, SearchRequest request, SearchEntry entry)
          Handle the attributes of a search entry.
 void initializeRequest(SearchRequest request)
          Initialize the search request for use with this entry handler.
 void setAttributeName(String name)
          Sets the attribute name to convert from binary to string.
 
Methods inherited from class org.ldaptive.handler.AbstractSearchEntryHandler
equals, handle, handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBinaryAttributeHandler

public AbstractBinaryAttributeHandler()
Method Detail

getAttributeName

public String getAttributeName()
Returns the attribute name to convert from binary to string.

Returns:
attribute name

setAttributeName

public void setAttributeName(String name)
Sets the attribute name to convert from binary to string.

Parameters:
name - of the attribute

handleAttributes

protected void handleAttributes(Connection conn,
                                SearchRequest request,
                                SearchEntry entry)
                         throws LdapException
Handle the attributes of a search entry.

Overrides:
handleAttributes in class AbstractSearchEntryHandler
Parameters:
conn - the search was performed on
request - used to find the search entry
entry - search entry to extract the attributes from
Throws:
LdapException - if the LDAP returns an error

convertValue

protected abstract String convertValue(byte[] value)
Converts the supplied binary value to it's string form.

Parameters:
value - to convert
Returns:
string form of the value

initializeRequest

public void initializeRequest(SearchRequest request)
Initialize the search request for use with this entry handler.

Specified by:
initializeRequest in interface SearchEntryHandler
Overrides:
initializeRequest in class AbstractSearchEntryHandler
Parameters:
request - to initialize for this entry handler


Copyright © 2003-2015 Virginia Tech. All Rights Reserved.