示例#1
0
 public void snapshotFree(Snapshot snapshot) throws CommunicationException {
   try {
     String xmlSnapshot = snapshotSerializer.serializeSnapshot(snapshot);
     this.jniSnapshotFree(xmlSnapshot);
     this.checkConnection();
   } catch (TransformationException e) {
     throw new CommunicationException("Could not free snapshot.");
   }
 }
示例#2
0
  public Sample snapshotTake(Snapshot snapshot)
      throws CommunicationException, DataTypeUnsupportedException {
    Sample s = null;
    this.checkConnection();

    try {
      String xmlSnapshot = snapshotSerializer.serializeSnapshot(snapshot);
      String xmlSample = this.jniSnapshotTake(xmlSnapshot);
      this.checkConnection();
      s = untypedSampleDeserializer.deserializeSample(xmlSample, snapshot.getUserDataType());
    } catch (TransformationException e) {
      throw new CommunicationException("Could not take from snapshot.");
    } catch (CMException ce) {
      throw new CommunicationException(ce.getMessage());
    }
    return s;
  }