public class WGFakeContentStore extends WGFakeDatabase implements WGDatabaseCoreFeatureReturnHierarchyCount, WGDatabaseCoreFeatureSequenceProvider, AuthenticationSourceListener
Modifier and Type | Class and Description |
---|---|
class |
WGFakeContentStore.ACLEntryImpl |
class |
WGFakeContentStore.ACLImpl |
COPTION_LANGUAGE, DBTYPE, FAKE_AREA, FAKE_CONTENTNAME, FAKE_CONTENTTYPE, FAKE_LANGUAGE, FAKE_STRUCTKEY, FAKE_TITLE, FAKE_TML
Constructor and Description |
---|
WGFakeContentStore() |
Modifier and Type | Method and Description |
---|---|
void |
authenticationDataChanged()
Callback method on a change in the authentication data backend
|
void |
beginUpdate()
Notifies the backend database that the session will update data from now on.
|
java.lang.Object |
callBackendService(java.lang.String serviceName,
java.lang.Object[] params)
Calls a backend service whose support is optional.
|
WGDocumentCore |
createUserProfile(java.lang.String name,
int type)
Called to create a new user profile.
|
void |
deleteSequence(java.lang.String name)
Deletes a sequence, clearing all increment and initialisation data
|
WGACLCore |
getACL()
Retrieves the ACL if implementation supports WGDatabase.FEATURE_ACL_MANAGEABLE
|
int |
getChildEntryCount(WGStructEntry structEntry)
Retrieves the number of child entries of the given struct entry without actually retrieving them
|
int |
getContentStorePatchLevel()
Returns the patch level of the storage format of this WGA Content Store.
|
double |
getContentStoreVersion()
Returns the version of WGA Content Store that this backend represents.
|
long |
getLastSequenceIncrementValue(java.lang.String name)
Returns the returned value of the sequence on the last
WGDatabaseCoreFeatureSequenceProvider.incrementSequence(String) call. 0 if it was not yet used. |
int |
getRootEntryCount(WGArea area)
Retrieves the root entries (i.e. entries without parents) of the given area.
|
java.util.List |
getUpdateLogs(java.lang.Comparable cutoff)
Retrieves list of update logs - i.e. the operations done on documents - since a cutoff revision in ascending order of operation times.
|
java.util.List<java.lang.String> |
getUsedSequenceNames()
Returns names of sequences already initialized and/or in use
|
boolean |
hasFeature(java.lang.String feature)
Returns information on specific features, that this database implements.
|
long |
incrementSequence(java.lang.String name)
Increments the sequence and returns a new unique value.
|
boolean |
initSequence(java.lang.String name,
long startValue,
boolean forceInit)
Initializes a sequence, if it either is not yet initialized or argument forceInit is true.
|
boolean |
isBackendServiceSupported(java.lang.String serviceName)
Returns if a backend service is supported
|
boolean |
isContentTypeUsed(WGContentType ct)
Tests if the given content type is still in usage, i.e. if there are struct entries referencing it
|
boolean |
isLanguageUsed(WGLanguage lang)
Tests if the given language is still in usage, i.e. if there are contents referencing it
|
boolean |
isSequenceInitialized(java.lang.String name)
Returns if a sequence of that name is already initialized.
|
WGUserAccess |
openSession(AuthenticationSession authSession,
java.lang.Object credentials,
boolean master)
Opens a session for the given user/thread.
|
beginTransaction, clearSessionCache, close, closeSession, commitTransaction, convertFileNameForAttaching, createContent, createCopy, createDesignDocument, createStructEntry, fastAccess, getAllContent, getAllContentKeys, getAllUserProfileNames, getChildEntries, getContentByKey, getContentByName, getContentCount, getCreated, getDedicatedWorkflowEngine, getDeletions, getDesignObject, getDesignObjects, getDummyContent, getExtensionData, getExtensionDataNames, getFakeLanguage, getIncomingRelations, getNativeObject, getParentEntry, getRevision, getRevisionDate, getRoles, getRootEntries, getServerName, getStructEntryByKey, getStructEntryByName, getTitle, getTypeName, getUserProfile, isMemberOfUserList, moveStructEntry, open, parseStructKey, query, queryUserProfileNames, refresh, removeExtensionData, resultIsFalse, resultIsTrue, rollbackTransaction, setCurrentSession, writeExtensionData
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginTransaction, clearSessionCache, close, closeSession, commitTransaction, convertFileNameForAttaching, createContent, createCopy, createDesignDocument, createStructEntry, fastAccess, getAllContent, getAllContentKeys, getChildEntries, getContentByKey, getContentByName, getContentCount, getDedicatedWorkflowEngine, getDesignObject, getDesignObjects, getDummyContent, getExtensionData, getExtensionDataNames, getIncomingRelations, getNativeObject, getParentEntry, getRevision, getRevisionDate, getRoles, getRootEntries, getServerName, getStructEntryByKey, getStructEntryByName, getTitle, getTypeName, isMemberOfUserList, moveStructEntry, open, parseStructKey, query, refresh, removeExtensionData, resultIsFalse, resultIsTrue, rollbackTransaction, setCurrentSession, writeExtensionData
public WGUserAccess openSession(AuthenticationSession authSession, java.lang.Object credentials, boolean master) throws WGAPIException
WGDatabaseCore
openSession
in interface WGDatabaseCore
authSession
- The authentication session of the current user. If there is no authentication module configured this is of type BackendAuthSession
credentials
- The credentials that the user gave for authenticatingmaster
- States, that the used login is the master loginWGAPIException
public void beginUpdate() throws WGBackendException
WGDatabaseCore
beginUpdate
in interface WGDatabaseCore
WGBackendException
public boolean isContentTypeUsed(WGContentType ct) throws WGAPIException
WGDatabaseCore
isContentTypeUsed
in interface WGDatabaseCore
ct
- The content type to testWGAPIException
public boolean isLanguageUsed(WGLanguage lang) throws WGAPIException
WGDatabaseCore
isLanguageUsed
in interface WGDatabaseCore
lang
- The language to testWGAPIException
public boolean isBackendServiceSupported(java.lang.String serviceName)
WGDatabaseCore
isBackendServiceSupported
in interface WGDatabaseCore
serviceName
- Name of the servicepublic java.lang.Object callBackendService(java.lang.String serviceName, java.lang.Object[] params) throws WGAPIException
WGDatabaseCore
callBackendService
in interface WGDatabaseCore
serviceName
- The service name. Use WGDatabase.BACKENDSERVICE_*params
- The matching parameters for the called serviceWGAPIException
public boolean hasFeature(java.lang.String feature)
WGDatabaseCore
hasFeature
in interface WGDatabaseCore
hasFeature
in class WGFakeDatabase
feature
- The requested feature. The constants WGDatabase.FEATURE_... are used here.public double getContentStoreVersion() throws WGAPIException
WGDatabaseCore
getContentStoreVersion
in interface WGDatabaseCore
getContentStoreVersion
in class WGFakeDatabase
WGAPIException
public int getContentStorePatchLevel() throws WGAPIException
WGDatabaseCore
getContentStorePatchLevel
in interface WGDatabaseCore
getContentStorePatchLevel
in class WGFakeDatabase
WGAPIException
public WGDocumentCore createUserProfile(java.lang.String name, int type) throws WGAPIException
WGPersonalisationDatabaseCore
createUserProfile
in interface WGPersonalisationDatabaseCore
createUserProfile
in class WGFakeDatabase
name
- The name, that the caller wants for the new profile. If null, the implementation should create a name.type
- The type, that the caller wants to assign the profile. Possible values chosen by personalisation implementationWGAPIException
public void authenticationDataChanged()
AuthenticationSourceListener
authenticationDataChanged
in interface AuthenticationSourceListener
public boolean initSequence(java.lang.String name, long startValue, boolean forceInit) throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
initSequence
in interface WGDatabaseCoreFeatureSequenceProvider
name
- Name of the sequencestartValue
- The start value of the sequence, i.e. the first value to serve by the first WGDatabaseCoreFeatureSequenceProvider.incrementSequence(String)
call.forceInit
- true if you want to re-initialize the sequence even if it already existsWGBackendException
WGAPIException
public long incrementSequence(java.lang.String name) throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
incrementSequence
in interface WGDatabaseCoreFeatureSequenceProvider
name
- Name of the sequenceWGAPIException
public boolean isSequenceInitialized(java.lang.String name) throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
isSequenceInitialized
in interface WGDatabaseCoreFeatureSequenceProvider
name
- Name of the sequence.WGAPIException
public long getLastSequenceIncrementValue(java.lang.String name) throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
WGDatabaseCoreFeatureSequenceProvider.incrementSequence(String)
call. 0 if it was not yet used.getLastSequenceIncrementValue
in interface WGDatabaseCoreFeatureSequenceProvider
name
- Name of the sequenceWGAPIException
public void deleteSequence(java.lang.String name) throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
deleteSequence
in interface WGDatabaseCoreFeatureSequenceProvider
name
- Name of the sequenceWGAPIException
public java.util.List<java.lang.String> getUsedSequenceNames() throws WGAPIException
WGDatabaseCoreFeatureSequenceProvider
getUsedSequenceNames
in interface WGDatabaseCoreFeatureSequenceProvider
WGAPIException
public int getChildEntryCount(WGStructEntry structEntry) throws WGAPIException
WGDatabaseCoreFeatureReturnHierarchyCount
getChildEntryCount
in interface WGDatabaseCoreFeatureReturnHierarchyCount
structEntry
- The struct entry, whose children are to be retrievedWGAPIException
public int getRootEntryCount(WGArea area) throws WGAPIException
WGDatabaseCoreFeatureReturnHierarchyCount
getRootEntryCount
in interface WGDatabaseCoreFeatureReturnHierarchyCount
area
- The area, whose root entries are to be retrievedWGAPIException
public WGACLCore getACL()
WGDatabaseCore
getACL
in interface WGDatabaseCore
getACL
in class WGFakeDatabase
public java.util.List getUpdateLogs(java.lang.Comparable cutoff)
WGDatabaseCore
getUpdateLogs
in interface WGDatabaseCore
getUpdateLogs
in class WGFakeDatabase
WGUpdateLog