killbill 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -2,16 +2,17 @@ language: ruby
2
2
 
3
3
  notifications:
4
4
  email:
5
- - killbilling-dev@googlegroups.com
5
+ - kill-bill-commits@googlegroups.com
6
6
 
7
7
  rvm:
8
8
  - jruby-19mode
9
+ - jruby-20mode
9
10
  - jruby-head
10
11
 
11
12
  jdk:
13
+ - openjdk6
12
14
  - openjdk7
13
15
  - oraclejdk7
14
- - openjdk6
15
16
 
16
17
  matrix:
17
18
  allow_failures:
data/Jarfile CHANGED
@@ -1,5 +1,5 @@
1
- jar 'com.ning.billing:killbill-api', '0.6.0'
2
- jar 'com.ning.billing.plugin:killbill-plugin-api-notification', '0.4.0'
3
- jar 'com.ning.billing.plugin:killbill-plugin-api-payment', '0.4.0'
4
- jar 'com.ning.billing:killbill-util:tests', '0.6.0'
1
+ jar 'com.ning.billing:killbill-api', '0.7.1'
2
+ jar 'com.ning.billing.plugin:killbill-plugin-api-notification', '0.5.0'
3
+ jar 'com.ning.billing.plugin:killbill-plugin-api-payment', '0.5.0'
4
+ jar 'com.ning.billing:killbill-util:tests', '0.6.17'
5
5
  jar 'javax.servlet:javax.servlet-api', '3.0.1'
data/NEWS CHANGED
@@ -1,8 +1,11 @@
1
+ 1.7.0
2
+ Update to killbill-api 0.7.1 and killbill-plugin-api 0.5.0 (pagination)
3
+
1
4
  1.6.0
2
- New entitlement Apis + merge with serach APIs
5
+ New entitlement APIs + merge with search APIs
3
6
 
4
7
  1.5.0 (don't use)
5
- New entitlement Apis
8
+ New entitlement APIs
6
9
 
7
10
  1.4.0
8
11
  Add search APIs
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.0
1
+ 1.7.0
data/gen_config/api.conf CHANGED
@@ -35,7 +35,8 @@ com.ning.billing.util.api,
35
35
  com.ning.billing.util.callcontext,
36
36
  com.ning.billing.util.customfield,
37
37
  com.ning.billing.util.entity,
38
- com.ning.billing.util.tag
38
+ com.ning.billing.util.tag,
39
+ com.ning.billing.security
39
40
  -x
40
41
  ExportUserApi,
41
42
  PluginConfig,
@@ -102,40 +102,40 @@ module Killbill
102
102
  end
103
103
  end
104
104
 
105
- java_signature 'Java::java.util.List searchAccounts(Java::java.lang.String, Java::com.ning.billing.util.callcontext.TenantContext)'
106
- def search_accounts(searchKey, context)
105
+ java_signature 'Java::com.ning.billing.util.entity.Pagination searchAccounts(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::com.ning.billing.util.callcontext.TenantContext)'
106
+ def search_accounts(searchKey, offset, limit, context)
107
107
 
108
108
  # conversion for searchKey [type = java.lang.String]
109
109
  searchKey = searchKey.to_s unless searchKey.nil?
110
110
 
111
+ # conversion for offset [type = java.lang.Long]
112
+ offset = offset
113
+
114
+ # conversion for limit [type = java.lang.Long]
115
+ limit = limit
116
+
111
117
  # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
112
118
  context = context.to_java unless context.nil?
113
- res = @real_java_api.search_accounts(searchKey, context)
114
- # conversion for res [type = java.util.List]
115
- tmp = []
116
- (res || []).each do |m|
117
- # conversion for m [type = com.ning.billing.account.api.Account]
118
- m = Killbill::Plugin::Model::Account.new.to_ruby(m) unless m.nil?
119
- tmp << m
120
- end
121
- res = tmp
119
+ res = @real_java_api.search_accounts(searchKey, offset, limit, context)
120
+ # conversion for res [type = com.ning.billing.util.entity.Pagination]
121
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
122
122
  return res
123
123
  end
124
124
 
125
- java_signature 'Java::java.util.List getAccounts(Java::com.ning.billing.util.callcontext.TenantContext)'
126
- def get_accounts(context)
125
+ java_signature 'Java::com.ning.billing.util.entity.Pagination getAccounts(Java::java.lang.Long, Java::java.lang.Long, Java::com.ning.billing.util.callcontext.TenantContext)'
126
+ def get_accounts(offset, limit, context)
127
+
128
+ # conversion for offset [type = java.lang.Long]
129
+ offset = offset
130
+
131
+ # conversion for limit [type = java.lang.Long]
132
+ limit = limit
127
133
 
128
134
  # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
129
135
  context = context.to_java unless context.nil?
130
- res = @real_java_api.get_accounts(context)
131
- # conversion for res [type = java.util.List]
132
- tmp = []
133
- (res || []).each do |m|
134
- # conversion for m [type = com.ning.billing.account.api.Account]
135
- m = Killbill::Plugin::Model::Account.new.to_ruby(m) unless m.nil?
136
- tmp << m
137
- end
138
- res = tmp
136
+ res = @real_java_api.get_accounts(offset, limit, context)
137
+ # conversion for res [type = com.ning.billing.util.entity.Pagination]
138
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
139
139
  return res
140
140
  end
141
141
 
@@ -32,7 +32,7 @@ module Killbill
32
32
 
33
33
  include com.ning.billing.entitlement.api.Entitlement
34
34
 
35
- attr_accessor :id, :created_date, :updated_date, :base_entitlement_id, :bundle_id, :account_id, :external_key, :state, :source_type, :effective_start_date, :effective_end_date, :product, :plan, :price_list, :current_phase, :product_category, :last_active_product, :last_active_plan, :last_active_price_list, :last_active_product_category
35
+ attr_accessor :id, :created_date, :updated_date, :base_entitlement_id, :bundle_id, :account_id, :external_key, :state, :source_type, :effective_start_date, :effective_end_date, :last_active_product, :last_active_plan, :last_active_phase, :last_active_price_list, :last_active_product_category
36
36
 
37
37
  def initialize()
38
38
  end
@@ -81,27 +81,15 @@ module Killbill
81
81
  @effective_end_date = Java::org.joda.time.LocalDate.parse(@effective_end_date.to_s)
82
82
  end
83
83
 
84
- # conversion for product [type = com.ning.billing.catalog.api.Product]
85
- @product = @product.to_java unless @product.nil?
86
-
87
- # conversion for plan [type = com.ning.billing.catalog.api.Plan]
88
- @plan = @plan.to_java unless @plan.nil?
89
-
90
- # conversion for price_list [type = com.ning.billing.catalog.api.PriceList]
91
- @price_list = @price_list.to_java unless @price_list.nil?
92
-
93
- # conversion for current_phase [type = com.ning.billing.catalog.api.PlanPhase]
94
- @current_phase = @current_phase.to_java unless @current_phase.nil?
95
-
96
- # conversion for product_category [type = com.ning.billing.catalog.api.ProductCategory]
97
- @product_category = Java::com.ning.billing.catalog.api.ProductCategory.value_of("#{@product_category.to_s}") unless @product_category.nil?
98
-
99
84
  # conversion for last_active_product [type = com.ning.billing.catalog.api.Product]
100
85
  @last_active_product = @last_active_product.to_java unless @last_active_product.nil?
101
86
 
102
87
  # conversion for last_active_plan [type = com.ning.billing.catalog.api.Plan]
103
88
  @last_active_plan = @last_active_plan.to_java unless @last_active_plan.nil?
104
89
 
90
+ # conversion for last_active_phase [type = com.ning.billing.catalog.api.PlanPhase]
91
+ @last_active_phase = @last_active_phase.to_java unless @last_active_phase.nil?
92
+
105
93
  # conversion for last_active_price_list [type = com.ning.billing.catalog.api.PriceList]
106
94
  @last_active_price_list = @last_active_price_list.to_java unless @last_active_price_list.nil?
107
95
 
@@ -166,26 +154,6 @@ module Killbill
166
154
  @effective_end_date = @effective_end_date.to_s
167
155
  end
168
156
 
169
- # conversion for product [type = com.ning.billing.catalog.api.Product]
170
- @product = j_obj.product
171
- @product = Killbill::Plugin::Model::Product.new.to_ruby(@product) unless @product.nil?
172
-
173
- # conversion for plan [type = com.ning.billing.catalog.api.Plan]
174
- @plan = j_obj.plan
175
- @plan = Killbill::Plugin::Model::Plan.new.to_ruby(@plan) unless @plan.nil?
176
-
177
- # conversion for price_list [type = com.ning.billing.catalog.api.PriceList]
178
- @price_list = j_obj.price_list
179
- @price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@price_list) unless @price_list.nil?
180
-
181
- # conversion for current_phase [type = com.ning.billing.catalog.api.PlanPhase]
182
- @current_phase = j_obj.current_phase
183
- @current_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@current_phase) unless @current_phase.nil?
184
-
185
- # conversion for product_category [type = com.ning.billing.catalog.api.ProductCategory]
186
- @product_category = j_obj.product_category
187
- @product_category = @product_category.to_s.to_sym unless @product_category.nil?
188
-
189
157
  # conversion for last_active_product [type = com.ning.billing.catalog.api.Product]
190
158
  @last_active_product = j_obj.last_active_product
191
159
  @last_active_product = Killbill::Plugin::Model::Product.new.to_ruby(@last_active_product) unless @last_active_product.nil?
@@ -194,6 +162,10 @@ module Killbill
194
162
  @last_active_plan = j_obj.last_active_plan
195
163
  @last_active_plan = Killbill::Plugin::Model::Plan.new.to_ruby(@last_active_plan) unless @last_active_plan.nil?
196
164
 
165
+ # conversion for last_active_phase [type = com.ning.billing.catalog.api.PlanPhase]
166
+ @last_active_phase = j_obj.last_active_phase
167
+ @last_active_phase = Killbill::Plugin::Model::PlanPhase.new.to_ruby(@last_active_phase) unless @last_active_phase.nil?
168
+
197
169
  # conversion for last_active_price_list [type = com.ning.billing.catalog.api.PriceList]
198
170
  @last_active_price_list = j_obj.last_active_price_list
199
171
  @last_active_price_list = Killbill::Plugin::Model::PriceList.new.to_ruby(@last_active_price_list) unless @last_active_price_list.nil?
@@ -0,0 +1,76 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'java.util'
31
+
32
+ include java.util.Iterator
33
+ class EnumeratorIterator
34
+
35
+ def initialize(delegate)
36
+ @buffer = []
37
+ # We expect an Enumerable or Enumerator
38
+ @delegate = delegate.is_a?(Enumerable) ? delegate.to_enum : delegate
39
+ _next
40
+ end
41
+
42
+ def has_next
43
+ !@next.nil?
44
+ end
45
+
46
+ def next
47
+ prev = @next
48
+ _next
49
+ prev
50
+ end
51
+
52
+ def remove
53
+ raise NotImplementedError.new
54
+ end
55
+
56
+ private
57
+
58
+ def _next
59
+ @next = @buffer.shift
60
+ return unless @next.nil?
61
+
62
+ @next = @delegate.next rescue nil
63
+ return if @next.nil?
64
+
65
+ if @next.is_a? Enumerable
66
+ @buffer += @next.to_a
67
+ else
68
+ @buffer << @next
69
+ end
70
+ _next
71
+ end
72
+
73
+ end
74
+ end
75
+ end
76
+ end
@@ -57,6 +57,23 @@ module Killbill
57
57
  return res
58
58
  end
59
59
 
60
+ java_signature 'Java::com.ning.billing.util.entity.Pagination getInvoices(Java::java.lang.Long, Java::java.lang.Long, Java::com.ning.billing.util.callcontext.TenantContext)'
61
+ def get_invoices(offset, limit, context)
62
+
63
+ # conversion for offset [type = java.lang.Long]
64
+ offset = offset
65
+
66
+ # conversion for limit [type = java.lang.Long]
67
+ limit = limit
68
+
69
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
70
+ context = context.to_java unless context.nil?
71
+ res = @real_java_api.get_invoices(offset, limit, context)
72
+ # conversion for res [type = com.ning.billing.util.entity.Pagination]
73
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
74
+ return res
75
+ end
76
+
60
77
  java_signature 'Java::java.math.BigDecimal getAccountBalance(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
61
78
  def get_account_balance(accountId, context)
62
79
 
@@ -51,13 +51,7 @@ module Killbill
51
51
  @is_retired = @is_retired.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_retired)
52
52
 
53
53
  # conversion for initial_phase_iterator [type = java.util.Iterator]
54
- tmp = java.util.ArrayList.new
55
- (@initial_phase_iterator || []).each do |m|
56
- # conversion for m [type = com.ning.billing.catalog.api.PlanPhase]
57
- m = m.to_java unless m.nil?
58
- tmp.add(m)
59
- end
60
- @initial_phase_iterator = tmp
54
+ @initial_phase_iterator = Killbill::Plugin::Model::EnumeratorIterator.new(@initial_phase_iterator)
61
55
 
62
56
  # conversion for final_phase [type = com.ning.billing.catalog.api.PlanPhase]
63
57
  @final_phase = @final_phase.to_java unless @final_phase.nil?
@@ -103,13 +97,6 @@ module Killbill
103
97
 
104
98
  # conversion for initial_phase_iterator [type = java.util.Iterator]
105
99
  @initial_phase_iterator = j_obj.initial_phase_iterator
106
- tmp = []
107
- (@initial_phase_iterator || []).each do |m|
108
- # conversion for m [type = com.ning.billing.catalog.api.PlanPhase]
109
- m = Killbill::Plugin::Model::PlanPhase.new.to_ruby(m) unless m.nil?
110
- tmp << m
111
- end
112
- @initial_phase_iterator = tmp
113
100
 
114
101
  # conversion for final_phase [type = com.ning.billing.catalog.api.PlanPhase]
115
102
  @final_phase = j_obj.final_phase
@@ -0,0 +1,79 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.util.entity'
31
+ class Pagination
32
+
33
+ include com.ning.billing.util.entity.Pagination
34
+
35
+ attr_accessor :iterator, :current_offset, :next_offset, :max_nb_records, :total_nb_records
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for iterator [type = java.util.Iterator]
42
+ @iterator = Killbill::Plugin::Model::EnumeratorIterator.new(@iterator)
43
+
44
+ # conversion for current_offset [type = java.lang.Long]
45
+ @current_offset = @current_offset
46
+
47
+ # conversion for next_offset [type = java.lang.Long]
48
+ @next_offset = @next_offset
49
+
50
+ # conversion for max_nb_records [type = java.lang.Long]
51
+ @max_nb_records = @max_nb_records
52
+
53
+ # conversion for total_nb_records [type = java.lang.Long]
54
+ @total_nb_records = @total_nb_records
55
+ self
56
+ end
57
+
58
+ def to_ruby(j_obj)
59
+ # conversion for iterator [type = java.util.Iterator]
60
+ @iterator = j_obj.iterator
61
+
62
+ # conversion for current_offset [type = java.lang.Long]
63
+ @current_offset = j_obj.current_offset
64
+
65
+ # conversion for next_offset [type = java.lang.Long]
66
+ @next_offset = j_obj.next_offset
67
+
68
+ # conversion for max_nb_records [type = java.lang.Long]
69
+ @max_nb_records = j_obj.max_nb_records
70
+
71
+ # conversion for total_nb_records [type = java.lang.Long]
72
+ @total_nb_records = j_obj.total_nb_records
73
+ self
74
+ end
75
+
76
+ end
77
+ end
78
+ end
79
+ end
@@ -32,7 +32,7 @@ module Killbill
32
32
 
33
33
  include com.ning.billing.payment.api.Payment
34
34
 
35
- attr_accessor :id, :created_date, :updated_date, :account_id, :invoice_id, :payment_method_id, :payment_number, :amount, :paid_amount, :effective_date, :currency, :payment_status, :attempts, :ext_first_payment_id_ref, :ext_second_payment_id_ref, :payment_info_plugin
35
+ attr_accessor :id, :created_date, :updated_date, :account_id, :invoice_id, :payment_method_id, :payment_number, :amount, :paid_amount, :effective_date, :currency, :payment_status, :attempts, :payment_info_plugin
36
36
 
37
37
  def initialize()
38
38
  end
@@ -100,12 +100,6 @@ module Killbill
100
100
  end
101
101
  @attempts = tmp
102
102
 
103
- # conversion for ext_first_payment_id_ref [type = java.lang.String]
104
- @ext_first_payment_id_ref = @ext_first_payment_id_ref.to_s unless @ext_first_payment_id_ref.nil?
105
-
106
- # conversion for ext_second_payment_id_ref [type = java.lang.String]
107
- @ext_second_payment_id_ref = @ext_second_payment_id_ref.to_s unless @ext_second_payment_id_ref.nil?
108
-
109
103
  # conversion for payment_info_plugin [type = com.ning.billing.payment.plugin.api.PaymentInfoPlugin]
110
104
  @payment_info_plugin = @payment_info_plugin.to_java unless @payment_info_plugin.nil?
111
105
  self
@@ -181,12 +175,6 @@ module Killbill
181
175
  end
182
176
  @attempts = tmp
183
177
 
184
- # conversion for ext_first_payment_id_ref [type = java.lang.String]
185
- @ext_first_payment_id_ref = j_obj.ext_first_payment_id_ref
186
-
187
- # conversion for ext_second_payment_id_ref [type = java.lang.String]
188
- @ext_second_payment_id_ref = j_obj.ext_second_payment_id_ref
189
-
190
178
  # conversion for payment_info_plugin [type = com.ning.billing.payment.plugin.api.PaymentInfoPlugin]
191
179
  @payment_info_plugin = j_obj.payment_info_plugin
192
180
  @payment_info_plugin = Killbill::Plugin::Model::PaymentInfoPlugin.new.to_ruby(@payment_info_plugin) unless @payment_info_plugin.nil?