systemic.sif.sbpframework.publisher
Class SBPBasePublisher

java.lang.Object
  extended by systemic.sif.sifcommon.BaseInfo
      extended by systemic.sif.sifcommon.publisher.BasePublisher
          extended by systemic.sif.sbpframework.publisher.SBPBasePublisher
All Implemented Interfaces:
java.lang.Runnable, openadk.library.Publisher

public abstract class SBPBasePublisher
extends systemic.sif.sifcommon.publisher.BasePublisher

Note:

Publishers that are part of the SBP must extend this SBPBasePublisher. If your agent deals with other SIF objects than the ones defined in the SBP then you should extends the NoneSBPBasePublisher class for these objects and not this class. If you use this class for any other SIF objects than defined in the SBP the behaviour is unknown, most likely will cause your agent to crash.

Author:
Joerg Huber

Constructor Summary
SBPBasePublisher(java.lang.String publisherID, openadk.library.ElementDef dtd)
           
 
Method Summary
abstract  systemic.sif.sifcommon.publisher.SIFResponseIterator getAllSIFObjects(openadk.library.Query query, openadk.library.Zone zone)
          This method is called if an unbound query is received by this publisher.
 systemic.sif.sifcommon.publisher.SIFResponseIterator getObjectsByGenericQuery(openadk.library.Query query, openadk.library.Zone zone)
          This is the default implementation for all SIF Queries that are not based on either the unbounded query or primary key query.
 systemic.sif.sifcommon.publisher.SIFResponseIterator getRequestedSIFObjects(openadk.library.Query query, openadk.library.Zone zone)
           
abstract  openadk.library.SIFDataObject getSIFObjectByPrimaryKey(java.util.List<SIFObjectKey> keyValues, openadk.library.Query query, openadk.library.Zone zone)
          This method is called if the SIF Query has conditions for the Primary Key of the object this publisher deals with.
 
Methods inherited from class systemic.sif.sifcommon.publisher.BasePublisher
broadcastEvents, finalise, getEventsFromFile, getObjectsFromFile, getOptions, getSIFEvents, loadXMLFileData, onRequest, run, setOptions, shutdownPublisher
 
Methods inherited from class systemic.sif.sifcommon.BaseInfo
getAgentConfig, getAgentID, getAgentProperties, getAgentProperty, getApplicationID, getDtd, getFrameworkProperties, getId, getMappings, getZoneByID, getZones, isValidZone, setAgentConfig, setAgentID, setAgentProperties, setApplicationID, setDtd, setFrameworkProperties, setId, setMappings, setZones
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SBPBasePublisher

public SBPBasePublisher(java.lang.String publisherID,
                        openadk.library.ElementDef dtd)
Method Detail

getAllSIFObjects

public abstract systemic.sif.sifcommon.publisher.SIFResponseIterator getAllSIFObjects(openadk.library.Query query,
                                                                                      openadk.library.Zone zone)
                                                                               throws openadk.library.ADKException,
                                                                                      openadk.library.SIFException
This method is called if an unbound query is received by this publisher. According to the SIF Specification and the SBP Specification this should return all objects for the SIF Object Type of this class.

Parameters:
query - Note this query will have no conditions but it may have field restrictions and therefore the need to have it available in this method.
zone - The Zone from which the query has been received. Maybe there is a need to know what that is.
Returns:
SIFResponseIterator for ALL objects from your system that are managed by this publisher (i.e StudentPersonal)
Throws:
openadk.library.ADKException - If there is an error with retrieving data.
openadk.library.SIFException - If the query cannot be dealt with (ie not supported). In this case the following fields must be set:
Error Category of SIFErrorCategory.REQUEST_RESPONSE and
An Error Code of SIFErrorCodes.REQRSP_UNSUPPORTED_QUERY_9

getSIFObjectByPrimaryKey

public abstract openadk.library.SIFDataObject getSIFObjectByPrimaryKey(java.util.List<SIFObjectKey> keyValues,
                                                                       openadk.library.Query query,
                                                                       openadk.library.Zone zone)
                                                                throws openadk.library.ADKException,
                                                                       openadk.library.SIFException
This method is called if the SIF Query has conditions for the Primary Key of the object this publisher deals with. Since this method is called for an object based on its primary key it only returns one SIF Object instead of a list. The query is given as a parameter but there is no need to inspect the condition because this is done for you and the key values are given by the 'keyValues' parameter. The query object is only required to determine the field restrictions. The 'keyValues' are given in xpath notation.

Example:

keyValues[0].xpathToKey=@RefId, keyValues[0].keyValue=D3E34B359D75101A8C3D00AA001A1652

Note:

Some objects such as the StudentContactRelationship are made up of a compound key and therefore the example above could look like this: keyValues[0].xpathToKey=@StudentPersonalRefId, keyValues[0].keyValue=02834EA9EDA12090347F83297E1C290D

keyValues[1].xpathToKey=@StudentContactPersonalRefId, keyValues[1].keyValue=6472B2610947583A463DBB345291B001

Parameters:
keyValues - The key names (xpath notation) and values of this objects primary key.
query - Query condition and Field restrictions.
zone - The Zone from which the query has been received. Maybe there is a need to know what that is.
Returns:
The SIF Object that matches the primary key. Null if no such object exists.
Throws:
openadk.library.ADKException - If there is an error with retrieving data.
openadk.library.SIFException - If the query cannot be dealt with (ie not supported). In this case the following fields must be set:
Error Category of SIFErrorCategory.REQUEST_RESPONSE and
An Error Code of SIFErrorCodes.REQRSP_UNSUPPORTED_QUERY_9

getObjectsByGenericQuery

public systemic.sif.sifcommon.publisher.SIFResponseIterator getObjectsByGenericQuery(openadk.library.Query query,
                                                                                     openadk.library.Zone zone)
                                                                              throws openadk.library.ADKException,
                                                                                     openadk.library.SIFException
This is the default implementation for all SIF Queries that are not based on either the unbounded query or primary key query. By default it returns a Query Not Supported message to the ZIS but it is expected if this publisher can deal with any other type of query that this method is overridden.

Parameters:
query - The query.
zone - The zone from which the qury has been received
Returns:
SIFResponseIterator returning SIF Objects that match the given query.
Throws:
openadk.library.ADKException - If there is an error with retrieving data.
openadk.library.SIFException - Default implementation of this method If the query cannot be dealt with (ie not supported). In this case the following fields must be set:
Error Category of SIFErrorCategory.REQUEST_RESPONSE and
An Error Code of SIFErrorCodes.REQRSP_UNSUPPORTED_QUERY_9

getRequestedSIFObjects

public systemic.sif.sifcommon.publisher.SIFResponseIterator getRequestedSIFObjects(openadk.library.Query query,
                                                                                   openadk.library.Zone zone)
                                                                            throws openadk.library.ADKException,
                                                                                   openadk.library.SIFException
Specified by:
getRequestedSIFObjects in class systemic.sif.sifcommon.publisher.BasePublisher
Throws:
openadk.library.ADKException
openadk.library.SIFException