Search in sources :

Example 1 with GlobalNotificationMessage

use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.

the class MasterList method publishFrequencyVersions.

@Transaction
public void publishFrequencyVersions() {
    if (!this.isValid()) {
        throw new InvalidMasterListException();
    }
    NotificationFacade.queue(new GlobalNotificationMessage(MessageType.PUBLISH_JOB_CHANGE, null));
    try {
        Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
        final ServerGeoObjectType objectType = this.getGeoObjectType();
        Pair<Date, Date> range = this.getDateRange(objectType);
        if (range != null) {
            Date endDate = range.getSecond();
            if (endDate.after(new Date())) {
                endDate = new Date();
            }
            List<Date> dates = this.getFrequencyDates(range.getFirst(), range.getSecond());
            for (Date date : dates) {
                MasterListVersion version = this.getOrCreateVersion(date, MasterListVersion.PUBLISHED);
                ((Session) Session.getCurrentSession()).reloadPermissions();
                version.publish();
            }
        } else {
            throw new EmptyListException();
        }
    } finally {
        Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
    }
}
Also used : ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage) Date(java.util.Date) Session(com.runwaysdk.session.Session) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Example 2 with GlobalNotificationMessage

use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.

the class ListCurationJob method createNewHistory.

@Override
protected JobHistory createNewHistory() {
    ListCurationHistory history = new ListCurationHistory();
    history.setStartTime(new Date());
    history.addStatus(AllJobStatus.NEW);
    history.apply();
    NotificationFacade.queue(new GlobalNotificationMessage(MessageType.CURATION_JOB_CHANGE, null));
    return history;
}
Also used : GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage) Date(java.util.Date)

Example 3 with GlobalNotificationMessage

use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.

the class FhirExportJob method execute.

@Override
public void execute(ExecutionContext executionContext) throws Throwable {
    NotificationFacade.queue(new GlobalNotificationMessage(MessageType.PUBLISH_JOB_CHANGE, null));
    FhirExternalSystem system = this.getExternalSystem();
// this.getVersion().exportToFhir(system, this.getImplementation());
}
Also used : GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage) FhirExternalSystem(net.geoprism.registry.graph.FhirExternalSystem)

Example 4 with GlobalNotificationMessage

use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.

the class PublishListTypeVersionJob method afterJobExecute.

@Override
public void afterJobExecute(JobHistory history) {
    super.afterJobExecute(history);
    NotificationFacade.queue(new GlobalNotificationMessage(MessageType.PUBLISH_JOB_CHANGE, null));
}
Also used : GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage)

Example 5 with GlobalNotificationMessage

use of net.geoprism.registry.ws.GlobalNotificationMessage in project geoprism-registry by terraframe.

the class PublishShapefileJob method execute.

@Override
public void execute(ExecutionContext executionContext) throws Throwable {
    NotificationFacade.queue(new GlobalNotificationMessage(MessageType.PUBLISH_JOB_CHANGE, null));
    this.getVersion().generateShapefile();
}
Also used : GlobalNotificationMessage(net.geoprism.registry.ws.GlobalNotificationMessage)

Aggregations

GlobalNotificationMessage (net.geoprism.registry.ws.GlobalNotificationMessage)25 Date (java.util.Date)5 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)4 Request (com.runwaysdk.session.Request)4 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)4 JsonObject (com.google.gson.JsonObject)3 Session (com.runwaysdk.session.Session)3 HttpError (net.geoprism.registry.etl.export.HttpError)3 FhirExternalSystem (net.geoprism.registry.graph.FhirExternalSystem)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 ListTypeVersion (net.geoprism.registry.ListTypeVersion)2 OAuthClientRequest (org.apache.oltu.oauth2.client.request.OAuthClientRequest)2 DataFormatException (ca.uhn.fhir.parser.DataFormatException)1 GsonBuilder (com.google.gson.GsonBuilder)1 JsonArray (com.google.gson.JsonArray)1 Business (com.runwaysdk.business.Business)1 BusinessQuery (com.runwaysdk.business.BusinessQuery)1 QueryFactory (com.runwaysdk.query.QueryFactory)1 JobHistory (com.runwaysdk.system.scheduler.JobHistory)1 JobHistoryQuery (com.runwaysdk.system.scheduler.JobHistoryQuery)1