Class TCPConnectionImpl
- java.lang.Object
-
- com.sun.xml.ws.transport.tcp.server.TCPConnectionImpl
-
- All Implemented Interfaces:
WebServiceContextDelegate
public class TCPConnectionImpl extends Object implements WebServiceContextDelegate
- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Constructor Description TCPConnectionImpl(ChannelContext channelContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()ChannelContextgetChannelContext()StringgetContentType()StringgetEPRAddress(Packet request, WSEndpoint endpoint)Gets the address of the endpoint.intgetStatus()PrincipalgetUserPrincipal(Packet request)ImplementsWebServiceContext.getUserPrincipal()for the given packet.StringgetWSDLAddress(Packet request, WSEndpoint endpoint)Gets the address of the primary WSDL.booleanisUserInRole(Packet request, String role)ImplementsWebServiceContext.isUserInRole(String)for the given packet.InputStreamopenInput()OutputStreamopenOutput()voidsendErrorMessage(WSTCPError message)voidsetContentType(String contentType)voidsetStatus(int statusCode)
-
-
-
Constructor Detail
-
TCPConnectionImpl
public TCPConnectionImpl(ChannelContext channelContext)
-
-
Method Detail
-
openInput
public InputStream openInput() throws IOException, WSTCPException
- Throws:
IOExceptionWSTCPException
-
openOutput
public OutputStream openOutput() throws IOException, WSTCPException
- Throws:
IOExceptionWSTCPException
-
getStatus
public int getStatus()
-
setStatus
public void setStatus(int statusCode)
-
getContentType
public String getContentType()
-
setContentType
public void setContentType(String contentType)
-
flush
public void flush() throws IOException, WSTCPException- Throws:
IOExceptionWSTCPException
-
close
public void close()
-
getUserPrincipal
public Principal getUserPrincipal(Packet request)
Description copied from interface:WebServiceContextDelegateImplementsWebServiceContext.getUserPrincipal()for the given packet.- Specified by:
getUserPrincipalin interfaceWebServiceContextDelegate- Parameters:
request- Always non-null. See class javadoc.- See Also:
WebServiceContext.getUserPrincipal()
-
isUserInRole
public boolean isUserInRole(Packet request, String role)
Description copied from interface:WebServiceContextDelegateImplementsWebServiceContext.isUserInRole(String)for the given packet.- Specified by:
isUserInRolein interfaceWebServiceContextDelegate- Parameters:
request- Always non-null. See class javadoc.- See Also:
WebServiceContext.isUserInRole(String)
-
getEPRAddress
@NotNull public String getEPRAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint)
Description copied from interface:WebServiceContextDelegateGets the address of the endpoint.The "address" of endpoints is always affected by a particular client being served, hence it's up to transport to provide this information.
- Specified by:
getEPRAddressin interfaceWebServiceContextDelegate- Parameters:
request- Always non-null. See class javadoc.endpoint- The endpoint whose address will be returned.- Returns:
- Absolute URL of the endpoint. This shold be an address that the client can use to talk back to this same service later.
- See Also:
WebServiceContext.getEndpointReference(org.w3c.dom.Element...)
-
getWSDLAddress
public String getWSDLAddress(@NotNull Packet request, @NotNull WSEndpoint endpoint)
Description copied from interface:WebServiceContextDelegateGets the address of the primary WSDL.If a transport supports publishing of WSDL by itself (instead/in addition to MEX), then it should implement this method so that the rest of the JAX-WS RI can use that information. For example, HTTP transports often use the convention
getEPRAddress()+"?wsdl"for publishing WSDL on HTTP.Some transports may not have such WSDL publishing mechanism on its own. Those transports may choose to return null, indicating that WSDL is not published. If such transports are always used in conjunction with other transports that support WSDL publishing (such as SOAP/TCP used with Servlet transport), then such transport may choose to find the corresponding servlet endpoint by
Module.getBoundEndpoints()and try to obtain the address from there.This information is used to put a metadata reference inside an EPR, among other things. Clients that do not support MEX rely on this WSDL URL to retrieve metadata, it is desirable for transports to support this, but not mandatory.
This method will be never invoked if the
WSEndpointdoes not have a corresponding WSDL to begin with (IOWreturning null.- Specified by:
getWSDLAddressin interfaceWebServiceContextDelegate- Parameters:
request- Always non-null. See class javadoc.endpoint- The endpoint whose address will be returned.- Returns:
- null if the implementation does not support the notion of WSDL publishing.
-
sendErrorMessage
public void sendErrorMessage(WSTCPError message) throws IOException, WSTCPException
- Throws:
IOExceptionWSTCPException
-
getChannelContext
public ChannelContext getChannelContext()
-
-