public interface StoreManager
public MyStoreManager(ClassLoaderResolver clr, NucleusContext ctx, Map<String, Object> props) { }The constructor arguments are
Modifier and Type | Method and Description |
---|---|
void |
addClass(String className,
ClassLoaderResolver clr)
Method to add a class to the managed list for this datastore manager.
|
void |
addClasses(String[] classNames,
ClassLoaderResolver clr)
Add classes to the persistence model for the datastore.
|
void |
close()
Release of resources.
|
ApiAdapter |
getApiAdapter()
Accessor for the API adapter.
|
Boolean |
getBooleanObjectProperty(String name) |
boolean |
getBooleanProperty(String name) |
boolean |
getBooleanProperty(String name,
boolean resultIfNotSet) |
String |
getClassNameForObjectID(Object id,
ClassLoaderResolver clr,
ExecutionContext ec)
Returns the class corresponding to the given object identity.
|
ManagedConnection |
getConnection(ExecutionContext ec)
Accessor for a connection for the specified ExecutionContext.
|
ManagedConnection |
getConnection(ExecutionContext ec,
Map options)
Accessor for a connection for the specified ExecutionContext.
|
String |
getConnectionDriverName()
Convenience accessor for the driver name to use for the connection.
|
Object |
getConnectionFactory()
Convenience accessor for the factory for the connection (transactional).
|
Object |
getConnectionFactory2()
Convenience accessor for the factory for the connection (non-transactional).
|
String |
getConnectionFactory2Name()
Convenience accessor for the factory name for the connection (non-transactional).
|
String |
getConnectionFactoryName()
Convenience accessor for the factory name for the connection (transactional).
|
ConnectionManager |
getConnectionManager()
Accessor for the connection manager for this store manager.
|
String |
getConnectionPassword()
Convenience accessor for the password to use for the connection.
|
String |
getConnectionURL()
Convenience accessor for the URL for the connection.
|
String |
getConnectionUserName()
Convenience accessor for the user name to use for the connection.
|
Date |
getDatastoreDate()
Get the date/time of the datastore.
|
String |
getDefaultObjectProviderClassName() |
Extent |
getExtent(ExecutionContext ec,
Class c,
boolean subclasses)
Interface to getting an Extent for a class.
|
FlushProcess |
getFlushProcess()
Accessor for the flush process to use with this datastore.
|
int |
getIntProperty(String name) |
NamingFactory |
getNamingFactory()
Accessor for the schema naming factory.
|
NucleusConnection |
getNucleusConnection(ExecutionContext ec)
Method to return a connection to the user for the ExecutionContext.
|
NucleusContext |
getNucleusContext()
Accessor for the context in which this StoreManager is running
|
NucleusSequence |
getNucleusSequence(ExecutionContext ec,
SequenceMetaData seqmd)
Method to return a datastore sequence for this datastore matching the passed sequence MetaData.
|
StorePersistenceHandler |
getPersistenceHandler()
Accessor for the store persistence handler.
|
Object |
getProperty(String name) |
String |
getQueryCacheKey()
Accessor for the key used for representing this store manager in the query cache.
|
QueryManager |
getQueryManager()
Accessor for the query manager for this datastore.
|
StoreSchemaHandler |
getSchemaHandler()
Accessor for the store schema handler (if this datastore supports the concept of a schema).
|
String |
getStoreManagerKey()
Accessor for the key for this store manager.
|
Object |
getStrategyValue(ExecutionContext ec,
AbstractClassMetaData cmd,
int absoluteFieldNumber)
Method to retrieve the value for a strategy for a particular field.
|
String |
getStringProperty(String name) |
Collection<String> |
getSubClassesForClass(String className,
boolean includeDescendents,
ClassLoaderResolver clr)
Utility to return the names of the classes that are known subclasses of the provided
class.
|
Collection |
getSupportedOptions()
Accessor for the supported options in string form
|
ValueGenerationManager |
getValueGenerationManager()
Accessor for the ValueGenerationManager for obtaining sequences.
|
boolean |
hasProperty(String name) |
boolean |
isAutoCreateColumns() |
boolean |
isAutoCreateConstraints() |
boolean |
isAutoCreateTables() |
boolean |
isJdbcStore()
Returns whether the datastore is a "JDBC datastore".
|
boolean |
isStrategyDatastoreAttributed(AbstractClassMetaData cmd,
int absFieldNumber)
Convenience method to return whether the strategy used by the specified class/member is
generated in the datastore during a persist.
|
String |
manageClassForIdentity(Object id,
ClassLoaderResolver clr)
Convenience method to ensure that the class defined by the passed OID/SingleFIeldIdentity is
managed by the store.
|
boolean |
managesClass(String className)
Accessor for whether the specified class is managed currently
|
void |
printInformation(String cat,
PrintStream ps)
Method to output particular information owned by this datastore.
|
void |
removeAllClasses(ClassLoaderResolver clr)
Remove all classes from the persistence model for the datastore.
|
boolean |
supportsQueryLanguage(String language)
Accessor for whether this query language is supported.
|
boolean |
supportsValueStrategy(String strategy)
Accessor for whether this value strategy is supported.
|
void |
transactionCommitted(ExecutionContext ec)
Method to inform the StoreManager that a transaction has committed for the specified execution context.
|
void |
transactionRolledBack(ExecutionContext ec)
Method to inform the StoreManager that a transaction has rolled back for the specified execution context.
|
void |
transactionStarted(ExecutionContext ec)
Method to inform the StoreManager that a transaction has started for the specified execution context.
|
boolean |
useBackedSCOWrapperForMember(AbstractMemberMetaData mmd,
ExecutionContext ec)
Method to return whether the specified member should use a backed SCO wrapper.
|
Collection getSupportedOptions()
void close()
StorePersistenceHandler getPersistenceHandler()
FlushProcess getFlushProcess()
NamingFactory getNamingFactory()
QueryManager getQueryManager()
StoreSchemaHandler getSchemaHandler()
NucleusSequence getNucleusSequence(ExecutionContext ec, SequenceMetaData seqmd)
ec
- execution contextseqmd
- SequenceMetaDataNucleusConnection getNucleusConnection(ExecutionContext ec)
ec
- execution contextConnectionManager getConnectionManager()
ManagedConnection getConnection(ExecutionContext ec)
If there is an active transaction, a connection from the transactional connection factory will be returned. If there is no active transaction, a connection from the nontransactional connection factory will be returned.
ec
- execution contextNucleusException
- Thrown if an error occurs getting the connectionManagedConnection getConnection(ExecutionContext ec, Map options)
If there is an active transaction, a connection from the transactional connection factory will be returned. If there is no active transaction, a connection from the nontransactional connection factory will be returned.
ec
- execution contextoptions
- connetion optionsNucleusException
- Thrown if an error occurs getting the connectionString getConnectionDriverName()
String getConnectionURL()
String getConnectionUserName()
String getConnectionPassword()
Object getConnectionFactory()
String getConnectionFactoryName()
Object getConnectionFactory2()
String getConnectionFactory2Name()
ValueGenerationManager getValueGenerationManager()
ApiAdapter getApiAdapter()
String getStoreManagerKey()
String getQueryCacheKey()
NucleusContext getNucleusContext()
Date getDatastoreDate()
boolean isJdbcStore()
void printInformation(String cat, PrintStream ps) throws Exception
cat
- Category of informationps
- PrintStreamException
- Thrown if an error occurs in the output processboolean useBackedSCOWrapperForMember(AbstractMemberMetaData mmd, ExecutionContext ec)
mmd
- Metadata for the memberec
- ExecutionContextboolean managesClass(String className)
className
- The name of the classvoid addClass(String className, ClassLoaderResolver clr)
className
- Name of the classclr
- The ClassLoaderResolvervoid addClasses(String[] classNames, ClassLoaderResolver clr)
This method is primarily useful for applications that wish to perform all of their datastore initialization up front, rather than wait for the runtime to do it on-demand.
classNames
- The class(es) to be added.clr
- The ClassLoaderResolverDatastoreValidationException
- If there is some mismatch between the current datastore contents and
those necessary to enable persistence of the given classes.void removeAllClasses(ClassLoaderResolver clr)
clr
- The ClassLoaderResolverString manageClassForIdentity(Object id, ClassLoaderResolver clr)
id
- OIDclr
- ClassLoader resolverNucleusUserException
- if the identity is assigned to the wrong classExtent getExtent(ExecutionContext ec, Class c, boolean subclasses)
ec
- execution contextc
- The class requiring the Extentsubclasses
- Whether to include subclasses of 'c'boolean supportsQueryLanguage(String language)
language
- The languageboolean supportsValueStrategy(String strategy)
strategy
- The strategyString getClassNameForObjectID(Object id, ClassLoaderResolver clr, ExecutionContext ec)
id
- The identity of some object.clr
- ClassLoader resolverec
- execution contextClassCastException
- If the type of ID is not recognized (OID
or SCOID
).boolean isStrategyDatastoreAttributed(AbstractClassMetaData cmd, int absFieldNumber)
cmd
- Metadata for the classabsFieldNumber
- number of the field (or -1 if for datastore-id)Object getStrategyValue(ExecutionContext ec, AbstractClassMetaData cmd, int absoluteFieldNumber)
ec
- execution contextcmd
- AbstractClassMetaData for the classabsoluteFieldNumber
- The field numberCollection<String> getSubClassesForClass(String className, boolean includeDescendents, ClassLoaderResolver clr)
className
- Class for which we search for subclasses.includeDescendents
- Whether to include subclasses of subclasses etcclr
- The ClassLoaderResolverboolean hasProperty(String name)
int getIntProperty(String name)
boolean getBooleanProperty(String name)
boolean getBooleanProperty(String name, boolean resultIfNotSet)
void transactionStarted(ExecutionContext ec)
ec
- ExecutionContextvoid transactionCommitted(ExecutionContext ec)
ec
- ExecutionContextvoid transactionRolledBack(ExecutionContext ec)
ec
- ExecutionContextboolean isAutoCreateTables()
boolean isAutoCreateConstraints()
boolean isAutoCreateColumns()
String getDefaultObjectProviderClassName()
Copyright © 2021. All rights reserved.