Skip to content

Commit

Permalink
Merge pull request #143 from pdowler/master
Browse files Browse the repository at this point in the history
argus: avoid NPE if AAI services do not provide VOSI-availability
  • Loading branch information
pdowler authored Aug 22, 2023
2 parents 647c004 + cd1ef7f commit e85355c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion argus/VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## deployable containers have a semantic and build tag
# semantic version tag: major.minor
# build version tag: timestamp
VER=1.0.4
VER=1.0.5
TAGS="${VER} ${VER}-$(date -u +"%Y%m%dT%H%M%S")"
unset VER
24 changes: 18 additions & 6 deletions argus/src/main/java/org/opencadc/argus/CaomTapService.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@ public Availability getStatus() {

URI credURI = localAuthority.getServiceURI(stdID);
url = reg.getServiceURL(credURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
checkResource = new CheckWebService(url);
checkResource.check();
if (url != null) {
checkResource = new CheckWebService(url);
checkResource.check();
} else {
log.debug("check skipped: " + credURI + " does not provide " + Standards.VOSI_AVAILABILITY);
}
} catch (NoSuchElementException ex) {
log.debug("not found: " + stdID);
}
Expand All @@ -164,8 +168,12 @@ public Availability getStatus() {
try {
groupsURI = localAuthority.getServiceURI(stdID);
url = reg.getServiceURL(groupsURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
checkResource = new CheckWebService(url);
checkResource.check();
if (url != null) {
checkResource = new CheckWebService(url);
checkResource.check();
} else {
log.debug("check skipped: " + groupsURI + " does not provide " + Standards.VOSI_AVAILABILITY);
}
} catch (NoSuchElementException ex) {
log.debug("not found: " + stdID);
}
Expand All @@ -175,8 +183,12 @@ public Availability getStatus() {
URI usersURI = localAuthority.getServiceURI(stdID);
if (!usersURI.equals(groupsURI)) {
url = reg.getServiceURL(usersURI, Standards.VOSI_AVAILABILITY, AuthMethod.ANON);
checkResource = new CheckWebService(url);
checkResource.check();
if (url != null) {
checkResource = new CheckWebService(url);
checkResource.check();
} else {
log.debug("check skipped: " + usersURI + " does not provide " + Standards.VOSI_AVAILABILITY);
}
} else {
log.debug("already checked: " + stdID + " = " + usersURI);
}
Expand Down

0 comments on commit e85355c

Please sign in to comment.