org.gcube.contentmanagement.contentmanager.stubs.calls
Class AdminCalls

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.calls.AdminCalls

public class AdminCalls
extends java.lang.Object

Wraps a ManagerCall, the inner call, to enable administrative operations over remote collection managers.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
AdminCalls()
           
 
Method Summary
static java.util.List<java.util.concurrent.Future<RPDocument>> deleteAllManagers(java.lang.String collectionID, GCUBEScope scope, GCUBESecurityManager... manager)
          Deletes the collection managers for a given collection in a given scope and, optionally, with a given security manager.
static java.util.List<java.util.concurrent.Future<RPDocument>> deleteAllManagersByType(ManagerCall call)
          Discovers and deletes all the collection managers for the target collection of a ManagerCall.
static java.util.concurrent.Future<?> deleteManager(ManagerCall call)
          Delete the collection manager targeted by a given ManagerCall.
static java.util.List<java.util.concurrent.Future<?>> deleteManagers(java.lang.String collectionID, java.net.URI uri, GCUBEScope scope, GCUBESecurityManager... manager)
          Deletes the collection managers for a given collection at a given service instance in a given scope and, optionally, with a given security manager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminCalls

public AdminCalls()
Method Detail

deleteManagers

public static java.util.List<java.util.concurrent.Future<?>> deleteManagers(java.lang.String collectionID,
                                                                            java.net.URI uri,
                                                                            GCUBEScope scope,
                                                                            GCUBESecurityManager... manager)
                                                                     throws java.lang.Exception
Deletes the collection managers for a given collection at a given service instance in a given scope and, optionally, with a given security manager.

Parameters:
collectionID - the identifier of the collection.
uri - the address of the instance.
scope - the scope.
manager - (optional) the security manager.
Returns:
a two-element list of Future outcomes of the operation (ReadManager and WriteManager).
Throws:
java.lang.Exception - if the operation fails due to a local error.

deleteAllManagers

public static java.util.List<java.util.concurrent.Future<RPDocument>> deleteAllManagers(java.lang.String collectionID,
                                                                                        GCUBEScope scope,
                                                                                        GCUBESecurityManager... manager)
                                                                                 throws org.apache.commons.discovery.DiscoveryException,
                                                                                        java.lang.Exception
Deletes the collection managers for a given collection in a given scope and, optionally, with a given security manager.

Parameters:
collectionID - the identifier of the collection.
scope - the scope.
manager - (optional) the security manager.
Returns:
a list with the Future outcomes of the operation, one for each target manager.
Throws:
org.apache.commons.discovery.DiscoveryException - if an error occurred during manager discovery.
java.lang.Exception - if the operation fails due to a local error.

deleteManager

public static java.util.concurrent.Future<?> deleteManager(ManagerCall call)
                                                    throws java.lang.IllegalArgumentException
Delete the collection manager targeted by a given ManagerCall.

Parameters:
call - the call.
Returns:
the Future outcome of the operation.
Throws:
java.lang.IllegalArgumentException - if the collection or the manager endpoint are not set on the input call.

deleteAllManagersByType

public static java.util.List<java.util.concurrent.Future<RPDocument>> deleteAllManagersByType(ManagerCall call)
                                                                                       throws java.lang.IllegalArgumentException,
                                                                                              org.apache.commons.discovery.DiscoveryException
Discovers and deletes all the collection managers for the target collection of a ManagerCall.

Parameters:
call - the call.
Returns:
a list of Future outcomes, one for discovered manager.
Throws:
java.lang.IllegalArgumentException - if
org.apache.commons.discovery.DiscoveryException - if an error occurred during manager discovery.