本文整理汇总了Java中org.apache.cxf.interceptor.Fault类的典型用法代码示例。如果您正苦于以下问题:Java Fault类的具体用法?Java Fault怎么用?Java Fault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Fault类属于org.apache.cxf.interceptor包,在下文中一共展示了Fault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
/**
* Handles the {@link Connection} in the given {@link Message}.
* @see DBConnectionResponseInterceptor
*/
@Override
public void handleMessage(final Message message) throws Fault {
final Connection con = (Connection) message.getExchange().getInMessage().getContextualProperty(
DBConnectionContextProvider.PROPERTY_CONNECTION);
if(con != null) {
try {
final int responseCode = (int) message.get(Message.RESPONSE_CODE);
if(Family.familyOf(responseCode).equals(Family.SERVER_ERROR)) {
con.rollback();
}
else {
con.commit();
}
con.close();
}
catch(final SQLException e) {
LOGGER.error("Can't commit/rollback/close db connection because of an SQLException.", e);
}
}
}
示例2: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@SuppressWarnings("nls")
@Override
public void handleMessage(SoapMessage message) throws Fault
{
final UserState us = CurrentUser.getUserState();
XMLStreamWriterCallback obj = new XMLStreamWriterCallback()
{
@Override
public void write(XMLStreamWriter writer) throws Fault, XMLStreamException
{
writer.writeEmptyElement("equella");
writer.writeAttribute("session", us.getSessionID());
writer.writeAttribute("id", us.getUserBean().getUniqueID());
writer.writeAttribute("username", us.getUserBean().getUsername());
}
};
message.getHeaders().add(new Header(new QName("equella"), obj, new StaxDataBinding()));
}
示例3: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public void handleMessage(SoapMessage message) throws Fault
{
Header header = message.getHeader(new QName("equella"));
if( header != null )
{
Element e = (Element) header.getObject();
PropBagEx equella = new PropBagEx(e);
String token = equella.getNode("token");
if( !Check.isEmpty(token) )
{
HttpServletRequest request = (HttpServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST);
try
{
userService.loginWithToken(token, userService.getWebAuthenticationDetails(request), true);
}
catch( RuntimeException ex )
{
LOGGER.error("Error initialising session with SOAP header token '" + token + "' for URL "
+ request.getRequestURL().toString());
throw ex;
}
}
}
}
示例4: invoke
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public DOMSource invoke(final DOMSource request) {
Thread.currentThread().setName("Vrij bericht ontvanger");
LOGGER.debug("Vrij bericht ontvanger aangeroepen");
BrpNu.set(DatumUtil.nuAlsZonedDateTime());
try {
schemaValidatorService.valideer(request, VrijBerichtWebService.SCHEMA);
} catch (SchemaValidatorService.SchemaValidatieException schemaValidatieException) {
LOGGER.debug("Vrij bericht ontvanger aangeroepen met invalide xml", schemaValidatieException);
throw new Fault(schemaValidatieException.getCause());
}
return AlgemeneFoutHandler.doeBijFout(e -> {
LOGGER.error("Algemene fout", e);
throw new WebServiceException("Er is iets fout gegaan bij het verwerken van het vrij bericht verzoek.");
}).voerUit(() -> maakResponse(request));
}
示例5: invoke
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public DOMSource invoke(final DOMSource request) {
Thread.currentThread().setName("Bevraging voor Levering");
LOGGER.debug("Bevraging voor levering aangeroepen");
try {
schemaValidatorService.valideer(request, SCHEMA);
} catch (SchemaValidatorService.SchemaValidatieException schemaValidatieException) {
LOGGER.debug("Bevraging aangeroepen met invalide xml", schemaValidatieException);
throw new Fault(schemaValidatieException.getCause());
}
BrpNu.set(DatumUtil.nuAlsZonedDateTime());
return AlgemeneFoutHandler.doeBijFout(e -> {
LOGGER.error("Algemene fout", e);
throw new WebServiceException("Er is iets fout gegaan bij het verwerken van het verzoek.");
}).voerUit(() -> maakResponse(request));
}
示例6: invoke
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public DOMSource invoke(final DOMSource request) {
Thread.currentThread().setName("Stuf bericht vertaler ontvanger");
LOGGER.debug("Stuf bericht vertaler ontvanger aangeroepen");
BrpNu.set(DatumUtil.nuAlsZonedDateTime());
try {
schemaValidatorService.valideer(request, SCHEMA);
} catch (SchemaValidatorService.SchemaValidatieException schemaValidatieException) {
LOGGER.debug("Stuf bericht vertaler ontvanger aangeroepen met invalide xml", schemaValidatieException);
throw new Fault(schemaValidatieException.getCause());
}
return AlgemeneFoutHandler.doeBijFout(e -> {
LOGGER.error("Algemene fout", e);
throw new WebServiceException("Er is iets fout gegaan bij het verwerken van het stuf vertaal verzoek.");
}).voerUit(() -> maakResponse(request));
}
示例7: invoke
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
/**
* Voert het verzoek uit.
* @param request de ingaande request
* @return het response
*/
@Bedrijfsregel(Regel.R1978)
@Bedrijfsregel(Regel.R1979)
@Bedrijfsregel(Regel.R1984)
@Override
public final DOMSource invoke(final DOMSource request) {
Thread.currentThread().setName("OnderhoudAfnemerindicatie");
LOGGER.debug("AfnemerindicatiesService aangeroepen");
try {
schemaValidatorService.valideer(request, OnderhoudAfnemerindicatiesWebServiceImpl.SCHEMA);
} catch (SchemaValidatorService.SchemaValidatieException schemaValidatieException) {
LOGGER.debug("AfnemerindicatiesService aangeroepen met invalide xml", schemaValidatieException);
throw new Fault(schemaValidatieException.getCause());
}
BrpNu.set(DatumUtil.nuAlsZonedDateTime());
return AlgemeneFoutHandler.doeBijFout(
e1 -> {
LOGGER.error("Algemene fout", e1);
throw new WebServiceException("Er is iets fout gegaan bij het verwerken van het verzoek.");
}
).voerUit(() -> getDomSource(request));
}
示例8: invoke
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
/**
* Handelt het verzoek af.
* @param request het verzoek
* @return het response.
*/
@Bedrijfsregel(Regel.R1978)
@Bedrijfsregel(Regel.R1979)
@Override
public final DOMSource invoke(final DOMSource request) {
Thread.currentThread().setName("Synchronisatie Service");
LOGGER.debug("SynchronisatieService aangeroepen");
try {
schemaValidatorService.valideer(request, SCHEMA);
} catch (SchemaValidatorService.SchemaValidatieException schemaValidatieException) {
LOGGER.debug("SynchronisatieService aangeroepen met invalide xml", schemaValidatieException);
throw new Fault(schemaValidatieException.getCause());
}
BrpNu.set(DatumUtil.nuAlsZonedDateTime());
return AlgemeneFoutHandler
.doeBijFout(e1 -> {
LOGGER.error("Algemene fout", e1);
throw new WebServiceException("Er is iets fout gegaan bij het verwerken van het verzoek.");
}).voerUit(() -> maakResponse(request));
}
示例9: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public void handleMessage(Message message) throws Fault
{
final OutputStream os = message.getContent(OutputStream.class);
if (os == null)
{
return;
}
Logger logger = getMessageLogger(message);
if (logger.isLoggable(Level.INFO) || writer != null)
{
// Write the output while caching it for the log message
boolean hasLogged = message.containsKey(LOG_SETUP);
if (!hasLogged)
{
message.put(LOG_SETUP, Boolean.TRUE);
final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(
os);
message.setContent(OutputStream.class, newOut);
newOut.registerCallback(new LoggingCallback(logger, message, os));
}
}
}
示例10: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
public void handleMessage(Message message)
throws Fault
{
// 通知流量监控模块
IMonitor monitor = ApplicationContextUtil.getBean("southFCMonitor");
if (monitor != null)
{
monitor.reportStatus(1); // 增加一次SOAP调用
IPerformer performer = ApplicationContextUtil.getBean("southFCPerformer");
if (performer != null)
{
if (performer.doFilter(null))
{
monitor.reportStatus(-1); // 被流控消息不计入监控数据
SOAPException soapExc = new SOAPException("");
Fault fault = new Fault(soapExc);
fault.setFaultCode(new QName(Integer.toString(ESDKErrorCodeConstant.ERROR_CODE_SDK_SYSBUSY)));
throw fault;
}
}
}
}
示例11: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public void handleMessage(Message message) throws Fault {
// allows WADL requests for unauthenticated users
String messageQueryString = String.valueOf(message.get(Message.QUERY_STRING));
boolean isServiceRequest = "_wadl".equalsIgnoreCase(messageQueryString);
if (isServiceRequest) {
return;
}
LoggedInInfo info = getLoggedInInfo(message);
boolean isAuthenticated = info != null && (info.getLoggedInProvider() != null || info.getLoggedInSecurity() != null);
if (isAuthenticated) {
return;
}
logAccessError(message);
ResponseBuilder builder = Response.status(Status.UNAUTHORIZED);
builder.type(MediaType.TEXT_XML);
builder.entity("<error>Not authorized</error>");
message.getExchange().put(Response.class, builder.build());
}
示例12: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void handleMessage(Message message)
throws Fault
{
OperationInfo operation = message.get(MessageInfo.class).getOperation();
String inputName = operation.getInputName();
if("login".equals(inputName) || "getPublicKey".equals(inputName))
{
Map headers = (Map)message.get(Message.PROTOCOL_HEADERS);
List msgSession = (List)headers.get("Set-Cookie");
if(msgSession != null && !msgSession.isEmpty())
{
MsgSessionHolder.getInstance().setSession(msgSession);
}
}
}
示例13: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
public void handleMessage(Message message)
throws Fault
{
OperationInfo operation = message.get(MessageInfo.class).getOperation();
String inputName = operation.getInputName();
if (!"getPublicKey".equals(inputName))
{
List session = MsgSessionHolder.getInstance().getSession();
if (session != null && !session.isEmpty())
{
Map headers = (Map)message.get(Message.PROTOCOL_HEADERS);
headers.put("Cookie", session);
}
}
}
示例14: handleMessage
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void handleMessage(Message message)
throws Fault
{
// 对返回参数中的sessionId截取,通过拆分字符串的方式解析出IVS中的sessionId
Map<String, List> headers = (Map<String, List>)message.get(Message.PROTOCOL_HEADERS);
if (message.toString().contains("loginResponse") || message.toString().contains("setSecretKeyResponse"))
{
List<String> msgSession = headers.get("Set-Cookie");
if (null != msgSession && !msgSession.isEmpty())
{
// 发消息到SDK的情况,如果不是loginRequest接口,不赋值
MsgSessionHolder.getInstance().setSession(msgSession);
}
}
}
示例15: processReport
import org.apache.cxf.interceptor.Fault; //导入依赖的package包/类
@Override
public ObjectListType processReport(String query, RemoteReportParametersType parameters,
SelectorQualifiedGetOptionsType options) {
try {
Map<QName, Object> parametersMap = getParamsMap(parameters);
ObjectQuery q = reportService.parseQuery(query, parametersMap);
Collection<PrismObject<? extends ObjectType>> resultList = reportService.searchObjects(q,
MiscSchemaUtil.optionsTypeToOptions(options));
return createObjectListType(resultList);
} catch (SchemaException | ObjectNotFoundException | SecurityViolationException
| CommunicationException | ConfigurationException | ExpressionEvaluationException e) {
// TODO Auto-generated catch block
throw new Fault(e);
}
}