Search in sources :

Example 1 with OauthExternalSystem

use of net.geoprism.registry.etl.OauthExternalSystem in project geoprism-registry by terraframe.

the class ExternalSystemService method applyInTrans.

@Transaction
private JsonObject applyInTrans(String json) {
    JsonObject jo = JsonParser.parseString(json).getAsJsonObject();
    ExternalSystem system = ExternalSystem.desieralize(jo);
    system.apply();
    if (system instanceof OauthExternalSystem) {
        OauthExternalSystem oauthSystem = (OauthExternalSystem) system;
        oauthSystem.updateOauthServer(jo);
        if (system instanceof DHIS2ExternalSystem) {
            // Test the DHIS2 connection information
            new DHIS2FeatureService().setExternalSystemDhis2Version((DHIS2ExternalSystem) system);
        }
    }
    return system.toJSON();
}
Also used : OauthExternalSystem(net.geoprism.registry.etl.OauthExternalSystem) DHIS2ExternalSystem(net.geoprism.registry.graph.DHIS2ExternalSystem) FhirExternalSystem(net.geoprism.registry.graph.FhirExternalSystem) DHIS2ExternalSystem(net.geoprism.registry.graph.DHIS2ExternalSystem) ExternalSystem(net.geoprism.registry.graph.ExternalSystem) OauthExternalSystem(net.geoprism.registry.etl.OauthExternalSystem) DHIS2FeatureService(net.geoprism.registry.dhis2.DHIS2FeatureService) JsonObject(com.google.gson.JsonObject) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Aggregations

JsonObject (com.google.gson.JsonObject)1 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)1 DHIS2FeatureService (net.geoprism.registry.dhis2.DHIS2FeatureService)1 OauthExternalSystem (net.geoprism.registry.etl.OauthExternalSystem)1 DHIS2ExternalSystem (net.geoprism.registry.graph.DHIS2ExternalSystem)1 ExternalSystem (net.geoprism.registry.graph.ExternalSystem)1 FhirExternalSystem (net.geoprism.registry.graph.FhirExternalSystem)1