wt.clients.util
Class RMIMultiPartPost

java.lang.Object
  extended bywt.clients.util.RMIMultiPartPost
All Implemented Interfaces:
MultiPartPostIfc

public class RMIMultiPartPost
extends Object
implements MultiPartPostIfc


Field Summary
private static boolean DEBUG
           
private  FileUpload fup
           
private  int operationStatus
           
private  Vector postEntryV
           
private  String queryStr
           
private  int responseCode
           
private  String responseString
           
private  String serverClass
           
private  String serverPostMethod
           
private  MultiPartPostListener uploadListener
           
private  boolean uploadToCacheOnly
           
 
Fields inherited from interface wt.clients.util.MultiPartPostIfc
OPERATION_CANCEL, OPERATION_CANCEL_REQUEST, OPERATION_COMPLETE, OPERATION_FAILURE, OPERATION_INACTIVE, OPERATION_START
 
Constructor Summary
RMIMultiPartPost(URL url)
          Create a MultiPartPost object.
RMIMultiPartPost(URL url, boolean uploadToCacheOnly)
          Create a MultiPartPost object and set the uploadToCacheOnly flag.
 
Method Summary
 void cancelOperation()
           
private  void dumpPostEntries()
           
private  void fileCleanup(Vector fileUploads)
           
 FileUpload getFileUpload()
           
 int getOperationStatus()
           
 String getPostEntries()
           
 int getResponseCode()
           
 String getResponseString()
           
 Thread performOperation(boolean separateThread)
          Perform the multi part post operation.
private static void PP(String message)
           
 void setData(String contentName, String value)
          Record data to be posted.
 void setListener(MultiPartPostListener listener)
           
 void setPath(String contentName, String path)
          Record file to be posted.
 void setServerClass(String serverClass)
          Set the server class to receive this post data
 void setServerPostMethod(String serverPostMethod)
          Set the method to receive this post data.
private  void uploadToCacheServer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

fup

private FileUpload fup

queryStr

private String queryStr

postEntryV

private Vector postEntryV

serverClass

private String serverClass

serverPostMethod

private String serverPostMethod

uploadToCacheOnly

private boolean uploadToCacheOnly

operationStatus

private int operationStatus

responseCode

private int responseCode

responseString

private String responseString

uploadListener

private MultiPartPostListener uploadListener
Constructor Detail

RMIMultiPartPost

public RMIMultiPartPost(URL url,
                        boolean uploadToCacheOnly)
Create a MultiPartPost object and set the uploadToCacheOnly flag. If uploadToCacheOnly is true, then url can be null because it will not be used for upload/persistence If uploadToCacheOnly is false, then url must be provided

Parameters:
url - The url to post to. Takes the standard windchill url types and parses out the server class and method which the post will send its arguments to.
uploadToCacheOnly - Whether to upload to cache and return cache info, rather than completing the saveContent (if true), or whether to complete the saveContent without returning mid-stream cached content information (if false).

RMIMultiPartPost

public RMIMultiPartPost(URL url)
Create a MultiPartPost object. Takes the standard windchill url types and parses out the server class and method which the post will send its arguments to.

Parameters:
url - The url to post to.
Method Detail

setListener

public void setListener(MultiPartPostListener listener)

getFileUpload

public FileUpload getFileUpload()

setServerClass

public void setServerClass(String serverClass)
Set the server class to receive this post data

Parameters:
serverClass - the server class capable of receiving RMIMultiPartPost data

setServerPostMethod

public void setServerPostMethod(String serverPostMethod)
Set the method to receive this post data. Method must take an argument of java.util.Vector to be passed to the RMIMPInputStream constructor.

Parameters:
serverPostMethod - the method to receive post data from RMIMultiPartPost.

setData

public void setData(String contentName,
                    String value)
Record data to be posted.

Specified by:
setData in interface MultiPartPostIfc
Parameters:
contentName - the content name to be supplied in the post.

setPath

public void setPath(String contentName,
                    String path)
Record file to be posted.

Specified by:
setPath in interface MultiPartPostIfc
Parameters:
contentName - the content name to be supplied in the post.
path - the path to the file.

getOperationStatus

public int getOperationStatus()
Specified by:
getOperationStatus in interface MultiPartPostIfc

getResponseCode

public int getResponseCode()
Specified by:
getResponseCode in interface MultiPartPostIfc

getResponseString

public String getResponseString()
Specified by:
getResponseString in interface MultiPartPostIfc

cancelOperation

public void cancelOperation()
Specified by:
cancelOperation in interface MultiPartPostIfc

performOperation

public Thread performOperation(boolean separateThread)
Perform the multi part post operation. The name/value pairs are sent to the server. Files are sent as placeholders and are then upload via wt.client.UploadFile

Specified by:
performOperation in interface MultiPartPostIfc
Throws:
FileNotFoundException - thrown when file can't be found.
IOException - This is not an expected exception, indicates a critical error.

fileCleanup

private void fileCleanup(Vector fileUploads)

uploadToCacheServer

private void uploadToCacheServer()

dumpPostEntries

private void dumpPostEntries()

getPostEntries

public String getPostEntries()

PP

private static void PP(String message)