|
|
|
@ -63,7 +63,7 @@ public class ISClientConnector {
|
|
|
|
|
ScopeProvider.instance.set(scope);
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
List<ServiceEndpoint> resources = client.submit(query);
|
|
|
|
|
if(scope!=null){
|
|
|
|
@ -85,11 +85,13 @@ public class ISClientConnector {
|
|
|
|
|
|
|
|
|
|
private String[] fillConnectionFields(ServiceEndpoint resource) {
|
|
|
|
|
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;
|
|
|
|
|
for (AccessPoint ap:resource.profile().accessPoints()) {
|
|
|
|
|
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
|
|
|
|
|
setUsername(ap.username());
|
|
|
|
|
// set password default value to empty string
|
|
|
|
@ -105,6 +107,8 @@ public class ISClientConnector {
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String [] server=new String[srvs.size()];
|
|
|
|
|
server = srvs.toArray(server);
|
|
|
|
|
setBackendType(retrievePropertyValue(resource, "type"));
|
|
|
|
|
String [] volatileHost= new String [1];
|
|
|
|
|
volatileHost[0]=retrievePropertyValue(resource, "volatile");
|
|
|
|
|