gr.uoa.di.madgik.searchlibrary.operatorlibrary.google
Class GoogleOp

java.lang.Object
  extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.google.GoogleOp

public class GoogleOp
extends Object

Operator class used to perform external lookups to the Google engine and create a org.gcube.searchservice.searchlibrary.resultset.ResultSet with the results

Author:
UoA

Field Summary
static String ObjectIdFieldNameDef
          The default name for the Field of the object id
static String PayloadFieldNameDef
          The default name for the Field of the payload
static long TimeoutDef
          The default timeout used by the IRecordWriter.
static TimeUnit TimeUnitDef
          The default timeout unit used by the RecordWriter.
 
Constructor Summary
GoogleOp(long timeout, TimeUnit timeUnit, StatsContainer stats)
          Creates a new GoogleOp with the default field names for object id and payload
GoogleOp(StatsContainer stats)
          Creates a new GoogleOp with the default timeout and the default field names for object id and payload
GoogleOp(String objectIdFieldName, String payloadFieldName, long timeout, TimeUnit timeUnit, StatsContainer stats)
          Creates a new GoogleOp with configurable timeout and field names for object id and payload
 
Method Summary
 URI compute(String query, int resNo)
          Performs the external lookup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ObjectIdFieldNameDef

public static String ObjectIdFieldNameDef
The default name for the Field of the object id


PayloadFieldNameDef

public static String PayloadFieldNameDef
The default name for the Field of the payload


TimeoutDef

public static final long TimeoutDef
The default timeout used by the IRecordWriter. Currently set to 60.

See Also:
Constant Field Values

TimeUnitDef

public static final TimeUnit TimeUnitDef
The default timeout unit used by the RecordWriter. The current default unit is seconds.

Constructor Detail

GoogleOp

public GoogleOp(StatsContainer stats)
Creates a new GoogleOp with the default timeout and the default field names for object id and payload

Parameters:
stats - Statistics

GoogleOp

public GoogleOp(long timeout,
                TimeUnit timeUnit,
                StatsContainer stats)
Creates a new GoogleOp with the default field names for object id and payload

Parameters:
timeUnit - The time unit of the timeout
stats - Statistics

GoogleOp

public GoogleOp(String objectIdFieldName,
                String payloadFieldName,
                long timeout,
                TimeUnit timeUnit,
                StatsContainer stats)
Creates a new GoogleOp with configurable timeout and field names for object id and payload

Parameters:
objectIdFieldName - The name of the Field which will hold the object id
payloadFieldName - The name of the Field which will hold the payload
timeout - The timeout which will be used by the writer
timeUnit - The time unit of the timeout
stats - Statistics
Method Detail

compute

public URI compute(String query,
                   int resNo)
            throws Exception
Performs the external lookup

Parameters:
type - The type of resource to create
query - Teh query string
resNo - number of results
Returns:
The output org.gcube.searchservice.searchlibrary.resultset.ResultSet
Throws:
Exception - An unrecoverable for the operation error occurred


Copyright © 2013. All Rights Reserved.