Search in sources :

Example 1 with UnknownBeaconException

use of org.molgenis.beacon.controller.model.exceptions.UnknownBeaconException in project molgenis by molgenis.

the class BeaconQueryServiceImpl method searchBeaconForQueryString.

private boolean searchBeaconForQueryString(String referenceName, Long start, String referenceBases, String alternateBases, String beaconId) {
    boolean exists = false;
    Beacon beacon = dataService.findOneById(BeaconMetadata.BEACON, beaconId, Beacon.class);
    if (beacon != null) {
        for (BeaconDataset beaconDataset : beacon.getDataSets()) {
            exists = queryBeaconDataset(beaconDataset, referenceName, start, referenceBases, alternateBases);
        }
    } else {
        throw new UnknownBeaconException(beaconId, BeaconAlleleRequest.create(referenceName, start, referenceBases, alternateBases));
    }
    return exists;
}
Also used : UnknownBeaconException(org.molgenis.beacon.controller.model.exceptions.UnknownBeaconException) Beacon(org.molgenis.beacon.config.Beacon) BeaconDataset(org.molgenis.beacon.config.BeaconDataset)

Aggregations

Beacon (org.molgenis.beacon.config.Beacon)1 BeaconDataset (org.molgenis.beacon.config.BeaconDataset)1 UnknownBeaconException (org.molgenis.beacon.controller.model.exceptions.UnknownBeaconException)1