com.ca.jcs.processor
Class AbstractAttributeStyleOpProcessor

java.lang.Object
  extended by com.ca.jcs.processor.AbstractBaseProcessor
      extended by com.ca.jcs.processor.AbstractAttributeStyleOpProcessor
All Implemented Interfaces:
Activatable, AttributeStyleOpProcessor, OpProcessor, PostQueryAttributesProcessor
Direct Known Subclasses:
AbstractAttributeStyleOpProcessorAssocDirect, AbstractAttributeStyleOpProcessorAssocIndirect, StubAttributeStyleOpProcessor

public abstract class AbstractAttributeStyleOpProcessor
extends AbstractBaseProcessor
implements AttributeStyleOpProcessor, PostQueryAttributesProcessor

Base class for attribute-style processors, that mandates a standardized constructor for maximum consistency. Provides the service of automatically initializing its proxiedSelf member, which should be used when OpBindings are supported, and may need to be triggered for calls that the attribute style processor makes to it's own methods. This member is automatically assigned to "this" when no such OpBindings are active due to the current metadata.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ca.jcs.processor.OpProcessor
OpProcessor.MethodName
 
Field Summary
protected  AttributeStyleOpProcessor proxiedSelf
          Set to "this" unless OpBindings are active in which case assigned to an OpBindings-aware proxy.
 
Fields inherited from class com.ca.jcs.processor.AbstractBaseProcessor
ldapExceptionPrefix, log
 
Constructor Summary
AbstractAttributeStyleOpProcessor(BaseConnector connector)
          Hang on to some important contextual values.
 
Method Summary
 void activate()
          Sets proxiedSelf to OpBindings-aware proxy if any OpBindings are configured, otherwise left assigned to "this".
 void deactivate()
          We also define this for symmetry as activate() is defined.
 Attribute doLookupExpensiveStub(ObjectInfo objInfo, String attrId)
          Default implementation is to simply do a lookup for attrId, but derived classes may be able to more efficiently find out if the attribute is set or not.
 boolean isPostQueryPocessingActive()
          Defaults to true.
 void processPostQueryAttributes(ObjectInfo objInfo, Attributes attrs)
          Called after attributes have been collected after a doLookUp or for each result returned by a doSearch.
 void processPostQuerySearchResult(ObjectInfo objInfo, Set<String> requestedConnAttrIds, Attributes attrs, SearchResult sr)
          Called after LDAP search result returned by a doSearch is finalized (note that PostQueryAttributesProcessor.processPostQueryAttributes(ObjectInfo, Attributes) will have already been called) to allow specialized processing.
 void setPostQueryPocessingActive(boolean postQueryPocessingActive)
           
 
Methods inherited from class com.ca.jcs.processor.AbstractBaseProcessor
getBaseConnector, makeNamingException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ca.jcs.processor.AttributeStyleOpProcessor
getMetaData, setMetaData
 
Methods inherited from interface com.ca.jcs.processor.OpProcessor
doAdd, doDelete, doLookUp, doModify, doModifyRn, doMove, doSearch
 

Field Detail

proxiedSelf

@NotNull
protected AttributeStyleOpProcessor proxiedSelf
Set to "this" unless OpBindings are active in which case assigned to an OpBindings-aware proxy.

Constructor Detail

AbstractAttributeStyleOpProcessor

public AbstractAttributeStyleOpProcessor(BaseConnector connector)
Hang on to some important contextual values.

Parameters:
connector - Parent baseConnector.
Method Detail

activate

public void activate()
              throws NamingException
Sets proxiedSelf to OpBindings-aware proxy if any OpBindings are configured, otherwise left assigned to "this".

Specified by:
activate in interface Activatable
Specified by:
activate in interface AttributeStyleOpProcessor
Throws:
NamingException

deactivate

public void deactivate()
                throws NamingException
We also define this for symmetry as activate() is defined.

Specified by:
deactivate in interface Activatable
Specified by:
deactivate in interface AttributeStyleOpProcessor
Throws:
NamingException

doLookupExpensiveStub

public Attribute doLookupExpensiveStub(ObjectInfo objInfo,
                                       String attrId)
                                throws NamingException
Default implementation is to simply do a lookup for attrId, but derived classes may be able to more efficiently find out if the attribute is set or not.

Specified by:
doLookupExpensiveStub in interface AttributeStyleOpProcessor
Parameters:
objInfo - Object for which attribute should be looked up.
attrId - Id for expensive attribute.
Returns:
Possibly less expensive placeholder for expensive attribute, if its possible to avoid looking it up fully.
Throws:
NamingException
See Also:
ValidationLazyAttributesProxy

isPostQueryPocessingActive

public boolean isPostQueryPocessingActive()
Defaults to true.

Specified by:
isPostQueryPocessingActive in interface PostQueryAttributesProcessor
Returns:
True if methods below (and possible opbindings) should be called.

setPostQueryPocessingActive

public void setPostQueryPocessingActive(boolean postQueryPocessingActive)
Specified by:
setPostQueryPocessingActive in interface PostQueryAttributesProcessor

processPostQueryAttributes

public void processPostQueryAttributes(ObjectInfo objInfo,
                                       Attributes attrs)
                                throws NamingException
Description copied from interface: PostQueryAttributesProcessor
Called after attributes have been collected after a doLookUp or for each result returned by a doSearch.

Specified by:
processPostQueryAttributes in interface PostQueryAttributesProcessor
Parameters:
objInfo - Information about object for which attrs were retrieved.
attrs - Connector-speak attributes.
Throws:
NamingException - If thrown then doLookUp will fail or search result will be skipped.

processPostQuerySearchResult

public void processPostQuerySearchResult(ObjectInfo objInfo,
                                         Set<String> requestedConnAttrIds,
                                         Attributes attrs,
                                         SearchResult sr)
                                  throws NamingException
Description copied from interface: PostQueryAttributesProcessor
Called after LDAP search result returned by a doSearch is finalized (note that PostQueryAttributesProcessor.processPostQueryAttributes(ObjectInfo, Attributes) will have already been called) to allow specialized processing.

Specified by:
processPostQuerySearchResult in interface PostQueryAttributesProcessor
Parameters:
objInfo - Information about object for which attrs were retrieved.
requestedConnAttrIds - Attributes requested by the top-level search which generated this SearchResult.
attrs - Connector-speak attributes.
sr - Search result in LDAP-speak that will be returned to the client after any manipulations done by this method.
Throws:
NamingException - If thrown then doLookUp will fail or search result will be skipped.


Created 2011-07-14 13:27 EST