eu.scape_project.watch.adaptor.c3po.client
Class C3PODummyClient

java.lang.Object
  extended by eu.scape_project.watch.adaptor.c3po.client.C3PODummyClient
All Implemented Interfaces:
C3POClientInterface

public class C3PODummyClient
extends Object
implements C3POClientInterface

A dummy client that always returns the same job uuid and returns a random collection profile for its only collection named 'Test'.

Author:
Petar Petrov

Field Summary
static String COLLECTION_NAME
          A hardcoded collection name.
 
Constructor Summary
C3PODummyClient()
           
 
Method Summary
 List<String> getCollectionIdentifiers()
          Fetches the current content profile identifiers stored in the c3po instance.
 InputStream pollJobResult(String uuid)
          Retrieves an input stream with the results of the job for the given uuid, or null if the job is not yet finished or unknown.
 String submitCollectionProfileJob(String identifier, List<String> properties)
          Submits a new profile creation job to c3po.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLLECTION_NAME

public static final String COLLECTION_NAME
A hardcoded collection name.

See Also:
Constant Field Values
Constructor Detail

C3PODummyClient

public C3PODummyClient()
Method Detail

getCollectionIdentifiers

public List<String> getCollectionIdentifiers()
Description copied from interface: C3POClientInterface
Fetches the current content profile identifiers stored in the c3po instance.

Specified by:
getCollectionIdentifiers in interface C3POClientInterface
Returns:
a list of collection identifiers

submitCollectionProfileJob

public String submitCollectionProfileJob(String identifier,
                                         List<String> properties)
Description copied from interface: C3POClientInterface
Submits a new profile creation job to c3po.

Specified by:
submitCollectionProfileJob in interface C3POClientInterface
Parameters:
identifier - the collection identifier
properties - the properties that are of interest
Returns:
a string representing the uuid of the job or null if 404.

pollJobResult

public InputStream pollJobResult(String uuid)
Description copied from interface: C3POClientInterface
Retrieves an input stream with the results of the job for the given uuid, or null if the job is not yet finished or unknown.

Specified by:
pollJobResult in interface C3POClientInterface
Parameters:
uuid - the job id.
Returns:
the InputStream holding the profile.


Copyright © 2012. All Rights Reserved.