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


Java PhaseInterceptorChain类代码示例

本文整理汇总了Java中org.apache.cxf.phase.PhaseInterceptorChain的典型用法代码示例。如果您正苦于以下问题:Java PhaseInterceptorChain类的具体用法?Java PhaseInterceptorChain怎么用?Java PhaseInterceptorChain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PhaseInterceptorChain类属于org.apache.cxf.phase包,在下文中一共展示了PhaseInterceptorChain类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invoke

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Override
public DOMSource invoke(final DOMSource bericht) {
    LOGGER.debug("BijhoudingWebService aangeroepen");

    valideer(bericht);
    final BijhoudingVerzoekBericht verzoekBericht =
            berichtAuthenticatieInfoService.vulBerichtAanMetOinGegevensUitHttpHeader(PhaseInterceptorChain.getCurrentMessage(), parse(bericht));

    BijhoudingAntwoordBericht bijhoudingAntwoordBericht;
    try {
        bijhoudingAntwoordBericht = bijhoudingService.verwerkBrpBericht(verzoekBericht);
    } catch (Exception e) {
        LOGGER.error("Algemene fout bij verwerking van bijhoudingsbericht.", e);
        bijhoudingAntwoordBericht =
                bijhoudingAntwoordBerichtService.maakAntwoordBericht(
                    verzoekBericht,
                    Collections.singletonList(MeldingElement.getInstance(Regel.ALG0001, verzoekBericht.getAdministratieveHandeling())),
                    null,
                    null);
    }
    return transformeerNaarDOMSource(bijhoudingAntwoordBericht);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:23,代码来源:BijhoudingWebService.java

示例2: getLoggedInInfo

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
/**
 * Gets the login information associated with the current request.
 * 
 * @return
 * 		Returns the login information
 * 
 * @throws IllegalStateException
 * 		IllegalStateException is thrown in case authentication info is not available 
 */
protected LoggedInInfo getLoggedInInfo() {

	Message message = PhaseInterceptorChain.getCurrentMessage();
    HttpServletRequest request = (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST);
    
    LoggedInInfo info = LoggedInInfo.getLoggedInInfoFromSession(request);

       if (info != null && info.getLoggedInProvider() == null) {
           // It's possible in the OAuth situation that the session is empty, but we have a valid LoggedInInfo on the request.
           info = LoggedInInfo.getLoggedInInfoFromRequest(request);
       }

	if (info == null) {
           throw new IllegalStateException("Authentication info is not available.");
	}
	return info;
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:27,代码来源:AbstractServiceImpl.java

示例3: deleteToolById

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@GET
@Path("/deleteToolById/{toolId}")
@Transactional
@Override
public void deleteToolById(@PathParam(value = "toolId") Long toolId) {
	HttpServletRequest request;
	if (getMessageContext() != null) {
		request = (HttpServletRequest) getMessageContext().getHttpServletRequest();
	} else {
		request = (HttpServletRequest) PhaseInterceptorChain.getCurrentMessage().get("HTTP.REQUEST");
	}
	if (null == request || null == request.getSession()) {
		LOG.error("request==null, quit!");
	} else {
		HttpSession session = request.getSession();
		User user = (User) session.getAttribute(AuthenticationConstants.KME_USER_KEY);
		if (user.isMember("KME-ADMINISTRATORS")) {
			getAdminDao().deleteToolById(toolId);
		}
	}
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:22,代码来源:ToolServiceImpl.java

示例4: saveHomeScreen

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Transactional
@Override
public Long saveHomeScreen(HomeScreen homeScreen) {
	HttpServletRequest request = null;
	if (getMessageContext() != null) {
		request = (HttpServletRequest) getMessageContext()
				.getHttpServletRequest();
	} else {
		if (PhaseInterceptorChain.getCurrentMessage() != null) {
			request = (HttpServletRequest) PhaseInterceptorChain
					.getCurrentMessage().get("HTTP.REQUEST");
		}
	}
	if (null == request || null == request.getSession()) {
		LOG.error("request==null, quit!");
		return getAdminDao().saveHomeScreen(homeScreen);
	} else {
		HttpSession session = request.getSession();
		User user = (User) session.getAttribute(AuthenticationConstants.KME_USER_KEY);
		if (user.isMember("KME-ADMINISTRATORS")) {
			return getAdminDao().saveHomeScreen(homeScreen);
		}
	}
	// temporary setting -1 id if user is not authenticated
	return null;
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:27,代码来源:AdminServiceImpl.java

示例5: deleteHomeScreenById

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Transactional
@Override
public void deleteHomeScreenById(long homeScreenId) {
	HttpServletRequest request;
	if (getMessageContext() != null) {
		request = (HttpServletRequest) getMessageContext().getHttpServletRequest();
	} else {
		request = (HttpServletRequest) PhaseInterceptorChain.getCurrentMessage().get("HTTP.REQUEST");
	}
	if (null == request || null == request.getSession()) {
		LOG.error("request==null, quit!");
	} else {
		HttpSession session = request.getSession();
		User user = (User) session
				.getAttribute(AuthenticationConstants.KME_USER_KEY);
		if (user.isMember("KME-ADMINISTRATORS")) {
			getAdminDao().deleteHomeScreenById(homeScreenId);
		}
	}
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:21,代码来源:AdminServiceImpl.java

示例6: saveTool

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Transactional
@Override
public Long saveTool(Tool tool) {
	HttpServletRequest request = null;
	if (getMessageContext() != null) {
		request = (HttpServletRequest) getMessageContext()
				.getHttpServletRequest();
	} else if (PhaseInterceptorChain.getCurrentMessage() != null) {
		request = (HttpServletRequest) PhaseInterceptorChain
				.getCurrentMessage().get("HTTP.REQUEST");
	}
	if (null == request || null == request.getSession()) {
		LOG.error("request==null, quit!");
		return getAdminDao().saveTool(tool);
	} else {
		HttpSession session = request.getSession();
		User user = (User) session
				.getAttribute(AuthenticationConstants.KME_USER_KEY);
		if (user.isMember("KME-ADMINISTRATORS")) {
			return getAdminDao().saveTool(tool);
		}
	}
	return null;
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:25,代码来源:AdminServiceImpl.java

示例7: deleteToolById

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Transactional
@Override
public void deleteToolById(long toolId) {
	HttpServletRequest request;
	if (getMessageContext() != null) {
		request = (HttpServletRequest) getMessageContext()
				.getHttpServletRequest();
	} else {
		request = (HttpServletRequest) PhaseInterceptorChain
				.getCurrentMessage().get("HTTP.REQUEST");
	}
	if (null == request || null == request.getSession()) {
		LOG.error("request==null, quit!");
	} else {
		HttpSession session = request.getSession();
		User user = (User) session
				.getAttribute(AuthenticationConstants.KME_USER_KEY);
		if (user.isMember("KME-ADMINISTRATORS")) {
			getAdminDao().deleteToolById(toolId);
		}
	}
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:23,代码来源:AdminServiceImpl.java

示例8: authenticate

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Override
@POST
@Path("/login")
public AuthResponse authenticate(@FormParam("loginName") String loginName,
								 @FormParam("password") String password) {
	AuthResponse response = getDao().authenticate(loginName, password);

	if (response.didAuthenticate()) {
		HttpServletRequest request;
		if (getMessageContext() != null) {
			request = (HttpServletRequest) getMessageContext().getHttpServletRequest();
		} else {
			request = (HttpServletRequest) PhaseInterceptorChain.getCurrentMessage().get("HTTP.REQUEST");
		}
		HttpSession session = request.getSession();
		session.setAttribute(AuthenticationConstants.KME_USER_KEY, response.getUser());
	}

	response.setUser(null);

	return response;
}
 
开发者ID:tamerman,项目名称:mobile-starting-framework,代码行数:23,代码来源:AuthServiceImpl.java

示例9: setupInterceptorChain

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
protected InterceptorChain setupInterceptorChain(Exchange exchange) {
    if (outgoingInterceptorChain != null) {
        return outgoingInterceptorChain;
    }

    Endpoint endpoint = getEndpoint(exchange);

    PhaseManager pm = bus.getExtension(PhaseManager.class);
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i1 = bus.getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i2 = endpoint.getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i3 = getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i4 = endpoint.getBinding().getOutInterceptors();

    PhaseInterceptorChain phaseInterceptorChain = outboundChainCache.get(pm
            .getOutPhases(), i1, i2, i3, i4);
    return phaseInterceptorChain;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:22,代码来源:ProtobufClient.java

示例10: handleAspect

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
/**
 * Run the handle the authorization.
 *
 * @param joinPoint
 * @param role
 * @return
 * @throws Throwable
 */
private Object handleAspect(ProceedingJoinPoint joinPoint, String role) throws Throwable {
  Object result = null;
  HttpServletRequest request = (HttpServletRequest) PhaseInterceptorChain.getCurrentMessage().get("HTTP.REQUEST");
  String uid = request.getRemoteUser();

  LOG.debug("Running Authorizor.checkRole for uid=" + uid + ", role=" + role);

  if (authorizor == null || authorizor.checkRole(uid, role)) {
    LOG.info("Authorizor.checkRole for uid=" + uid + ", role=" + role + ": OK");
    result = joinPoint.proceed();
  } else {
    LOG.info("Authorizor.checkRole for uid=" + uid + ", role=" + role + ": DENIED");
    HttpServletResponse response = (HttpServletResponse) PhaseInterceptorChain.getCurrentMessage().get("HTTP.RESPONSE");

    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "You do not have the the required role '" + role + "'");

    PhaseInterceptorChain.getCurrentMessage().getInterceptorChain().abort();
  }

  return result;
}
 
开发者ID:stockholmuniversity,项目名称:cxf-server,代码行数:30,代码来源:AuthorizorAspect.java

示例11: get

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Override
public Optional<String> get() {
    final Message message = PhaseInterceptorChain.getCurrentMessage();
    final Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>) message.get(Message.PROTOCOL_HEADERS));
    return headers
            .getOrDefault(StringUtils.leftPad(HEADER.PARTIJ_CODE.getNaam(), PARTIJ_CODE_LENGTE, '0'), Collections.emptyList())
            .stream()
            .findFirst();
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:10,代码来源:PartijCodeResolverImpl.java

示例12: get

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
@Override
public OIN get() {
    final Message message = PhaseInterceptorChain.getCurrentMessage();
    final HttpServletRequest httpRequest = (HttpServletRequest) message.get(AbstractHTTPDestination.HTTP_REQUEST);
    final String oinWaardeOndertekenaar = httpRequest.getHeader(OIN.OIN_ONDERTEKENAAR);
    final String oinWaardeTransporteur = httpRequest.getHeader(OIN.OIN_TRANSPORTEUR);
    return new OIN(oinWaardeOndertekenaar, oinWaardeTransporteur);
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:9,代码来源:OinResolverImpl.java

示例13: logAccess

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
private void logAccess(String action) {
	OscarLog log = new OscarLog();
	log.setAction(action);
	log.setProviderNo("N/A");
	
	Message currentMessage = PhaseInterceptorChain.getCurrentMessage();
	
	HttpServletRequest request = (HttpServletRequest) currentMessage.get("HTTP.REQUEST");

	log.setIp(request.getRemoteAddr());
	log.setContent(request.getRequestURL().toString());
	log.setData(request.getParameterMap().toString());

	LogAction.addLogSynchronous(log);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:16,代码来源:WebServiceLoggingAdvice.java

示例14: data

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
public ResponseBody data(String source, String interfaceName, String parameter) {
    Message message = PhaseInterceptorChain.getCurrentMessage();  
    HttpServletRequest request = (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST);
    String ip = RequestInfoHelper.getRemoteIp(request);
    System.out.println("requstId:"+request.getAttribute(FrameConst.CLIENT_REQ_ID));
    System.out.println("ip:"+ip);
    ResponseBody res = new ResponseBody();
    // 获取对应服务
    InvocationDefine define = serviceFactoryManager.getInvocationDefine(interfaceName);
    if (define == null) {
        res.setCode(RtCodeConst.ERR_CODE);
        res.setMessage("未找到服务");
        logger.warn("未找到服务...");
        return res;
    }
    // 接口参数验证
    Map<String, String> sourceMap = JSONUtils.jsonString2Map(source);
    if (sourceMap == null || sourceMap.get(FrameConst.CLIENT_FROM) == null) {
        res.setCode(RtCodeConst.ERR_CODE);
        res.setMessage("接口参数非法");
        logger.warn("接口参数非法...");
        return res;
    }
    sourceMap.put(FrameConst.CLIENT_IP, ip);
    // 调用服务
    ServiceContext serviceContext = new ServiceContext(sourceMap, interfaceName, parameter);
    DataServiceProxy serviceProxy = new DataServiceProxy(define, serviceContext);
    Object result = serviceProxy.execute();

    res.setCode(RtCodeConst.SUCC_CODE);
    res.setData(result);
    return res;
}
 
开发者ID:javen-hao,项目名称:osmp,代码行数:34,代码来源:SoapPlatformTransport.java

示例15: getAll

import org.apache.cxf.phase.PhaseInterceptorChain; //导入依赖的package包/类
/**
 * @see org.kuali.rice.ksb.messaging.remotedservices.BaseballCardCollectionService#getAll()
 */
public List<BaseballCard> getAll() {
    // excuse me while we exploit this service to test service call version headers
    // annotations on impl not supported by RESTServiceExporter/RestServiceDefinition
    ServiceCallInformationHolder.multiValues = (Map<String, List<String>>)PhaseInterceptorChain.getCurrentMessage().get(Message.PROTOCOL_HEADERS);
    return new ArrayList<BaseballCard>(cards.values());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:BaseballCardCollectionServiceImpl.java


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