summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2016-04-09 14:22:20 -0700
committerJesse Morgan <jesse@jesterpm.net>2016-04-09 15:48:01 -0700
commit3102d8bce3426d9cf41aeaf201c360d342677770 (patch)
tree38c4f1e8828f9af9c4b77a173bee0d312b321698 /src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java
parentbbf907e51dfcf157bdee24dead1d531122aa25db (diff)
Switching from Ivy+Ant to Maven.
Diffstat (limited to 'src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java')
-rw-r--r--src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java b/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java
deleted file mode 100644
index fc6148f..0000000
--- a/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.p4square.grow.ccb;
-
-import com.codahale.metrics.MetricRegistry;
-import com.p4square.ccbapi.CCBAPI;
-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.restlet.Context;
-import org.restlet.security.Verifier;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * The ChurchCommunityBuilderIntegrationDriver is used to integrate Grow with Church Community Builder.
- */
-public class ChurchCommunityBuilderIntegrationDriver implements IntegrationDriver {
-
- private final Context mContext;
- private final MetricRegistry mMetricRegistry;
- private final Config mConfig;
-
- private final CCBAPI mAPI;
-
- private final CCBProgressReporter mProgressReporter;
-
- public ChurchCommunityBuilderIntegrationDriver(final Context context) {
- mContext = context;
- mConfig = (Config) context.getAttributes().get("com.p4square.grow.config");
- mMetricRegistry = (MetricRegistry) context.getAttributes().get("com.p4square.grow.metrics");
-
- try {
- CCBAPI api = new CCBAPIClient(new URI(mConfig.getString("CCBAPIURL", "")),
- mConfig.getString("CCBAPIUser", ""),
- mConfig.getString("CCBAPIPassword", ""));
-
- if (mMetricRegistry != null) {
- api = new MonitoredCCBAPI(api, mMetricRegistry);
- }
-
- mAPI = api;
-
- final CustomFieldCache cache = new CustomFieldCache(mAPI);
- mProgressReporter = new CCBProgressReporter(mAPI, cache);
-
- } catch (URISyntaxException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public Verifier newUserAuthenticationVerifier() {
- return new CCBUserVerifier(mAPI);
- }
-
- @Override
- public ProgressReporter getProgressReporter() {
- return mProgressReporter;
- }
-}