Beispiel #1
0
  @SuppressWarnings("unchecked")
  public synchronized void processDatagrammPacket(DatagramPacket aRecievedDatagrammPacket) {

    Object vUnkownObject = null;

    if (mExpectedPacket != null) {

      vUnkownObject =
          Helpers.unmarshallXMLString(
              new String(
                  aRecievedDatagrammPacket.getData(), 0, aRecievedDatagrammPacket.getLength()),
              mExpectedPacket);
    }

    if (vUnkownObject != null) {

      if (vUnkownObject instanceof ConnectionEstablished
          && mExpectedPacket == ConnectionEstablished.class) {

        process((ConnectionEstablished) vUnkownObject);

      } else {

        mValidityCounter++;
      }

    } else {

      mValidityCounter++;
    }

    checkValidity();
  }
  public static ConnectionEstablished unmarshallXMLConnectionEstablishedString(
      String aXMLConnectionEstablishedPackage) {

    return Helpers.unmarshallXMLString(
        aXMLConnectionEstablishedPackage, ConnectionEstablished.class);
  }
  public String toXMLString() {

    return Helpers.marshallXMLString(this, ConnectionEstablished.class);
  }
  public static ConnectionAcknowlege unmarshallXMLConnectionAcknowlegeString(
      String aXMLConnectionAcknowlegePackage) {

    return Helpers.unmarshallXMLString(aXMLConnectionAcknowlegePackage, ConnectionAcknowlege.class);
  }
  public String toXMLString() {

    return Helpers.marshallXMLString(this, ConnectionAcknowlege.class);
  }