congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AuditUserApi.getAccountAuditLogs
Code IndexAdd Tabnine to your IDE (free)

How to use
getAccountAuditLogs
method
in
com.ning.billing.util.api.AuditUserApi

Best Java code snippets using com.ning.billing.util.api.AuditUserApi.getAccountAuditLogs (Showing top 20 results out of 315)

origin: com.ning.billing/killbill-jaxrs

@GET
@Produces(APPLICATION_JSON)
public Response getAccountByKey(@QueryParam(QUERY_EXTERNAL_KEY) final String externalKey,
                @QueryParam(QUERY_ACCOUNT_WITH_BALANCE) @DefaultValue("false") final Boolean accountWithBalance,
                @QueryParam(QUERY_ACCOUNT_WITH_BALANCE_AND_CBA) @DefaultValue("false") final Boolean accountWithBalanceAndCBA,
                @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
                @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
  final TenantContext tenantContext = context.createContext(request);
  final Account account = accountUserApi.getAccountByKey(externalKey, tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), auditMode.getLevel(), tenantContext);
  final AccountJson accountJson = getAccount(account, accountWithBalance, accountWithBalanceAndCBA, accountAuditLogs, tenantContext);
  return Response.status(Status.OK).entity(accountJson).build();
}
origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{accountId:" + UUID_PATTERN + "}")
@Produces(APPLICATION_JSON)
public Response getAccount(@PathParam("accountId") final String accountId,
              @QueryParam(QUERY_ACCOUNT_WITH_BALANCE) @DefaultValue("false") final Boolean accountWithBalance,
              @QueryParam(QUERY_ACCOUNT_WITH_BALANCE_AND_CBA) @DefaultValue("false") final Boolean accountWithBalanceAndCBA,
              @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
              @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException {
  final TenantContext tenantContext = context.createContext(request);
  final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), auditMode.getLevel(), tenantContext);
  final AccountJson accountJson = getAccount(account, accountWithBalance, accountWithBalanceAndCBA, accountAuditLogs, tenantContext);
  return Response.status(Status.OK).entity(accountJson).build();
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public AccountJson apply(final Account account) {
    final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), auditMode.getLevel(), tenantContext);
    return getAccount(account, accountWithBalance, accountWithBalanceAndCBA, accountAuditLogs, tenantContext);
  }
},
origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{accountId:" + UUID_PATTERN + "}/" + PAYMENT_METHODS)
@Produces(APPLICATION_JSON)
public Response getPaymentMethods(@PathParam("accountId") final String accountId,
                 @QueryParam(QUERY_PAYMENT_METHOD_PLUGIN_INFO) @DefaultValue("false") final Boolean withPluginInfo,
                 @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
                 @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException {
  final TenantContext tenantContext = context.createContext(request);
  final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), tenantContext);
  final List<PaymentMethod> methods = paymentApi.getPaymentMethods(account, withPluginInfo, tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), auditMode.getLevel(), tenantContext);
  final List<PaymentMethodJson> json = new ArrayList<PaymentMethodJson>(Collections2.transform(methods, new Function<PaymentMethod, PaymentMethodJson>() {
    @Override
    public PaymentMethodJson apply(final PaymentMethod input) {
      return PaymentMethodJson.toPaymentMethodJson(account, input, accountAuditLogs);
    }
  }));
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public AccountJson apply(final Account account) {
    final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(account.getId(), auditMode.getLevel(), tenantContext);
    return getAccount(account, accountWithBalance, accountWithBalanceAndCBA, accountAuditLogs, tenantContext);
  }
},
origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{paymentMethodId:" + UUID_PATTERN + "}")
@Produces(APPLICATION_JSON)
public Response getPaymentMethod(@PathParam("paymentMethodId") final String paymentMethodId,
                 @QueryParam(QUERY_PAYMENT_METHOD_PLUGIN_INFO) @DefaultValue("false") final Boolean withPluginInfo,
                 @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
                 @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException {
  final TenantContext tenantContext = context.createContext(request);
  final PaymentMethod paymentMethod = paymentApi.getPaymentMethodById(UUID.fromString(paymentMethodId), false, withPluginInfo, tenantContext);
  final Account account = accountUserApi.getAccountById(paymentMethod.getAccountId(), tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(paymentMethod.getAccountId(), auditMode.getLevel(), tenantContext);
  final PaymentMethodJson json = PaymentMethodJson.toPaymentMethodJson(account, paymentMethod, accountAuditLogs);
  return Response.status(Status.OK).entity(json).build();
}
origin: com.ning.billing/killbill-jaxrs

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

@GET
@Path("/{invoiceId:" + UUID_PATTERN + "}/")
@Produces(APPLICATION_JSON)
public Response getInvoice(@PathParam("invoiceId") final String invoiceId,
              @QueryParam(QUERY_INVOICE_WITH_ITEMS) @DefaultValue("false") final boolean withItems,
              @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
              @javax.ws.rs.core.Context final HttpServletRequest request) throws InvoiceApiException {
  final TenantContext tenantContext = context.createContext(request);
  final Invoice invoice = invoiceApi.getInvoice(UUID.fromString(invoiceId), tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(invoice.getAccountId(), auditMode.getLevel(), tenantContext);
  if (invoice == null) {
    throw new InvoiceApiException(ErrorCode.INVOICE_NOT_FOUND, invoiceId);
  } else {
    final InvoiceJson json = new InvoiceJson(invoice, withItems, accountAuditLogs);
    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

@GET
@Path("/{invoiceNumber:" + NUMBER_PATTERN + "}/")
@Produces(APPLICATION_JSON)
public Response getInvoiceByNumber(@PathParam("invoiceNumber") final Integer invoiceNumber,
                  @QueryParam(QUERY_INVOICE_WITH_ITEMS) @DefaultValue("false") final boolean withItems,
                  @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
                  @javax.ws.rs.core.Context final HttpServletRequest request) throws InvoiceApiException {
  final TenantContext tenantContext = context.createContext(request);
  final Invoice invoice = invoiceApi.getInvoiceByNumber(invoiceNumber, tenantContext);
  final AccountAuditLogs accountAuditLogs = auditUserApi.getAccountAuditLogs(invoice.getAccountId(), auditMode.getLevel(), tenantContext);
  if (invoice == null) {
    throw new InvoiceApiException(ErrorCode.INVOICE_NOT_FOUND, invoiceNumber);
  } else {
    final InvoiceJson json = new InvoiceJson(invoice, withItems, accountAuditLogs);
    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 InvoiceJson apply(final Invoice invoice) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(invoice.getAccountId()) == null) {
      accountsAuditLogs.get().put(invoice.getAccountId(), auditUserApi.getAccountAuditLogs(invoice.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    return new InvoiceJson(invoice, withItems, accountsAuditLogs.get().get(invoice.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

@GET
@Path("/{invoiceId:" + UUID_PATTERN + "}/" + PAYMENTS)
@Produces(APPLICATION_JSON)
public Response getPayments(@PathParam("invoiceId") final String invoiceId,
              @QueryParam(QUERY_AUDIT) @DefaultValue("NONE") final AuditMode auditMode,
              @javax.ws.rs.core.Context final HttpServletRequest request) throws PaymentApiException {
  final TenantContext tenantContext = context.createContext(request);
  final List<Payment> payments = paymentApi.getInvoicePayments(UUID.fromString(invoiceId), tenantContext);
  final List<PaymentJson> result = new ArrayList<PaymentJson>(payments.size());
  if (payments.size() == 0) {
    return Response.status(Status.OK).entity(result).build();
  }
  final AccountAuditLogsForObjectType auditLogsForPayments = auditUserApi.getAccountAuditLogs(payments.get(0).getAccountId(),
                                                ObjectType.PAYMENT,
                                                auditMode.getLevel(),
                                                tenantContext);
  for (final Payment cur : payments) {
    result.add(new PaymentJson(cur, auditLogsForPayments.getAuditLogs(cur.getId())));
  }
  return Response.status(Status.OK).entity(result).build();
}
origin: com.ning.billing/killbill-jaxrs

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

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

protected Response getTags(final UUID accountId, final UUID taggedObjectId, final AuditMode auditMode, final boolean includeDeleted, final TenantContext context) throws TagDefinitionApiException {
  final List<Tag> tags = tagUserApi.getTagsForObject(taggedObjectId, getObjectType(), includeDeleted, context);
  final AccountAuditLogsForObjectType tagsAuditLogs = auditUserApi.getAccountAuditLogs(accountId, ObjectType.TAG, auditMode.getLevel(), context);
  final Map<UUID, TagDefinition> tagDefinitionsCache = new HashMap<UUID, TagDefinition>();
  final Collection<TagJson> result = new LinkedList<TagJson>();
  for (final Tag tag : tags) {
    if (tagDefinitionsCache.get(tag.getTagDefinitionId()) == null) {
      tagDefinitionsCache.put(tag.getTagDefinitionId(), tagUserApi.getTagDefinition(tag.getTagDefinitionId(), context));
    }
    final TagDefinition tagDefinition = tagDefinitionsCache.get(tag.getTagDefinitionId());
    final List<AuditLog> auditLogs = tagsAuditLogs.getAuditLogs(tag.getId());
    result.add(new TagJson(tag, tagDefinition, auditLogs));
  }
  return Response.status(Response.Status.OK).entity(result).build();
}
origin: com.ning.billing/killbill-jaxrs

  @Override
  public PaymentMethodJson apply(final PaymentMethod paymentMethod) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(paymentMethod.getAccountId()) == null) {
      accountsAuditLogs.get().put(paymentMethod.getAccountId(), auditUserApi.getAccountAuditLogs(paymentMethod.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    // Lookup the associated account(s)
    if (accounts.get(paymentMethod.getAccountId()) == null) {
      final Account account;
      try {
        account = accountUserApi.getAccountById(paymentMethod.getAccountId(), tenantContext);
        accounts.put(paymentMethod.getAccountId(), account);
      } catch (final AccountApiException e) {
        log.warn("Unable to retrieve account", e);
        return null;
      }
    }
    return PaymentMethodJson.toPaymentMethodJson(accounts.get(paymentMethod.getAccountId()), paymentMethod, accountsAuditLogs.get().get(paymentMethod.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

  @Override
  public PaymentMethodJson apply(final PaymentMethod paymentMethod) {
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(paymentMethod.getAccountId()) == null) {
      accountsAuditLogs.get().put(paymentMethod.getAccountId(), auditUserApi.getAccountAuditLogs(paymentMethod.getAccountId(), auditMode.getLevel(), tenantContext));
    }
    // Lookup the associated account(s)
    if (accounts.get(paymentMethod.getAccountId()) == null) {
      final Account account;
      try {
        account = accountUserApi.getAccountById(paymentMethod.getAccountId(), tenantContext);
        accounts.put(paymentMethod.getAccountId(), account);
      } catch (final AccountApiException e) {
        log.warn("Unable to retrieve account", e);
        return null;
      }
    }
    return PaymentMethodJson.toPaymentMethodJson(accounts.get(paymentMethod.getAccountId()), paymentMethod, accountsAuditLogs.get().get(paymentMethod.getAccountId()));
  }
},
origin: com.ning.billing/killbill-jaxrs

  @Override
  public RefundJson apply(final Refund refund) {
    UUID kbAccountId = null;
    if (!AuditLevel.NONE.equals(auditMode.getLevel()) && paymentIdAccountIdMappings.get(refund.getPaymentId()) == null) {
      try {
        kbAccountId = paymentApi.getPayment(refund.getPaymentId(), false, tenantContext).getAccountId();
        paymentIdAccountIdMappings.put(refund.getPaymentId(), kbAccountId);
      } catch (final PaymentApiException e) {
        log.warn("Unable to retrieve payment for id " + refund.getPaymentId());
      }
    }
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(kbAccountId) == null) {
      accountsAuditLogs.get().put(kbAccountId, auditUserApi.getAccountAuditLogs(kbAccountId, auditMode.getLevel(), tenantContext));
    }
    final List<AuditLog> auditLogs = accountsAuditLogs.get().get(kbAccountId) == null ? null : accountsAuditLogs.get().get(kbAccountId).getAuditLogsForRefund(refund.getId());
    return new RefundJson(refund, null, auditLogs);
  }
},
origin: com.ning.billing/killbill-jaxrs

  @Override
  public RefundJson apply(final Refund refund) {
    UUID kbAccountId = null;
    if (!AuditLevel.NONE.equals(auditMode.getLevel()) && paymentIdAccountIdMappings.get(refund.getPaymentId()) == null) {
      try {
        kbAccountId = paymentApi.getPayment(refund.getPaymentId(), false, tenantContext).getAccountId();
        paymentIdAccountIdMappings.put(refund.getPaymentId(), kbAccountId);
      } catch (final PaymentApiException e) {
        log.warn("Unable to retrieve payment for id " + refund.getPaymentId());
      }
    }
    // Cache audit logs per account
    if (accountsAuditLogs.get().get(kbAccountId) == null) {
      accountsAuditLogs.get().put(kbAccountId, auditUserApi.getAccountAuditLogs(kbAccountId, auditMode.getLevel(), tenantContext));
    }
    final List<AuditLog> auditLogs = accountsAuditLogs.get().get(kbAccountId) == null ? null : accountsAuditLogs.get().get(kbAccountId).getAuditLogsForRefund(refund.getId());
    return new RefundJson(refund, null, auditLogs);
  }
},
com.ning.billing.util.apiAuditUserApigetAccountAuditLogs

Javadoc

Retrieve all audit logs (for all objects of a given type) for a given account

Popular methods of AuditUserApi

  • getAuditLogs
    Get all the audit entries for a given object.

Popular in Java

  • Start an intent from android
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JPanel (javax.swing)
  • Github Copilot alternatives
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