コード例 #1
0
  /**
   * Anmeldung als Sender oder Quelle
   *
   * @param atg Attributgruppe
   * @param asp Aspekt
   * @param simulationVariant Simulationsvariante
   * @param senderRole Sender oder Quelle
   * @param senderObject Beliebiges Objekt das zu diesem Sender gespeichert wird. Jedes Objekt ist
   *     einer Datenidentifikation fest zugeordnet und kann nur einmal angemeldet werden.
   * @throws MissingObjectException Falls Attributgruppe oder Aspekt nicht vorhanden sind
   * @return true wenn das Objekt angemeldet wurde, sonst false.
   */
  public boolean registerSender(
      final String atg,
      final String asp,
      final short simulationVariant,
      final SenderRole senderRole,
      final KExDaVSender senderObject)
      throws MissingObjectException {
    if (atg == null) throw new IllegalArgumentException("atg ist null");
    if (asp == null) throw new IllegalArgumentException("asp ist null");
    if (senderRole == null) throw new IllegalArgumentException("senderRole ist null");
    if (senderObject == null) throw new IllegalArgumentException("senderObject ist null");

    if (_senders.containsKey(senderObject))
      throw new IllegalArgumentException("Der Sender " + senderObject + " ist bereits angemeldet.");

    final DataDescription dataDescription = makeDataDescription(atg, asp, simulationVariant);

    final InnerSender innerSender = new InnerSender(senderObject, dataDescription, senderRole);

    final SystemObject systemObject = getWrappedObject();
    if (systemObject == null) return true;

    if (!checkType(systemObject.getType(), dataDescription.getAttributeGroup())) return false;

    registerSender(innerSender, systemObject);
    return true;
  }
コード例 #2
0
  /**
   * Anmeldung als Empfänger/Senke
   *
   * @param atg Attributgruppe
   * @param asp Aspekt
   * @param simulationVariant Simulationsvariante
   * @param receiverRole (Empfänger oder Senke)
   * @param receiveOptions (Delta oder Nachgeliefert oder Normal)
   * @param receiver Objekt an das Empfangene Daten gesendet werden. Jedes Objekt ist einer
   *     Datenidentifikation fest zugeordnet und kann nur einmal angemeldet werden.
   * @throws MissingObjectException Falls Attributgruppe oder Aspekt nicht vorhanden sind
   */
  public boolean registerReceiver(
      final String atg,
      final String asp,
      final short simulationVariant,
      final ReceiverRole receiverRole,
      final ReceiveOptions receiveOptions,
      final KExDaVReceiver receiver)
      throws MissingObjectException {
    if (atg == null) throw new IllegalArgumentException("atg ist null");
    if (asp == null) throw new IllegalArgumentException("asp ist null");
    if (receiverRole == null) throw new IllegalArgumentException("receiverRole ist null");
    if (receiver == null) throw new IllegalArgumentException("receiver ist null");

    if (_receivers.containsKey(receiver))
      throw new IllegalArgumentException("Der Empfänger " + receiver + " ist bereits angemeldet.");

    final DataDescription dataDescription = makeDataDescription(atg, asp, simulationVariant);
    final InnerReceiver innerReceiver =
        new InnerReceiver(receiver, receiverRole, dataDescription, receiveOptions);

    final SystemObject systemObject = getWrappedObject();
    if (systemObject == null) return true;

    if (!checkType(systemObject.getType(), dataDescription.getAttributeGroup())) return false;

    registerReceiver(innerReceiver, systemObject);
    return true;
  }
コード例 #3
0
 @Override
 public String toString() {
   return KExDaVObject.this
       + ":"
       + _dataDescription.getAttributeGroup().getPidOrNameOrId()
       + ":"
       + _dataDescription.getAspect().getPidOrNameOrId()
       + ":"
       + _dataDescription.getSimulationVariant();
 }
コード例 #4
0
  /**
   * Vergleicht die Datenbeschreibung mit einer anderen Datenbeschreibung. Zwei Datenbeschreibungen
   * sind gleich, wenn die Attributgruppen, die Aspekte und die Simulationsvarianten gleich sind.
   *
   * @param other Andere Datenbeschreibung mit der diese Datenbeschreibung verglichen werden soll.
   * @return <code>true</code>, wenn die Datenbeschreibungen gleich sind, sonst <code>false</code>.
   */
  public final boolean equals(Object other) {
    if (this == other) return true;

    if (!(other instanceof DataDescription)) {
      return false;
    }
    DataDescription o = (DataDescription) other;

    return (_attributeGroup == null
            ? o._attributeGroup == null
            : _attributeGroup.equals(o._attributeGroup))
        && (_aspect == null ? o._aspect == null : _aspect.equals(o._aspect))
        && (o.getSimulationVariant() == getSimulationVariant());
  }