thinkmap.datasource.util
Class FilterEntityHandler

java.lang.Object
  extended by thinkmap.datasource.util.FilterEntityHandler
All Implemented Interfaces:
IEntityHandler

public abstract class FilterEntityHandler
extends Object
implements IEntityHandler

FilterEntityHandler provides an implementation of IEntityHandler where all methods simply call through to another handler. Useful if your handler is only interested in one or two messages.

Version:
$Id: FilterEntityHandler.java,v 1.2 2004/05/11 13:57:57 tinkler Exp $

Field Summary
protected  IEntityHandler underlyingHandler
           
 
Fields inherited from interface thinkmap.datasource.IEntityHandler
ADD_REQUEST, ATTR_CACHE_REVISION, DELETE_REQUEST, EDGE, ENTITY_REQUEST, FLAG_NO_CACHE, FLAGS, FLAGS_DEFAULT, ID_REQUEST, LIST_ENTITIES_REQUEST, METADATA_REQUEST, NODE, NULL_REQUEST, QUERY_MAX_RESULTS, QUERY_STARTING_RESULT_NUMBER, QUERY_STRING, RELATED_REQUEST, RESERVED_ID_MAX, SINK, SOURCE, TOTAL_RESULTS, UNLIMITED_RESULTS, UPDATE_REQUEST
 
Constructor Summary
FilterEntityHandler(IEntityHandler underlyingHandler)
          Creates a new FilterEntityHandler object.
 
Method Summary
 void attribute(String name, Object value)
          Send a message attribute.
 void beginEntity()
          Begin an entity.
 void beginEntityMD(String parentType)
          Begin entity metadata.
 void beginId(String entityType)
          Begin an entity ID.
 void beginMessage(int messageType)
          Begin a message.
 void beginRelatedEntity(String propertyName, boolean reciprocal)
          A related entity.
 void beginRelatedList(byte i)
          Begin the list of related entities.
 void endEntity()
          End an entity.
 void endEntityMD()
          End entity metadata.
 void endId()
          End an entity ID.
 void endMessage()
          End a message.
 void endRelatedEntity()
          End a related entity.
 void endRelatedList()
          Mark the end of a related list.
 void error(Exception e)
          Tell the entity source about an error.
 void fatalError(Exception e)
          A fatal error occured.
 void idKey(Object o)
          Send an id key.
 void idKeyMD(Class o)
          Describe an entity id's key.
 void property(String name, Object value)
          Send an entity's property.
 void propertyMD(String name, Class type)
          Describe an entity's property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

underlyingHandler

protected IEntityHandler underlyingHandler
Constructor Detail

FilterEntityHandler

public FilterEntityHandler(IEntityHandler underlyingHandler)
Creates a new FilterEntityHandler object.

Parameters:
underlyingHandler - IEntityHandler to be filtered
Method Detail

beginMessage

public void beginMessage(int messageType)
Description copied from interface: IEntityHandler
Begin a message.

Specified by:
beginMessage in interface IEntityHandler
Parameters:
messageType - one of the request types below, eg RELATED_REQUEST

attribute

public void attribute(String name,
                      Object value)
Description copied from interface: IEntityHandler
Send a message attribute. See the grammar above; this is sent only at the top level of a message, before entities (if any) are sent.

Specified by:
attribute in interface IEntityHandler
Parameters:
name - The attribute's name
value - The attribute's value

beginEntity

public void beginEntity()
Description copied from interface: IEntityHandler
Begin an entity.

Specified by:
beginEntity in interface IEntityHandler

endEntity

public void endEntity()
Description copied from interface: IEntityHandler
End an entity.

Specified by:
endEntity in interface IEntityHandler

beginEntityMD

public void beginEntityMD(String parentType)
Description copied from interface: IEntityHandler
Begin entity metadata.

Specified by:
beginEntityMD in interface IEntityHandler
Parameters:
parentType - The parent type of this entity, eg NODE or EDGE.

endEntityMD

public void endEntityMD()
Description copied from interface: IEntityHandler
End entity metadata.

Specified by:
endEntityMD in interface IEntityHandler

property

public void property(String name,
                     Object value)
Description copied from interface: IEntityHandler
Send an entity's property. Primary data-transmission point.

Specified by:
property in interface IEntityHandler

propertyMD

public void propertyMD(String name,
                       Class type)
Description copied from interface: IEntityHandler
Describe an entity's property.

Specified by:
propertyMD in interface IEntityHandler

beginId

public void beginId(String entityType)
Description copied from interface: IEntityHandler
Begin an entity ID.

Specified by:
beginId in interface IEntityHandler
Parameters:
entityType - The type of entity being sent.

endId

public void endId()
Description copied from interface: IEntityHandler
End an entity ID.

Specified by:
endId in interface IEntityHandler

idKey

public void idKey(Object o)
Description copied from interface: IEntityHandler
Send an id key.

Specified by:
idKey in interface IEntityHandler
Parameters:
o - A key in an entity ID.

idKeyMD

public void idKeyMD(Class o)
Description copied from interface: IEntityHandler
Describe an entity id's key.

Specified by:
idKeyMD in interface IEntityHandler
Parameters:
o - Describe an entity ID's key.

beginRelatedList

public void beginRelatedList(byte i)
Description copied from interface: IEntityHandler
Begin the list of related entities.

Specified by:
beginRelatedList in interface IEntityHandler
Parameters:
i - one of: FLAGS_DEFAULT, FLAG_NO_CACHE

endRelatedList

public void endRelatedList()
Description copied from interface: IEntityHandler
Mark the end of a related list.

Specified by:
endRelatedList in interface IEntityHandler

beginRelatedEntity

public void beginRelatedEntity(String propertyName,
                               boolean reciprocal)
Description copied from interface: IEntityHandler
A related entity. Generally only EDGEs have related entities, and they have two of them (SOURCE and SINK).

Specified by:
beginRelatedEntity in interface IEntityHandler
Parameters:
propertyName - either SOURCE or SINK.
reciprocal - should this connection go both ways? SOURCE should always be reciprocal, and SINK should be reciprocal for a bidirectional edge.

endRelatedEntity

public void endRelatedEntity()
Description copied from interface: IEntityHandler
End a related entity.

Specified by:
endRelatedEntity in interface IEntityHandler

endMessage

public void endMessage()
Description copied from interface: IEntityHandler
End a message.

Specified by:
endMessage in interface IEntityHandler

error

public void error(Exception e)
Description copied from interface: IEntityHandler
Tell the entity source about an error. The message must still be well- formed; this is not an abort.

Specified by:
error in interface IEntityHandler
Parameters:
e - The cause.

fatalError

public void fatalError(Exception e)
Description copied from interface: IEntityHandler
A fatal error occured. This is an abort, so don't expect the message to be properly finished.

Specified by:
fatalError in interface IEntityHandler
Parameters:
e - The cause.


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.