本文整理汇总了Java中org.biokoframework.utils.fields.Fields.putAll方法的典型用法代码示例。如果您正苦于以下问题:Java Fields.putAll方法的具体用法?Java Fields.putAll怎么用?Java Fields.putAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.biokoframework.utils.fields.Fields
的用法示例。
在下文中一共展示了Fields.putAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: twoWorkingCommands
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
@Test
public void twoWorkingCommands() throws BiokoException {
EntityBuilder<Login> login = new LoginBuilder().loadDefaultExample();
login.setId("1");
Fields input = new Fields();
input.put(FieldNames.COMMAND_NAME, "POST_login");
input.putAll(login.build(false).fields());
Fields output = _system.execute(input);
Fields input2 = new Fields();
input2.put(FieldNames.COMMAND_NAME, "GET_login");
input2.put(GenericFieldNames.USER_EMAIL, "matto");
input2.put(GenericFieldNames.PASSWORD, "fatto");
output = _system.execute(input2);
assertEquals("[" + login.build(true).toJSONString() + "]",
JSONValue.toJSONString(output.get(GenericFieldNames.RESPONSE)));
}
示例2: executeCommand
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
@Override
public Fields executeCommand(Fields input) throws SystemException, ValidationException {
AuthResponse authResponse = null;
try {
authResponse = fAuthService.authenticate(input, fRequiredRoles);
input.putAll(authResponse.getMergeFields());
} catch (AuthenticationFailureException exception) {
if (fRequireValidAuthentication) {
throw exception;
}
}
Fields output = fWrappedHandler.executeCommand(input);
if (authResponse != null && authResponse.getOverrideFields() != null) {
output.putAll(authResponse.getOverrideFields());
}
return output;
}
示例3: safelyParse
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
@Override
protected Fields safelyParse(HttpServletRequest request) throws RequestNotSupportedException {
Fields fields = new Fields();
try {
for(Part aPart : request.getParts()) {
if (isAFilePart(aPart)) {
fields.putAll(fFilePartParser.parse(aPart, chooseEncoding(request)));
} else {
fields.putAll(fStringPartParser.parse(aPart, chooseEncoding(request)));
}
}
} catch (IOException | ServletException e) {
e.printStackTrace();
}
return fields;
}
示例4: execute
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
@Override
public Fields execute(Fields input) throws CommandException {
LOGGER.info("EXECUTING Command:" + this.getClass().getSimpleName());
Fields result = new Fields();
// Meta linguaggio? Il comando descrive il command handler con lo stesso meccanismo con cui
// descriverebbe qualunque altra cosa
ArrayList<DomainEntity> response = new ArrayList<DomainEntity>();
for (String aCommandName : _commandHandler.keys()) {
CommandEntity commandEntity = new CommandEntity();
commandEntity.set(CommandEntity.NAME, aCommandName);
response.add(commandEntity);
}
result.put(GenericFieldNames.RESPONSE, response);
result.putAll(input);
LOGGER.info("END Command:" + this.getClass().getSimpleName());
return result;
}
示例5: getFields
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
private Fields getFields(HttpServletRequest request) throws RouteNotSupportedException {
Fields headersFields = extractHeaders(request);
headersFields.putAll(extractQueryString(request));
if (request.getContentLength() > 0 || StringUtils.startsWith(request.getContentType(), "multipart/form-data")) {
boolean somebodyParsedTheRequest = false;
try {
for (IHttpFieldsParser aParser : fFieldsParsers) {
if (aParser.isCompatibleWith(MediaType.parse(request.getContentType()))) {
headersFields.putAll(aParser.parse(request));
somebodyParsedTheRequest = true;
}
}
} catch (RequestNotSupportedException exception) {
throw new RouteNotSupportedException(exception);
}
if (!somebodyParsedTheRequest) {
ErrorEntity error = new ErrorEntity();
error.setAll(new Fields(
ErrorEntity.ERROR_FIELD, "ContentType",
ErrorEntity.ERROR_CODE, FieldNames.UNSUPPORTED_FORMAT_CODE,
ErrorEntity.ERROR_MESSAGE, "Content type used is not supported"
));
throw new RouteNotSupportedException(error);
}
}
return headersFields;
}
示例6: execute
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
@Override
public Fields execute(Fields input) throws CommandException, ValidationException {
Fields overAllOutput = Fields.successful();
LOGGER.info("Executing MultipleCommand: " + this.getClass().getSimpleName());
LOGGER.info("Steps: " + _steps.size());
for (Entry<String,AbstractCommand> step : _steps.entrySet()) {
Fields output = new Fields();
LOGGER.info("Executing step: " + step.getKey());
output = step.getValue().execute(input);
if (output.containsKey(FieldsErrors.FAILURE)) {
output.put(FieldNames.FAILED_COMMAND, step.getValue().getClass().getSimpleName());
LOGGER.info("Step " + step.getKey() + " execution failed!");
return overAllOutput.putAll(Fields.failed()).putAll(output);
} else if (output.containsKey(FieldsErrors.ERROR)) {
output.put(FieldNames.ERROR_COMMAND, step.getValue().getClass().getSimpleName());
LOGGER.info("Step " + step.getKey() + " execution error!");
return overAllOutput.putAll(Fields.failed()).putAll(output);
}
overAllOutput.putAll(output);
input.putAll(output);
}
LOGGER.info("MultipleCommand output: " + overAllOutput.toString());
LOGGER.info("End MultipleCommand: " + this.getClass().getSimpleName());
return overAllOutput;
}
示例7: prepareNextStepInput
import org.biokoframework.utils.fields.Fields; //导入方法依赖的package包/类
protected void prepareNextStepInput(String prevStepName, Fields prevStepOutput, Fields nextStepInput) {
prevStepOutput.remove(GenericFieldNames.RESPONSE);
nextStepInput.putAll(prevStepOutput);
}