Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Storage
Commits
6423a5b7
Commit
6423a5b7
authored
Sep 23, 2020
by
Abhishek Patil
Browse files
Upgrading core-lib-azure version
parent
26e2dfe5
Pipeline
#11187
failed with stages
in 41 minutes and 19 seconds
Changes
3
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
provider/storage-azure/pom.xml
View file @
6423a5b7
...
...
@@ -80,7 +80,7 @@
<dependency>
<groupId>
org.opengroup.osdu
</groupId>
<artifactId>
core-lib-azure
</artifactId>
<version>
0.0.
11
</version>
<version>
0.0.
29
</version>
</dependency>
<dependency>
<groupId>
org.opengroup.osdu
</groupId>
...
...
provider/storage-azure/src/main/java/org/opengroup/osdu/storage/provider/azure/di/TenantFactoryImpl.java
deleted
100644 → 0
View file @
26e2dfe5
// Copyright © Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
org.opengroup.osdu.storage.provider.azure.di
;
import
org.opengroup.osdu.core.common.cache.ICache
;
import
org.opengroup.osdu.core.common.model.tenant.TenantInfo
;
import
org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory
;
import
org.opengroup.osdu.storage.provider.azure.repository.TenantInfoRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map
;
@Component
public
class
TenantFactoryImpl
implements
ITenantFactory
{
@Autowired
private
TenantInfoRepository
db
;
private
Map
<
String
,
TenantInfo
>
tenants
;
public
boolean
exists
(
String
tenantName
)
{
if
(
this
.
tenants
==
null
)
initTenants
();
return
this
.
tenants
.
containsKey
(
tenantName
);
}
public
TenantInfo
getTenantInfo
(
String
tenantName
)
{
if
(
this
.
tenants
==
null
)
initTenants
();
return
this
.
tenants
.
get
(
tenantName
);
}
public
Collection
<
TenantInfo
>
listTenantInfo
()
{
if
(
this
.
tenants
==
null
)
initTenants
();
return
this
.
tenants
.
values
();
}
public
<
V
>
ICache
<
String
,
V
>
createCache
(
String
tenantName
,
String
host
,
int
port
,
int
expireTimeSeconds
,
Class
<
V
>
classOfV
)
{
return
null
;
}
public
void
flushCache
()
{}
private
void
initTenants
()
{
this
.
tenants
=
new
HashMap
<>();
db
.
findAll
().
forEach
(
doc
->
{
TenantInfo
ti
=
new
TenantInfo
();
String
tenantName
=
doc
.
getId
();
ti
.
setName
(
tenantName
);
this
.
tenants
.
put
(
tenantName
,
ti
)
;
});
}
}
provider/storage-azure/src/main/resources/application.properties
View file @
6423a5b7
...
...
@@ -51,3 +51,7 @@ azure.keyvault.url=${KEYVAULT_URI}
azure.cosmosdb.schema.collection
=
StorageSchema
azure.cosmosdb.recordmetadata.collection
=
StorageRecord
azure.cosmosdb.tenantinfo.collection
=
TenantInfo
#TenantFactory Configuration
tenantFactoryImpl.required
=
true
tenantInfo.container.name
=
TenantInfo
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment