Interface MTSymbol

All Superinterfaces:
Comparable<MTNamedObject>, MTDataObject, MTHistoryEnabled, MTNamedObject, MTSymbolHeader
All Known Subinterfaces:
MTCompleteSymbol

public interface MTSymbol extends MTSymbolHeader, MTHistoryEnabled
Full interface for symbols. A symbol could be for example a role, a process or an individual. Each symbol can be placed in one or more models where they are represented by vertices.
Since:
3.0
  • Field Details

  • Method Details

    • canUserRead

      boolean canUserRead()
    • canUserWrite

      boolean canUserWrite()
    • getOwner

      MTUserHeader getOwner()
      Returns "access control" owner of this object.
      Returns:
      owner of object
    • getGroup

      MTPermissionGroup getGroup()
      Returns the "access control" group of this object.
      Returns:
      object group
    • getLastModifiedBy

      MTUserHeader getLastModifiedBy()
      Returns the user that last modified this object.
      Returns:
      the last user that modified this object.
    • setLastModifiedBy

      void setLastModifiedBy(MTUserHeader user)
      Set the last user that modified this object.
      Parameters:
      user - the last user that modified this object.
    • getCreatedBy

      MTUserHeader getCreatedBy()
    • setCreatedBy

      void setCreatedBy(MTUserHeader user)
    • getPermissions

      MTPermissions getPermissions()
      Returns "access control" permissions for this object.
      Returns:
      permissions for object
    • setPermissions

      void setPermissions(MTPermissions permissions)
      Sets "access control" permissions for this object.
      Parameters:
      permissions - permissions for this object
    • setPermissions

      void setPermissions(int permissions)
    • setLastModified

      void setLastModified(Date date)
      Sets the last modified date for the symbol. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the symbol is saved.
      Parameters:
      date - The new last modified date
    • setCreated

      void setCreated(Date date)
      Sets the creation date for the symbol. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the symbol is saved.
      Parameters:
      date - The new last modified date
    • getPropertyProviders

      Set<String> getPropertyProviders()
      Returns all providers that have stored properties.
      Returns:
      A set of provider ID:s
      Since:
      3.0
    • getPropertyKeys

      Set<String> getPropertyKeys(String provider)
      Returns the property names of all properties stored by a provider.
      Parameters:
      provider - The provider ID.
      Returns:
      A set of property names.
    • getProperty

      String getProperty(String provider, String name)
      Returns a property value.
      Parameters:
      provider - The provider ID.
      name - The property name.
      Returns:
      The property value or null.
      Since:
      3.0
    • setProperty

      void setProperty(String provider, String name, String value)
      Sets a property value.
      Parameters:
      provider - The ID of the provider setting this property.
      name - The property name.
      value - The new property value. Values longer than 255 characters will be truncated.
      Since:
      3.0
    • removeProperty

      void removeProperty(String provider, String name)
      Removes a property.
      Parameters:
      provider - The ID of the provider setting this property.
      name - The property name.
    • getAttributes

      List<MTAttribute> getAttributes(Predicate<MTAttribute> filter)
      Returns all attributes connected to the symbol.
      Parameters:
      filter - If this returns false for an MTAttribute, it will not be in the returned list.
      Returns:
      All attributes connected to the symbol.
      Since:
      5.0
    • getAttribute

      Returns the attribute of the given type.
      Parameters:
      type - the type of the attribute to return
      Returns:
      the attribute of the given type
      Throws:
      IllegalArgumentException - If the attribute type is not connected to this symbol's type
      Since:
      5.0
    • getRevisionLog

      List<MTRevisionLogEntry> getRevisionLog()
      Returns the revision log for this revision of the symbol.
      Returns:
      The revision log.
      Since:
      3.0
    • getBreakdownUUIDs

      Collection<String> getBreakdownUUIDs()
      Returns the UUID:s for all models that this symbol breaks down to. The result does not take workspaces into account, so it is not guaranteed that all of the models exist in the current workspace.
      Returns:
      The UUID:s of all models that this symbol breaks down to.
      Since:
      3.0
    • setBreakdownUUIDs

      void setBreakdownUUIDs(Collection<String> models)
      Sets the UUID:s for all models that this symbol breaks down to. The new breakdowns will be saved when the symbol is saved.
      Since:
      3.0
    • setType

      void setType(SymbolType type)
      Sets the type of the symbol. This will not remove existing data but might prevent access to the data if the new type is not recognized as having that data. This is specifically the case for plugin data. Generally, one should not change the type defined by a certain model extension to a type defined by another model extension.
      Parameters:
      type - The new type of the symbol
    • setTitle

      void setTitle(String title)
      Sets the title in the current language.
      Parameters:
      title - The new title.
      Since:
      3.0
    • setTitle

      void setTitle(MTLanguageHeader lang, String title)
      Sets the title in a given language.
      Parameters:
      lang - The language.
      title - The new title.
      Since:
      3.0
    • setReferenceID

      void setReferenceID(String referenceID)
      Sets the reference ID of the model. This is the reference ID used to identify the model for example when creating HTML pages. If no reference ID has been set the UUID will be used.
      Parameters:
      referenceID - referenceID The new reference ID or null to clear the reference ID.
      Since:
      3.1
    • setVariant

      void setVariant(SymbolVariant variant)
      Sets the variant for symbol types that have different variants. The variant must be one of the available variants for the current symbol type.
      Parameters:
      variant - The new variant.
      Throws:
      IllegalArgumentException - If the variant is not one of the available variants for the current symbol type.
      Since:
      3.0
    • setOwner

      void setOwner(MTUserHeader owner)
      Sets the owner of the symbol.
      Parameters:
      owner - The new owner.
      Since:
      3.0
    • setGroup

      void setGroup(MTPermissionGroup group)
      Sets the group that the symbol belongs to.
      Parameters:
      group - The new group.
      Since:
      3.0
    • setTranslated

      void setTranslated(MTLanguage lang, boolean translated)
      Marks this symbol as translated in the given language.
      Since:
      3.1
    • setPrefix

      void setPrefix(String prefix)
      Sets a prefix used to identify this symbol. If used the prefix can be used for filtering/finding symbols easier.
    • setPrefixLocked

      void setPrefixLocked(boolean locked)
      Locks the current prefix so it cannot be modified.
    • addDocument

      void addDocument(MTDocument document)
      Adds a document to the symbol.
      Parameters:
      document - The document to add.
      Since:
      3.0
    • removeDocument

      void removeDocument(MTDocumentHeader document)
      Removes a document from the symbol.
      Parameters:
      document - The document to remove.
      Since:
      3.0
    • connectDocument

      default void connectDocument(Document document)
      Connects a document to a symbol.
    • connectDocument

      default void connectDocument(Document.DocumentID id)
      Connects a document to a symbol.
    • disconnectDocument

      default void disconnectDocument(Document document)
      Disconnects a document from the symbol.
    • disconnectDocument

      default void disconnectDocument(Document.DocumentID id)
      Disconnects a document from the symbol.
    • queueSave

      void queueSave(MTRemoteChangeHandler exceptionHandler) throws MTAccessException
      Puts this symbol on a save queue, making this call safe to do from the event dispatch thread.
      Parameters:
      exceptionHandler - an exception handler that is called if an exception is raised during save, or null to let the saving thread's own exception handler deal with an uncaught (wrapping) runtime exception.
      Throws:
      MTAccessException
    • save

      Saves a new symbol or changes to an existing one. A symbol can only be saved in the current workspace.
      Throws:
      MTAccessException
      MTRemoteChangeException
      Since:
      3.0
    • hasPluginData

      boolean hasPluginData()
      Returns true if there is plug-in data connected to the entity.
    • lockRevision

      MTRevisionOperation lockRevision()
      Prepares for locking the current revision of the symbol. Calling this method does not actually lock the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the lock operation.
      Returns:
      A revision operation object that can be used to perform the lock operation assuming that locks could be obtained successfully.
    • changeRevision

      MTRevisionOperation changeRevision()
      Prepares for a change to the current revision of the symbol, i.e. add a message to the revision log of the current revision. Calling this method does not actually change the revision. It obtains a lock on the model. The returned operation object can be used to actually commit the change to the revision.
      Returns:
      A revision operation object that can be used to perform the change operation assuming that a lock could be obtained successfully.
    • createRevision

      MTRevisionOperation createRevision()
      Prepares for creating a new revision of the symbol. Calling this method does not actually create the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the create operation.
      Returns:
      A revision operation object that can be used to perform the create operation assuming that locks could be obtained successfully.
    • revertToRevision

      MTRevisionOperation revertToRevision(MTRevisionInfo rev)
      Prepares for reverting to an earlier revision of the symbol. If the current revision of this symbol is open, the data from the earlier revision will be copied to this revision of the symbol. If the current revision is lost a new revision will be created in the current workspace and the data will be copied to this revision. This will also create new revisions of any models in the workspace that uses the symbol.
      Parameters:
      rev - The revision to revert to.
      Returns:
      A revision operation object that can be used to perform the revert operation assuming that locks could be obtained successfully.