killbill-memoizeit

Changes

Details

diff --git a/api/src/main/java/com/ning/billing/payment/api/PaymentEvent.java b/api/src/main/java/com/ning/billing/payment/api/PaymentEvent.java
new file mode 100644
index 0000000..95e2d77
--- /dev/null
+++ b/api/src/main/java/com/ning/billing/payment/api/PaymentEvent.java
@@ -0,0 +1,20 @@
+/*
+ * 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.payment.api;
+
+public interface PaymentEvent {
+
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/AccountChangeInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/AccountChangeInternalEvent.java
new file mode 100644
index 0000000..b6458e3
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/AccountChangeInternalEvent.java
@@ -0,0 +1,30 @@
+/*
+ * 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.util.events;
+
+import java.util.List;
+import java.util.UUID;
+
+import com.ning.billing.account.api.ChangedField;
+
+public interface AccountChangeInternalEvent extends BusInternalEvent {
+    public UUID getAccountId();
+
+    public List<ChangedField> getChangedFields();
+
+    public boolean hasChanges();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/AccountCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/AccountCreationInternalEvent.java
new file mode 100644
index 0000000..fcbdd91
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/AccountCreationInternalEvent.java
@@ -0,0 +1,28 @@
+/*
+ * 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.util.events;
+
+import java.util.UUID;
+
+import com.ning.billing.account.api.AccountData;
+
+public interface AccountCreationInternalEvent extends BusInternalEvent {
+
+    public UUID getId();
+
+    public AccountData getData();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/BusInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/BusInternalEvent.java
new file mode 100644
index 0000000..f4eb2c5
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/BusInternalEvent.java
@@ -0,0 +1,51 @@
+/*
+ * 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.util.events;
+
+import java.util.UUID;
+
+public interface BusInternalEvent {
+
+    public enum BusEventType {
+        ACCOUNT_CREATE,
+        ACCOUNT_CHANGE,
+        SUBSCRIPTION_TRANSITION,
+        BUNDLE_REPAIR,
+        INVOICE_EMPTY,
+        INVOICE_CREATION,
+        INVOICE_ADJUSTMENT,
+        PAYMENT_INFO,
+        PAYMENT_ERROR,
+        CONTROL_TAG_CREATION,
+        CONTROL_TAG_DELETION,
+        USER_TAG_CREATION,
+        USER_TAG_DELETION,
+        CONTROL_TAGDEFINITION_CREATION,
+        CONTROL_TAGDEFINITION_DELETION,
+        USER_TAGDEFINITION_CREATION,
+        USER_TAGDEFINITION_DELETION,
+        OVERDUE_CHANGE
+    }
+
+    public BusEventType getBusEventType();
+
+    public UUID getUserToken();
+
+    public Long getTenantRecordId();
+
+    public Long getAccountRecordId();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/ControlTagCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/ControlTagCreationInternalEvent.java
new file mode 100644
index 0000000..e439771
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/ControlTagCreationInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface ControlTagCreationInternalEvent extends TagInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionCreationInternalEvent.java
new file mode 100644
index 0000000..46c3389
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionCreationInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface ControlTagDefinitionCreationInternalEvent extends TagDefinitionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionDeletionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionDeletionInternalEvent.java
new file mode 100644
index 0000000..dcd87ba
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/ControlTagDefinitionDeletionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface ControlTagDefinitionDeletionInternalEvent extends TagDefinitionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/ControlTagDeletionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/ControlTagDeletionInternalEvent.java
new file mode 100644
index 0000000..e8cd01a
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/ControlTagDeletionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface ControlTagDeletionInternalEvent extends TagInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/EffectiveSubscriptionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/EffectiveSubscriptionInternalEvent.java
new file mode 100644
index 0000000..b5a8cdb
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/EffectiveSubscriptionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * 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.util.events;
+
+
+public interface EffectiveSubscriptionInternalEvent extends SubscriptionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/InvoiceAdjustmentInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/InvoiceAdjustmentInternalEvent.java
new file mode 100644
index 0000000..9584ae0
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/InvoiceAdjustmentInternalEvent.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+import java.util.UUID;
+
+
+public interface InvoiceAdjustmentInternalEvent extends InvoiceInternalEvent {
+
+    public UUID getInvoiceId();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/InvoiceCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/InvoiceCreationInternalEvent.java
new file mode 100644
index 0000000..54cda6f
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/InvoiceCreationInternalEvent.java
@@ -0,0 +1,32 @@
+/*
+ * 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.util.events;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+
+import com.ning.billing.catalog.api.Currency;
+
+public interface InvoiceCreationInternalEvent extends InvoiceInternalEvent {
+
+    public UUID getInvoiceId();
+
+    public BigDecimal getAmountOwed();
+
+    public Currency getCurrency();
+
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/InvoiceInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/InvoiceInternalEvent.java
new file mode 100644
index 0000000..ef15357
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/InvoiceInternalEvent.java
@@ -0,0 +1,23 @@
+/*
+ * 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.util.events;
+
+import java.util.UUID;
+
+
+public interface InvoiceInternalEvent extends BusInternalEvent {
+    public UUID getAccountId();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/NullInvoiceInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/NullInvoiceInternalEvent.java
new file mode 100644
index 0000000..ac8a1de
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/NullInvoiceInternalEvent.java
@@ -0,0 +1,22 @@
+/*
+ * 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.util.events;
+
+
+
+public interface NullInvoiceInternalEvent extends InvoiceInternalEvent {
+
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/OverdueChangeInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/OverdueChangeInternalEvent.java
new file mode 100644
index 0000000..04d932f
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/OverdueChangeInternalEvent.java
@@ -0,0 +1,32 @@
+/*
+ * 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.util.events;
+
+import java.util.UUID;
+
+import com.ning.billing.junction.api.Blockable;
+
+
+public interface OverdueChangeInternalEvent extends BusInternalEvent {
+    UUID getOverdueObjectId();
+
+    Blockable.Type getOverdueObjectType();
+
+    String getPreviousOverdueStateName();
+
+    String getNextOverdueStateName();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/PaymentErrorInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/PaymentErrorInternalEvent.java
new file mode 100644
index 0000000..27b50e8
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/PaymentErrorInternalEvent.java
@@ -0,0 +1,30 @@
+/* 
+ * 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.util.events;
+
+import java.util.UUID;
+
+
+public interface PaymentErrorInternalEvent extends BusInternalEvent {
+
+    public String getMessage();
+
+    public UUID getInvoiceId();
+
+    public UUID getAccountId();
+
+    public UUID getPaymentId();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/PaymentInfoInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/PaymentInfoInternalEvent.java
new file mode 100644
index 0000000..d02421b
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/PaymentInfoInternalEvent.java
@@ -0,0 +1,45 @@
+/*
+ * 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.util.events;
+
+import java.math.BigDecimal;
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+
+import com.ning.billing.payment.api.PaymentStatus;
+import com.ning.billing.util.entity.Entity;
+
+public interface PaymentInfoInternalEvent extends Entity, BusInternalEvent {
+
+    public UUID getPaymentId();
+
+    public UUID getAccountId();
+
+    public UUID getInvoiceId();
+
+    public BigDecimal getAmount();
+
+    public DateTime getEffectiveDate();
+
+    public Integer getPaymentNumber();
+
+    public PaymentStatus getStatus();
+
+    public String getExtFirstPaymentRefId();
+
+    public String getExtSecondPaymentRefId();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/RepairEntitlementInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/RepairEntitlementInternalEvent.java
new file mode 100644
index 0000000..e9f5bf6
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/RepairEntitlementInternalEvent.java
@@ -0,0 +1,30 @@
+/* 
+ * 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.util.events;
+
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+
+
+public interface RepairEntitlementInternalEvent extends BusInternalEvent {
+
+    public UUID getAccountId();
+
+    public UUID getBundleId();
+
+    public DateTime getEffectiveDate();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/RequestedSubscriptionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/RequestedSubscriptionInternalEvent.java
new file mode 100644
index 0000000..1d8b549
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/RequestedSubscriptionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface RequestedSubscriptionInternalEvent extends SubscriptionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/SubscriptionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/SubscriptionInternalEvent.java
new file mode 100644
index 0000000..3bc35fe
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/SubscriptionInternalEvent.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+import java.util.UUID;
+
+import org.joda.time.DateTime;
+
+import com.ning.billing.entitlement.api.SubscriptionTransitionType;
+import com.ning.billing.entitlement.api.user.Subscription;
+import com.ning.billing.entitlement.api.user.Subscription.SubscriptionState;
+
+public interface SubscriptionInternalEvent extends BusInternalEvent {
+    UUID getId();
+
+    SubscriptionTransitionType getTransitionType();
+
+    UUID getBundleId();
+
+    UUID getSubscriptionId();
+
+    DateTime getSubscriptionStartDate();
+
+    DateTime getRequestedTransitionTime();
+
+    DateTime getEffectiveTransitionTime();
+
+    SubscriptionState getPreviousState();
+
+    String getPreviousPlan();
+
+    String getPreviousPriceList();
+
+    String getPreviousPhase();
+
+    String getNextPlan();
+
+    String getNextPhase();
+
+    SubscriptionState getNextState();
+
+    String getNextPriceList();
+
+    Integer getRemainingEventsForUserOperation();
+
+    Long getTotalOrdering();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/TagDefinitionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/TagDefinitionInternalEvent.java
new file mode 100644
index 0000000..7df55ea
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/TagDefinitionInternalEvent.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+import java.util.UUID;
+
+import com.ning.billing.util.tag.TagDefinition;
+
+public interface TagDefinitionInternalEvent extends BusInternalEvent {
+    UUID getTagDefinitionId();
+
+    TagDefinition getTagDefinition();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/TagInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/TagInternalEvent.java
new file mode 100644
index 0000000..bcded78
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/TagInternalEvent.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+import java.util.UUID;
+
+import com.ning.billing.util.dao.ObjectType;
+import com.ning.billing.util.tag.TagDefinition;
+
+public interface TagInternalEvent extends BusInternalEvent {
+
+    UUID getTagId();
+
+    UUID getObjectId();
+
+    ObjectType getObjectType();
+
+    TagDefinition getTagDefinition();
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/UserTagCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/UserTagCreationInternalEvent.java
new file mode 100644
index 0000000..cc9c206
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/UserTagCreationInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface UserTagCreationInternalEvent extends TagInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionCreationInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionCreationInternalEvent.java
new file mode 100644
index 0000000..9b1e3f5
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionCreationInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface UserTagDefinitionCreationInternalEvent extends TagDefinitionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionDeletionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionDeletionInternalEvent.java
new file mode 100644
index 0000000..b9ade13
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/UserTagDefinitionDeletionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface UserTagDefinitionDeletionInternalEvent extends TagDefinitionInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/events/UserTagDeletionInternalEvent.java b/util/src/main/java/com/ning/billing/util/events/UserTagDeletionInternalEvent.java
new file mode 100644
index 0000000..6c6a462
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/events/UserTagDeletionInternalEvent.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010-2012 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.util.events;
+
+
+public interface UserTagDeletionInternalEvent extends TagInternalEvent {
+}
diff --git a/util/src/main/java/com/ning/billing/util/svcapi/tag/DefaultTagInternalApi.java b/util/src/main/java/com/ning/billing/util/svcapi/tag/DefaultTagInternalApi.java
new file mode 100644
index 0000000..5a8eae8
--- /dev/null
+++ b/util/src/main/java/com/ning/billing/util/svcapi/tag/DefaultTagInternalApi.java
@@ -0,0 +1,59 @@
+/*
+ * 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.util.svcapi.tag;
+
+import java.util.Map;
+import java.util.UUID;
+
+import javax.inject.Inject;
+
+import com.ning.billing.util.api.TagApiException;
+import com.ning.billing.util.callcontext.InternalCallContext;
+import com.ning.billing.util.callcontext.InternalTenantContext;
+import com.ning.billing.util.dao.ObjectType;
+import com.ning.billing.util.tag.Tag;
+import com.ning.billing.util.tag.dao.TagDao;
+
+public class DefaultTagInternalApi implements TagInternalApi {
+
+    private final TagDao tagDao;
+
+    @Inject
+    public DefaultTagInternalApi(final TagDao tagDao) {
+        this.tagDao = tagDao;
+    }
+
+    @Override
+    public Map<String, Tag> getTags(UUID objectId, ObjectType objectType,
+            InternalTenantContext context) {
+        return tagDao.loadEntities(objectId, objectType, context);
+    }
+
+    @Override
+    public void addTag(UUID objectId, ObjectType objectType,
+            UUID tagDefinitionId, InternalCallContext context)
+            throws TagApiException {
+        tagDao.insertTag(objectId, objectType, tagDefinitionId, context);
+
+    }
+
+    @Override
+    public void removeTag(UUID objectId, ObjectType objectType,
+            UUID tagDefinitionId, InternalCallContext context)
+            throws TagApiException {
+        tagDao.deleteTag(objectId, objectType, tagDefinitionId, context);
+    }
+}