de.uka.ipd.consensus.foundation.evolution
Interface EvolutionManager

All Superinterfaces:
ConsensusFoundationModule
All Known Implementing Classes:
EvolutionManagerImpl

public interface EvolutionManager
extends ConsensusFoundationModule

The EvolutionManager is responsible for major or destructive changes and keeping the ontology consistent.

The EvolutionManager implementation can be configured with the key cf.evolutionmanager in the ConsensusFoundation.properties configuration file. It's an optional component.

The implementation is loaded by the ConsensusFoundation constructor. For successful instantiation, the EvolutionManager implementation must provide a default constructor without arguments.

Version:
2006-06-14
Author:
Thomas Much
See Also:
ConsensusFoundation, OntologyManager

Method Summary
 void addEvolutionListener(EvolutionListener listener)
          Registers a new EvolutionListener.
 void deleteAssociation(User user, Association assoc)
          Deletes an association and all dependant elements (e.g. topics, if it makes sense).
 void deleteAttribute(User user, Topic topic, Attribute attr)
          Deletes an attribute (and all dependant elements if there are any).
 void deleteTopic(User user, Topic topic)
          Deletes a topic and all dependant elements (attributes and, if it makes sense, associations), but not the subtopics of the topic.
 void deleteTopicAndSubtopics(User user, Topic topic)
          Deletes a topic and all dependant elements, including the subtopics of the topic.
 void init(Properties config, LoggingManager logging, UserManager users, OntologyManager ontology)
          This method is called by the ConsensusFoundation constructor to initialize the EvolutionManager.
 Topic makeClass(User user, Topic instance)
          Converts an instance topic into a class topic.
 Topic makeInstance(User user, Topic cls)
          Converts an instance topic into a class topic.
 Topic mergeTopics(User user, Topic topic1, Topic topic2)
          Merges two topics.
 void removeEvolutionListener(EvolutionListener listener)
          Removes an EvolutionListener, if it is registered with the EvolutionManager (otherwise this call is ignored).
 
Methods inherited from interface de.uka.ipd.consensus.foundation.ConsensusFoundationModule
getConsensusFoundationManager, getVersion, initCompleted, shutdown
 

Method Detail

init

public void init(Properties config,
                 LoggingManager logging,
                 UserManager users,
                 OntologyManager ontology)
          throws Exception

This method is called by the ConsensusFoundation constructor to initialize the EvolutionManager.

Parameters:
config - all entries from ConsensusFoundation.properties
logging - the successfully initialized LoggingManager instance
users - the the successfully initialized UserManager instance
ontology - the the successfully initialized OntologyManager instance
Throws:
Exception - if any error occurs (startup of the application is aborted in this case)
See Also:
ConsensusFoundation.ConsensusFoundation()

deleteTopic

public void deleteTopic(User user,
                        Topic topic)
                 throws EvolutionManagerException,
                        DynamicRightsManagerException
Deletes a topic and all dependant elements (attributes and, if it makes sense, associations), but not the subtopics of the topic. Especially for class topics this means that subclasses have to be moved higher in the hierarchy somehow.

Parameters:
user - the user who wants to delete the topic
topic - the topic to be deleted
Throws:
EvolutionManagerException - if the topic could not be deleted
DynamicRightsManagerException - if the user is not allowed to delete the topic
UnsupportedOperationException - if the implementation does not support deletion of topics
See Also:
Topic.isClassTopic(), DynamicRightsManager.mayDeleteTopic(User, Topic), OntologyManager.deleteTopic(Topic), deleteTopicAndSubtopics(User, Topic)

deleteTopicAndSubtopics

public void deleteTopicAndSubtopics(User user,
                                    Topic topic)
                             throws EvolutionManagerException,
                                    DynamicRightsManagerException
Deletes a topic and all dependant elements, including the subtopics of the topic. This method must take care if there are cycles in the topic hierarchy.

Parameters:
user - the user who wants to delete the topic
topic - the topic to be deleted
Throws:
EvolutionManagerException - if the topic and its subtopics could not be deleted
DynamicRightsManagerException - if the user is not allowed to delete the topic and its subtopics
UnsupportedOperationException - if the implementation does not support deletion of topics
See Also:
DynamicRightsManager.mayDeleteTopic(User, Topic), OntologyManager.deleteTopic(Topic), deleteTopic(User, Topic)

deleteAssociation

public void deleteAssociation(User user,
                              Association assoc)
                       throws EvolutionManagerException,
                              DynamicRightsManagerException
Deletes an association and all dependant elements (e.g. topics, if it makes sense).

Parameters:
user - the user who wants to delete the association
assoc - the association to be deleted
Throws:
EvolutionManagerException - if the association could not be deleted
DynamicRightsManagerException - if the user is not allowed to delete the association
UnsupportedOperationException - if the implementation does not support deletion of associations
See Also:
DynamicRightsManager.mayDeleteAssociation(User, Association), OntologyManager.deleteAssociation(Association)

deleteAttribute

public void deleteAttribute(User user,
                            Topic topic,
                            Attribute attr)
                     throws EvolutionManagerException,
                            DynamicRightsManagerException
Deletes an attribute (and all dependant elements if there are any).

Parameters:
user - the user who wants to delete the attribute
topic - the topic from which the attribute will be removed
attr - the attribute to be deleted
Throws:
EvolutionManagerException - if the attribute could not be deleted
DynamicRightsManagerException - if the user is not allowed to delete the attribute
UnsupportedOperationException - if the implementation does not support deletion of attributes
See Also:
OntologyManager.deleteAttribute(Attribute)

mergeTopics

public Topic mergeTopics(User user,
                         Topic topic1,
                         Topic topic2)
                  throws EvolutionManagerException,
                         DynamicRightsManagerException
Merges two topics.

Note that the topic returned is not necessarily one of the argument topics. An implementation may decide to return a newly created topic.

Parameters:
user - the user who wants to merge the topics
topic1 - the first topic to be merged
topic2 - the second topic to be merged
Returns:
the merged topic
Throws:
EvolutionManagerException - if the two topics could not be merged
DynamicRightsManagerException - if the user is not allowed to merge the topics
UnsupportedOperationException - if the implementation does not support merging of topics
See Also:
DynamicRightsManager.mayMergeTopics(User, Topic, Topic)

makeClass

public Topic makeClass(User user,
                       Topic instance)
                throws EvolutionManagerException,
                       DynamicRightsManagerException
Converts an instance topic into a class topic.

Parameters:
user - the user who wants to convert the topic into a class topic
instance - the instance topic to be converted
Returns:
the converted class topic
Throws:
EvolutionManagerException - if the instance topic could not be converted into a class topic
DynamicRightsManagerException - if the user is not allowed to convert the topic
UnsupportedOperationException - if the implementation does not support changing a topic's class flag
See Also:
Topic.isClassTopic()

makeInstance

public Topic makeInstance(User user,
                          Topic cls)
                   throws EvolutionManagerException,
                          DynamicRightsManagerException
Converts an instance topic into a class topic.

This is more than just calling Topic.setClassTopic() since the implementation has to take care what happens with subclasses of the class topic.

Parameters:
user - the user who wants to convert the topic into an instance topic
cls - the class topic to be converted
Returns:
the converted instance topic
Throws:
EvolutionManagerException - if the class topic could not be converted into an instance topic
DynamicRightsManagerException - if the user is not allowed to convert the topic
UnsupportedOperationException - if the implementation does not support changing a topic's class flag
See Also:
Topic.isClassTopic()

addEvolutionListener

public void addEvolutionListener(EvolutionListener listener)
Registers a new EvolutionListener.

Parameters:
listener - the EvolutionListener to be added

removeEvolutionListener

public void removeEvolutionListener(EvolutionListener listener)
Removes an EvolutionListener, if it is registered with the EvolutionManager (otherwise this call is ignored).

Parameters:
listener - the EvolutionListener to be removed