Interface IThingService
- All Superinterfaces:
IComponent
,IInitializable
,IMetaComponent
Create/delete of things
Management of thing cache
deprecated methods may not be supported in future versions
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
db ID of root folder (/meta/pmDB/folder/000000002)static final int
db ID of root topic (/meta/pmDB/topic/0000000003) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cacheThingID
(IThingID thingID) Deprecated.createThing
(int xtypeID, IThingID parentID, IThingID ownerID) Create a Thing.createThing
(String xtypeName, IThingID parentID, IThingID ownerID) Create a Thing.createThingForMigration
(int xtypeID, Integer thingID, IThingID parentID, IThingID ownerID) Create a Thing.createThingProtected
(int xtypeID, IThingID parentID, IThingID ownerID) creates an object in "protected" ID space so the object can never be inadvertently deleted (below base ID) internal use onlycreateVersionedThing
(IThingID thingID, String resourceID, String versionID, int updateType, String updateID, IThingID serviceID) Creates an IVersionInfo object and attaches it to thingIDboolean
Goes into the DB and verifies that this item still exists.void
flushCache
(IThingID thingID) Remove an object from the internal thing cache, if the cache is enabled.void
flushCacheAll
(boolean flushRemote) flushes (removes) all objects from internal thing cachevoid
flushCacheForClasses
(String[] classNames, boolean flushRemote) Flushes objects from thing cache which names match to those specifiedvoid
flushRemoteCaches
(IThingID thingID) Remove an object from remote, synced up thing caches.int
the base value for user-created DB objectsGet the root Folder.Get the root Folder ID.Get the root Topic.Get the root Topic ID.getThingFromID
(IThingID thingID, boolean noArchive) Deprecated.getThingFromIDForUpdate
(IThingID thingID) getThingIDFromDbID
(int dbID) Deprecated.int
getThingState
(IThingID thingID) Deprecated.use IThingID#getDBStatevoid
loadThings
(int xtypeID) Bulks loads data for all things of a given xtypevoid
refreshLocalThingOnly
(IThingID thingID) void
refreshThing
(IThingID thingID, boolean refreshLocal) sends a refresh message to thingID.Attempts to undelete all things that are in the "undestroyed" state.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
Methods inherited from interface com.webmethods.portal.service.meta2.IMetaComponent
getMetaContext, setMetaContext
-
Field Details
-
ROOTFOLDER_DBID
static final int ROOTFOLDER_DBIDdb ID of root folder (/meta/pmDB/folder/000000002)- See Also:
-
ROOTTOPIC_DBID
static final int ROOTTOPIC_DBIDdb ID of root topic (/meta/pmDB/topic/0000000003)- See Also:
-
-
Method Details
-
getThingFromID
Deprecated.Get an IThing object based on its ID. This is a factory method for objects implementing the IThing interface. Objects are instantiated based on a thing's xtypeID. This call is cached. When a thing is first instantiated, we make a DB call to check state, which is then cached. internal use only- Parameters:
thingID
- ID of objectnoArchive
- don't return an archived object- Returns:
- object
-
getThingFromIDForUpdate
-
getThingIDFromDbID
Deprecated.tries to find a cached thingID based on dbID returns null if not found in cache -
cacheThingID
Deprecated.puts a thingID in the cache- Parameters:
thingID
-
-
flushCache
Remove an object from the internal thing cache, if the cache is enabled. -
flushCacheAll
void flushCacheAll(boolean flushRemote) flushes (removes) all objects from internal thing cache -
flushCacheForClasses
Flushes objects from thing cache which names match to those specified- Parameters:
classNames
-flushRemote
-
-
flushRemoteCaches
Remove an object from remote, synced up thing caches. -
undeleteAllUndestroyed
Attempts to undelete all things that are in the "undestroyed" state. This state is set for a thing whenever it fails to be purged from database, usually happens because of some untracked FK's. Then manual intervention is needed in that case better to simply undelete a thing- Throws:
MetaException
-
refreshThing
sends a refresh message to thingID. Should cause thing data to reload at next DB call- Parameters:
thingID
- id of thing to refreshrefreshLocal
- true if local cache should be updated
-
refreshLocalThingOnly
-
createThing
Create a Thing. When this method is called, the thing type is looked up, and the create() method is called on the factory class associated with the xtypeID.- Parameters:
xtypeID
- xtype of new objectparentID
- parent of new type. Optional for some types, required for othersownerID
- Owner (generally principal) of object. Can be ignored for some types.- Returns:
- ID of newly created thing
- Throws:
MetaException
- for a variety of reasons:- Parent doesn't exist
- Owner doesn't exist
- parent or owner is an invalid type or null
- general database errors
- See Also:
-
createThingForMigration
IThingID createThingForMigration(int xtypeID, Integer thingID, IThingID parentID, IThingID ownerID) throws MetaException Create a Thing. This should only be used for side-by-side migration so that the old thingId can be reused. When this method is called, the thing type is looked up, and the create() method is called on the factory class associated with the xtypeID.- Parameters:
xtypeID
- xtype of new objectthingID
- thingID of the old thingparentID
- parent of new type. Optional for some types, required for othersownerID
- Owner (generally principal) of object. Can be ignored for some types.- Returns:
- ID of newly created thing
- Throws:
MetaException
- for a variety of reasons:- Parent doesn't exist
- Owner doesn't exist
- parent or owner is an invalid type or null
- general database errors
- See Also:
-
createThing
Create a Thing. When this method is called, the thing type is looked up, and the create() method is called on the factory class associated with the xtype name.- Parameters:
xtypeName
- xtype of new objectparentID
- parent of new type. Optional for some types, required for othersownerID
- Owner (generally principal) of object. Can be ignored for some types.- Returns:
- ID of newly created thing
- Throws:
MetaException
- for a variety of reasons:- Parent doesn't exist
- Owner doesn't exist
- parent or owner is an invalid type or null
- general database errors
- See Also:
-
createThingProtected
IThingID createThingProtected(int xtypeID, IThingID parentID, IThingID ownerID) throws MetaException creates an object in "protected" ID space so the object can never be inadvertently deleted (below base ID) internal use only- Throws:
MetaException
-
createVersionedThing
IThingID createVersionedThing(IThingID thingID, String resourceID, String versionID, int updateType, String updateID, IThingID serviceID) throws MetaException Creates an IVersionInfo object and attaches it to thingID- Parameters:
thingID
- ID of thing to versionresourceID
- ResourceversionID
- Version- Returns:
- new thingID of thing
- Throws:
MetaException
- if thing is already versioned, thing doesn't exist,or other error
-
exists
Goes into the DB and verifies that this item still exists. Useful for detecting stale cached items. Unless you are in a transaction, this doesn't guarantee that any operation with this ID will succeed. Even in a transaction, you may get blocked.- Parameters:
thingID
- id of thing to check. Only uses dbID part- Returns:
- true if thing exists regardless of thing state
-
getThingState
Deprecated.use IThingID#getDBStategoes into the DB and gets thing state for ID (ignores bits in ID) guaranteed to call DB- Parameters:
thingID
- ID of thing to check. Only uses dbID- Returns:
IThingState.UNKNOWN
on error- See Also:
-
getRootFolder
IFolder getRootFolder()Get the root Folder. -
getRootFolderID
IThingID getRootFolderID()Get the root Folder ID. -
getRootTopic
ITopic getRootTopic()Get the root Topic. -
getRootTopicID
IThingID getRootTopicID()Get the root Topic ID. -
loadThings
Bulks loads data for all things of a given xtype- Parameters:
xtypeID
-- Throws:
MetaException
-
getDbIdBase
int getDbIdBase()the base value for user-created DB objects
-
IThingID.getThing()