Esempio n. 1
0
  public void encodeData(AsnOutputStream asnOs) throws MAPException {

    if (this.plmnId == null) throw new MAPException("plmnId parameter must not be null");

    try {
      ((PlmnIdImpl) plmnId).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_plmn_Id);

      if (this.ranTechnology != null) {
        asnOs.writeInteger(
            Tag.CLASS_CONTEXT_SPECIFIC, _ID_ran_Technology, this.ranTechnology.getCode());
      }

      if (this.ranPeriodicLocationSupport) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_ran_PeriodicLocationSupport);
      }
    } catch (IOException e) {
      throw new MAPException(
          "IOException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
    } catch (AsnException e) {
      throw new MAPException(
          "AsnException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
    }
  }
Esempio n. 2
0
  /*
   * (non-Javadoc)
   *
   * @see org.mobicents.protocols.protocols.ss7.cap.api.map.primitives.MAPAsnPrimitive#encodeData (com.ebridge
   * .protocols.asn.AsnOutputStream)
   */
  public void encodeData(AsnOutputStream asnOs) throws MAPException {
    try {
      if (this.locationInformation) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_locationInformation);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter locationInformation: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter locationInformation: ", e);
    }

    try {
      if (this.subscriberState) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_subscriberState);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter subscriberState: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter subscriberState: ", e);
    }

    if (this.extensionContainer != null)
      ((MAPExtensionContainerImpl) this.extensionContainer)
          .encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _ID_extensionContainer);

    try {
      if (this.currentLocation) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_currentLocation);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter currentLocation: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter currentLocation: ", e);
    }

    try {
      if (this.requestedDomain != null) {
        asnOs.writeInteger(
            Tag.CLASS_CONTEXT_SPECIFIC, _ID_requestedDomain, this.requestedDomain.getType());
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter requestedDomain: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter requestedDomain: ", e);
    }

    try {
      if (this.imei) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_imei);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter imei: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter imei: ", e);
    }

    try {
      if (this.msClassmark) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_msclassmark);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter msClassmark: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter msClassmark: ", e);
    }

    try {
      if (this.mnpRequestedInfo) {
        asnOs.writeNull(Tag.CLASS_CONTEXT_SPECIFIC, _ID_mnpRequestedInfo);
      }
    } catch (IOException e) {
      throw new MAPException("IOException when encoding parameter mnpRequestedInfo: ", e);
    } catch (AsnException e) {
      throw new MAPException("AsnException when encoding parameter mnpRequestedInfo: ", e);
    }
  }