public class CommandOperation extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ERR_MSGS |
String |
name |
static String |
ROOT_OBJ |
Constructor and Description |
---|
CommandOperation(String operationName,
Object metaData) |
Modifier and Type | Method and Description |
---|---|
void |
addError(String s) |
static List<Map> |
captureErrors(List<CommandOperation> ops) |
static List<CommandOperation> |
clone(List<CommandOperation> ops) |
boolean |
getBoolean(String key,
boolean def) |
Object |
getCommandData() |
CommandOperation |
getCopy() |
Map<String,Object> |
getDataMap() |
List<String> |
getErrors() |
Integer |
getInt(String name) |
Integer |
getInt(String name,
Integer def) |
Map |
getMap(String key,
Map def) |
String |
getStr(String key)
Get a required field.
|
String |
getStr(String key,
String def) |
List<String> |
getStrs(String key) |
List<String> |
getStrs(String key,
List<String> def)
Get collection of values for a key.
|
Object |
getVal(String key) |
Map<String,Object> |
getValuesExcluding(String... keys)
Get all the values from the metadata for the command
without the specified keys
|
boolean |
hasError() |
static List<CommandOperation> |
parse(InputStream in,
Set<String> singletonCommands)
Parse the command operations into command objects from javabin payload
* @param singletonCommands commands that cannot be repeated
|
static List<CommandOperation> |
parse(Reader rdr) |
static List<CommandOperation> |
parse(Reader rdr,
Set<String> singletonCommands)
Parse the command operations into command objects from a json payload
|
static List<CommandOperation> |
readCommands(Iterable<ContentStream> streams,
NamedList resp) |
static List<CommandOperation> |
readCommands(Iterable<ContentStream> streams,
NamedList resp,
Set<String> singletonCommands)
Read commands from request streams
|
void |
setCommandData(Object o) |
String |
toString() |
void |
unknownOperation() |
public final String name
public static final String ERR_MSGS
public static final String ROOT_OBJ
public Object getCommandData()
public boolean getBoolean(String key, boolean def)
public void setCommandData(Object o)
public void unknownOperation()
public List<String> getStrs(String key, List<String> def)
public boolean hasError()
public void addError(String s)
public Map<String,Object> getValuesExcluding(String... keys)
public static List<Map> captureErrors(List<CommandOperation> ops)
public static List<CommandOperation> parse(Reader rdr) throws IOException
IOException
public static List<CommandOperation> parse(InputStream in, Set<String> singletonCommands) throws IOException
IOException
public static List<CommandOperation> parse(Reader rdr, Set<String> singletonCommands) throws IOException
rdr
- The payloadsingletonCommands
- commands that cannot be repeatedIOException
public CommandOperation getCopy()
public static List<CommandOperation> readCommands(Iterable<ContentStream> streams, NamedList resp) throws IOException
IOException
public static List<CommandOperation> readCommands(Iterable<ContentStream> streams, NamedList resp, Set<String> singletonCommands) throws IOException
streams
- the streamsresp
- solr query responsesingletonCommands
- , commands that cannot be repeatedIOException
- if there is an error while parsing the streampublic static List<CommandOperation> clone(List<CommandOperation> ops)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.