package pl.plgrid.unicore.portal.core.services;

import pl.plgrid.unicore.portal.core.entities.StorageEntity;
import pl.plgrid.unicore.portal.core.exceptions.UnavailableGridServiceException;

import java.util.Collection;

/**
 * Created by Rafal on 2014-05-25.
 */
public class GlobalStorage extends AbstractStorage {
    @Override
    public Collection<StorageEntity> getStorageEntities() throws UnavailableGridServiceException {
        return null;
    }

    @Override
    public <T> T createClient() throws UnavailableGridServiceException {
        return null;
    }
}

@@ -42,16 +42,248 @@
 vices;%0A%0A
+import com.google.gwt.thirdparty.guava.common.base.Function;%0Aimport com.google.gwt.thirdparty.guava.common.collect.Collections2;%0Aimport de.fzj.unicore.uas.StorageManagement;%0Aimport org.w3.x2005.x08.addressing.EndpointReferenceType;%0A
 import p
@@ -445,16 +445,127 @@
 lection;
+%0Aimport java.util.List;%0A%0Aimport static pl.plgrid.unicore.portal.core.entities.StorageEntityType.GLOBAL_STORAGE;
 %0A%0A/**%0A *
@@ -771,35 +771,493 @@
 n %7B%0A        
-return null
+List%3CEndpointReferenceType%3E accessibleServices = getAccessibleServices(StorageManagement.SMS_PORT);%0A        return Collections2.transform(accessibleServices,%0A                new Function%3CEndpointReferenceType, StorageEntity%3E() %7B%0A                    @Override%0A                    public StorageEntity apply(EndpointReferenceType storageEpr) %7B%0A                        return new StorageEntity(storageEpr, GLOBAL_STORAGE);%0A                    %7D%0A                %7D%0A        )
 ;%0A    %7D%0A%0A   

work in progress