@@ -120,11 +120,13 @@ public static void delete(final Context context, final String number)
120120 * @param context determines the vendor on whose behalf the call is performed
121121 * @param number bundle number
122122 * @param licenseeNumber licensee number
123+ * @param transactionNumber transaction number
123124 * @return collection of created licenses.
124125 * @throws NetLicensingException any subclass of {@linkplain NetLicensingException}. These exceptions will be transformed to the
125126 * corresponding service response messages.
126127 */
127- public static Page <License > obtain (final Context context , final String number , final String licenseeNumber )
128+ public static Page <License > obtain (final Context context , final String number , final String licenseeNumber ,
129+ final String transactionNumber )
128130 throws NetLicensingException {
129131 CheckUtils .paramNotEmpty (number , "number" );
130132 CheckUtils .paramNotEmpty (licenseeNumber , "licenseeNumber" );
@@ -134,8 +136,28 @@ public static Page<License> obtain(final Context context, final String number, f
134136 final Form form = new Form ();
135137 form .param (Constants .Licensee .LICENSEE_NUMBER , licenseeNumber );
136138
137- final Netlicensing response = NetLicensingService .getInstance ().request (context , HttpMethod .POST , endpoint , form , null );
139+ if (StringUtils .isNotBlank (transactionNumber )) {
140+ form .param (Constants .Transaction .TRANSACTION_NUMBER , transactionNumber );
141+ }
142+
143+ final Netlicensing response = NetLicensingService .getInstance ()
144+ .request (context , HttpMethod .POST , endpoint , form , null );
138145
139146 return entityFactory .createPage (response , License .class );
140147 }
148+
149+ /**
150+ * Obtain bundle(create licenses from a bundle license templates).
151+ *
152+ * @param context determines the vendor on whose behalf the call is performed
153+ * @param number bundle number
154+ * @param licenseeNumber licensee number
155+ * @return collection of created licenses.
156+ * @throws NetLicensingException any subclass of {@linkplain NetLicensingException}. These exceptions will be transformed to the
157+ * corresponding service response messages.
158+ */
159+ public static Page <License > obtain (final Context context , final String number , final String licenseeNumber )
160+ throws NetLicensingException {
161+ return obtain (context , number ,licenseeNumber , null );
162+ }
141163}
0 commit comments