Search in sources :

Example 6 with ProgressTopic

use of org.bimserver.notifications.ProgressTopic in project BIMserver by opensourceBIM.

the class NotificationRegistryServiceImpl method unregisterProgressHandler.

@Override
public void unregisterProgressHandler(Long topicId, Long endPointId) throws UserException, ServerException {
    EndPoint endPoint = getEndPoint(endPointId);
    ProgressTopic progressTopic = getBimServer().getNotificationsManager().getProgressTopic(topicId);
    if (progressTopic == null) {
        throw new UserException("Topic with id " + topicId + " not found");
    }
    try {
        progressTopic.unregister(endPoint);
    } catch (TopicRegisterException e) {
        handleException(e);
    }
}
Also used : ProgressTopic(org.bimserver.notifications.ProgressTopic) TopicRegisterException(org.bimserver.notifications.TopicRegisterException) EndPoint(org.bimserver.endpoints.EndPoint) UserException(org.bimserver.shared.exceptions.UserException)

Example 7 with ProgressTopic

use of org.bimserver.notifications.ProgressTopic in project BIMserver by opensourceBIM.

the class NotificationRegistryServiceImpl method updateProgressTopic.

@Override
public void updateProgressTopic(Long topicId, SLongActionState state) throws UserException, ServerException {
    try {
        ProgressTopic topic = getBimServer().getNotificationsManager().getProgressTopic(topicId);
        ProgressNotification progressNotification;
        progressNotification = new ProgressNotification(getBimServer(), topic, getBimServer().getSConverter().convertFromSObject(state));
        getBimServer().getNotificationsManager().addToQueue(progressNotification);
    } catch (BimserverDatabaseException e) {
        throw new ServerException(e);
    }
}
Also used : BimserverDatabaseException(org.bimserver.BimserverDatabaseException) ProgressTopic(org.bimserver.notifications.ProgressTopic) ServerException(org.bimserver.shared.exceptions.ServerException) ProgressNotification(org.bimserver.notifications.ProgressNotification)

Aggregations

ProgressTopic (org.bimserver.notifications.ProgressTopic)7 UserException (org.bimserver.shared.exceptions.UserException)6 TopicRegisterException (org.bimserver.notifications.TopicRegisterException)4 ServerException (org.bimserver.shared.exceptions.ServerException)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)3 OutputStream (java.io.OutputStream)2 DatabaseSession (org.bimserver.database.DatabaseSession)2 IfcModelInterface (org.bimserver.emf.IfcModelInterface)2 EndPoint (org.bimserver.endpoints.EndPoint)2 SExtendedData (org.bimserver.interfaces.objects.SExtendedData)2 SFile (org.bimserver.interfaces.objects.SFile)2 SLongActionState (org.bimserver.interfaces.objects.SLongActionState)2 LongActionState (org.bimserver.models.store.LongActionState)2 Revision (org.bimserver.models.store.Revision)2 PluginConfiguration (org.bimserver.plugins.PluginConfiguration)2 ServiceMap (org.bimserver.webservices.ServiceMap)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 EOFException (java.io.EOFException)1