@Override public void encode(OutputStream out, final boolean removeSpc, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try{ if(super.digits == null){ throw new IllegalStateException(); } out.write(this.translationType); out.write((this.numberingPlan.getValue() << 4) | this.encodingScheme.getSchemeCode()); this.encodingScheme.encode(digits, out); } catch (IOException e) { throw new ParseException(e); } }
@Override public void decode(final InputStream in,final ParameterFactory factory, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try{ this.translationType = in.read() & 0xff; int b = in.read() & 0xff; this.encodingScheme = factory.createEncodingScheme((byte) (b & 0x0f)); this.numberingPlan = NumberingPlan.valueOf((b & 0xf0) >> 4); super.digits = this.encodingScheme.decode(in); } catch (IOException e) { throw new ParseException(e); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((numberingPlan == null) ? 0 : numberingPlan.hashCode()); result = prime * result + translationType; return result; }
@Override public String getNumberingPlan_Value() { return this.testerHost.getConfigurationData().getSccpConfigurationData().getNumberingPlan().toString(); }
public void write(SccpConfigurationData sccp, OutputElement xml) throws XMLStreamException { xml.setAttribute(REMOTE_ON_GT_MODE, sccp.isRouteOnGtMode()); xml.setAttribute(REMOTE_SPC, sccp.getRemoteSpc()); xml.setAttribute(LOCAL_SPC, sccp.getLocalSpc()); xml.setAttribute(NI, sccp.getNi()); xml.setAttribute(REMOTE_SSN, sccp.getRemoteSsn()); xml.setAttribute(LOCAL_SSN, sccp.getLocalSsn()); xml.setAttribute(LOCAL_SSN2, sccp.getLocalSsn2()); xml.setAttribute(TRANSLATION_TYTE, sccp.getTranslationType()); xml.add(sccp.getGlobalTitleType().toString(), GLOBAL_TITLE_TYPE, String.class); xml.add(sccp.getNatureOfAddress().toString(), ADDRESS_NATURE, String.class); xml.add(sccp.getNumberingPlan().toString(), NUMBERING_PLAN, String.class); xml.add(sccp.getSccpProtocolVersion().toString(), SCCP_PROTOCOL_VERSION, String.class); xml.add(sccp.getCallingPartyAddressDigits(), CALLING_PARTY_ADDRESS_DIGITS, String.class); }
@Override public void encode(OutputStream out, final boolean removeSpc, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try{ if(super.digits == null){ throw new IllegalStateException(); } out.write(this.translationType); out.write((this.numberingPlan.getValue() << 4) | this.encodingScheme.getSchemeCode()); out.write(this.natureOfAddress.getValue()); this.encodingScheme.encode(digits, out); } catch (IOException e) { throw new ParseException(e); } }
@Override public void decode(final InputStream in,final ParameterFactory factory, final SccpProtocolVersion sccpProtocolVersion) throws ParseException { try{ this.translationType = in.read() & 0xff; int b = in.read() & 0xff; this.encodingScheme = factory.createEncodingScheme((byte) (b & 0x0f)); this.numberingPlan = NumberingPlan.valueOf((b & 0xf0) >> 4); b = in.read() & 0xff; this.natureOfAddress = NatureOfAddress.valueOf(b); super.digits = this.encodingScheme.decode(in); } catch (IOException e) { throw new ParseException(e); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((natureOfAddress == null) ? 0 : natureOfAddress.hashCode()); result = prime * result + ((numberingPlan == null) ? 0 : numberingPlan.hashCode()); result = prime * result + translationType; return result; }
public static NumberingPlanSccpType createInstance(String s) { Integer i1 = doCreateInstance(s, stringMap, intMap); if (i1 == null) return new NumberingPlanSccpType(NumberingPlan.UNKNOWN.getValue()); else return new NumberingPlanSccpType(i1); }
@Override public void setNumberingPlan(NumberingPlanSccpType val) { this.testerHost.getConfigurationData().getSccpConfigurationData() .setNumberingPlan(NumberingPlan.valueOf(val.intValue())); this.testerHost.markStore(); }
@Override public NumberingPlanSccpType getNumberingPlan() { return new NumberingPlanSccpType(this.testerHost.getConfigurationData().getSccpConfigurationData().getNumberingPlan() .getValue()); }
NumberingPlan npObj = NumberingPlan.valueOf(np); NatureOfAddress naiObj = NatureOfAddress.valueOf(nao);
M3uaForm.setEnumeratedBaseComboBox(cbNumberingPlan, new NumberingPlanSccpType(NumberingPlan.ISDN_TELEPHONY.getValue())); M3uaForm.setEnumeratedBaseComboBox(cbSccpProtocolVersion, new SccpProtocolVersionType(SccpProtocolVersion.ITU.getValue()));
public void read(InputElement xml, GlobalTitle0011Impl ai) throws XMLStreamException { try { ai.translationType = xml.getAttribute(TRANSLATION_TYPE).toInt(); //wrong... final byte esCode = (byte) xml.getAttribute(ENCODING_SCHEME).toInt(); ai.encodingScheme = factory.createEncodingScheme(esCode); ai.numberingPlan = NumberingPlan.valueOf(xml.getAttribute(NUMBERING_PLAN).toInt()); ai.digits = xml.getAttribute(DIGITS).toString(); } catch (Exception e) { throw new XMLStreamException(e); } } };
M3uaForm.setEnumeratedBaseComboBox(cbNumberingPlan, new NumberingPlanSccpType(NumberingPlan.ISDN_TELEPHONY.getValue())); M3uaForm.setEnumeratedBaseComboBox(cbSccpProtocolVersion, new SccpProtocolVersionType(SccpProtocolVersion.ITU.getValue()));
NumberingPlan np = NumberingPlan.valueOf(npValue); NatureOfAddress nai = NatureOfAddress.valueOf(naiValue);
public void write(GlobalTitle0011Impl ai, OutputElement xml) throws XMLStreamException { xml.setAttribute(TRANSLATION_TYPE, ai.translationType); xml.setAttribute(ENCODING_SCHEME, ai.encodingScheme.getSchemeCode()); xml.setAttribute(NUMBERING_PLAN, ai.numberingPlan.getValue()); xml.setAttribute(DIGITS, ai.digits); }
public void read(InputElement xml, GlobalTitle0100Impl ai) throws XMLStreamException { try { ai.translationType = xml.getAttribute(TRANSLATION_TYPE).toInt(); //wrong... final byte esCode = (byte) xml.getAttribute(ENCODING_SCHEME).toInt(); ai.encodingScheme = factory.createEncodingScheme(esCode); ai.numberingPlan = NumberingPlan.valueOf(xml.getAttribute(NUMBERING_PLAN).toInt()); ai.natureOfAddress = NatureOfAddress.valueOf(xml.getAttribute(NATURE_OF_ADDRESS_INDICATOR).toInt()); ai.digits = xml.getAttribute(DIGITS).toString(); } catch (Exception e) { throw new XMLStreamException(e); } } };
public void write(GlobalTitle0100Impl ai, OutputElement xml) throws XMLStreamException { xml.setAttribute(TRANSLATION_TYPE, ai.translationType); xml.setAttribute(ENCODING_SCHEME, ai.encodingScheme.getSchemeCode()); xml.setAttribute(NUMBERING_PLAN, ai.numberingPlan.getValue()); xml.setAttribute(NATURE_OF_ADDRESS_INDICATOR, ai.natureOfAddress.getValue()); xml.setAttribute(DIGITS, ai.digits); }
public void read(InputElement xml, SccpConfigurationData_OldFormat sccp) throws XMLStreamException { sccp.setRouteOnGtMode(xml.getAttribute(REMOTE_ON_GT_MODE).toBoolean()); sccp.setRemoteSpc(xml.getAttribute(REMOTE_SPC).toInt()); sccp.setLocalSpc(xml.getAttribute(LOCAL_SPC).toInt()); sccp.setNi(xml.getAttribute(NI).toInt()); sccp.setRemoteSsn(xml.getAttribute(REMOTE_SSN).toInt()); sccp.setLocalSsn(xml.getAttribute(LOCAL_SSN).toInt()); sccp.setTranslationType(xml.getAttribute(TRANSLATION_TYTE).toInt()); String gtt = (String) xml.get(GLOBAL_TITLE_TYPE, String.class); sccp.setGlobalTitleType(GlobalTitleType.createInstance(gtt)); String an = (String) xml.get(ADDRESS_NATURE, String.class); sccp.setNatureOfAddress(NatureOfAddress.valueOf(an)); String np = (String) xml.get(NUMBERING_PLAN, String.class); sccp.setNumberingPlan(NumberingPlan.valueOf(np)); sccp.setCallingPartyAddressDigits((String) xml.get(CALLING_PARTY_ADDRESS_DIGITS, String.class)); // for skipping previous data String extraLocalAddressDigits = (String) xml.get(EXTRA_LOCAL_ADDRESS_DIGITS, String.class); } };