Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Notification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Notification
Commits
0c1d78e2
Commit
0c1d78e2
authored
3 years ago
by
Nikhil Singh[MicroSoft]
Committed by
Komal Makkar
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Usage of Non Request Scope bean for Service Bus Flow
parent
4845fc47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!100
Commit 2 contents:
,
!95
Usage of Non Request Scope bean for Service Bus Flow
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notification-core/src/main/java/org/opengroup/osdu/notification/di/SubscriptionCacheFactory.java
+11
-2
11 additions, 2 deletions
...ngroup/osdu/notification/di/SubscriptionCacheFactory.java
with
11 additions
and
2 deletions
notification-core/src/main/java/org/opengroup/osdu/notification/di/SubscriptionCacheFactory.java
+
11
−
2
View file @
0c1d78e2
...
...
@@ -19,7 +19,10 @@ package org.opengroup.osdu.notification.di;
import
org.opengroup.osdu.core.common.cache.ICache
;
import
org.opengroup.osdu.core.common.cache.MultiTenantCache
;
import
org.opengroup.osdu.core.common.cache.VmCache
;
import
org.opengroup.osdu.core.common.model.http.AppException
;
import
org.opengroup.osdu.core.common.model.http.DpsHeaders
;
import
org.opengroup.osdu.core.common.model.tenant.TenantInfo
;
import
org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -27,7 +30,9 @@ import org.springframework.stereotype.Component;
@Component
public
class
SubscriptionCacheFactory
implements
ICache
<
String
,
String
>
{
@Autowired
private
TenantInfo
tenant
;
private
DpsHeaders
headers
;
@Autowired
private
ITenantFactory
tenantFactory
;
private
MultiTenantCache
<
String
>
caches
;
...
...
@@ -56,6 +61,10 @@ public class SubscriptionCacheFactory implements ICache<String, String> {
}
private
ICache
<
String
,
String
>
partitionCache
()
{
return
this
.
caches
.
get
(
String
.
format
(
"%s:subscription"
,
this
.
tenant
.
getDataPartitionId
()));
TenantInfo
tenantInfo
=
this
.
tenantFactory
.
getTenantInfo
(
this
.
headers
.
getPartitionIdWithFallbackToAccountId
());
if
(
tenantInfo
==
null
)
{
throw
AppException
.
createUnauthorized
(
String
.
format
(
"could not retrieve tenant info for data partition id: %s"
,
this
.
headers
.
getPartitionIdWithFallbackToAccountId
()));
}
return
this
.
caches
.
get
(
String
.
format
(
"%s:subscription"
,
tenantInfo
.
getDataPartitionId
()));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment