当前位置: 首页>>代码示例>>Java>>正文


Java Fault类代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:XMBomb,项目名称:InComb,代码行数:28,代码来源:DBConnectionResponseInterceptor.java

示例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()));
}
 
开发者ID:equella,项目名称:Equella,代码行数:21,代码来源:TokenHeaderOutInterceptor.java

示例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;
			}
		}
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:26,代码来源:TokenHeaderInInterceptor.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:VrijBerichtWebService.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:BevragingWebService.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:StufWebService.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:27,代码来源:OnderhoudAfnemerindicatiesWebServiceImpl.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:25,代码来源:SynchronisatieWebServiceImpl.java

示例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));
        }
    }
}
 
开发者ID:Huawei,项目名称:eSDK_EC_SDK_Java,代码行数:25,代码来源:UCLoggingOutInterceptor.java

示例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;
            }
        }
    }
}
 
开发者ID:Huawei,项目名称:eSDK_EC_SDK_Java,代码行数:23,代码来源:UCOBGOutInterceptor.java

示例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());
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:23,代码来源:AuthenticationInInterceptor.java

示例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);
        }
    }
}
 
开发者ID:Huawei,项目名称:eSDK_IVS_Java,代码行数:20,代码来源:MsgInInterceptor.java

示例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);
        }
    }
}
 
开发者ID:Huawei,项目名称:eSDK_IVS_Java,代码行数:20,代码来源:MsgOutInterceptor.java

示例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);
        }
    }
    
}
 
开发者ID:Huawei,项目名称:eSDK_IVS_Java,代码行数:18,代码来源:MsgInInterceptor.java

示例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);
	}

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:ReportWebService.java


注:本文中的org.apache.cxf.interceptor.Fault类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。