use of org.apache.cxf.common.i18n.Message in project cxf by apache.
the class SequenceFaultFactory method createMessageNumberRolloverFault.
SequenceFault createMessageNumberRolloverFault(Identifier sid) {
Message msg = new Message("MESSAGE_NR_ROLLOVER_EXC", BUNDLE);
SequenceFault fault = new SequenceFault(msg.toString());
fault.setDetail(sid);
fault.setSender(true);
fault.setFaultCode(constants.getMessageNumberRolloverFaultCode());
return fault;
}
use of org.apache.cxf.common.i18n.Message in project cxf by apache.
the class SequenceFaultFactory method createCreateSequenceRefusedFault.
SequenceFault createCreateSequenceRefusedFault() {
Message msg = new Message("CREATE_SEQ_REFUSED", BUNDLE);
SequenceFault fault = new SequenceFault(msg.toString());
fault.setSender(true);
fault.setFaultCode(constants.getCreateSequenceRefusedFaultCode());
return fault;
}
use of org.apache.cxf.common.i18n.Message in project cxf by apache.
the class JavaToWSDLProcessor method getOutputFile.
protected File getOutputFile(File nameFromClz, String defaultOutputFile) {
String output = (String) context.get(ToolConstants.CFG_OUTPUTFILE);
String dir = (String) context.get(ToolConstants.CFG_OUTPUTDIR);
if (dir == null) {
dir = "./";
}
File result;
if (output != null) {
result = new File(output);
if (!result.isAbsolute()) {
result = new File(new File(dir), output);
}
} else {
result = new File(new File(dir), defaultOutputFile);
}
if (nameFromClz != null) {
result = nameFromClz;
}
// rename the exising wsdl file
if (result.exists() && !result.renameTo(new File(result.getParent(), result.getName()))) {
throw new ToolException(new Message("OUTFILE_EXISTS", LOG));
}
return result;
}
use of org.apache.cxf.common.i18n.Message in project cxf by apache.
the class JAXWSFrontEndProcessor method checkJaxwsClass.
public void checkJaxwsClass() {
Class<?> clz = context.get(Class.class);
WebService webServiceAnno = clz.getAnnotation(WebService.class);
if (webServiceAnno == null) {
Message msg = new Message("CLASS_DOESNOT_CARRY_WEBSERVICE_ANNO", LOG, clz.getName());
LOG.log(Level.WARNING, msg.toString());
throw new ToolException(msg);
}
if (isImplRmiRemote(clz)) {
Message msg = new Message("PARA_OR_RETURN_IMPL_REMOTE", LOG, clz.getName());
LOG.log(Level.WARNING, msg.toString());
throw new ToolException(msg);
}
}
use of org.apache.cxf.common.i18n.Message in project cxf by apache.
the class JavaToWSContainer method checkParams.
public void checkParams(ErrorVisitor errs) throws ToolException {
super.checkParams(errs);
CommandDocument doc = super.getCommandDocument();
if (doc.hasParameter(ToolConstants.CFG_FRONTEND)) {
String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
if (!ToolConstants.JAXWS_FRONTEND.equals(ft) && !ToolConstants.SIMPLE_FRONTEND.equals(ft)) {
Message msg = new Message("INVALID_FRONTEND", LOG, new Object[] { ft });
errs.add(new ErrorVisitor.UserError(msg.toString()));
}
if (ToolConstants.SIMPLE_FRONTEND.equals(ft) && doc.getParameter(ToolConstants.CFG_DATABINDING) != null && !ToolConstants.AEGIS_DATABINDING.equals(doc.getParameter(ToolConstants.CFG_DATABINDING))) {
Message msg = new Message("INVALID_DATABINDING_FOR_SIMPLE", LOG);
errs.add(new ErrorVisitor.UserError(msg.toString()));
}
}
if (doc.hasParameter(ToolConstants.CFG_WRAPPERBEAN)) {
String ft = doc.getParameter(ToolConstants.CFG_FRONTEND);
if (ft != null && !ToolConstants.JAXWS_FRONTEND.equals(ft)) {
Message msg = new Message("WRAPPERBEAN_WITHOUT_JAXWS", LOG);
errs.add(new ErrorVisitor.UserError(msg.toString()));
}
}
if (errs.getErrors().size() > 0) {
Message msg = new Message("PARAMETER_MISSING", LOG);
throw new ToolException(msg, new BadUsageException(getUsage(), errs));
}
}
Aggregations