org.gcube.contentmanagement.gcubedocumentlibrary.views
Class Views

java.lang.Object
  extended by org.gcube.contentmanagement.gcubedocumentlibrary.views.Views

public class Views
extends java.lang.Object

A set of facilities to discover views of document descriptions in remote collections.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
Views()
           
 
Method Summary
static java.util.List<? extends CollectionView<?,?>> convert(java.util.List<RPDocument> results, GCUBEScope s, GCUBESecurityManager m)
          Internal method for conversion.
static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId)
          Returns CollectionViews for a given collection in the current scope.
static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId, GCUBEScope s)
          Returns CollectionViews for a given collection in a given GCUBEScope.
static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId, GCUBEScope s, GCUBESecurityManager m)
          Returns CollectionViews for a given collection in a given GCUBEScope and with a given SecurityManager.
static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId, GCUBESecurityManager m)
          Returns CollectionViews for a given collection in the current scope and with a given SecurityManager.
static
<E extends GCubeElement,P extends Property,V extends CollectionView<E,P>>
java.util.List<V>
findLike(V view)
           
static java.util.List<? extends CollectionView<?,?>> listViews()
          Returns all available views in the current scope.
static java.util.List<? extends CollectionView<?,?>> listViews(GCUBEScope scope)
          Returns all available views in a given scope.
static java.util.List<? extends CollectionView<?,?>> listViews(GCUBEScope scope, GCUBESecurityManager securityManager)
          Returns all available views for the scope.
static java.util.List<? extends CollectionView<?,?>> listViews(GCUBESecurityManager securityManager)
          Returns all available views in the current scope.
static void registerType(javax.xml.namespace.QName n, java.lang.Class<? extends CollectionView<?,?>> c)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Views

public Views()
Method Detail

registerType

public static void registerType(javax.xml.namespace.QName n,
                                java.lang.Class<? extends CollectionView<?,?>> c)

findLike

public static <E extends GCubeElement,P extends Property,V extends CollectionView<E,P>> java.util.List<V> findLike(V view)
                                                              throws DiscoveryException,
                                                                     GCUBEException,
                                                                     java.lang.Exception
Throws:
DiscoveryException
GCUBEException
java.lang.Exception

find

public static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId)
                                                          throws ISException,
                                                                 java.lang.Exception
Returns CollectionViews for a given collection in the current scope.

Parameters:
collectionId - the collection identifier.
Returns:
an Iterator over the document views.
Throws:
ISException - if the operation could not complete due to resource discovery errors.
java.lang.Exception - the operation could not complete due to local errors.

find

public static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId,
                                                                 GCUBEScope s)
                                                          throws ISException,
                                                                 java.lang.Exception
Returns CollectionViews for a given collection in a given GCUBEScope.

Parameters:
collectionId - the collection identifier.
s - the scope.
Returns:
an Iterator over the document views.
Throws:
ISException - if the operation could not complete due to resource discovery errors.
java.lang.Exception - the operation could not complete due to local errors.

find

public static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId,
                                                                 GCUBESecurityManager m)
                                                          throws ISException,
                                                                 java.lang.Exception
Returns CollectionViews for a given collection in the current scope and with a given SecurityManager.

Parameters:
collectionId - the collection identifier.
m - the security manager.
Returns:
an Iterator over the document views.
Throws:
ISException - if the operation could not complete due to resource discovery errors.
java.lang.Exception - the operation could not complete due to local errors.

find

public static java.util.List<? extends CollectionView<?,?>> find(java.lang.String collectionId,
                                                                 GCUBEScope s,
                                                                 GCUBESecurityManager m)
                                                          throws ISException,
                                                                 java.lang.Exception
Returns CollectionViews for a given collection in a given GCUBEScope and with a given SecurityManager.

Parameters:
collectionId - the collection identifier.
s - the scope.
m - the security manager.
Returns:
an Iterator over the document views.
Throws:
ISException - if the operation could not complete due to resource discovery errors.
java.lang.Exception - the operation could not complete due to local errors.

listViews

public static java.util.List<? extends CollectionView<?,?>> listViews()
                                                               throws java.lang.Exception
Returns all available views in the current scope.

Parameters:
scope - the working scope.
Returns:
the views list.
Throws:
java.lang.Exception - if an error occurs during the retrieving.

listViews

public static java.util.List<? extends CollectionView<?,?>> listViews(GCUBEScope scope)
                                                               throws java.lang.Exception
Returns all available views in a given scope.

Parameters:
scope - the scope.
Returns:
the views list.
Throws:
java.lang.Exception - if an error occurs during the retrieving.

listViews

public static java.util.List<? extends CollectionView<?,?>> listViews(GCUBESecurityManager securityManager)
                                                               throws java.lang.Exception
Returns all available views in the current scope.

Parameters:
scope - the working scope.
securityManager - the security manager.
Returns:
the views list.
Throws:
java.lang.Exception - if an error occurs during the retrieving.

listViews

public static java.util.List<? extends CollectionView<?,?>> listViews(GCUBEScope scope,
                                                                      GCUBESecurityManager securityManager)
                                                               throws java.lang.Exception
Returns all available views for the scope.

Parameters:
scope - the working scope.
securityManager - the security manager.
Returns:
the views list.
Throws:
java.lang.Exception - if an error occurs during the retrieving.

convert

public static java.util.List<? extends CollectionView<?,?>> convert(java.util.List<RPDocument> results,
                                                                    GCUBEScope s,
                                                                    GCUBESecurityManager m)
                                                             throws javax.xml.bind.JAXBException
Internal method for conversion.

Parameters:
results - the IS result set.
s - the working scope.
m - the security manager.
Returns:
the converted list views.
Throws:
javax.xml.bind.JAXBException - if an error occurs during the conversion.