org.gcube.informationsystem.publisher
Class AdvancedScopedPublisher

java.lang.Object
  extended by org.gcube.informationsystem.publisher.AdvancedPublisherCommonUtils
      extended by org.gcube.informationsystem.publisher.AdvancedScopedPublisher
All Implemented Interfaces:
ScopedPublisher

public class AdvancedScopedPublisher
extends AdvancedPublisherCommonUtils
implements ScopedPublisher

Wrapper class of ScopedPublisherImpl class that implements the ScopedPublisher interface

Author:
rcirillo

Field Summary
 
Fields inherited from class org.gcube.informationsystem.publisher.AdvancedPublisherCommonUtils
registry
 
Constructor Summary
AdvancedScopedPublisher()
           
AdvancedScopedPublisher(ScopedPublisher publisher)
           
 
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.
 
Methods inherited from class org.gcube.informationsystem.publisher.AdvancedPublisherCommonUtils
forceRemove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdvancedScopedPublisher

public AdvancedScopedPublisher()

AdvancedScopedPublisher

public AdvancedScopedPublisher(ScopedPublisher publisher)
Method Detail

create

public <T extends org.gcube.common.resources.gcore.Resource> T create(T resource,
                                                                      List<String> scopes)
                                                           throws RegistryNotFoundException
Description copied from interface: ScopedPublisher
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

Specified by:
create in interface ScopedPublisher
Throws:
RegistryNotFoundException

update

public <T extends org.gcube.common.resources.gcore.Resource> T update(T resource)
                                                           throws RegistryNotFoundException
Description copied from interface: ScopedPublisher
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.

Specified by:
update in interface ScopedPublisher
Throws:
RegistryNotFoundException

remove

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

Specified by:
remove in interface ScopedPublisher
Returns:
the resource without the current scope if the remove operation is succesfully
Throws:
RegistryNotFoundException


Copyright © 2013. All Rights Reserved.