Package org.apache.solr.common.util
Class CommandOperation
- java.lang.Object
- 
- org.apache.solr.common.util.CommandOperation
 
- 
 public class CommandOperation extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description CommandOperation(String operationName, Object metaData)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(String s)static List<Map<String,Object>>captureErrors(List<CommandOperation> ops)static List<CommandOperation>clone(List<CommandOperation> ops)booleangetBoolean(String key, boolean def)ObjectgetCommandData()CommandOperationgetCopy()Map<String,Object>getDataMap()List<String>getErrors()IntegergetInt(String name)IntegergetInt(String name, Integer def)MapgetMap(String key, Map def)StringgetStr(String key)Get a required field.StringgetStr(String key, String def)List<String>getStrs(String key)List<String>getStrs(String key, List<String> def)Get collection of values for a key.ObjectgetVal(String key)Map<String,Object>getValuesExcluding(String... keys)Get all the values from the metadata for the command without the specified keysbooleanhasError()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 repeatedstatic List<CommandOperation>parse(Reader rdr)static List<CommandOperation>parse(Reader rdr, Set<String> singletonCommands)Parse the command operations into command objects from a json payloadstatic List<CommandOperation>readCommands(Iterable<ContentStream> streams, NamedList resp)static List<CommandOperation>readCommands(Iterable<ContentStream> streams, NamedList resp, Set<String> singletonCommands)Read commands from request streamsvoidsetCommandData(Object o)StringtoString()voidunknownOperation()
 
- 
- 
- 
Field Detail- 
namepublic final String name 
 - 
ERR_MSGSpublic static final String ERR_MSGS - See Also:
- Constant Field Values
 
 - 
ROOT_OBJpublic static final String ROOT_OBJ - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getCommandDatapublic Object getCommandData() 
 - 
getBooleanpublic boolean getBoolean(String key, boolean def) 
 - 
setCommandDatapublic void setCommandData(Object o) 
 - 
unknownOperationpublic void unknownOperation() 
 - 
getStrspublic List<String> getStrs(String key, List<String> def) Get collection of values for a key. If only one val is present a single value collection is returned
 - 
hasErrorpublic boolean hasError() 
 - 
addErrorpublic void addError(String s) 
 - 
getValuesExcludingpublic Map<String,Object> getValuesExcluding(String... keys) Get all the values from the metadata for the command without the specified keys
 - 
parsepublic static List<CommandOperation> parse(Reader rdr) throws IOException - Throws:
- IOException
 
 - 
parsepublic static List<CommandOperation> parse(InputStream in, Set<String> singletonCommands) throws IOException Parse the command operations into command objects from javabin payload * @param singletonCommands commands that cannot be repeated- Throws:
- IOException
 
 - 
parsepublic static List<CommandOperation> parse(Reader rdr, Set<String> singletonCommands) throws IOException Parse the command operations into command objects from a json payload- Parameters:
- rdr- The payload
- singletonCommands- commands that cannot be repeated
- Returns:
- parsed list of commands
- Throws:
- IOException
 
 - 
getCopypublic CommandOperation getCopy() 
 - 
readCommandspublic static List<CommandOperation> readCommands(Iterable<ContentStream> streams, NamedList resp) throws IOException - Throws:
- IOException
 
 - 
readCommandspublic static List<CommandOperation> readCommands(Iterable<ContentStream> streams, NamedList resp, Set<String> singletonCommands) throws IOException Read commands from request streams- Parameters:
- streams- the streams
- resp- solr query response
- singletonCommands- , commands that cannot be repeated
- Returns:
- parsed list of commands
- Throws:
- IOException- if there is an error while parsing the stream
 
 - 
clonepublic static List<CommandOperation> clone(List<CommandOperation> ops) 
 
- 
 
-