public abstract class IlpAbstractDataSource extends Object implements IlpDataSource, IlvBatchable, ilog.cpl.storage.internal.IlpSAXDataHandlerFactory
Constructor and Description |
---|
IlpAbstractDataSource()
Default constructor.
|
IlpAbstractDataSource(IlpContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataSourceListener(DataSourceListener l)
Adds a listener to the data source.
|
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.
|
void |
endBatch()
Terminates a batch of modifications.
|
void |
fireBatchEnded()
Fires an batch ended event.
|
void |
fireBatchStarted()
Fires an batch started event.
|
void |
fireObjectAdded(IlpObject object)
Fires an object added event for one object.
|
void |
fireObjectAttributeChanged(IlpObject object,
IlpAttribute attribute)
Fires an object attribute changed event.
|
void |
fireObjectAttributeChanged(IlpObject object,
IlpAttribute attribute,
Object newValue,
Object oldValue)
Fires an object attribute changed event.
|
void |
fireObjectRemoved(IlpObject object)
Fires an object removed event for one object.
|
void |
fireObjectsAdded(List<IlpObject> objects)
Fires an object added event for a list of objects.
|
void |
fireObjectsRemoved(List<IlpObject> objects)
Fires an object removed event for a list of objects.
|
void |
fireObjectStructureChanged(IlpObject object,
Class<?> structuralInterface)
Fires an object structure changed event.
|
IlpContext |
getContext()
Returns the context used by this data source.
|
int |
getDebugMask()
Returns the debug mask configured for this datasource.
|
protected Object |
getIdentifier(Object idOrIlpObject)
Utility method that retrieves an object identifier from a parameter that
can be either an identifier or an
IlpObject instance. |
protected boolean |
logMessage(Logger logger,
Level l)
Indicates if a message shall be logged in the given logger.
|
void |
removeDataSourceListener(DataSourceListener l)
Removes a listener of the data source.
|
void |
setContext(IlpContext context)
Set the context used by this data source.
|
void |
setDebugMask(int mask)
Sets a new debug mask in this datasource.
|
void |
startBatch()
Starts a batch of modifications.
|
protected boolean |
throwException()
Indicates if an exception shall be thrown.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildInterface, getContainerInterface, getLinkExtremityInterface, getLinkInterface, getObject, getObjects, getRootObjects
public IlpAbstractDataSource()
IlpSystem.GetDefaultContext()
public IlpAbstractDataSource(IlpContext context)
context
- The context used by the data source.public IlpContext getContext()
getContext
in interface IlpDataSource
public void setContext(IlpContext context)
public void startBatch()
batchStarted
event.
Use this method if you plan to make changes to the content of a data source such as:
endBatch
.startBatch
in interface IlvBatchable
endBatch()
public void endBatch()
batchEnded
event.endBatch
in interface IlvBatchable
startBatch()
public void addDataSourceListener(DataSourceListener l)
addDataSourceListener
in interface IlpDataSource
l
- The listener to add.public void removeDataSourceListener(DataSourceListener l)
removeDataSourceListener
in interface IlpDataSource
l
- The listener to remove.public void fireObjectAdded(IlpObject object)
object
- The object that has been added. Cannot be null
.public void fireObjectsAdded(List<IlpObject> objects)
objects
- The objects that have been added. Cannot be null
.public void fireObjectRemoved(IlpObject object)
object
- The object that has been removed. Cannot be null
.public void fireObjectsRemoved(List<IlpObject> objects)
objects
- The objects that have been removed. Cannot be null
).public void fireBatchStarted()
public void fireBatchEnded()
public void fireObjectStructureChanged(IlpObject object, Class<?> structuralInterface)
object
- The object whose structure has changed. Cannot be null
.structuralInterface
- The structural interface that has changed. Cannot be null
.public void fireObjectAttributeChanged(IlpObject object, IlpAttribute attribute)
fireObjectAttributeChanged(IlpObject, IlpAttribute, Object, Object)
instead.object
- The object whose attribute has changed. Cannot be
null
.attribute
- The attribute that has changed. Cannot be
null
.public void fireObjectAttributeChanged(IlpObject object, IlpAttribute attribute, Object newValue, Object oldValue)
object
- The object whose attribute has changed. Cannot be
null
.attribute
- The attribute that has changed. Cannot be
null
.newValue
- The new value of the attribute.oldValue
- The previous value of the attribute. When the old value
is not available, use
DataSourceObjectEvent.OLD_VALUE_UNAVAILABLE
.protected Object getIdentifier(Object idOrIlpObject)
IlpObject
instance.idOrIlpObject
- May be an IlpObject
instance
or an identifier (of any other Java class).IlpObject
instance, or
the identifier of the parameter if it is an IlpObject
instance.public ilog.cpl.storage.internal.IlpSAXDataHandler createDataHandler(IlpMutableDataSource dataSource, XMLReader parser, IlpIdentifierFactory identifierFactory, IlpFilter pfilter, Object parentIdOfRootObjects, boolean buffering, Logger logger)
createDataHandler
in interface ilog.cpl.storage.internal.IlpSAXDataHandlerFactory
dataSource
- Datasourceparser
- ParseidentifierFactory
- Identifier factorypfilter
- FilterparentIdOfRootObjects
- buffering
- Buffering events or notlogger
- Loggerpublic void setDebugMask(int mask)
The debug mask can be used by the datasource implementations to tell how the implementation should behave in case of errors. It is up to the datasource implementation to choose if the debug mask will be respected and when to use it to log a message and/or throw an exception.
mask
- Debug maskIlpDataSourceDebugMask
public int getDebugMask()
IlpDataSourceDebugMask
protected boolean logMessage(Logger logger, Level l)
logger
- Loggerl
- Log leveltrue
if this datasource is configured to
log messages when performing operations that change the
data source contents.protected boolean throwException()
true
if this datasource is configured to
throw exceptions when performing operations that change
the data source contents.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.