use of org.bimserver.endpoints.EndPoint in project BIMserver by opensourceBIM.
the class NotificationRegistryServiceImpl method registerChangeProgressOnProject.
@Override
public void registerChangeProgressOnProject(Long endPointId, Long poid) throws ServerException, UserException {
if (endPointId == null) {
throw new UserException("No endpoint given");
}
ChangeProgressTopicOnProjectTopic changeProgressOnProjectTopic = getBimServer().getNotificationsManager().getChangeProgressOnProjectTopic(poid);
EndPoint endPoint = getEndPoint(endPointId);
try {
changeProgressOnProjectTopic.register(endPoint);
} catch (TopicRegisterException e) {
handleException(e);
}
}
use of org.bimserver.endpoints.EndPoint 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);
}
}
use of org.bimserver.endpoints.EndPoint in project BIMserver by opensourceBIM.
the class NotificationRegistryServiceImpl method registerChangeProgressOnRevision.
@Override
public void registerChangeProgressOnRevision(Long endPointId, Long poid, Long roid) throws ServerException, UserException {
ChangeProgressTopicOnRevisionTopic changeProgressOnProjectTopic = getBimServer().getNotificationsManager().getChangeProgressOnRevisionTopic(poid, roid);
EndPoint endPoint = getEndPoint(endPointId);
try {
changeProgressOnProjectTopic.register(endPoint);
} catch (TopicRegisterException e) {
handleException(e);
}
}
use of org.bimserver.endpoints.EndPoint in project BIMserver by opensourceBIM.
the class NotificationRegistryServiceImpl method registerProgressHandler.
@Override
public void registerProgressHandler(Long topicId, Long endPointId) throws UserException {
if (endPointId == null) {
throw new UserException("No EndpointId given");
}
EndPoint endPoint = getEndPoint(endPointId);
if (endPoint == null) {
throw new UserException("Endpoint with id " + endPointId + " not found");
}
ProgressTopic progressTopic = getBimServer().getNotificationsManager().getProgressTopic(topicId);
if (progressTopic == null) {
throw new UserException("Topic with id " + topicId + " not found");
}
try {
progressTopic.register(endPoint);
LongActionState lastProgress = progressTopic.getLastProgress();
if (lastProgress != null && lastProgress.getState() == ActionState.FINISHED) {
LoggerFactory.getLogger(NotificationRegistryInterface.class).debug("Sending update directly for topic " + progressTopic.getKey().getId());
// TODO!!
// progressTopic.stageProgressUpdate(ate, title)updateProgress(lastProgress);
} else {
LoggerFactory.getLogger(NotificationRegistryInterface.class).debug("NOT Sending update directly for topic " + progressTopic.getKey().getId());
}
} catch (TopicRegisterException e) {
throw new UserException(e);
}
}
use of org.bimserver.endpoints.EndPoint in project BIMserver by opensourceBIM.
the class NotificationRegistryServiceImpl method unregisterChangeProgressOnProject.
@Override
public void unregisterChangeProgressOnProject(Long endPointId, Long poid) throws ServerException, UserException {
ChangeProgressTopicOnProjectTopic changeProgressOnProjectTopic = getBimServer().getNotificationsManager().getChangeProgressOnProjectTopic(poid);
EndPoint endPoint = getEndPoint(endPointId);
try {
changeProgressOnProjectTopic.unregister(endPoint);
} catch (TopicRegisterException e) {
handleException(e);
}
}
Aggregations