com.vikingbrain.nmt.operations.metadatadatabase.AbstractGetVideoInfoOperation Maven / Gradle / Ivy
package com.vikingbrain.nmt.operations.metadatadatabase;
import java.util.LinkedHashMap;
import com.vikingbrain.nmt.operations.ModuleType;
import com.vikingbrain.nmt.operations.OperationType;
import com.vikingbrain.nmt.operations.TheDavidboxOperationFactory;
import com.vikingbrain.nmt.operations.parameters.InfoMode;
import com.vikingbrain.nmt.responses.DavidBoxResponse;
/**
* Get particular video info (summary).
* Execution example: http://popcorn:8008/metadata_database?arg0=get_video_info&arg1=/opt/sybhttpd/localhost.drives/SATA_DISK/nmj_database/media.db&arg2=s91&arg3=summary
* @author vikingBrain
*
*/
public abstract class AbstractGetVideoInfoOperation extends AbstractMetadatadatabaseOperation {
/** Operation type. */
private static final OperationType operationType = ModuleType.METADATA_DATABASE.get_video_info;
/** Required operation attributes. */
private String databasePath;
//Video id.
private String videoId;
//Type of info requested.
private InfoMode infoMode;
/**
* Constructor. Create the operation with the supplied parameters plus the default client parameters.
* @param operationFactory the operation factory
* @param databasePath the database path
*/
protected AbstractGetVideoInfoOperation(TheDavidboxOperationFactory operationFactory, Class responseTargetClass, String databasePath, String videoId, InfoMode infoMode) {
super(operationFactory, operationType, responseTargetClass);
this.databasePath = databasePath;
this.videoId = videoId;
this.infoMode = infoMode;
}
@Override
/** {@inheritDoc} */
public LinkedHashMap buildHttpArguments(){
//Get http arguments from superclass
LinkedHashMap httpArguments = super.buildHttpArguments();
httpArguments.put("arg1", databasePath);
httpArguments.put("arg2", videoId);
httpArguments.put("arg3", infoMode.getParamValue());
return httpArguments;
}
public final String getDatabasePath() {
return databasePath;
}
public final void setDatabasePath(String databasePath) {
this.databasePath = databasePath;
}
public final String getVideoId() {
return videoId;
}
public final void setVideoId(String videoId) {
this.videoId = videoId;
}
public final InfoMode getInfoMode() {
return infoMode;
}
public final void setInfoMode(InfoMode infoMode) {
this.infoMode = infoMode;
}
@Override
public String toString() {
return "AbstractGetVideoInfoOperation [databasePath=" + databasePath
+ ", videoId=" + videoId + ", infoMode=" + infoMode
+ ", getOperationType()=" + getOperationType() + "]";
}
}