Tabnine Logo
BundleJson.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.ning.billing.jaxrs.json.BundleJson
constructor

Best Java code snippets using com.ning.billing.jaxrs.json.BundleJson.<init> (Showing top 8 results out of 315)

origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle input) {
    return new BundleJson(input, null);
  }
});
origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{bundleId:" + UUID_PATTERN + "}")
@Produces(APPLICATION_JSON)
public Response getBundle(@PathParam("bundleId") final String bundleId,
             @javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException {
  final UUID id = UUID.fromString(bundleId);
  final SubscriptionBundle bundle = subscriptionApi.getSubscriptionBundle(id, context.createContext(request));
  final BundleJson json = new BundleJson(bundle, null);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

@GET
@Produces(APPLICATION_JSON)
public Response getBundleByKey(@QueryParam(QUERY_EXTERNAL_KEY) final String externalKey,
                @javax.ws.rs.core.Context final HttpServletRequest request) throws SubscriptionApiException {
  final SubscriptionBundle bundle = subscriptionApi.getActiveSubscriptionBundleForExternalKey(externalKey, context.createContext(request));
  final BundleJson json = new BundleJson(bundle, null);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle bundle) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(bundle.getAccountId()) == null) {
      accountsAuditLogs.get().put(bundle.getAccountId(), auditUserApi.getAccountAuditLogs(bundle.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    return new BundleJson(bundle, accountsAuditLogs.get().get(bundle.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

  @Override
  public BundleJson apply(final SubscriptionBundle bundle) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(bundle.getAccountId()) == null) {
      accountsAuditLogs.get().put(bundle.getAccountId(), auditUserApi.getAccountAuditLogs(bundle.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    return new BundleJson(bundle, accountsAuditLogs.get().get(bundle.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

private BundleJson createBundleWithSubscriptions() {
  final String someUUID = UUID.randomUUID().toString();
  final UUID accountId = UUID.randomUUID();
  final UUID bundleId = UUID.randomUUID();
  final UUID subscriptionId = UUID.randomUUID();
  final String externalKey = UUID.randomUUID().toString();
  final SubscriptionJson entitlementJsonWithEvents = new SubscriptionJson(accountId.toString(), bundleId.toString(), subscriptionId.toString(), externalKey,
                                                new LocalDate(), someUUID, someUUID, someUUID, someUUID,
                                                new LocalDate(), new LocalDate(), new LocalDate(), new LocalDate(),
                                                null, null, null, null);
  return new BundleJson(accountId.toString(), bundleId.toString(), externalKey, ImmutableList.<SubscriptionJson>of(entitlementJsonWithEvents), null);
}
origin: com.ning.billing/killbill-jaxrs

  @Test(groups = "fast")
  public void testJson() throws Exception {

    final String someUUID = UUID.randomUUID().toString();
    final UUID bundleId = UUID.randomUUID();
    final String externalKey = UUID.randomUUID().toString();
    final List<AuditLogJson> auditLogs = createAuditLogsJson(clock.getUTCNow());

    EventSubscriptionJson event = new EventSubscriptionJson(someUUID, BillingPeriod.NO_BILLING_PERIOD.toString(), new LocalDate(), new LocalDate(), "product", "priceList", "eventType", "phase", null);
    final SubscriptionJson subscription = new SubscriptionJson(someUUID, someUUID, someUUID, externalKey,
                                            new LocalDate(), someUUID, someUUID, someUUID, someUUID, new LocalDate(), new LocalDate(),
                                            new LocalDate(), new LocalDate(),
                                            ImmutableList.<EventSubscriptionJson>of(event), null, null, auditLogs);

    final BundleJson bundleJson = new BundleJson(someUUID, bundleId.toString(), externalKey, ImmutableList.<SubscriptionJson>of(subscription), auditLogs);
    Assert.assertEquals(bundleJson.getBundleId(), bundleId.toString());
    Assert.assertEquals(bundleJson.getExternalKey(), externalKey);
    Assert.assertEquals(bundleJson.getSubscriptions().size(), 1);
    Assert.assertEquals(bundleJson.getAuditLogs(), auditLogs);

    final String asJson = mapper.writeValueAsString(bundleJson);
    final BundleJson fromJson = mapper.readValue(asJson, BundleJson.class);
    Assert.assertEquals(fromJson, bundleJson);
  }
}
origin: com.ning.billing/killbill-jaxrs

for (final SubscriptionBundle bundle : bundles) {
  final List<AuditLog> bundleAuditLogs = accountAuditLogs.getAuditLogsForBundle(bundle.getId());
  final BundleJson jsonWithSubscriptions = new BundleJson(bundle, accountAuditLogs);
  this.bundles.add(jsonWithSubscriptions);
com.ning.billing.jaxrs.jsonBundleJson<init>

Popular methods of BundleJson

  • equals
  • getAccountId
  • getAuditLogs
  • getBundleId
  • getExternalKey
  • getSubscriptions
  • hashCode
  • toAuditLogJson

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now