Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification Module #283

Merged
merged 1 commit into from
Aug 21, 2017
Merged

Notification Module #283

merged 1 commit into from
Aug 21, 2017

Conversation

adhyans
Copy link
Contributor

@adhyans adhyans commented Jan 29, 2017

This module will allow developers to integrate notifications with their functionality. Here are some wikis on which you can read more about this module.

  1. Notification Module Design
  2. Notification API Developer User Guide
  3. Configure Notifications-End User guide

private String action;

@Column(name = "actor")
private Long actorId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actor is text in notification_generator definition. But entity is defined with Long?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, when the last time I changed the actorId to Long, I forgot to change it in the notification_generator definition.

import java.util.List;

@Service
public class NotificationGeneratorReadPlatformServiceImpl implements NotificationGeneratorReadPlatformService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are reading Entity from NotificationRepository, do we need to have separate readplatform service? Why can't caller directly call method on NotificationRepository? Readplatforms are designed to use JDBCTemplate not Repositories.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or are you trying as repository wrapper? In such case why the class name is read platform service?

Copy link
Contributor Author

@adhyans adhyans Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying it as repository wrapper. What name should this class be named? Would it be NotificationGeneratorReadRepositoryWrapper?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We follow an approach all read platforms should have jdbc template usage. In your it is not read platform it is just a wrapper. So it should be renamed to NotificationGeneratorReadRepositoryWrapper

import java.util.List;

@Service
public class NotificationMapperReadPlatformServiceImpl implements NotificationMapperReadPlatformService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this class? Why can't caller directly call methods on NotificationMapperRepository?
Read platform services are designed to use JDBCTemplate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or are you trying as repository wrapper? In such case why the class name is read platform service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying it as repository wrapper. What name should this class be named? Would it be NotificationMapperReadRepositoryWrapper?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to NotificationMapperReadRepositoryWrapper

import javax.jms.Session;

@Service
public class NotificationEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a event or service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a service which broadcast the notification event to an external queue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this file to NotificationEventService

private final PaginationHelper<NotificationData> paginationHelper = new PaginationHelper<>();
private final NotificationDataRow notificationDataRow = new NotificationDataRow();
private final NotificationMapperRow notificationMapperRow = new NotificationMapperRow();
private HashMap<Long, CacheNotificationResponseHeader> notificationResponseHeaderCache = new HashMap<>();
Copy link
Contributor

@nazeer1100126 nazeer1100126 Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this cache works in multi tenancy environment? What happens if two tenants have same user id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I missed this case. Do I need to implement this now or can we add this later in another PR?

Copy link
Contributor

@nazeer1100126 nazeer1100126 Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, I don't think this PR is useful. If this cannot be done, then remove this caching.

Copy link
Contributor Author

@adhyans adhyans Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be done. Just a little bit of work, need to associate tenant with user id's. Will try to complete it as soon as possible 😄

import javax.jms.Session;

@Service
public class NotificationEvent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this file to NotificationEventService

import java.util.List;

@Service
public class NotificationGeneratorReadPlatformServiceImpl implements NotificationGeneratorReadPlatformService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We follow an approach all read platforms should have jdbc template usage. In your it is not read platform it is just a wrapper. So it should be renamed to NotificationGeneratorReadRepositoryWrapper

import java.util.List;

@Service
public class NotificationMapperReadPlatformServiceImpl implements NotificationMapperReadPlatformService {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to NotificationMapperReadRepositoryWrapper

@nazeer1100126
Copy link
Contributor

@ad-os Changes looks ok. Can you resent PR with single commit please.

@nazeer1100126
Copy link
Contributor

@ad-os as discussed over slack, You have added a library which is having dependency on BSD licensed third party library. Can you check the current binary licensing please.

@nazeer1100126
Copy link
Contributor

@ad-os Please refer LICENSE_RELEASE file. You need to add an entry about this BSD library.

Added Notification Module

Added Notification Module

Added Notification Module

Added license file for jar analyzer

Added entry into LICENSE_RELEASE file

Added gradle wrapper
@asfgit asfgit merged commit c60c660 into apache:develop Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants