Package se.conciliate.extensions.store
Interface MTStore
public interface MTStore
Provides an entry point for accessing MT classes, which can
be used to query and update data in the modeling tool.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidcreateBatchIterator(Class mtClass, List<Long> idList) Creates and returns an iterator over a list of MT objects that fetches information from the underlying store in batches as the iterator is traversed.findRepository(long repositoryID) Finds a repository by ID.Returns the current connection, if any.Returns the current language.Returns the languages in the current repository.Returns the current permission group.default Set<MTPermissionGroup>Returns the currently available permission groups.Returns the current repository.Returns the currently logged in user or null if no such user can be found, that is, if the end-user is not logged in.Returns the current workspace.Returns a document store.getLanguage(String uuid) Returns the language with uuid 'uuid'Returns a model store.Returns a notification store.Returns the current repository connection.Returns the current server connection or null if no such connection exists.Returns the current repository connection.Returns a symbol store.Returns a user store.booleanReturns true if we have a connection to any database, i.e.booleanisLocal()Checks if the current connection is a "local" connection.booleanisRemote()Returns true if the current connection is "remote", i.e.default voidqueueEdits(LinkedHashSet<MTEdit> edits) Queues edits that needs to be saved in a single transaction for saving later on the edit queue.voidvoidvoidvoidvoidvoidvoidvoiddefault <T> TrunUnsafeSQL(String sql) <T> TDeprecated.Not part of the public API.voidsetCurrentLanguage(MTLanguage language) Sets the current language.default voidSets the current permission group to work in.voidsetDataSourceConnection(MTConnection connection) Used when switching between local repositories and servers.void
-
Method Details
-
getCurrentUser
MTUser getCurrentUser()Returns the currently logged in user or null if no such user can be found, that is, if the end-user is not logged in.- Returns:
- null or the currently logged in user.
- Since:
- 3.0
-
getCurrentPermissionGroup
MTPermissionGroup getCurrentPermissionGroup()Returns the current permission group. This is the permissions that will be initially set on all objects created by the user. -
setCurrentPermissionGroup
Sets the current permission group to work in. -
getCurrentPermissionGroups
Returns the currently available permission groups. -
getCurrentRepository
MTRepository getCurrentRepository()Returns the current repository.- Returns:
- The current repository or
nullif no workspace is currently opened. - Since:
- 3.0
-
getCurrentWorkspace
MTWorkspace getCurrentWorkspace()Returns the current workspace.- Returns:
- The current workspace or
nullif no workspace is currently opened. - Since:
- 3.0
-
getCurrentLanguage
MTLanguage getCurrentLanguage()Returns the current language.- Returns:
- The current language or
nullif no workspace is currently opened. - Since:
- 3.0
-
setCurrentLanguage
Sets the current language.- Parameters:
language- The language to switch to.- Throws:
IllegalArgumentException- If the language is not one of the languages in the current repository.
-
getLanguage
Returns the language with uuid 'uuid'- Returns:
- The the language with uuid 'uuid' or
nullif no exists - Since:
- 3.1
-
getCurrentLanguages
List<MTLanguage> getCurrentLanguages()Returns the languages in the current repository.- Returns:
- The languages in the current repository.
- Since:
- 3.0
-
getModelStore
MTModelStore getModelStore()Returns a model store.- Returns:
- A model store.
- Since:
- 3.0
-
getNotificationStore
MTNotificationStore getNotificationStore()Returns a notification store.- Returns:
- A notification store.
-
getUserStore
MTUserStore getUserStore()Returns a user store.- Returns:
- A user store.
- Since:
- 3.0
-
getDocumentStore
MTDocumentStore getDocumentStore()Returns a document store.- Returns:
- A document store.
- Since:
- 3.0
-
getSymbolStore
MTSymbolStore getSymbolStore()Returns a symbol store.- Returns:
- A symbol store.
- Since:
- 3.0
-
createBatchIterator
Creates and returns an iterator over a list of MT objects that fetches information from the underlying store in batches as the iterator is traversed. Iterators can be created for the following types: MTDocumentHeader.class MTDocument.class MTDocumentTypeHeader.class MTDocumentType.class MTModelHeader.class MTModel.class MTSymbolHeader.class MTSymbol.class MTVertexHeader.class MTVertex.class- Parameters:
mtClass- The MT class to iterate over, e.g. MTModelHeader or MTModelidList- The list of ID:s of the objects to iterate through- Returns:
- An MT batch iterator over the objects with the given ID:s.
-
isLocal
boolean isLocal()Checks if the current connection is a "local" connection. Also returns true if no connection to a repository is currently made.- Returns:
- false if connected to a remote server, true otherwise.
- Since:
- 3.0
-
isRemote
boolean isRemote()Returns true if the current connection is "remote", i.e. connected to a remote repository or in repository manager with an active server connection. -
isConnected
boolean isConnected()Returns true if we have a connection to any database, i.e. a server connection or connected to a local repository.- Returns:
- true if connected, otherwise false
-
getServer
MTServer getServer()Returns the current server connection or null if no such connection exists.- Returns:
- Returns the current server connection or
nullif not currently connected to a server. - Since:
- 3.1
-
addRepositoryStateListener
-
removeRepositoryStateListener
-
addLanguageListener
-
removeLanguageListener
-
addListListener
-
removeListListener
-
addMTDocumentListener
-
removeMTDocumentListener
-
addMTDocumentTypeListener
-
removeMTDocumentTypeListener
-
addMTAttributeTypeListener
-
removeMTAttributeTypeListener
-
addVariableListener
-
removeVariableListener
-
addSubscriberListener
-
removeSubscriberListener
-
findRepository
Finds a repository by ID. -
runUnsafeSQL
-
getConnection
MTConnection getConnection()Returns the current connection, if any. -
getRepositoryConnection
MTRepositoryConnection getRepositoryConnection()Returns the current repository connection. Returns null if not currently connected to a repository. -
getServerConnection
MTServerConnection getServerConnection()Returns the current repository connection. Returns null if not currently connected to a repository. -
setDataSourceConnection
Used when switching between local repositories and servers. -
service
Deprecated.Not part of the public API. -
rest
-
updateColorScheme
void updateColorScheme() -
queueEdits
Queues edits that needs to be saved in a single transaction for saving later on the edit queue. For edits that can be saved individually without affecting other edits, use the specific implementation methods instead, e.g. MTVertex.queueSave(), MTSymbol.queueSave().- Parameters:
edits- The edits to save in the same transaction.
-