protected PasswordAuthentication getPasswordAuthentication() { PasswordAuthentication auth = null; Message m = PhaseInterceptorChain.getCurrentMessage(); if (m != null) { Exchange exchange = m.getExchange();
@Override protected void updateMessageForSuspend() { Message currentMessage = PhaseInterceptorChain.getCurrentMessage(); if (currentMessage.get(WriteListener.class) != null) { // CXF Continuation WriteListener will likely need to be introduced // for NIO supported with non-Servlet specific mechanisms getOutputStream().setWriteListener(currentMessage.get(WriteListener.class)); currentMessage.getInterceptorChain().suspend(); } else { inMessage.getExchange().getInMessage().getInterceptorChain().suspend(); } }
org.apache.cxf.message.Message message = PhaseInterceptorChain.getCurrentMessage(); if (message != null) { includeLocationOnly = MessageUtils
protected <X> X getStreamHandlerFromCurrentMessage(Class<X> staxCls) { Message m = PhaseInterceptorChain.getCurrentMessage(); if (m != null) { return staxCls.cast(m.getContent(staxCls)); } return null; }
private static int getDeflateLevel() { Integer level = null; Message m = PhaseInterceptorChain.getCurrentMessage(); if (m != null) { level = PropertyUtils.getInteger(m, "deflate.level"); } if (level == null) { level = Deflater.DEFLATED; } return level; }
protected void persistParamsOnMessage(MultivaluedMap<String, String> params) { Message message = PhaseInterceptorChain.getCurrentMessage(); if (message != null) { message.put(FormUtils.FORM_PARAM_MAP, params); } }
public static Properties loadSignatureOutProperties(boolean required) { Message m = PhaseInterceptorChain.getCurrentMessage(); return KeyManagementUtils.loadStoreProperties(m, required, JoseConstants.RSSEC_SIGNATURE_OUT_PROPS, JoseConstants.RSSEC_SIGNATURE_PROPS); } public static Properties loadSignatureInProperties(boolean required) {
public static Properties loadSignatureProperties(String propertiesName, boolean required) { Message m = PhaseInterceptorChain.getCurrentMessage(); return KeyManagementUtils.loadStoreProperties(m, required, propertiesName, null); } public static Properties loadSignatureProperties(String propertiesLoc, Bus bus) {
private static int getDeflateLevel() { Integer level = null; Message m = PhaseInterceptorChain.getCurrentMessage(); if (m != null) { level = PropertyUtils.getInteger(m, "deflate.level"); } if (level == null) { level = Deflater.DEFLATED; } return level; } }
public static JwsSignatureVerifier loadSignatureVerifier(Properties props, JwsHeaders inHeaders) { return loadSignatureVerifier(PhaseInterceptorChain.getCurrentMessage(), props, inHeaders); } public static JwsSignatureVerifier loadSignatureVerifier(Message m,
public static Properties loadEncryptionOutProperties(boolean required) { Message m = PhaseInterceptorChain.getCurrentMessage(); String keyEncryptionAlgorithm = (String)m.getContextualProperty(JoseConstants.RSSEC_ENCRYPTION_KEY_ALGORITHM); if (keyEncryptionAlgorithm != null && AlgorithmUtils.PBES_HS_SET.contains(keyEncryptionAlgorithm)) { // We don't need to load the keystore properties for the PBES case required = false; } return KeyManagementUtils.loadStoreProperties(m, required, JoseConstants.RSSEC_ENCRYPTION_OUT_PROPS, JoseConstants.RSSEC_ENCRYPTION_PROPS); }
public static void validateCertificateChain(Properties storeProperties, List<X509Certificate> inCerts) { Message message = PhaseInterceptorChain.getCurrentMessage(); KeyStore ks = loadPersistKeyStore(message, storeProperties); validateCertificateChain(ks, inCerts); } public static void validateCertificateChain(KeyStore ks, List<X509Certificate> inCerts) {
public static void setJoseContextProperty(JoseHeaders headers) { Message message = PhaseInterceptorChain.getCurrentMessage(); String context = (String)message.get(JoseConstants.JOSE_CONTEXT_PROPERTY); if (context != null) { headers.setHeader(JoseConstants.JOSE_CONTEXT_PROPERTY, context); } } public static void setJoseMessageContextProperty(JoseHeaders headers, String value) {
public static void setJoseMessageContextProperty(JoseHeaders headers, String value) { headers.setHeader(JoseConstants.JOSE_CONTEXT_PROPERTY, value); Message message = PhaseInterceptorChain.getCurrentMessage(); message.put(JoseConstants.JOSE_CONTEXT_PROPERTY, value); } public static void setMessageContextProperty(JoseHeaders headers) {
public static void traceHeaders(JoseHeaders headers) { Message m = PhaseInterceptorChain.getCurrentMessage(); if (MessageUtils.getContextualBoolean(m, JoseConstants.JOSE_DEBUG, false)) { JsonMapObjectReaderWriter writer = new JsonMapObjectReaderWriter(true); String thePrefix = headers instanceof JwsHeaders ? "JWS" : headers instanceof JweHeaders ? "JWE" : "JOSE"; LOG.info(thePrefix + " Headers: \r\n" + writer.toJson(headers)); } } //
@GET @Path("propagate-exception2") public Book propogateException2() throws BookNotFoundFault { PhaseInterceptorChain.getCurrentMessage().put("org.apache.cxf.propagate.exception", Boolean.FALSE); throw new BookNotFoundFault("Book Exception"); }
@POST @Path("/oneway") @Oneway public void onewayRequest() { if (!PhaseInterceptorChain.getCurrentMessage().getExchange().isOneWay()) { throw new WebApplicationException(); } }
private void updateOutputAction(String append) { AddressingProperties p = ContextUtils.retrieveMAPs(PhaseInterceptorChain.getCurrentMessage(), false, false); AddressingProperties pout = new AddressingProperties(); AttributedURIType action = new AttributedURIType(); action.setValue(p.getAction().getValue() + append); pout.exposeAs(p.getNamespaceURI()); pout.setAction(action); ContextUtils.storeMAPs(pout, PhaseInterceptorChain.getCurrentMessage(), true); }
@Override public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { handleMessage(PhaseInterceptorChain.getCurrentMessage()); context.setMediaType(MediaType.APPLICATION_JSON_TYPE); context.proceed(); context.setMediaType(JAXRSUtils.toMediaType(getMediaType())); } }
public static Map<String, String> getSchemaLocations(Server server) { Message message = PhaseInterceptorChain.getCurrentMessage(); String base = (String)message.get(Message.REQUEST_URL); String ctxUri = (String)message.get(Message.PATH_INFO); WSDLGetUtils utils = new WSDLGetUtils(); EndpointInfo info = server.getEndpoint().getEndpointInfo(); return utils.getSchemaLocations(message, base, ctxUri, info); }