bug fix #20505. New ServiceEndpoint with category Storage ##21245. Update to version 2.6.1-SNAPSHOT

This commit is contained in:
Roberto Cirillo 2021-08-04 17:16:04 +02:00
parent 59b841ba94
commit e10b0d8012
3 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,8 @@
# Changelog for storage-manager-wrapper # Changelog for storage-manager-wrapper
## [v2.6.1-SNAPSHOT] 2021-08-04
* bug fix #20505
## [v2.6.0-SNAPSHOT] 2020-11-12 ## [v2.6.0-SNAPSHOT] 2020-11-12
* adding new constructor with the backendType as input parameter * adding new constructor with the backendType as input parameter

View File

@ -8,7 +8,7 @@
</parent> </parent>
<groupId>org.gcube.contentmanagement</groupId> <groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId> <artifactId>storage-manager-wrapper</artifactId>
<version>2.6.0-SNAPSHOT</version> <version>2.6.1-SNAPSHOT</version>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>

View File

@ -63,7 +63,7 @@ public class ISClientConnector {
ScopeProvider.instance.set(scope); ScopeProvider.instance.set(scope);
} }
SimpleQuery query = queryFor(ServiceEndpoint.class); SimpleQuery query = queryFor(ServiceEndpoint.class);
query.addCondition("$resource/Profile/Category/text() eq 'DataStorage' and $resource/Profile/Name eq 'StorageManager' "); query.addCondition("$resource/Profile/Category/text() eq 'Storage' and $resource/Profile/Name eq 'StorageManager' ");
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class); DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
List<ServiceEndpoint> resources = client.submit(query); List<ServiceEndpoint> resources = client.submit(query);
if(scope!=null){ if(scope!=null){
@ -85,11 +85,13 @@ public class ISClientConnector {
private String[] fillConnectionFields(ServiceEndpoint resource) { private String[] fillConnectionFields(ServiceEndpoint resource) {
if(resource!=null){ if(resource!=null){
String [] server=new String[resource.profile().accessPoints().size()]; ArrayList<String> srvs=new ArrayList <String>();
// String [] server=new String[resource.profile().accessPoints().size()];
int i=0; int i=0;
for (AccessPoint ap:resource.profile().accessPoints()) { for (AccessPoint ap:resource.profile().accessPoints()) {
if (ap.name().equals("server"+(i+1))) { if (ap.name().equals("server"+(i+1))) {
server[i] = ap.address(); // server[i] = ap.address();
srvs.add(ap.address());
// if presents, try to get user and password // if presents, try to get user and password
setUsername(ap.username()); setUsername(ap.username());
// set password default value to empty string // set password default value to empty string
@ -105,6 +107,8 @@ public class ISClientConnector {
i++; i++;
} }
} }
String [] server=new String[srvs.size()];
server = srvs.toArray(server);
setBackendType(retrievePropertyValue(resource, "type")); setBackendType(retrievePropertyValue(resource, "type"));
String [] volatileHost= new String [1]; String [] volatileHost= new String [1];
volatileHost[0]=retrievePropertyValue(resource, "volatile"); volatileHost[0]=retrievePropertyValue(resource, "volatile");