InputStreamSource_3 InterfaceFcsClient users must implement the InputStreamSource_3 interface. This interface follows an "Iterator" pattern by accessing files from a list one at a time. The FcsClient calls next() to indicate that the next file is being operated on, and then calls reset() to move the current file pointer to the beginning of the list. The InputStreamSource_3 interface is an enhanced version of the InputStreamSource_2 interface. InputStreamSource_2 Interface: package com.matrixone.client.fcs; import java.io.IOException; import java.io.InputStream; public interface InputStreamSource_2 { /** * get the next item to be processed */ public InputStream getInputStream() throws IOException; /** get the next file name to be processed */ public String getFileName(); public boolean hasNext(); public hasNext(); public String getFormat(); /** * @return */ public long getFileSize(); public void next(); public void reset(); } InputStreamSource_3 includes an extra method called getCorelationID(), which adds a fourth option to the list of ways you can pair items in the Business Object Proxy (BOP) list and the actual files, using the correlation ID as the key.
InputStreamSource_3 Interface: package com.matrixone.client.fcs; import java.io.IOException; import java.io.InputStream; public interface InputStreamSource_3 extends InputStreamSource_2 { public String getCorelationID(); } The InputStreamSource_3 interface is easier to use than the InputStreamSource_2 interface. The latter is still available, but is not recommended. The original InputStreamSource interface is no longer available and should not be used. Getting and Setting the Correlation IDYou should implement InputStreamSource_3 such that the getCorelationID() method returns the corresponding ID as the BOP. public interface InputStreamSource_3 extends InputStreamSource_2 { public String getCorelation ID(); } You should invoke bproxy.setCorelationID(corelationId) for each BOP on the list. public class BusinessObjectProxy implements Cloneable, Serializable { public void setCorelationID(String corelationId) { _corelationId = corelationId; } For convenience, a unique ID generation method has been added to the FcsClient. Applications can use this method to generate a unique correlation ID. public class FcsClient { public static String generateCorelationId() { return System.currentTimeMillis() + rand.nextInt() + ""; } Debugging with the Correlation IDFor debugging purposes, FcsSubmit accepts a -correlateWithId argument, which causes the checkin to be run in correlationID mode. For example: String fcsargs[] = {"-user", "tester1", "-password", "", "-type", "FCSTstType1", "-name", "TSTBO", "-rev", "A", "-url", _fcsurl, "-policy", "FCSTstPolicy1", "-vault", "eService Production", "-format", "FCSTstFormat1", "-store", "TESTSTORE", "-count", ""+_COUNT, "-donotexit", "-correlateWithId"}; FcsSubmit.main(fcsargs); Uncompressing the Data StreamBy default, the FcsClient receives a compressed data stream when checking out more than one file. The compressed data stream conserves network bandwidth but negatively impacts the transfer rate between the FCS and FcsClient. When you check out without compression, the transfer rate between the FCS and FcsClient improves and FCS CPU consumption is minimized. You can choose to check out with compression when you need to conserve bandwidth, or without compression when bandwidth is available. You can uncompress the data stream in either of two ways:
|