ilog.tgo.datasource
Class IltDefaultDataSource

java.lang.Object
  extended by ilog.cpl.datasource.IlpAbstractDataSource
      extended by ilog.cpl.datasource.IlpDefaultDataSource
          extended by ilog.tgo.datasource.IltDefaultDataSource
All Implemented Interfaces:
IlpDataSource, IlpMutableDataSource, AttributeValueListener, ilog.cpl.storage.internal.IlpSAXDataHandlerFactory, IlvBatchable, EventListener

public class IltDefaultDataSource
extends IlpDefaultDataSource

Data source dedicated to support IltObject class and its subclasses.

Since:
JTGO 3.0

Constructor Summary
IltDefaultDataSource()
          Default constructor.
IltDefaultDataSource(IlpContext context)
          Constructor.
 
Method Summary
protected  List addChildrenObjects(IlpObject ilpObject)
          Adds also the objects that are children of the given object.
 void addObject(IlpObject ilpObject)
          Adds an object to the data source.
 void attributeValueChange(AttributeValueEvent ev)
          This method is called when an attribute value of an IlpObject in the data source is changed.
 ilog.cpl.storage.internal.IlpSAXDataHandler createDataHandler(IlpMutableDataSource dataSource, XMLReader parser, IlpIdentifierFactory identifierFactory, IlpFilter pfilter, Object parentIdOfRootObjects, boolean buffering, Logger logger)
          Creates a new datasource data handler.
 boolean isHandlingAlarmReferences()
          Returns whether the data source handles or not references between IltAlarms and IltObjects.
protected  boolean isInShelf(IlpObject child)
          Returns if the given object is an object contained in a shelf or one of its children.
protected  void removeObjectFromParent(IlpObject ilpObject)
          Removes the given object from its current parent.
 void setChildren(Object idOrIlpObject, List childrenIdsOrIlpObjects)
          Declares an object as having children.
 void setHandlingAlarmReferences(boolean value)
          Sets the data source behavior regarding references between IltAlarms and IltObjects.
 void setLink(Object idOrIlpObject, Object fromIdOrIlpObject, Object toIdOrIlpObject)
          Declares an object as being a link.
 void setParent(Object idOrIlpObject, Object parentIdOrIlpObject)
          Declares an object as being the child of another.
protected  void subscribeToObject(IlpObject ilpObject)
          Subscribe to receive events for the given object.
protected  void unsubscribeToObject(IlpObject ilpObject)
          Unsubscribe from notifications of the given business object.
 
Methods inherited from class ilog.cpl.datasource.IlpDefaultDataSource
addBean, addObjects, clear, getChildInterface, getChildren, getContainerInterface, getFileName, getFrom, getLinkExtremityInterface, getLinkInterface, getLinks, getObject, getObjects, getParent, getReferenceManager, getTo, isSubscribedToObject, output, output, output, output, parse, parse, parse, parse, parse, parse, removeObject, removeObjects, removeObjects, setFileName, setFileName
 
Methods inherited from class ilog.cpl.datasource.IlpAbstractDataSource
addDataSourceListener, endBatch, fireBatchEnded, fireBatchStarted, fireObjectAdded, fireObjectAttributeChanged, fireObjectAttributeChanged, fireObjectRemoved, fireObjectsAdded, fireObjectsRemoved, fireObjectStructureChanged, getContext, getDebugMask, getIdentifier, logMessage, removeDataSourceListener, setContext, setDebugMask, startBatch, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.datasource.IlpDataSource
addDataSourceListener, getContext, removeDataSourceListener
 

Constructor Detail

IltDefaultDataSource

public IltDefaultDataSource()
Default constructor. The data source is initialized using the default context.

See Also:
IlpSystem.GetDefaultContext()

IltDefaultDataSource

public IltDefaultDataSource(IlpContext context)
Constructor.

Parameters:
context - The context used by the data source.
Method Detail

attributeValueChange

public void attributeValueChange(AttributeValueEvent ev)
This method is called when an attribute value of an IlpObject in the data source is changed.

Specified by:
attributeValueChange in interface AttributeValueListener
Overrides:
attributeValueChange in class IlpDefaultDataSource

isInShelf

protected boolean isInShelf(IlpObject child)
Returns if the given object is an object contained in a shelf or one of its children.

Parameters:
child - Business object
Returns:
true if the object is contained in a shelf.
Internal method or field: do not use!

setHandlingAlarmReferences

public void setHandlingAlarmReferences(boolean value)
Sets the data source behavior regarding references between IltAlarms and IltObjects.

By default the data source handles these references. The result is that when IltAlarms are inserted in the same data source as the IltObject they references, then alarm counters for the IltObject are computed from the corresponding list of alarms.

This property must be set before any object is added to the data source.

The association between IltAlarms and IltObjects is implemented by the IltAlarm.ManagedObjectInstanceAttribute attribute of IltAlarm. To establish the association use the object identifier of the IltObject as the value for ManagedObjectInstance.

Parameters:
value - true to set the data source to handle references between IltAlarms and IltObjects. false to disable it.
Since:
JTGO 4.0

isHandlingAlarmReferences

public boolean isHandlingAlarmReferences()
Returns whether the data source handles or not references between IltAlarms and IltObjects. By default the data source handles the references.

This property must be set before any object is added to the data source.

Returns:
true when the data source handles references between IltAlarms and IltObjects. false when it does not.
Since:
JTGO 4.0

addObject

public void addObject(IlpObject ilpObject)
Adds an object to the data source.

If the object is an IltContainer, its current children are also added to the data source, and the children model is replicated as a data source structure. This process is recursive, so that the children of children are added too.

Specified by:
addObject in interface IlpMutableDataSource
Overrides:
addObject in class IlpDefaultDataSource
Parameters:
ilpObject - The object to be added to the data source.

addChildrenObjects

protected List addChildrenObjects(IlpObject ilpObject)
Adds also the objects that are children of the given object. In this implementation, the children objects of containers and link sets are automatically added to the datasource.

Overrides:
addChildrenObjects in class IlpDefaultDataSource
Parameters:
ilpObject - Business object
Returns:
Returns a list of all added objects
Since:
JViews 7.5
Internal method or field: do not use!

subscribeToObject

protected void subscribeToObject(IlpObject ilpObject)
Subscribe to receive events for the given object.

Overrides:
subscribeToObject in class IlpDefaultDataSource
Parameters:
ilpObject - Business object that has been added to this datasource.

unsubscribeToObject

protected void unsubscribeToObject(IlpObject ilpObject)
Unsubscribe from notifications of the given business object.

Overrides:
unsubscribeToObject in class IlpDefaultDataSource
Parameters:
ilpObject - Business object

removeObjectFromParent

protected void removeObjectFromParent(IlpObject ilpObject)
Removes the given object from its current parent.

Overrides:
removeObjectFromParent in class IlpDefaultDataSource
Parameters:
ilpObject - Business object
Internal method or field: do not use!

setLink

public void setLink(Object idOrIlpObject,
                    Object fromIdOrIlpObject,
                    Object toIdOrIlpObject)
Description copied from class: IlpDefaultDataSource
Declares an object as being a link.

As the parameters of this method can be either identifiers or IlpObject instances, the IlpAbstractDataSource.getIdentifier(Object) method can be used to retrieve the identifier in both cases.

Specified by:
setLink in interface IlpMutableDataSource
Overrides:
setLink in class IlpDefaultDataSource
Parameters:
idOrIlpObject - The identifier of the link object or the object itself.
fromIdOrIlpObject - The identifier of the "from" end of the link, or the "from" object itself.
toIdOrIlpObject - The identifier of the "to" end of the link, or the "to" object itself.

setParent

public void setParent(Object idOrIlpObject,
                      Object parentIdOrIlpObject)
Description copied from class: IlpDefaultDataSource
Declares an object as being the child of another.

As the parameters of this method can be either identifiers or IlpObject instances, the IlpAbstractDataSource.getIdentifier(Object) method can be used to retrieve the identifier in both cases.

Specified by:
setParent in interface IlpMutableDataSource
Overrides:
setParent in class IlpDefaultDataSource
Parameters:
idOrIlpObject - The identifier of the child object, or the child object itself.
parentIdOrIlpObject - The identifier of the parent object, or the parent object itself.

setChildren

public void setChildren(Object idOrIlpObject,
                        List childrenIdsOrIlpObjects)
Declares an object as having children.

Specified by:
setChildren in interface IlpMutableDataSource
Overrides:
setChildren in class IlpDefaultDataSource
Parameters:
idOrIlpObject - The identifier of the object that has children or the object itself.
childrenIdsOrIlpObjects - A list containing the children as identifiers or IlpObject instances.

createDataHandler

public ilog.cpl.storage.internal.IlpSAXDataHandler createDataHandler(IlpMutableDataSource dataSource,
                                                                     XMLReader parser,
                                                                     IlpIdentifierFactory identifierFactory,
                                                                     IlpFilter pfilter,
                                                                     Object parentIdOfRootObjects,
                                                                     boolean buffering,
                                                                     Logger logger)
Description copied from class: IlpAbstractDataSource
Creates a new datasource data handler.

Specified by:
createDataHandler in interface ilog.cpl.storage.internal.IlpSAXDataHandlerFactory
Overrides:
createDataHandler in class IlpAbstractDataSource
Parameters:
dataSource - Datasource
parser - Parse
identifierFactory - Identifier factory
pfilter - Filter
buffering - Buffering events or not
logger - Logger
Returns:
New SAX Data Handler
Since:
JTGO 4.5
Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.