org.gcube.informationsystem.publisher
Interface ScopedPublisher

All Known Implementing Classes:
AdvancedScopedPublisher, ScopedPublisherImpl

public interface ScopedPublisher


Method Summary
<T extends org.gcube.common.resources.gcore.Resource>
T
create(T resource, List<String> scopes)
          The resource is created in all the scopes in the list and the resource is updated in all the other scopes that are presents in the resource
<T extends org.gcube.common.resources.gcore.Resource>
T
remove(T resource, List<String> scopes)
          Remove a resource from all the scopes in the input list, if and only if all the scopes are defined in the resource
<T extends org.gcube.common.resources.gcore.Resource>
T
update(T resource)
          The resource will be updated on all scopes that are defined in the resource.
 

Method Detail

create

<T extends org.gcube.common.resources.gcore.Resource> T create(T resource,
                                                               List<String> scopes)
                                                           throws RegistryNotFoundException
The resource is created in all the scopes in the list and the resource is updated in all the other scopes that are presents in the resource

Throws:
IllegalStateException - if the current scope is incompatible with the scope defined in the resource
IllegalArgumentException - if there are problems to contact the Registry service or the resource is not a valid resource
RegistryNotFoundException

update

<T extends org.gcube.common.resources.gcore.Resource> T update(T resource)
                                                           throws RegistryNotFoundException
The resource will be updated on all scopes that are defined in the resource. If an updating operation fail. It will be repeated with best-effort strategy.

Throws:
IllegalStateException - if the current scope is not defined in the resource.
IllegalArgumentException - if there are problems with the registry service or the resource is not a valid resource
RegistryNotFoundException

remove

<T extends org.gcube.common.resources.gcore.Resource> T remove(T resource,
                                                               List<String> scopes)
                                                           throws RegistryNotFoundException
Remove a resource from all the scopes in the input list, if and only if all the scopes are defined in the resource

Returns:
the resource without the current scope if the remove operation is succesfully
Throws:
IllegalArgumentException - if one or more scopes in the list are not defined in the resource
RegistryNotFoundException


Copyright © 2013. All Rights Reserved.