org.gcube.informationsystem.publisher
Class RegistryPublisherImpl

java.lang.Object
  extended by org.gcube.informationsystem.publisher.RegistryPublisherImpl
All Implemented Interfaces:
RegistryPublisher

public class RegistryPublisherImpl
extends Object
implements RegistryPublisher


Constructor Summary
protected RegistryPublisherImpl()
           
 
Method Summary
<T extends org.gcube.common.resources.gcore.Resource>
T
create(T resource)
          The resource is created in the current scope and it is updated in the other scopes that are presents in the resource.
<T extends org.gcube.common.resources.gcore.Resource>
T
remove(T resource)
          The resource will be removed from current scope if the scope is the last scope in the resource, the profile will be deleted from IS else if it is a VRE scope then the profile will be updated without the VRE scope, if it is a VO scope but there is another VRE scope, belong to the VO, defined in the resource then throw IllegalArgumentException
<T extends org.gcube.common.resources.gcore.Resource>
T
update(T resource)
          The resource will be updated on all the scopes that are defined in the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryPublisherImpl

protected RegistryPublisherImpl()
Method Detail

create

public <T extends org.gcube.common.resources.gcore.Resource> T create(T resource)
The resource is created in the current scope and it is updated in the other scopes that are presents in the resource. If is a VRE scope then in the resource will be added also the VO and INFRA scope if they are not present If is a VO scope then in the resource will be added also the INFRA scope if it is not present

Specified by:
create in interface RegistryPublisher
Throws:
RegistryNotFoundException - if no service endpoints can be discovered
InvalidResourceExceptionwhen - the resource type is invalid service.
ResourceNotAcceptedException - when the resource is not accepted cause it doesn't satisfy a requirement
CreateException - when something is failed on creation

update

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

Specified by:
update in interface RegistryPublisher
Throws:
RegistryNotFoundException - if no service endpoints can be discovered
InvalidResourceException - when the resource type is invalid service.
ResourceNotAcceptedException - when the resource is not accepted cause it doesn't satisfy a requirement
CreateException - when something is failed on creation

remove

public <T extends org.gcube.common.resources.gcore.Resource> T remove(T resource)
The resource will be removed from current scope if the scope is the last scope in the resource, the profile will be deleted from IS else if it is a VRE scope then the profile will be updated without the VRE scope, if it is a VO scope but there is another VRE scope, belong to the VO, defined in the resource then throw IllegalArgumentException

Specified by:
remove in interface RegistryPublisher
Returns:
the resource without the current scope if the remove operation has been successfully completed
Throws:
IllegalArgumentException - if no service endpoints can be discovered or if there is another VRE scope defined in the resource


Copyright © 2014. All Rights Reserved.