Package se.conciliate.extensions.store
Interface MTModelStore
public interface MTModelStore
Utility methods for models, vertices and edges.
- Since:
- 3.0
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a model store listener that will be notified when a model is added, removed or changed through the store api.voidvoidvoidbatchLock(Collection<? extends MTModelHeader> models) Locks all supplied models and returns normally or locks no model and throws an exception.voidcreateBreakdown(MTModelHeader model, MTEdgeHeader edge) Creates a new breakdown from the edge to the model, if one does not already exist.voidcreateBreakdown(MTModelHeader model, MTSymbolHeader symbol) Creates a new breakdown from the model to the symbol if one does not already exist.findAttributes(Collection<MTModel> models, Collection<? extends MTAttributeTypeHeader> types) Finds all attributes for a collection of models.findEdge(long id) Finds an edge given its ID.findEdgeHeaders(List<Long> idList) Finds edges from a list of edge ID:s, as headers.Finds edges from a list of edge ID:s.findHasBreakdown(List<MTModelHeader> headers) Returns a map describing if a model has breakdowns or not.findModel(long id) Finds a model by ID.Finds a model given its UUID and revision.findModelHeaders(List<Long> idList) Finds models in the current repository from a list of model ID:s, as headers.findModels(List<Long> idList) Finds models from a list of model ID:s.findRevisionLogEntries(String modelUUID) Finds all entries made in the revision log for a model in the current repository.findVertexHeaders(List<Long> idList) Finds vertices in the current repository from a list of vertex ID:s, as headers.findVertices(List<Long> idList) Finds vertices in the current repository from a list of vertex ID:s.getModelBounds(Collection<? extends MTVertex> vertices, Collection<? extends MTEdge> edges) Returns the bounds of a model.voidremoveBreakdown(MTModelHeader model, MTEdgeHeader edge) Removes the breakdown between the edge and the model if one exists, otherwise nothing happens.voidremoveBreakdown(MTModelHeader model, MTSymbolHeader symbol) Removes the breakdown between the symbol and the model if one exists, otherwise nothing happens.voidRemoves a model store listener.voidvoidvoidsetApprovers(Map<? extends MTModelHeader, Set<? extends MTUserHeader>> approvers) Sets approvers on models.voidsetMaintainers(Map<? extends MTModelHeader, Set<? extends MTUserHeader>> maintainers) Sets maintainers on models.voidsetReviewers(Map<? extends MTModelHeader, Set<? extends MTUserHeader>> reviewers) Sets reviewers on models.voidsetSubscribers(Map<? extends MTModelHeader, Set<MTSubscriber>> subscribers) Sets subscribers on models.voidupdateSubscriptions(Map<Long, Set<Long>> subscriptions) Sets model subscriptions for subscribers in the current repository.
- 
Method Details- 
addMTModelStoreListenerAdds a model store listener that will be notified when a model is added, removed or changed through the store api.- Parameters:
- l- a MTModelStoreListener
 
- 
removeMTModelStoreListenerRemoves a model store listener.- Parameters:
- l- The MTModelStoreListener to remove.
 
- 
addWorkflowRoleListener
- 
removeWorkflowRoleListener
- 
addSubscriberListener
- 
removeSubscriberListener
- 
removeBreakdownRemoves the breakdown between the edge and the model if one exists, otherwise nothing happens.- Parameters:
- model- The model part of the breakdown
- edge- The edge part of the breakdown
 
- 
removeBreakdownRemoves the breakdown between the symbol and the model if one exists, otherwise nothing happens.- Parameters:
- model- The model part of the breakdown
- symbol- The symbol part of the breakdown
 
- 
createBreakdownCreates a new breakdown from the edge to the model, if one does not already exist. If it already exists, nothing happens.- Parameters:
- model- the model to break down to
- edge- the edge to break down from
 
- 
createBreakdownCreates a new breakdown from the model to the symbol if one does not already exist. If it already exists, nothing happens.- Parameters:
- model- the model to break down to
- symbol- the edge to break down from
 
- 
findModelFinds a model by ID.- Parameters:
- id- The model ID.
- Returns:
- A model or nullif no such model exists.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findModelsFinds models from a list of model ID:s. The models will be returned in the same order as the ID list. Models which the current user does not have read access to will be filtered out of the result.- Parameters:
- idList- The ID:s of models to find.
- Returns:
- A list of models with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findModelHeadersFinds models in the current repository from a list of model ID:s, as headers. The models will be returned in the same order as the ID list. Models which the current user does not have read access to will be filtered out of the result.- Parameters:
- idList- The ID:s of models to find.
- Returns:
- A list of models with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
batchLockvoid batchLock(Collection<? extends MTModelHeader> models) throws MTAccessException, MTRemoteChangeException Locks all supplied models and returns normally or locks no model and throws an exception. This is the preferred way to lock multiple models. Looping over a collection of models and invokingMTModelHeader.lock()is discourage since it is not possible to either lock all or none. This method is able to either lock all or none.- Parameters:
- models- The models to lock.
- Throws:
- MTAccessException- If the current user lacks access rights to one of the supplied models.
- MTRemoteChangeException- If one of the supplied models has been locked by someone else or if one of the supplied models is out of date.
 
- 
findVerticesFinds vertices in the current repository from a list of vertex ID:s. The vertices will be returned in the same order as the ID list.- Parameters:
- idList- The ID:s of vertices to find.
- Returns:
- A list of vertices with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findVertexHeadersFinds vertices in the current repository from a list of vertex ID:s, as headers. The vertices will be returned in the same order as the ID list.- Parameters:
- idList- The ID:s of vertices to find.
- Returns:
- A list of vertices with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findEdgeFinds an edge given its ID.- Parameters:
- id- The ID of the edge.
- Returns:
- The edge or null.
 
- 
findEdgesFinds edges from a list of edge ID:s. The edges will be returned in the same order as the ID list.- Parameters:
- idList- The ID:s of edges to find.
- Returns:
- A list of edges with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findEdgeHeadersFinds edges from a list of edge ID:s, as headers. The edges will be returned in the same order as the ID list.- Parameters:
- idList- The ID:s of edges to find.
- Returns:
- A list of edges with the ID:s in idList.
- Throws:
- MTAccessException
- Since:
- 3.0
 
- 
findHasBreakdownReturns a map describing if a model has breakdowns or not.- Parameters:
- headers- The headers that should be "checked".
- Returns:
- a map describing if a model has breakdowns or not.
- Throws:
- MTAccessException
 
- 
findModelFinds a model given its UUID and revision.- Parameters:
- modelUUID- The UUID of the model.
- revision- The revision for the model.
- Returns:
- The model or null.
- Throws:
- MTAccessException
 
- 
getModelBoundsRectangle getModelBounds(Collection<? extends MTVertex> vertices, Collection<? extends MTEdge> edges) Returns the bounds of a model.- Parameters:
- vertices- The vertices in the model.
- edges- The edges in the model.
- Returns:
- The model bounds.
- Since:
- 3.0
 
- 
findRevisionLogEntriesFinds all entries made in the revision log for a model in the current repository. This includes entries for all revisions made of the model.- Parameters:
- modelUUID- The UUID of the model.
- Returns:
- All revision log entries for the model.
 
- 
setApproversSets approvers on models.- Parameters:
- approvers- A map where the keys are models and the values are their respective sets of approvers.
 
- 
setReviewersSets reviewers on models.- Parameters:
- reviewers- A map where the keys are models and the values are their respective sets of reviewers.
 
- 
setMaintainersSets maintainers on models.- Parameters:
- maintainers- A map where the keys are models and the values are their respective sets of maintainers.
 
- 
setSubscribersSets subscribers on models.- Parameters:
- subscribers- A map where the keys are models and the values are their respective sets of subscribers.
 
- 
updateSubscriptionsSets model subscriptions for subscribers in the current repository.- Parameters:
- subscriptions- A map where the keys are subscriber ID:s and the values are their respective sets of ID:s for models to subscribe to.
 
- 
findAttributesMap<MTModel,List<MTAttribute>> findAttributes(Collection<MTModel> models, Collection<? extends MTAttributeTypeHeader> types) Finds all attributes for a collection of models.
 
-