-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into IM-459-New-Configure-keycloak-in-remote-e…
…ngine
- Loading branch information
Showing
222 changed files
with
499 additions
and
882,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,8 @@ | ||
package org.integratedmodelling.klab.stac; | ||
|
||
import org.hortonmachine.gears.io.stac.HMStacCollection; | ||
import org.hortonmachine.gears.io.stac.HMStacManager; | ||
import org.hortonmachine.gears.libs.monitor.LogProgressMonitor; | ||
import org.integratedmodelling.klab.exceptions.KlabInternalErrorException; | ||
|
||
import kong.unirest.json.JSONObject; | ||
|
||
public class STACService { | ||
private HMStacManager catalog; | ||
private HMStacCollection collection; | ||
|
||
public STACService(String collectionUrl) { | ||
JSONObject collectionData = STACUtils.requestMetadata(collectionUrl, "collection"); | ||
String collectionId = STACCollectionParser.readCollectionId(collectionData); | ||
String catalogUrl = STACUtils.getCatalogUrl(collectionData); | ||
|
||
LogProgressMonitor lpm = new LogProgressMonitor(); | ||
this.catalog = new HMStacManager(catalogUrl, lpm); | ||
try { | ||
this.catalog.open(); | ||
} catch (Exception e) { | ||
throw new KlabInternalErrorException("Error at STAC service. Cannot read catalog at '" + catalogUrl + "'."); | ||
} | ||
|
||
try { | ||
this.collection = catalog.getCollectionById(collectionId); | ||
} catch (Exception e) { | ||
throw new KlabInternalErrorException("Error at STAC service. Cannot read collection at '" + collectionUrl + "'."); | ||
} | ||
if (collection == null) { | ||
throw new KlabInternalErrorException("Error at STAC service. Endpoint '" + catalogUrl + "' has no collection '" + collectionId + "'."); | ||
} | ||
} | ||
|
||
public HMStacCollection getCollection() { | ||
return collection; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.