cesium writer: how to draw a satellite orbit

hey there.
I`m trying to draw a satellite orbit with cesium and cesium writer. I have my own orbital propagator that gives me time tagged points, but I'm having some trouble generating the czml code with cesium writers.

First thing is: the epoch property of the position element, how do I set it?
In the path section, from what I have understood from samples, I have to use lead time and trail time to show a single orbit, but I can`t quite understand how. Are those parameters compulsory?

Is there any samples that can help me doing that? I`m using java.

Thank you for your help.

PositionCesiumWriter positionCesiumWriter = packet.openPositionProperty();
positionCesiumWriter.writeInterpolationAlgorithm(CesiumInterpolationAlgorithm.LAGRANGE);
positionCesiumWriter.writeInterpolationDegree(1);
//start epoch------------------------------------------------------------------------------------------------------------------------------
JulianDate startDate = new GregorianDate(2012, 4, 2, 12, 0, 0D).toJulianDate();
PositionCesiumWriter interval = positionCesiumWriter.openInterval();
ArrayList dates = new ArrayList();
ArrayList positions = new ArrayList();
dates.add(startDate);
positions.add(new Cartographic(1.0, 2.0, 3.0));
dates.add(startDate.addSeconds(60.0));
positions.add(new Cartographic(4.0, 5.0, 6.0));
dates.add(startDate.addSeconds(120.0));
positions.add(new Cartographic(7.0, 8.0, 9.0));
interval.writeCartographicRadians(dates, positions, 1, 1);
//end epoch
positionCesiumWriter.close();

I use JavaScript to develop satellite orbit display, which is displayed in the browser. This is my realization idea:

First, we need to obtain the orbital data, that is the satellite TLE data. I use the satellite JS library to analyze the data, so that we can get the space coordinate information corresponding to each time. Note that the inertial coordinate system is required here; Next, convert the track data into the format required by cesium, which is called SampledPositionProperty in cesium. Finally, call the cesium api to draw the track data.