diff options
Diffstat (limited to 'src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java')
-rw-r--r-- | src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java b/src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java index 3704fdc..dd62401 100644 --- a/src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java +++ b/src/main/java/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java @@ -6,9 +6,11 @@ import com.p4square.ccbapi.CCBAPIClient; import com.p4square.grow.config.Config; import com.p4square.grow.frontend.IntegrationDriver; import com.p4square.grow.frontend.ProgressReporter; +import org.apache.log4j.Logger; import org.restlet.Context; import org.restlet.security.Verifier; +import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -17,6 +19,8 @@ import java.net.URISyntaxException; */ public class ChurchCommunityBuilderIntegrationDriver implements IntegrationDriver { + private static final Logger LOG = Logger.getLogger(ChurchCommunityBuilderIntegrationDriver.class); + private final Context mContext; private final MetricRegistry mMetricRegistry; private final Config mConfig; @@ -65,4 +69,18 @@ public class ChurchCommunityBuilderIntegrationDriver implements IntegrationDrive public ProgressReporter getProgressReporter() { return mProgressReporter; } + + @Override + public boolean doHealthCheck() { + try { + // Try something benign, like getting the custom field labels, + // to verify that we can talk to CCB. + mAPI.getCustomFieldLabels(); + return true; + + } catch (IOException e) { + LOG.warn("CCB Health Check Failed: " + e.getMessage(), e); + return false; + } + } } |