use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.
the class DataExportJob method afterJobExecute.
@Override
public void afterJobExecute(JobHistory history) {
super.afterJobExecute(history);
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.DATA_EXPORT_JOB_CHANGE, null));
}
use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.
the class DataExportJob method createNewHistory.
@Override
protected JobHistory createNewHistory() {
ExportHistory history = new ExportHistory();
history.setStartTime(new Date());
history.addStatus(AllJobStatus.NEW);
history.addStage(ExportStage.CONNECTING);
history.apply();
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.DATA_EXPORT_JOB_CHANGE, null));
return history;
}
use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.
the class FhirExportSynchronizationManager method synchronize.
public void synchronize() {
final FhirExternalSystem system = (FhirExternalSystem) this.config.getSystem();
try (FhirConnection connection = FhirConnectionFactory.get(system)) {
SortedSet<FhirSyncLevel> levels = this.config.getLevels();
int expectedLevel = 0;
long exportCount = 0;
for (FhirSyncLevel level : levels) {
if (level.getLevel() != expectedLevel) {
throw new ProgrammingErrorException("Unexpected level number [" + level.getLevel() + "].");
}
history.appLock();
history.setWorkProgress((long) expectedLevel);
history.setExportedRecords(exportCount);
history.apply();
ListTypeVersion version = ListTypeVersion.get(level.getVersionId());
FhirDataPopulator populator = FhirFactory.getPopulator(level.getImplementation());
ListTypeFhirExporter exporter = new ListTypeFhirExporter(version, connection, populator, true);
long results = exporter.export();
exportCount += results;
expectedLevel++;
}
history.appLock();
history.setWorkTotal((long) expectedLevel);
history.setWorkProgress((long) expectedLevel);
history.setExportedRecords(exportCount);
history.clearStage();
history.addStage(ExportStage.COMPLETE);
history.apply();
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.DATA_EXPORT_JOB_CHANGE, null));
handleExportErrors();
} catch (Exception e) {
throw new HttpError(e);
}
}
use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.
the class ServerGeoObjectType method delete.
public void delete() {
try {
this.deleteInTransaction();
Session session = (Session) Session.getCurrentSession();
// session object in the request.
if (session != null) {
session.reloadPermissions();
}
// If we get here then it was successfully deleted
// We have to do a full metadata cache
// refresh because the GeoObjectType is
// embedded in the HierarchyType
ServiceFactory.getRegistryService().refreshMetadataCache();
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.TYPE_CACHE_CHANGE, null));
} catch (RuntimeException e) {
// An error occurred re-create the WMS layer
throw e;
}
}
use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.
the class RegistryService method importTypes.
/**
* Creates a {@link GeoObjectType} from the given JSON.
*
* @param sessionId
* @param gtJSON
* JSON of the {@link GeoObjectType} to be created.
* @return newly created {@link GeoObjectType}
*/
@Request(RequestType.SESSION)
public void importTypes(String sessionId, String orgCode, InputStream istream) {
ServiceFactory.getGeoObjectTypePermissionService().enforceCanCreate(orgCode, true);
GeoRegistryUtil.importTypes(orgCode, istream);
this.refreshMetadataCache();
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.TYPE_CACHE_CHANGE, null));
}
Aggregations