killbill-aplcache

Completed a merge and refactor of overdue into overdue module

4/18/2012 3:53:42 PM

Changes

junction/pom.xml 4(+2 -2)

ne/src/main/resources/com/ning/billing/ne/ddl.sql 9(+0 -9)

overdue/pom.xml 4(+2 -2)

pom.xml 6(+3 -3)

Details

diff --git a/analytics/pom.xml b/analytics/pom.xml
index f3bae99..d560cc6 100644
--- a/analytics/pom.xml
+++ b/analytics/pom.xml
@@ -86,12 +86,12 @@
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-ne</artifactId>
+            <artifactId>killbill-junction</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-ne</artifactId>
+            <artifactId>killbill-junction</artifactId>
              <type>test-jar</type>
             <scope>test</scope>
         </dependency>
diff --git a/analytics/src/test/java/com/ning/billing/analytics/AnalyticsTestModule.java b/analytics/src/test/java/com/ning/billing/analytics/AnalyticsTestModule.java
index 1d1b1ad..564f892 100644
--- a/analytics/src/test/java/com/ning/billing/analytics/AnalyticsTestModule.java
+++ b/analytics/src/test/java/com/ning/billing/analytics/AnalyticsTestModule.java
@@ -23,7 +23,7 @@ import com.ning.billing.analytics.setup.AnalyticsModule;
 import com.ning.billing.dbi.MysqlTestingHelper;
 import com.ning.billing.entitlement.glue.EntitlementModule;
 import com.ning.billing.invoice.glue.InvoiceModule;
-import com.ning.billing.mock.overdue.MockOverdueAccessModule;
+import com.ning.billing.junction.MockBlockingModule;
 import com.ning.billing.payment.setup.PaymentModule;
 import com.ning.billing.util.glue.BusModule;
 import com.ning.billing.util.glue.CallContextModule;
@@ -48,7 +48,7 @@ public class AnalyticsTestModule extends AnalyticsModule
         install(new AccountModule());
         install(new BusModule());
         install(new EntitlementModule());
-        install(new MockOverdueAccessModule());
+        install(new MockBlockingModule());
         install(new InvoiceModule());
         install(new PaymentModule());
         install(new TagStoreModule());
diff --git a/analytics/src/test/java/com/ning/billing/analytics/MockEntitlementUserApi.java b/analytics/src/test/java/com/ning/billing/analytics/MockEntitlementUserApi.java
index 1fe60e7..f9989af 100644
--- a/analytics/src/test/java/com/ning/billing/analytics/MockEntitlementUserApi.java
+++ b/analytics/src/test/java/com/ning/billing/analytics/MockEntitlementUserApi.java
@@ -28,7 +28,7 @@ import com.ning.billing.entitlement.api.user.EntitlementUserApi;
 import com.ning.billing.entitlement.api.user.EntitlementUserApiException;
 import com.ning.billing.entitlement.api.user.Subscription;
 import com.ning.billing.entitlement.api.user.SubscriptionBundle;
-import com.ning.billing.overdue.config.api.OverdueState;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.util.callcontext.CallContext;
 
 public class MockEntitlementUserApi implements EntitlementUserApi
diff --git a/api/src/main/java/com/ning/billing/account/api/Account.java b/api/src/main/java/com/ning/billing/account/api/Account.java
index b7f6337..65b97b5 100644
--- a/api/src/main/java/com/ning/billing/account/api/Account.java
+++ b/api/src/main/java/com/ning/billing/account/api/Account.java
@@ -16,12 +16,12 @@
 
 package com.ning.billing.account.api;
 
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.util.customfield.Customizable;
 import com.ning.billing.util.entity.UpdatableEntity;
 import com.ning.billing.util.tag.Taggable;
 
-public interface Account extends AccountData, Customizable, UpdatableEntity, Taggable, Overdueable{ 
+public interface Account extends AccountData, Customizable, UpdatableEntity, Taggable, Blockable{ 
     public static String ObjectType = "account";
     
     public MutableAccountData toMutableAccountData();    
diff --git a/api/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundle.java b/api/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundle.java
index 8794856..717561e 100644
--- a/api/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundle.java
+++ b/api/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundle.java
@@ -20,10 +20,10 @@ import java.util.UUID;
 
 import org.joda.time.DateTime;
 
-import com.ning.billing.overdue.config.api.OverdueState;
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.overdue.OverdueState;
 
-public interface SubscriptionBundle extends Overdueable {
+public interface SubscriptionBundle extends Blockable {
 
     public UUID getAccountId();
 
diff --git a/api/src/main/java/com/ning/billing/junction/api/BlockingApiException.java b/api/src/main/java/com/ning/billing/junction/api/BlockingApiException.java
new file mode 100644
index 0000000..3a7a6c5
--- /dev/null
+++ b/api/src/main/java/com/ning/billing/junction/api/BlockingApiException.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.junction.api;
+
+import com.ning.billing.BillingExceptionBase;
+import com.ning.billing.ErrorCode;
+
+public class BlockingApiException extends BillingExceptionBase {
+	private static final long serialVersionUID = 1L;
+
+	public BlockingApiException(Throwable cause, ErrorCode code, Object... args) {
+		super(cause, code, args);
+	}
+
+	public BlockingApiException(ErrorCode code, Object... args) {
+		super(code, args);
+	}
+
+}
diff --git a/api/src/main/java/com/ning/billing/overdue/config/api/BillingState.java b/api/src/main/java/com/ning/billing/overdue/config/api/BillingState.java
index 2afa40a..965e402 100644
--- a/api/src/main/java/com/ning/billing/overdue/config/api/BillingState.java
+++ b/api/src/main/java/com/ning/billing/overdue/config/api/BillingState.java
@@ -21,9 +21,10 @@ import java.util.UUID;
 
 import org.joda.time.DateTime;
 
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.util.tag.Tag;
 
-public class BillingState<T extends Overdueable> {
+public class BillingState<T extends Blockable> {
 	private final UUID objectId;
 	private final int numberOfUnpaidInvoices;
 	private final BigDecimal balanceOfUnpaidInvoices;
diff --git a/api/src/main/java/com/ning/billing/overdue/config/api/OverdueStateSet.java b/api/src/main/java/com/ning/billing/overdue/config/api/OverdueStateSet.java
index 03c076c..796e482 100644
--- a/api/src/main/java/com/ning/billing/overdue/config/api/OverdueStateSet.java
+++ b/api/src/main/java/com/ning/billing/overdue/config/api/OverdueStateSet.java
@@ -19,8 +19,10 @@ package com.ning.billing.overdue.config.api;
 import org.joda.time.DateTime;
 
 import com.ning.billing.catalog.api.CatalogApiException;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.overdue.OverdueState;
 
-public interface OverdueStateSet<T extends Overdueable> {
+public interface OverdueStateSet<T extends Blockable> {
 
     public abstract OverdueState<T> findClearState() throws CatalogApiException;
 
diff --git a/api/src/main/java/com/ning/billing/overdue/OverdueService.java b/api/src/main/java/com/ning/billing/overdue/OverdueService.java
index 8841046..06c1f15 100644
--- a/api/src/main/java/com/ning/billing/overdue/OverdueService.java
+++ b/api/src/main/java/com/ning/billing/overdue/OverdueService.java
@@ -19,6 +19,8 @@ package com.ning.billing.overdue;
 import com.ning.billing.lifecycle.KillbillService;
 
 public interface OverdueService extends KillbillService {
+    String OVERDUE_SERVICE_NAME = "overdue-service";
+
     public String getName();
 
     public OverdueUserApi getUserApi();
diff --git a/api/src/main/java/com/ning/billing/overdue/OverdueUserApi.java b/api/src/main/java/com/ning/billing/overdue/OverdueUserApi.java
index a785679..4399176 100644
--- a/api/src/main/java/com/ning/billing/overdue/OverdueUserApi.java
+++ b/api/src/main/java/com/ning/billing/overdue/OverdueUserApi.java
@@ -17,16 +17,15 @@
 package com.ning.billing.overdue;
 
 import com.ning.billing.catalog.api.CatalogApiException;
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.config.api.BillingState;
 import com.ning.billing.overdue.config.api.OverdueError;
-import com.ning.billing.overdue.config.api.OverdueState;
-import com.ning.billing.overdue.config.api.Overdueable;
 
 public interface OverdueUserApi {
 
-    public <T extends Overdueable> OverdueState<T> refreshOverdueStateFor(T overdueable) throws OverdueError, CatalogApiException;
+    public <T extends Blockable> OverdueState<T> refreshOverdueStateFor(T overdueable) throws OverdueError, CatalogApiException;
 
-    public <T extends Overdueable> void setOverrideBillingStateForAccount(T overdueable, BillingState<T> state) throws OverdueError;
+    public <T extends Blockable> void setOverrideBillingStateForAccount(T overdueable, BillingState<T> state) throws OverdueError;
 
-    public <T extends Overdueable> OverdueState<T> getOverdueStateFor(T overdueable) throws OverdueError;
+    public <T extends Blockable> OverdueState<T> getOverdueStateFor(T overdueable) throws OverdueError;
 }
diff --git a/entitlement/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundleData.java b/entitlement/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundleData.java
index 0fac2c8..d7b600d 100644
--- a/entitlement/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundleData.java
+++ b/entitlement/src/main/java/com/ning/billing/entitlement/api/user/SubscriptionBundleData.java
@@ -20,7 +20,7 @@ import java.util.UUID;
 
 import org.joda.time.DateTime;
 
-import com.ning.billing.overdue.config.api.OverdueState;
+import com.ning.billing.overdue.OverdueState;
 
 public class SubscriptionBundleData implements SubscriptionBundle {
 
diff --git a/junction/src/main/resources/com/ning/billing/junction/ddl.sql b/junction/src/main/resources/com/ning/billing/junction/ddl.sql
new file mode 100644
index 0000000..656ce70
--- /dev/null
+++ b/junction/src/main/resources/com/ning/billing/junction/ddl.sql
@@ -0,0 +1,13 @@
+
+DROP TABLE IF EXISTS blocking_states;
+CREATE TABLE blocking_states (
+  id char(36) NOT NULL,
+  type varchar(20) NOT NULL,
+  state varchar(50) NOT NULL,  
+  service varchar(20) NOT NULL,    
+  block_change bool NOT NULL,
+  block_entitlement bool NOT NULL,
+  block_billing bool NOT NULL,
+  created_date datetime NOT NULL
+) ENGINE=innodb;
+CREATE INDEX blocking_states_by_id ON blocking_states (id);
\ No newline at end of file

overdue/pom.xml 4(+2 -2)

diff --git a/overdue/pom.xml b/overdue/pom.xml
index d0a7413..5a9aff4 100644
--- a/overdue/pom.xml
+++ b/overdue/pom.xml
@@ -58,12 +58,12 @@
         <!-- Check if we need this one -->
         <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-ne</artifactId>
+            <artifactId>killbill-junction</artifactId>
             <scope>test</scope>
          </dependency>
          <dependency>
             <groupId>com.ning.billing</groupId>
-            <artifactId>killbill-ne</artifactId>
+            <artifactId>killbill-junction</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
diff --git a/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckNotifier.java b/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckNotifier.java
index a7f0627..ef4ec4f 100644
--- a/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckNotifier.java
+++ b/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckNotifier.java
@@ -23,7 +23,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
-import com.ning.billing.config.InvoiceConfig;
 import com.ning.billing.config.NotificationConfig;
 import com.ning.billing.ovedue.OverdueProperties;
 import com.ning.billing.overdue.service.DefaultOverdueService;
diff --git a/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckPoster.java b/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckPoster.java
index 29aa528..106a5c4 100644
--- a/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckPoster.java
+++ b/overdue/src/main/java/com/ning/billing/ovedue/notification/DefaultOverdueCheckPoster.java
@@ -22,7 +22,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.inject.Inject;
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.service.DefaultOverdueService;
 import com.ning.billing.util.notificationq.NotificationKey;
 import com.ning.billing.util.notificationq.NotificationQueue;
@@ -42,7 +42,7 @@ public class DefaultOverdueCheckPoster implements OverdueCheckPoster {
 	}
 
 	@Override
-	public void insertOverdueCheckNotification(final Transmogrifier transactionalDao, final Overdueable overdueable, final DateTime futureNotificationTime) {
+	public void insertOverdueCheckNotification(final Transmogrifier transactionalDao, final Blockable overdueable, final DateTime futureNotificationTime) {
     	NotificationQueue checkOverdueQueue;
 		try {
 			checkOverdueQueue = notificationQueueService.getNotificationQueue(DefaultOverdueService.OVERDUE_SERVICE_NAME,
@@ -60,7 +60,7 @@ public class DefaultOverdueCheckPoster implements OverdueCheckPoster {
 		}
     }
 	
-	public void clearNotificationEventsFor(final Overdueable overdueable) {
+	public void clearNotificationEventsFor(final Blockable overdueable) {
 	    NotificationQueue checkOverdueQueue;
         try {
             checkOverdueQueue = notificationQueueService.getNotificationQueue(DefaultOverdueService.OVERDUE_SERVICE_NAME,
diff --git a/overdue/src/main/java/com/ning/billing/ovedue/notification/OverdueCheckPoster.java b/overdue/src/main/java/com/ning/billing/ovedue/notification/OverdueCheckPoster.java
index 8573436..8105bc7 100644
--- a/overdue/src/main/java/com/ning/billing/ovedue/notification/OverdueCheckPoster.java
+++ b/overdue/src/main/java/com/ning/billing/ovedue/notification/OverdueCheckPoster.java
@@ -19,11 +19,12 @@ package com.ning.billing.ovedue.notification;
 import org.joda.time.DateTime;
 import org.skife.jdbi.v2.sqlobject.mixins.Transmogrifier;
 
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.api.Blockable;
+
 
 public interface OverdueCheckPoster {
 
 	void insertOverdueCheckNotification(Transmogrifier transactionalDao,
-			Overdueable overdueable, DateTime futureNotificationTime);
+			Blockable overdueable, DateTime futureNotificationTime);
 
 }
\ No newline at end of file
diff --git a/overdue/src/main/java/com/ning/billing/ovedue/OverdueProperties.java b/overdue/src/main/java/com/ning/billing/ovedue/OverdueProperties.java
index 4b38c09..956d957 100644
--- a/overdue/src/main/java/com/ning/billing/ovedue/OverdueProperties.java
+++ b/overdue/src/main/java/com/ning/billing/ovedue/OverdueProperties.java
@@ -22,6 +22,7 @@ import org.skife.config.Default;
 import com.ning.billing.config.KillbillConfig;
 import com.ning.billing.config.NotificationConfig;
 
+
 public interface OverdueProperties extends NotificationConfig, KillbillConfig  {
 
     @Override
diff --git a/overdue/src/main/java/com/ning/billing/overdue/api/DefaultOverdueUserApi.java b/overdue/src/main/java/com/ning/billing/overdue/api/DefaultOverdueUserApi.java
index 9855b9e..c4dd72f 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/api/DefaultOverdueUserApi.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/api/DefaultOverdueUserApi.java
@@ -23,14 +23,14 @@ import com.ning.billing.ErrorCode;
 import com.ning.billing.catalog.api.CatalogApiException;
 import com.ning.billing.catalog.api.CatalogService;
 import com.ning.billing.entitlement.api.user.SubscriptionBundle;
-import com.ning.billing.overdue.OverdueAccessApi;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.junction.api.BlockingApi;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.overdue.OverdueUserApi;
 import com.ning.billing.overdue.config.OverdueConfig;
 import com.ning.billing.overdue.config.api.BillingState;
 import com.ning.billing.overdue.config.api.OverdueError;
-import com.ning.billing.overdue.config.api.OverdueState;
 import com.ning.billing.overdue.config.api.OverdueStateSet;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.overdue.service.ExtendedOverdueService;
 import com.ning.billing.overdue.wrapper.OverdueWrapper;
 import com.ning.billing.overdue.wrapper.OverdueWrapperFactory;
@@ -39,11 +39,11 @@ public class DefaultOverdueUserApi implements OverdueUserApi{
 
     
     private final OverdueWrapperFactory factory;
-    private final OverdueAccessApi accessApi; 
+    private final BlockingApi accessApi; 
     private final OverdueConfig overdueConfig;
    
     @Inject
-    public DefaultOverdueUserApi(OverdueWrapperFactory factory,OverdueAccessApi accessApi, ExtendedOverdueService service,  CatalogService catalogService) {
+    public DefaultOverdueUserApi(OverdueWrapperFactory factory,BlockingApi accessApi, ExtendedOverdueService service,  CatalogService catalogService) {
         this.factory = factory;
         this.accessApi = accessApi;
         this.overdueConfig = service.getOverdueConfig();
@@ -51,9 +51,9 @@ public class DefaultOverdueUserApi implements OverdueUserApi{
     
     @SuppressWarnings("unchecked")
     @Override
-    public <T extends Overdueable> OverdueState<T> getOverdueStateFor(T overdueable) throws OverdueError {
+    public <T extends Blockable> OverdueState<T> getOverdueStateFor(T overdueable) throws OverdueError {
         try {
-            String stateName = accessApi.getOverdueStateNameFor(overdueable);
+            String stateName = accessApi.getBlockingStateNameFor(overdueable);
             OverdueStateSet<SubscriptionBundle> states = overdueConfig.getBundleStateSet();
             return (OverdueState<T>) states.findState(stateName);
         } catch (CatalogApiException e) {
@@ -62,14 +62,14 @@ public class DefaultOverdueUserApi implements OverdueUserApi{
     }
     
     @Override
-    public <T extends Overdueable> OverdueState<T> refreshOverdueStateFor(T overdueable) throws OverdueError, CatalogApiException {
+    public <T extends Blockable> OverdueState<T> refreshOverdueStateFor(T overdueable) throws OverdueError, CatalogApiException {
         OverdueWrapper<T> wrapper = factory.createOverdueWrapperFor(overdueable);
         return wrapper.refresh();
     } 
  
 
     @Override
-    public <T extends Overdueable> void setOverrideBillingStateForAccount(
+    public <T extends Blockable> void setOverrideBillingStateForAccount(
             T overdueable, BillingState<T> state) {
         throw new NotImplementedException();
     }
diff --git a/overdue/src/main/java/com/ning/billing/overdue/applicator/OverdueStateApplicator.java b/overdue/src/main/java/com/ning/billing/overdue/applicator/OverdueStateApplicator.java
index 5d40d67..f809788 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/applicator/OverdueStateApplicator.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/applicator/OverdueStateApplicator.java
@@ -21,20 +21,21 @@ import org.joda.time.DateTime;
 
 import com.google.inject.Inject;
 import com.ning.billing.ErrorCode;
-import com.ning.billing.overdue.OverdueAccessApi;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.junction.api.BlockingApi;
+import com.ning.billing.junction.api.BlockingState;
+import com.ning.billing.overdue.OverdueService;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.overdue.config.api.OverdueError;
-import com.ning.billing.overdue.config.api.OverdueState;
-import com.ning.billing.overdue.config.api.Overdueable;
-import com.ning.billing.util.clock.Clock;
 
-public class OverdueStateApplicator<T extends Overdueable>{
+public class OverdueStateApplicator<T extends Blockable>{
 
-    private final OverdueAccessApi accessApi;
+    private final BlockingApi blockingApi;
 
 
     @Inject
-    public OverdueStateApplicator(OverdueAccessApi accessApi) {
-        this.accessApi = accessApi;
+    public OverdueStateApplicator(BlockingApi accessApi) {
+        this.blockingApi = accessApi;
     }
 
     public void apply(T overdueable, OverdueState<T> previousOverdueState, OverdueState<T> nextOverdueState, DateTime timeOfNextCheck) throws OverdueError {
@@ -57,23 +58,37 @@ public class OverdueStateApplicator<T extends Overdueable>{
     }
 
 
-    protected void storeNewState(T overdueable, OverdueState<T> nextOverdueState) throws OverdueError {
+    protected void storeNewState(T blockable, OverdueState<T> nextOverdueState) throws OverdueError {
         try {
-            accessApi.setOverrideState(overdueable, nextOverdueState, Overdueable.Type.get(overdueable));
+            blockingApi.setBlockingState(new BlockingState(blockable.getId(), nextOverdueState.getName(), Blockable.Type.get(blockable), 
+                    OverdueService.OVERDUE_SERVICE_NAME, blockChanges(nextOverdueState), blockEntitlement(nextOverdueState), blockBilling(nextOverdueState)));
         } catch (Exception e) {
-            throw new OverdueError(e, ErrorCode.OVERDUE_CAT_ERROR_ENCOUNTERED, overdueable.getId(), overdueable.getClass().getName());
+            throw new OverdueError(e, ErrorCode.OVERDUE_CAT_ERROR_ENCOUNTERED, blockable.getId(), blockable.getClass().getName());
         }
     }
 
+    private boolean blockChanges(OverdueState<T> nextOverdueState) {
+        return nextOverdueState.blockChanges();
+    }
+
+    private boolean blockBilling(OverdueState<T> nextOverdueState) {
+        return nextOverdueState.disableEntitlementAndChangesBlocked();
+    }
+
+    private boolean blockEntitlement(OverdueState<T> nextOverdueState) {
+        return nextOverdueState.disableEntitlementAndChangesBlocked();
+    }
+
     protected void createFutureNotification(T overdueable,
             DateTime timeOfNextCheck) {
-        // TODO Auto-generated method stub
+        // TODO MDW
         
     }
 
 
     
     protected void clear(T overdueable) {
+        //TODO MDW
         // Clear future notification checks
         // Clear any overrides
         
diff --git a/overdue/src/main/java/com/ning/billing/overdue/calculator/BillingStateCalculator.java b/overdue/src/main/java/com/ning/billing/overdue/calculator/BillingStateCalculator.java
index eedde9a..640ca9a 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/calculator/BillingStateCalculator.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/calculator/BillingStateCalculator.java
@@ -29,11 +29,11 @@ import org.joda.time.DateTime;
 import com.google.inject.Inject;
 import com.ning.billing.invoice.api.Invoice;
 import com.ning.billing.invoice.api.InvoiceUserApi;
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.config.api.BillingState;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.util.clock.Clock;
 
-public abstract class BillingStateCalculator<T extends Overdueable> {
+public abstract class BillingStateCalculator<T extends Blockable> {
 
     private final InvoiceUserApi invoiceApi;
     private final Clock clock;
diff --git a/overdue/src/main/java/com/ning/billing/overdue/config/Condition.java b/overdue/src/main/java/com/ning/billing/overdue/config/Condition.java
index 7f79215..6fc8564 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/config/Condition.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/config/Condition.java
@@ -18,11 +18,12 @@ package com.ning.billing.overdue.config;
 
 import org.joda.time.DateTime;
 
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.config.api.BillingState;
-import com.ning.billing.overdue.config.api.Overdueable;
 
 
-public interface Condition<T extends Overdueable> {
+
+public interface Condition<T extends Blockable> {
 
     public boolean evaluate(BillingState state, DateTime now);
 
diff --git a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultCondition.java b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultCondition.java
index 8b6efac..08c13a9 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultCondition.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultCondition.java
@@ -26,8 +26,8 @@ import javax.xml.bind.annotation.XmlElementWrapper;
 
 import org.joda.time.DateTime;
 
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.config.api.BillingState;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.overdue.config.api.PaymentResponse;
 import com.ning.billing.util.config.ValidatingConfig;
 import com.ning.billing.util.config.ValidationErrors;
@@ -35,7 +35,8 @@ import com.ning.billing.util.tag.ControlTagType;
 import com.ning.billing.util.tag.Tag;
 
 @XmlAccessorType(XmlAccessType.NONE)
-public class DefaultCondition<T extends Overdueable> extends ValidatingConfig<OverdueConfig> implements Condition<T> {
+
+public class DefaultCondition<T extends Blockable> extends ValidatingConfig<OverdueConfig> implements Condition<T> {
 	@XmlElement(required=false, name="numberOfUnpaidInvoicesEqualsOrExceeds")
 	private Integer numberOfUnpaidInvoicesEqualsOrExceeds;
 
diff --git a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultDuration.java b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultDuration.java
index 7c6a862..90d3670 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultDuration.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultDuration.java
@@ -16,15 +16,16 @@
 
 package com.ning.billing.overdue.config;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.joda.time.DateTime;
+
 import com.ning.billing.catalog.api.Duration;
 import com.ning.billing.catalog.api.TimeUnit;
 import com.ning.billing.util.config.ValidatingConfig;
 import com.ning.billing.util.config.ValidationErrors;
-import org.joda.time.DateTime;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 
 @XmlAccessorType(XmlAccessType.NONE)
 public class DefaultDuration extends ValidatingConfig<OverdueConfig> implements Duration {
diff --git a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueState.java b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueState.java
index 3da59b1..1d76d72 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueState.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueState.java
@@ -22,14 +22,14 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlID;
 
-import com.ning.billing.overdue.config.api.OverdueState;
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.util.config.ValidatingConfig;
 import com.ning.billing.util.config.ValidationError;
 import com.ning.billing.util.config.ValidationErrors;
 
 @XmlAccessorType(XmlAccessType.NONE)
-public class DefaultOverdueState<T extends Overdueable> extends ValidatingConfig<OverdueConfig>  implements OverdueState<T> {
+public class DefaultOverdueState<T extends Blockable> extends ValidatingConfig<OverdueConfig>  implements OverdueState<T> {
 
     private static final int MAX_NAME_LENGTH = 50;
     
diff --git a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueStateSet.java b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueStateSet.java
index 7e82aa4..bbda620 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueStateSet.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/config/DefaultOverdueStateSet.java
@@ -24,15 +24,15 @@ import org.joda.time.DateTime;
 
 import com.ning.billing.ErrorCode;
 import com.ning.billing.catalog.api.CatalogApiException;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.overdue.config.api.BillingState;
-import com.ning.billing.overdue.config.api.OverdueState;
 import com.ning.billing.overdue.config.api.OverdueStateSet;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.util.config.ValidatingConfig;
 import com.ning.billing.util.config.ValidationErrors;
 
 @XmlAccessorType(XmlAccessType.NONE)
-public abstract class DefaultOverdueStateSet<T extends Overdueable> extends ValidatingConfig<OverdueConfig> implements OverdueStateSet<T> {
+public abstract class DefaultOverdueStateSet<T extends Blockable> extends ValidatingConfig<OverdueConfig> implements OverdueStateSet<T> {
     private DefaultOverdueState<T> clearState;
     
     protected abstract DefaultOverdueState<T>[] getStates();
diff --git a/overdue/src/main/java/com/ning/billing/overdue/glue/OverdueModule.java b/overdue/src/main/java/com/ning/billing/overdue/glue/OverdueModule.java
index 08fd53d..a94ccf5 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/glue/OverdueModule.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/glue/OverdueModule.java
@@ -18,6 +18,7 @@ package com.ning.billing.overdue.glue;
 
 import com.google.inject.AbstractModule;
 
+
 public class OverdueModule extends AbstractModule {
 
     @Override
diff --git a/overdue/src/main/java/com/ning/billing/overdue/service/DefaultOverdueService.java b/overdue/src/main/java/com/ning/billing/overdue/service/DefaultOverdueService.java
index dd2bd86..e405fcc 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/service/DefaultOverdueService.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/service/DefaultOverdueService.java
@@ -22,7 +22,6 @@ import com.google.inject.Inject;
 import com.ning.billing.lifecycle.LifecycleHandlerType;
 import com.ning.billing.lifecycle.LifecycleHandlerType.LifecycleLevel;
 import com.ning.billing.ovedue.OverdueProperties;
-import com.ning.billing.overdue.OverdueService;
 import com.ning.billing.overdue.OverdueUserApi;
 import com.ning.billing.overdue.config.OverdueConfig;
 import com.ning.billing.util.config.XMLLoader;
diff --git a/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapper.java b/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapper.java
index e7b1a8e..1c0b02b 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapper.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapper.java
@@ -17,25 +17,25 @@
 package com.ning.billing.overdue.wrapper;
 
 import com.ning.billing.catalog.api.CatalogApiException;
-import com.ning.billing.overdue.OverdueAccessApi;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.junction.api.BlockingApi;
+import com.ning.billing.overdue.OverdueState;
 import com.ning.billing.overdue.applicator.OverdueStateApplicator;
 import com.ning.billing.overdue.calculator.BillingStateCalculator;
 import com.ning.billing.overdue.config.api.BillingState;
 import com.ning.billing.overdue.config.api.OverdueError;
-import com.ning.billing.overdue.config.api.OverdueState;
 import com.ning.billing.overdue.config.api.OverdueStateSet;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.util.clock.Clock;
 
-public class OverdueWrapper<T extends Overdueable> {
+public class OverdueWrapper<T extends Blockable> {
     private final T overdueable;
-    private final OverdueAccessApi api;
+    private final BlockingApi api;
     private final Clock clock;
     private final OverdueStateSet<T> overdueStateSet;
     private final BillingStateCalculator<T> billingStateCalcuator;
     private final OverdueStateApplicator<T> overdueStateApplicator;
 
-    public OverdueWrapper(T overdueable, OverdueAccessApi api,
+    public OverdueWrapper(T overdueable, BlockingApi api,
             OverdueStateSet<T> overdueStateSet,
             Clock clock,
             BillingStateCalculator<T> billingStateCalcuator,
@@ -51,7 +51,7 @@ public class OverdueWrapper<T extends Overdueable> {
     public OverdueState<T> refresh() throws OverdueError, CatalogApiException {
         OverdueState<T> nextOverdueState;
         BillingState<T> billingState = billingStateCalcuator.calculateBillingState(overdueable);
-        String previousOverdueStateName = api.getOverdueStateNameFor(overdueable);
+        String previousOverdueStateName = api.getBlockingStateNameFor(overdueable);
         nextOverdueState = overdueStateSet.calculateOverdueState(billingState, clock.getUTCNow());
         if(!previousOverdueStateName.equals(nextOverdueState.getName())) {
             overdueStateApplicator.apply(overdueable, nextOverdueState, nextOverdueState, overdueStateSet.dateOfNextCheck(billingState, clock.getUTCNow())); 
diff --git a/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapperFactory.java b/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapperFactory.java
index 8d1c5b8..6873c4c 100644
--- a/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapperFactory.java
+++ b/overdue/src/main/java/com/ning/billing/overdue/wrapper/OverdueWrapperFactory.java
@@ -19,12 +19,12 @@ package com.ning.billing.overdue.wrapper;
 import com.google.inject.Inject;
 import com.ning.billing.ErrorCode;
 import com.ning.billing.entitlement.api.user.SubscriptionBundle;
-import com.ning.billing.overdue.OverdueAccessApi;
+import com.ning.billing.junction.api.Blockable;
+import com.ning.billing.junction.api.BlockingApi;
 import com.ning.billing.overdue.applicator.OverdueStateApplicator;
 import com.ning.billing.overdue.calculator.BillingStateCalculatorBundle;
 import com.ning.billing.overdue.config.OverdueConfig;
 import com.ning.billing.overdue.config.api.OverdueError;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.overdue.service.ExtendedOverdueService;
 import com.ning.billing.util.clock.Clock;
 
@@ -33,11 +33,11 @@ public class OverdueWrapperFactory {
     private final OverdueConfig overdueConfig;
     private final BillingStateCalculatorBundle billingStateCalcuatorBundle;
     private final OverdueStateApplicator<SubscriptionBundle> overdueStateApplicatorBundle;
-    private final OverdueAccessApi api;
+    private final BlockingApi api;
     private final Clock clock;
 
     @Inject
-    public OverdueWrapperFactory(OverdueAccessApi api, ExtendedOverdueService service, Clock clock, 
+    public OverdueWrapperFactory(BlockingApi api, ExtendedOverdueService service, Clock clock, 
             BillingStateCalculatorBundle billingStateCalcuatorBundle, OverdueStateApplicator<SubscriptionBundle> overdueStateApplicatorBundle) {
         this.billingStateCalcuatorBundle = billingStateCalcuatorBundle;
         this.overdueStateApplicatorBundle = overdueStateApplicatorBundle;
@@ -47,7 +47,7 @@ public class OverdueWrapperFactory {
     }
 
     @SuppressWarnings("unchecked")
-    public <T extends Overdueable> OverdueWrapper<T> createOverdueWrapperFor(T overdueable) throws OverdueError {
+    public <T extends Blockable> OverdueWrapper<T> createOverdueWrapperFor(T overdueable) throws OverdueError {
         if(overdueable instanceof SubscriptionBundle) {
             return (OverdueWrapper<T>)new OverdueWrapper<SubscriptionBundle>((SubscriptionBundle)overdueable, api, overdueConfig.getBundleStateSet(), 
                     clock, billingStateCalcuatorBundle, overdueStateApplicatorBundle );
diff --git a/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueRules.java b/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueRules.java
index 5ef0364..3095296 100644
--- a/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueRules.java
+++ b/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueRules.java
@@ -18,7 +18,7 @@ package com.ning.billing.overdue.config;
 
 
 import com.ning.billing.entitlement.api.user.SubscriptionBundle;
-import com.ning.billing.mock.overdue.MockOverdueAccessModule;
+import com.ning.billing.junction.MockBlockingModule;
 
 
 public class MockOverdueRules extends OverdueConfig {
@@ -26,7 +26,7 @@ public class MockOverdueRules extends OverdueConfig {
     @SuppressWarnings("unchecked")
     public MockOverdueRules() {
         OverdueStatesBundle bundleODS =  new OverdueStatesBundle();
-        bundleODS.setBundleOverdueStates(new DefaultOverdueState[] { new DefaultOverdueState<SubscriptionBundle>().setName(MockOverdueAccessModule.CLEAR_STATE) });
+        bundleODS.setBundleOverdueStates(new DefaultOverdueState[] { new DefaultOverdueState<SubscriptionBundle>().setName(MockBlockingModule.CLEAR_STATE) });
         setOverdueStatesBundle(bundleODS);
 
     }
diff --git a/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueState.java b/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueState.java
index bf41f8e..606556f 100644
--- a/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueState.java
+++ b/overdue/src/test/java/com/ning/billing/overdue/config/MockOverdueState.java
@@ -16,13 +16,13 @@
 
 package com.ning.billing.overdue.config;
 
-import com.ning.billing.mock.overdue.MockOverdueAccessModule;
-import com.ning.billing.overdue.config.api.Overdueable;
+import com.ning.billing.junction.MockBlockingModule;
+import com.ning.billing.junction.api.Blockable;
 
-public class MockOverdueState<T extends Overdueable> extends DefaultOverdueState<T> {
+public class MockOverdueState<T extends Blockable> extends DefaultOverdueState<T> {
     
     public MockOverdueState() {
-        setName(MockOverdueAccessModule.CLEAR_STATE);
+        setName(MockBlockingModule.CLEAR_STATE);
     }
 
     public MockOverdueState(String name, boolean blockChanges, boolean disableEntitlementAndBlockChanges) {
diff --git a/overdue/src/test/java/com/ning/billing/overdue/config/TestCondition.java b/overdue/src/test/java/com/ning/billing/overdue/config/TestCondition.java
index 3cd02ea..1e5f1e0 100644
--- a/overdue/src/test/java/com/ning/billing/overdue/config/TestCondition.java
+++ b/overdue/src/test/java/com/ning/billing/overdue/config/TestCondition.java
@@ -27,8 +27,8 @@ import org.joda.time.DateTime;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import com.ning.billing.junction.api.Blockable;
 import com.ning.billing.overdue.config.api.BillingState;
-import com.ning.billing.overdue.config.api.Overdueable;
 import com.ning.billing.overdue.config.api.PaymentResponse;
 import com.ning.billing.util.config.XMLLoader;
 import com.ning.billing.util.tag.ControlTagType;
@@ -39,7 +39,7 @@ import com.ning.billing.util.tag.Tag;
 public class TestCondition {
 	
 	@XmlRootElement(name="condition")
-	private static class MockCondition extends DefaultCondition<Overdueable> {}
+	private static class MockCondition extends DefaultCondition<Blockable> {}
 
 	@Test(groups={"fast"}, enabled=true)
 	public void testNumberOfUnpaidInvoicesEqualsOrExceeds() throws Exception {
@@ -50,9 +50,9 @@ public class TestCondition {
 		InputStream is = new ByteArrayInputStream(xml.getBytes());
 		MockCondition c = XMLLoader.getObjectFromStreamNoValidation(is,  MockCondition.class);
 		
-		BillingState<Overdueable> state0 = new BillingState<Overdueable>(new UUID(0L,1L), 0, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state1 = new BillingState<Overdueable>(new UUID(0L,1L), 1, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state2 = new BillingState<Overdueable>(new UUID(0L,1L), 2, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state0 = new BillingState<Blockable>(new UUID(0L,1L), 0, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state1 = new BillingState<Blockable>(new UUID(0L,1L), 1, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state2 = new BillingState<Blockable>(new UUID(0L,1L), 2, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
 		
 		Assert.assertTrue(!c.evaluate(state0, new DateTime()));
 		Assert.assertTrue(c.evaluate(state1, new DateTime()));
@@ -68,9 +68,9 @@ public class TestCondition {
 		InputStream is = new ByteArrayInputStream(xml.getBytes());
 		MockCondition c = XMLLoader.getObjectFromStreamNoValidation(is,  MockCondition.class);
 		
-		BillingState<Overdueable> state0 = new BillingState<Overdueable>(new UUID(0L,1L), 0, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state1 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state2 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state0 = new BillingState<Blockable>(new UUID(0L,1L), 0, BigDecimal.ZERO, new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state1 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state2 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), new DateTime(), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
 		
 		Assert.assertTrue(!c.evaluate(state0, new DateTime()));
 		Assert.assertTrue(c.evaluate(state1, new DateTime()));
@@ -89,9 +89,9 @@ public class TestCondition {
 		
 		DateTime now = new DateTime();
 		
-		BillingState<Overdueable> state0 = new BillingState<Overdueable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state1 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state2 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state0 = new BillingState<Blockable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state1 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state2 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
 		
 		Assert.assertTrue(!c.evaluate(state0, now));
 		Assert.assertTrue(c.evaluate(state1, now));
@@ -109,9 +109,9 @@ public class TestCondition {
 		
 		DateTime now = new DateTime();
 		
-		BillingState<Overdueable> state0 = new BillingState<Overdueable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.LOST_OR_STOLEN_CARD, new Tag[]{});
-		BillingState<Overdueable> state1 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
-		BillingState<Overdueable> state2 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), PaymentResponse.DO_NOT_HONOR , new Tag[]{});
+		BillingState<Blockable> state0 = new BillingState<Blockable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.LOST_OR_STOLEN_CARD, new Tag[]{});
+		BillingState<Blockable> state1 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{});
+		BillingState<Blockable> state2 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), PaymentResponse.DO_NOT_HONOR , new Tag[]{});
 		
 		Assert.assertTrue(!c.evaluate(state0, now));
 		Assert.assertTrue(c.evaluate(state1, now));
@@ -129,9 +129,9 @@ public class TestCondition {
 		
 		DateTime now = new DateTime();
 		
-		BillingState<Overdueable> state0 = new BillingState<Overdueable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.LOST_OR_STOLEN_CARD, new Tag[]{new DefaultControlTag(ControlTagType.AUTO_INVOICING_OFF),new DescriptiveTag("Tag")});
-		BillingState<Overdueable> state1 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{new DefaultControlTag(ControlTagType.OVERDUE_ENFORCEMENT_OFF)});
-		BillingState<Overdueable> state2 = new BillingState<Overdueable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), 
+		BillingState<Blockable> state0 = new BillingState<Blockable>(new UUID(0L,1L), 0, BigDecimal.ZERO, now, PaymentResponse.LOST_OR_STOLEN_CARD, new Tag[]{new DefaultControlTag(ControlTagType.AUTO_INVOICING_OFF),new DescriptiveTag("Tag")});
+		BillingState<Blockable> state1 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("100.00"), now.minusDays(10), PaymentResponse.INSUFFICIENT_FUNDS, new Tag[]{new DefaultControlTag(ControlTagType.OVERDUE_ENFORCEMENT_OFF)});
+		BillingState<Blockable> state2 = new BillingState<Blockable>(new UUID(0L,1L), 1, new BigDecimal("200.00"), now.minusDays(20), 
 				PaymentResponse.DO_NOT_HONOR, 
 				new Tag[]{new DefaultControlTag(ControlTagType.OVERDUE_ENFORCEMENT_OFF), 
 						  new DefaultControlTag(ControlTagType.AUTO_INVOICING_OFF),

pom.xml 6(+3 -3)

diff --git a/pom.xml b/pom.xml
index f7ab718..73d1456 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,7 @@
         <module>catalog</module>
         <module>entitlement</module>
         <module>invoice</module>
-        <module>ne</module>
+        <module>junction</module>
         <module>overdue</module>
         <module>payment</module>
         <module>util</module>
@@ -111,12 +111,12 @@
             </dependency>
             <dependency>
                 <groupId>com.ning.billing</groupId>
-                <artifactId>killbill-ne</artifactId>
+                <artifactId>killbill-junction</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>com.ning.billing</groupId>
-                <artifactId>killbill-ne</artifactId>
+                <artifactId>killbill-junction</artifactId>
                 <version>${project.version}</version>
                 <type>test-jar</type>
                 <scope>test</scope>