|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IObjectManager
The IObjectManager interface defines a scalable, thread-safe
storage medium for info objects. It is used primarily for importing and
exporting objects to and from the BusinessObjects Enterprise repository. It
can also be used to manage very large info objects.
To create an instance of this interface, use
BIARFactory.
Object Manager (OM) instances are thread-safe. As a rule, multiple threads may access an OM simultaneously without any need for synchronization.
Note: IManagedObjectIterator is not thread-safe. These
iterators should not be used while the OM is being concurrently modified,
either through its own interface or through another
IManagedObjectIterator. This is equally true if the
modification occurs in the same thread as the iterator or in any
other thread. This is similar to the behavior of Java Collections
iterators. Certain internal OM operations use these iterators. As such,
several methods are unsafe for use when the OM is accessed by multiple threads, including
IObjectManager.commit(), IObjectManager.exportToArchive(String, IExportOptions),
IObjectManager.importArchive(String, IImportOptions), and IObjectManager.importFiles().
Once the OM is populated with objects, its contents can be
inspected and operated on using methods such as IObjectManager.contains(int),
IObjectManager.read(int), IObjectManager.update(IInfoObject), and IObjectManager.delete(int).
When the contents are ready, OM provides a number of scalable alternatives to
the usual commit methods of the info store, such as IObjectManager.commit(), and
the IObjectManager.exportToArchive(String, IExportOptions) to export the contents
to a BIAR archive.
Note: when an IObjectManager instance is no longer
needed, call IObjectManager.dispose() to free all associated resources.
| Method Summary | |
|---|---|
void |
clear()
Removes all objects from the OM. |
ICommitResult |
commit()
Commits the objects in the OM to the repository without atomicity and using strict commit mode. |
ICommitResult |
commit(boolean atomic,
CommitMode mode)
Commits the objects in the OM to the repository using the specified atomicity and commit mode. |
ICommitResult |
commit(boolean atomic,
CommitMode mode,
int commitLevel)
Commits the objects in the OM to the repository using the specified atomicity, commit mode, and commit level. |
ICommitResult |
commit(CommitType type)
Commits the objects in the OM to the repository without atomicity and using strict commit mode. |
ICommitResult |
commit(CommitType type,
boolean atomic,
CommitMode mode)
Commits the objects in the OM to the repository using the specified commit type, atomicity, and commit mode. |
ICommitResult |
commit(CommitType type,
boolean atomic,
CommitMode mode,
int commitLevel)
Commits the objects in the OM to the repository using the specified commit type, atomicity, commit mode, and commit level. |
ICommitResult |
commit(ICommitOptions opts)
Commits the objects in the OM to the CMS repository using the specified options. |
java.util.Set |
containedCuids(java.util.Iterator cuids)
Returns the CUIDs of all objects in the OM that match CUIDs in the specified collection. |
java.util.Set |
containedIds(java.util.Iterator ids)
Returns the IDs in the OM that match the IDs in the specified collection. |
boolean |
contains(int id)
Returns whether the OM contains the info object with the specified ID. |
boolean |
contains(java.lang.String cuid)
Returns whether the OM contains the info object with the specified CUID. |
boolean |
delete(int id)
Removes the info object with the specified ID from the OM. |
boolean |
delete(java.lang.String cuid)
Removes the info object with the specified CUID from the OM. |
int |
deleteAllCuids(java.util.Iterator cuids)
Removes all info objects from the OM whose CUIDs are contained in the specified collection. |
int |
deleteAllIds(java.util.Iterator ids)
Removes all info objects from the OM whose IDs are contained in the specified collection. |
void |
dispose()
Disposes of the OM and releases any resources held by it. |
void |
exportToArchive(java.lang.String biarFile,
IExportOptions options)
Exports the entire contents of the OM to a BIAR archive. |
java.util.Set |
getCuidSet()
Returns the CUIDs of all the objects in the OM. |
IEnterpriseSession |
getEnterpriseSession()
Returns enterprise session object |
java.util.Set |
getIdSet()
Returns the IDs of all objects in the OM. |
java.util.Set |
getKindSet()
Returns the kinds of all objects in the OM. |
void |
importArchive(java.lang.String biarFile,
IImportOptions options)
Imports the contents of a BIAR archive into the OM. |
IImport |
importArchiveInteractively(java.lang.String biarFile,
IImportOptions options)
Imports the contents of a BIAR archive into the OM. |
void |
importFiles()
Imports the binary content of files associated with any info objects in the OM. |
void |
insert(IInfoObject obj)
Inserts the specified info object into the OM. |
void |
insertAll(java.util.Iterator objs)
Inserts all of the info objects in the specified collection into the OM. |
void |
insertAtomic(java.util.Iterator objs)
Atomically inserts all of the info objects in the specified collection into the OM. |
ILiveToLivePipe |
liveImport(IEnterpriseSession srcSession,
IExportOptions srcOpts,
IImportOptions destOpts)
Begins an import from a live Business Objects Enterprise system to this OM. |
IInfoObject |
read(int id)
Returns the info object with the specified ID from the OM. |
IInfoObject |
read(java.lang.String cuid)
Returns the info object with the specified CUID from the OM. |
IManagedObjectIterator |
readAll()
Returns an iterator that contains all of the objects in the OM. |
java.util.List |
readAllCuids(java.util.Iterator cuids)
Returns the info objects whose CUIDs match those in the specified collection. |
java.util.List |
readAllIds(java.util.Iterator ids)
Returns the info objects whose IDs match those in the specified collection. |
IManagedObjectIterator |
readAllKind(java.lang.String kind)
Returns an iterator containing all objects of the specified kind in the OM. |
IManagedObjectIterator |
readByCuids(java.util.Collection cuids)
Returns an iterator of info objects whose CUIDs match those in the specified collection. |
IManagedObjectIterator |
readByIds(java.util.Collection ids)
Returns an iterator of info objects whose IDs match those in the specified collection. |
int |
size()
Returns the number of objects currently stored in the OM. |
ICommitResult |
testCommit(ICommitOptions opts)
Performs a test commit, which returns all the errors that would occur if this OM's contents were committed to the repository using IObjectManager.commit(ICommitOptions), but does not alter repository
contents. |
void |
update(IInfoObject obj)
Updates an existing info object in the OM. |
void |
updateAll(java.util.Iterator objs)
Updates all of the info objects contained in the specified collection. |
void |
updateAtomic(java.util.Iterator objs)
Atomically updates all of the info objects in the specified collection. |
void |
write(IInfoObject obj)
Writes an object to the OM. |
void |
writeAll(java.util.Iterator objs)
Writes all of the specified objects to the OM. |
void |
writeAtomic(java.util.Iterator objs)
Atomically writes all of the info objects in the given collection. |
| Method Detail |
|---|
void clear()
throws OMException
OMException - if the operation fails.
ICommitResult commit(ICommitOptions opts)
throws OMException
opts - the commit options.
OMException - if this operation fails.
ICommitResult commit()
throws OMException
IObjectManager.commit(boolean, CommitMode) with false and
CommitMode.STRICT for the first and second arguments
respectively.
OMException - if the commit fails.IObjectManager.commit(boolean, CommitMode),
CommitMode
ICommitResult commit(CommitType type)
throws OMException
IObjectManager.commit(), except that it allows the commit type to be
specified.
type - the type of the commit.
OMException - if the commit suffers a catastrophic failure.CommitType
ICommitResult commit(boolean atomic,
CommitMode mode)
throws OMException
IInfoStore.commit(IInfoObjects, boolean, CommitMode),
but the process is carried out in such a way that memory consumption does
not grow in the size of the OM.
IObjectManager.commit(boolean, CommitMode, int) performs the same
operation but uses a specified commit level for every object of the
commit.
atomic - the atomicity of the commit. If atomic is true
then any error during the commit will result in the entire
commit being rolled back. If false the commit
will continue until all objects have been tried.mode - the commit mode. If CommitMode.STRICT then any
dangling relationship edges will be treated as errors,
otherwise they will only raise warnings and will not prevent
the host object from being committed.
OMException - if the commit suffers a catastrophic failure.CommitMode
ICommitResult commit(CommitType type,
boolean atomic,
CommitMode mode)
throws OMException
IObjectManager.commit(boolean, CommitMode), but the type
argument allows the commit semantics to be slightly altered.
type - the type of the commit.atomic - the atomicity of the commit. If atomic is true
then any error during the commit will result in the entire
commit being rolled back. If false the commit
will continue until all objects have been tried.mode - the commit mode. If CommitMode.STRICT then any
dangling relationship edges will be treated as errors,
otherwise they will only raise warnings and will not prevent
the host object from being committed.
OMException - if the commit suffers a catastrophic failure.CommitMode,
CommitType
ICommitResult commit(boolean atomic,
CommitMode mode,
int commitLevel)
throws OMException
IObjectManager.commit(boolean, CommitMode), except that the specified commit
level will be applied to each info object before it is committed.
atomic - the commit atomicity.mode - the commit mode.commitLevel - the commit level to apply to each object.
OMException - if the commit suffers a catastrophic failure.IInfoObject.CommitLevel,
CommitMode
ICommitResult commit(CommitType type,
boolean atomic,
CommitMode mode,
int commitLevel)
throws OMException
IObjectManager.commit(boolean, CommitMode, int), but the
type argument allows the commit semantics to be slightly
altered.
type - the type of the commit.atomic - the commit atomicity.mode - the commit mode.commitLevel - the commit level to apply to each object.
OMException - if the commit suffers a catastrophic failure.IInfoObject.CommitLevel,
CommitMode,
CommitType
boolean contains(int id)
throws OMException
Returns whether the OM contains the info object with the specified ID.
id - the ID of the info object
true if an info object with the specified ID is
found, false otherwise.
OMException - if the operation fails.IObjectManager.contains(String),
IObjectManager.containedCuids(Iterator),
IObjectManager.containedIds(Iterator)
boolean contains(java.lang.String cuid)
throws OMException
cuid - the CUID of the info object
true if an info object with the specified CUID is
found, false otherwise.
OMException - if the operation fails.IObjectManager.contains(int),
IObjectManager.containedCuids(Iterator),
IObjectManager.containedIds(Iterator)
java.util.Set containedCuids(java.util.Iterator cuids)
throws OMException
IObjectManager.getCuidSet().
cuids - an iterator over a collection of CUIDs
Set containing the intersection of the
specified collection of CUIDs and the
set of CUIDs of all objects in the OM.
OMException - if the operation fails.IObjectManager.contains(int),
IObjectManager.contains(String),
IObjectManager.containedIds(Iterator)
java.util.Set containedIds(java.util.Iterator ids)
throws OMException
Returns the IDs in the OM that match the IDs in the specified collection.
To obtain a complete set of the IDs of all objects
contained in the OM, use IObjectManager.getIdSet().
ids - an iterator over the collection of IDs.
OMException - if the operation fails.IObjectManager.contains(int),
IObjectManager.contains(String),
IObjectManager.containedCuids(Iterator)
boolean delete(int id)
throws OMException
Removes the info object with the specified ID from the OM.
id - the ID of the object to be removed.
true if an object was removed from the
OM as a result of this operation.
OMException - if the operation fails.IObjectManager.delete(String),
IObjectManager.deleteAllCuids(Iterator),
IObjectManager.deleteAllIds(Iterator)
boolean delete(java.lang.String cuid)
throws OMException
Removes the info object with the specified CUID from the OM.
cuid - the CUID of the object to be removed.
true if an object was removed from the
OM as a result of this operation.
OMException - if the operation fails.IObjectManager.delete(int),
IObjectManager.deleteAllCuids(Iterator),
IObjectManager.deleteAllIds(Iterator)
int deleteAllCuids(java.util.Iterator cuids)
throws OMException
Removes all info objects from the OM whose CUIDs are contained in the
specified collection. To remove all objects from the OM, use
IObjectManager.clear().
cuids - an iterator containing the CUIDs of the objects to be
removed.
OMException - if the operation fails.IObjectManager.delete(int),
IObjectManager.delete(String),
IObjectManager.deleteAllIds(Iterator)
int deleteAllIds(java.util.Iterator ids)
throws OMException
Removes all info objects from the OM whose IDs are contained in the specified
collection. To remoave all objects from the OM, use IObjectManager.clear().
ids - an iterator containing the IDs of the objects to be
removed.
OMException - if the operation fails.IObjectManager.delete(int),
IObjectManager.delete(String),
IObjectManager.deleteAllCuids(Iterator)
void dispose()
throws OMException
Disposes of the OM and releases any resources held by it.
Note: this does not automatically close any currently open
IManagedObjectIterator instances that may be open. These should
be closed before disposing of the OM. Otherwise, some resources may not be
released.
OMExceptionIManagedObjectIterator.close()
void exportToArchive(java.lang.String biarFile,
IExportOptions options)
throws BIARException
Exports the entire contents of the OM to a BIAR archive. Use the
Archive class to obtain meta-information about the resultant
archive.
If you do not need to use OM to temporarily cache info objects
before the export, then it is recommend that you use BIAROutput to export
info objects instead.
options - a set of options to control the parameters of export.
BIARException - if the operation fails.
OMException - if the operation fails due to an exception while iterating
over the objects in the OM.BIARFactory.createImportOptions()
java.util.Set getCuidSet()
throws OMException
Returns the CUIDs of all the objects in the OM. This is generally much more efficient than iterating over the entire OM.
OMException - if the operation fails.IObjectManager.getIdSet()
java.util.Set getIdSet()
throws OMException
Returns the IDs of all objects in the OM. This is generally much more efficient than iterating over the entire OM.
OMException - if the operation fails.IObjectManager.getCuidSet()
java.util.Set getKindSet()
throws OMException
Returns the kinds of all objects in the OM. This is generally much more efficient than iterating over the entire OM.
OMException - if the operation fails.
void importArchive(java.lang.String biarFile,
IImportOptions options)
throws BIARException
Imports the contents of a BIAR archive into the OM. Before importing, any info objects currently in the OM are removed.
The import options can be used to specify that this is a "two-step import".
If this option is set, the import operation only imports the info object
properties from the archive; the actual binary content of any associated
files is not extracted. To import the associated files from the archive,
call IObjectManager.importFiles() before they are committed or transfered from
the OM.
biarFile - file name of the archive to import.options - a set of options to control the parameters of import.
BIARException - if the operation fails.
OMException - if the operation fails due to an exception condition in the
OM.IObjectManager.importFiles(),
IImportOptions.setTwoStepImport(boolean),
BIARFactory.createImportOptions()
IImport importArchiveInteractively(java.lang.String biarFile,
IImportOptions options)
throws BIARException
Imports the contents of a BIAR archive into the OM. The semantics are identical to
IObjectManager.importArchive(String, IImportOptions), except that an
IImport is returned so that the import can be interacted with.
biarFile - file name of the archive to import.options - a set of options to control the parameters of import.
BIARException - if the operation fails.
OMException - if the operation fails due to an exception condition in the OM.
ILiveToLivePipe liveImport(IEnterpriseSession srcSession,
IExportOptions srcOpts,
IImportOptions destOpts)
throws BIARException
ILiveToLivePipe represents the in-progress transfer. A live-to-live
import also entails an export from the source system and therefore requires a set of export options to
be specified.
srcSession - a valid session obtained from the live source system.srcOpts - a set of options to control the parameters of export.destOpts - a set of options to control the parameters of import.
ILiveToLivePipe object representing the in-progress
transfer.
BIARException - if the operations fails.IObjectManager.importArchive(String, IImportOptions),
IObjectManager.importFiles()
void importFiles()
throws BIARException
Imports the binary content of files associated with any info objects in the OM. This is only necessary if the "two-step import" option was specified when importing the archive.
BIARExceptionIObjectManager.importArchive(String, IImportOptions),
IImportOptions.setTwoStepImport(boolean)
void insert(IInfoObject obj)
throws OMException
Inserts the specified info object into the OM.
obj - the object to insert.
OMException - if the operation fails. In particular, the operation will
fail if the obj has the same CUID or ID as another object
already contained in the OM.IObjectManager.insertAll(Iterator),
IObjectManager.insertAtomic(Iterator)
void insertAll(java.util.Iterator objs)
throws OMException
Inserts all of the info objects in the specified collection into the OM.
This has the same effect as performing multiple inserts, but is generally
more efficient, and will appear as a single atomic operation to other
threads. To ensure that the inserts will atomically
succeed or fail, use IObjectManager.insertAtomic(Iterator).
objs - an iterator over the collection of objects to insert.
OMException - if the operation fails. In particular, the operation will
fail if any object has the same CUID or ID as another object
already contained in the OM or present in the collection of
inserts.IObjectManager.insert(IInfoObject)
void insertAtomic(java.util.Iterator objs)
throws OMException
Atomically inserts all of the info objects in the specified collection
into the OM. This has the same effect as calling
IObjectManager.insertAll(Iterator), except that if any one insert fails, then
all inserts fail.
objs - an iterator over the collection of objects to insert.
OMException - if the operation fails. In particular, the operation will
fail if any object has the same CUID or ID as another object
already contained in the OM or present in the collection of
inserts.IObjectManager.insert(IInfoObject)
IInfoObject read(int id)
throws OMException
Returns the info object with the specified ID from the OM.
id - the ID of the object.
OMException - if this operation fails.IObjectManager.read(String),
IObjectManager.readAll(),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String)
IInfoObject read(java.lang.String cuid)
throws OMException
Returns the info object with the specified CUID from the OM.
cuid - the ID of the object.
OMException - if this operation fails.IObjectManager.read(int),
IObjectManager.readAll(),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String)
IManagedObjectIterator readAll()
throws OMException
Returns an iterator that contains all of the objects in the OM. It traverses the objects in the following order:
OMException - if the operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String)
java.util.List readAllCuids(java.util.Iterator cuids)
throws OMException
Returns the info objects whose CUIDs match those in the specified collection. Method is thread safe.
cuids - an iterator over the CUIDs of the objects.
OMException - if this operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAll(),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String),
IObjectManager.readByCuids(Collection),
IObjectManager.readByIds(Collection)
java.util.List readAllIds(java.util.Iterator ids)
throws OMException
Returns the info objects whose IDs match those in the specified collection. Method is thread safe.
ids - an iterator over the IDs of the objects.
OMException - if this operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAll(),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllKind(String),
IObjectManager.readByCuids(Collection),
IObjectManager.readByIds(Collection)
IManagedObjectIterator readAllKind(java.lang.String kind)
throws OMException
Returns an iterator containing all objects of the specified kind in the OM. It traverses the objects in the following order:
kind - the kind of info object to read.
OMException - if the operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readByCuids(Collection),
IObjectManager.readByIds(Collection),
IInfoObject.getKind()
IManagedObjectIterator readByCuids(java.util.Collection cuids)
throws OMException
Returns an iterator of info objects whose CUIDs match those in the specified collection.
cuids - an iterator over the CUIDs of the objects.
OMException - if this operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAll(),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String),
IObjectManager.readByIds(Collection)
IManagedObjectIterator readByIds(java.util.Collection ids)
throws OMException
Returns an iterator of info objects whose IDs match those in the specified collection.
ids - an iterator over the IDs of the objects.
OMException - if this operation fails.IObjectManager.read(int),
IObjectManager.read(String),
IObjectManager.readAll(),
IObjectManager.readAllCuids(Iterator),
IObjectManager.readAllIds(Iterator),
IObjectManager.readAllKind(String),
IObjectManager.readByCuids(Collection)
int size()
throws OMException
Returns the number of objects currently stored in the OM. This can be an expensive operation in terms of performance.
OMException - if this operation fails.
ICommitResult testCommit(ICommitOptions opts)
throws OMException
IObjectManager.commit(ICommitOptions), but does not alter repository
contents.
opts - the commit options.
OMException - if this operation fails.
void update(IInfoObject obj)
throws OMException
Updates an existing info object in the OM. To determine which object
to update in the OM, the SI_ID property of the object is compared
to the SI_ID of the objects in the OM.
obj - the updated object.
OMException - if this operation fails. In particular, it will fail if
the OM does not contain an object whose SI_ID matches that of
the object in obj.IObjectManager.updateAll(Iterator),
IObjectManager.updateAtomic(Iterator)
void updateAll(java.util.Iterator objs)
throws OMException
Updates all of the info objects contained in the specified collection.
This has the same effect as peforming multiple updates, but is generally
more efficient, and will appear as a single atomic operation to other
threads. To ensure that the updates will atomically
succeed or fail, use IObjectManager.updateAtomic(Iterator).
objs - an iterator over the collection of objects to update.
OMException - if this operation fails. In particular, it will fail if any
of the objects in objs does not have matching
IDs with some existing object in the OM.IObjectManager.update(IInfoObject)
void updateAtomic(java.util.Iterator objs)
throws OMException
Atomically updates all of the info objects in the specified collection.
This has the same effect as calling
IObjectManager.updateAll(Iterator), except that if any one update fails, then
all updates fail.
objs - an iterator over the collection of objects to update.
OMException - if the operation fails. In particular, it will fail if any of
IDs of the objects in objs do not match any of the
IDs of the object in the OM.IObjectManager.update(IInfoObject)
void write(IInfoObject obj)
throws OMException
Writes an object to the OM. The write operation either inserts or
updates the object as required. This is more
expensive than either IObjectManager.write(IInfoObject) or
IObjectManager.update(IInfoObject) but is more flexible.
obj - the object to write.
OMException - if this operation fails.IObjectManager.writeAll(Iterator),
IObjectManager.writeAtomic(Iterator)
void writeAll(java.util.Iterator objs)
throws OMException
Writes all of the specified objects to the OM. This has the same effect as
performing multiple writes, but is generally more efficient, and will appear as
a single atomic operation to other threads. To ensure that the entire operation
atomically succeeds or fails, use IObjectManager.writeAtomic(Iterator).
objs - an iterator over the collection of objects to write.
OMException - if this operation fails.IObjectManager.write(IInfoObject)
void writeAtomic(java.util.Iterator objs)
throws OMException
Atomically writes all of the info objects in the given collection. This
has the same effect as calling
IObjectManager.writeAll(Iterator), except that if any one write fails, then
all writes fail.
objs - an iterator over the collection of objects to write.
OMException - if this operation fails.IObjectManager.write(IInfoObject)IEnterpriseSession getEnterpriseSession()
Returns enterprise session object
OMException#IEnterpriseSession
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||