org.gcube.execution.indexerservice.utils
Class CMUtils

java.lang.Object
  extended by org.gcube.execution.indexerservice.utils.CMUtils

public class CMUtils
extends java.lang.Object


Field Summary
static java.lang.String indexerJobCollectionPrefix
           
 
Constructor Summary
CMUtils()
           
 
Method Summary
static java.lang.String createIndexerDocument(DocumentWriter writer, java.lang.String documentName, java.io.InputStream bytestream, GCUBEScope scope)
           
static CollectionReference createIndexerJobCollection(GCUBEScope scope)
          Creates a new indexerJobCollection in the given scope The new created collection will be readable and writable and won't be a User collection
static java.lang.String deleteAllIndexerJobCollections(GCUBEScope scope)
          This method deletes all collections of indexer in this scope
static java.lang.String findDocumentCMReferenceFromName(DocumentReader reader, java.lang.String name, GCUBEScope scope)
           
static DocumentReader getDocumentReaderByCollectionReference(CollectionReference colRef, GCUBEScope scope)
           
static DocumentReader getDocumentReaderByID(java.lang.String collectionID, GCUBEScope scope)
           
static DocumentWriter getDocumentWriterByCollectionReference(CollectionReference colRef, GCUBEScope scope)
           
static DocumentWriter getDocumentWriterByID(java.lang.String collectionID, GCUBEScope scope)
           
static java.lang.String getIndexerJobCollection(GCUBEScope scope)
          This method retrieves the ID of indexer collection with ocropus.tar.gz.gz in a specific scope
static void printCollectionDocs(java.lang.String collectionId, GCUBEScope scope)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexerJobCollectionPrefix

public static java.lang.String indexerJobCollectionPrefix
Constructor Detail

CMUtils

public CMUtils()
Method Detail

getIndexerJobCollection

public static java.lang.String getIndexerJobCollection(GCUBEScope scope)
This method retrieves the ID of indexer collection with ocropus.tar.gz.gz in a specific scope

Parameters:
scope - : the scope to search the collection
Returns:
: the collection's ID or null
Throws:
GCUBEFault - : an error occurred

createIndexerJobCollection

public static CollectionReference createIndexerJobCollection(GCUBEScope scope)
Creates a new indexerJobCollection in the given scope The new created collection will be readable and writable and won't be a User collection

Parameters:
scope - : the scope in which the indexerJobCollection is created
Returns:
The ID of the collection

createIndexerDocument

public static java.lang.String createIndexerDocument(DocumentWriter writer,
                                                     java.lang.String documentName,
                                                     java.io.InputStream bytestream,
                                                     GCUBEScope scope)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getDocumentReaderByID

public static DocumentReader getDocumentReaderByID(java.lang.String collectionID,
                                                   GCUBEScope scope)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getDocumentReaderByCollectionReference

public static DocumentReader getDocumentReaderByCollectionReference(CollectionReference colRef,
                                                                    GCUBEScope scope)
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

getDocumentWriterByID

public static DocumentWriter getDocumentWriterByID(java.lang.String collectionID,
                                                   GCUBEScope scope)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getDocumentWriterByCollectionReference

public static DocumentWriter getDocumentWriterByCollectionReference(CollectionReference colRef,
                                                                    GCUBEScope scope)
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

deleteAllIndexerJobCollections

public static java.lang.String deleteAllIndexerJobCollections(GCUBEScope scope)
This method deletes all collections of indexer in this scope

Parameters:
scope - : the scope in which to delete all collections
Returns:
: the collection's ID or null
Throws:
GCUBEFault - : an error occurred

findDocumentCMReferenceFromName

public static java.lang.String findDocumentCMReferenceFromName(DocumentReader reader,
                                                               java.lang.String name,
                                                               GCUBEScope scope)
                                                        throws GCUBEFault
Throws:
GCUBEFault

printCollectionDocs

public static void printCollectionDocs(java.lang.String collectionId,
                                       GCUBEScope scope)