wt.wrmf.transport.httptransport
Class HTTPPipeAdapter

java.lang.Object
  extended bywt.wrmf.transport.httptransport.HTTPPipeAdapter
All Implemented Interfaces:
Externalizable, Pipe, Serializable
Direct Known Subclasses:
GZIPHTTPPipe, HTTPPipe

public abstract class HTTPPipeAdapter
extends Object
implements Pipe, Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
protected static boolean RECONN_SUPPORTED
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private) static SSLSocketFactory socketFact
           
protected static boolean VERBOSE
           
private static String versionID
           
 
Constructor Summary
HTTPPipeAdapter()
           
 
Method Summary
private static long findDownloadedBytes(HTTPRequest request)
           
private static Enumeration findPullMethod(HTTPRequest request)
           
 void initialize()
          

Supported API: false
protected static String modifyUrlIfNecessary(String url, MethodInvocationDesc pipeDesc, boolean gzip, boolean reconn)
          Modify the "url" if necessary.
protected static void performPullInGeneral(HTTPRequest request, HTTPResponse response, boolean useGZIP, boolean useResumption)
           
protected static void performPushInGeneral(HTTPRequest request, HTTPResponse response, boolean fromISZipped, boolean gzipResultStream, boolean useResumption)
           
protected static void performPushInGeneral(HTTPRequest request, HTTPResponse response, InputStream is, boolean fromISZipped, boolean gzipResultStream, boolean useResumption)
           
protected static String preparePipeConnection(String fullUrl, String wrappedMethod, SiteAddress to)
          This method will be called at the "client/local" side.
protected static boolean preparePipeExecution(HTTPRequest request)
          This method will be called at the remote/serverl" side.
protected static InputStream pullInGeneral(String pullMethod, String fullUrl, SiteAddress to, String pipeMethod, boolean useGZIP, boolean useResumption)
           
protected static InputStream pushInGeneral(InputStream is, long length, SiteAddress to, String pipeMethod, boolean gzip, boolean reconn, boolean byWrmf)
          Note: "gzip" means to gzip con.getInputStream() or not (see code below) and "reconn" means to handle interruption (reconenct, resumption) automatically if set to true
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(HTTPPipeAdapter thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected static boolean setRemotePrincipal(HTTPRequest request)
          If the remote site is a Product Replication Peer, the corresponding WTPrincipal will be set; otherwise it will not.
protected static void setSSLSocketFactoryOnDemand(URLConnection con)
          This method was changed in 7.0_M010 to accomodate JDKs created by other vendors than sun.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wt.wrmf.transport.Pipe
pull, push
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

versionID

private static final String versionID
See Also:
Constant Field Values

VERBOSE

protected static boolean VERBOSE

RECONN_SUPPORTED

protected static boolean RECONN_SUPPORTED

socketFact

static SSLSocketFactory socketFact
Constructor Detail

HTTPPipeAdapter

public HTTPPipeAdapter()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(HTTPPipeAdapter thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

setRemotePrincipal

protected static boolean setRemotePrincipal(HTTPRequest request)
If the remote site is a Product Replication Peer, the corresponding WTPrincipal will be set; otherwise it will not. Return true if successfully set; return false if exceptions catched.

Supported API: false

Parameters:
request -
Returns:
boolean

preparePipeExecution

protected static boolean preparePipeExecution(HTTPRequest request)
This method will be called at the remote/serverl" side. It will verify authentication and set remote principal (if applicable)

Supported API: false

Parameters:
request -
Returns:
boolean

preparePipeConnection

protected static String preparePipeConnection(String fullUrl,
                                              String wrappedMethod,
                                              SiteAddress to)
                                       throws WTTransportException
This method will be called at the "client/local" side.

Supported API: false

Parameters:
fullUrl -
wrappedMethod -
to -
Returns:
String
Throws:
WTTransportException

modifyUrlIfNecessary

protected static String modifyUrlIfNecessary(String url,
                                             MethodInvocationDesc pipeDesc,
                                             boolean gzip,
                                             boolean reconn)
Modify the "url" if necessary. Note: If pipeDescis null, that is, the Http request will be handled by Windchill, then the configuration information (such as use GZIP, Reconnection/Resumption supported or not) is set to null because this information is already "included" in the pipe method; otherwise we need to pass the config info: gzip and reconnection supported, to the remote site where Windchill is not supported.

Supported API: false

Parameters:
url -
pipeDesc -
gzip -
reconn -
Returns:
String

findPullMethod

private static Enumeration findPullMethod(HTTPRequest request)

findDownloadedBytes

private static long findDownloadedBytes(HTTPRequest request)

initialize

public void initialize()
Description copied from interface: Pipe


Supported API: false

Specified by:
initialize in interface Pipe

pushInGeneral

protected static InputStream pushInGeneral(InputStream is,
                                           long length,
                                           SiteAddress to,
                                           String pipeMethod,
                                           boolean gzip,
                                           boolean reconn,
                                           boolean byWrmf)
                                    throws IOException,
                                           WTTransportException
Note: "gzip" means to gzip con.getInputStream() or not (see code below) and "reconn" means to handle interruption (reconenct, resumption) automatically if set to true

Throws:
IOException
WTTransportException

performPushInGeneral

protected static void performPushInGeneral(HTTPRequest request,
                                           HTTPResponse response,
                                           InputStream is,
                                           boolean fromISZipped,
                                           boolean gzipResultStream,
                                           boolean useResumption)
                                    throws IOException
Throws:
IOException

performPushInGeneral

protected static void performPushInGeneral(HTTPRequest request,
                                           HTTPResponse response,
                                           boolean fromISZipped,
                                           boolean gzipResultStream,
                                           boolean useResumption)
                                    throws IOException
Throws:
IOException

pullInGeneral

protected static InputStream pullInGeneral(String pullMethod,
                                           String fullUrl,
                                           SiteAddress to,
                                           String pipeMethod,
                                           boolean useGZIP,
                                           boolean useResumption)
                                    throws IOException,
                                           WTTransportException
Throws:
IOException
WTTransportException

performPullInGeneral

protected static void performPullInGeneral(HTTPRequest request,
                                           HTTPResponse response,
                                           boolean useGZIP,
                                           boolean useResumption)
                                    throws ClassNotFoundException,
                                           NoSuchMethodException,
                                           InvocationTargetException,
                                           IOException,
                                           IllegalAccessException
Throws:
ClassNotFoundException
NoSuchMethodException
InvocationTargetException
IOException
IllegalAccessException

setSSLSocketFactoryOnDemand

protected static void setSSLSocketFactoryOnDemand(URLConnection con)
                                           throws IOException
This method was changed in 7.0_M010 to accomodate JDKs created by other vendors than sun. There may be a need to do another rework of the code to accomodate variety of vendors.

Throws:
IOException