/protocols/ss7/isup/isup-impl/src/main/java/org/mobicents/protocols/ss7/isup/impl/message/BlockingMessageImpl.java

http://mobicents.googlecode.com/ · Java · 129 lines · 39 code · 28 blank · 62 comment · 0 complexity · 48600d7b1e46bd7005217863dd5b21e7 MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. /**
  23. * Start time:00:03:30 2009-09-07<br>
  24. * Project: mobicents-isup-stack<br>
  25. *
  26. * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski </a>
  27. */
  28. package org.mobicents.protocols.ss7.isup.impl.message;
  29. import java.util.Map;
  30. import java.util.Set;
  31. import org.mobicents.protocols.ss7.isup.ISUPParameterFactory;
  32. import org.mobicents.protocols.ss7.isup.ParameterException;
  33. import org.mobicents.protocols.ss7.isup.impl.message.parameter.MessageTypeImpl;
  34. import org.mobicents.protocols.ss7.isup.message.BlockingMessage;
  35. import org.mobicents.protocols.ss7.isup.message.parameter.MessageType;
  36. /**
  37. * Start time:00:03:30 2009-09-07<br>
  38. * Project: mobicents-isup-stack<br>
  39. *
  40. * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski </a>
  41. */
  42. public class BlockingMessageImpl extends ISUPMessageImpl implements BlockingMessage {
  43. public static final MessageTypeImpl _MESSAGE_TYPE = new MessageTypeImpl(MESSAGE_CODE);
  44. private static final int _MANDATORY_VAR_COUNT = 0;
  45. static final int _INDEX_F_MessageType = 0;
  46. BlockingMessageImpl(Set<Integer> mandatoryCodes, Set<Integer> mandatoryVariableCodes, Set<Integer> optionalCodes, Map<Integer, Integer> mandatoryCode2Index,
  47. Map<Integer, Integer> mandatoryVariableCode2Index, Map<Integer, Integer> optionalCode2Index) {
  48. super(mandatoryCodes, mandatoryVariableCodes, optionalCodes, mandatoryCode2Index, mandatoryVariableCode2Index, optionalCode2Index);
  49. super.f_Parameters.put(_INDEX_F_MessageType, this.getMessageType());
  50. }
  51. /*
  52. * (non-Javadoc)
  53. *
  54. * @see
  55. * org.mobicents.protocols.ss7.isup.ISUPMessageImpl#decodeMandatoryVariableBody(byte
  56. * [], int)
  57. */
  58. protected void decodeMandatoryVariableBody(ISUPParameterFactory parameterFactory,byte[] parameterBody, int parameterIndex) throws ParameterException {
  59. throw new UnsupportedOperationException("This message does not support mandatory variable parameters.");
  60. }
  61. /*
  62. * (non-Javadoc)
  63. *
  64. * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#decodeOptionalBody(byte[],
  65. * byte)
  66. */
  67. protected void decodeOptionalBody(ISUPParameterFactory parameterFactory,byte[] parameterBody, byte parameterCode) throws ParameterException {
  68. throw new UnsupportedOperationException("This message does not support optional parameters.");
  69. }
  70. protected int decodeMandatoryVariableParameters(ISUPParameterFactory parameterFactory,byte[] b, int index) throws ParameterException {
  71. throw new UnsupportedOperationException("This message does not support mandatory variable parameters.");
  72. }
  73. /*
  74. * (non-Javadoc)
  75. *
  76. * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#getMessageType()
  77. */
  78. public MessageType getMessageType() {
  79. return this._MESSAGE_TYPE;
  80. }
  81. /*
  82. * (non-Javadoc)
  83. *
  84. * @seeorg.mobicents.protocols.ss7.isup.ISUPMessageImpl#
  85. * getNumberOfMandatoryVariableLengthParameters()
  86. */
  87. protected int getNumberOfMandatoryVariableLengthParameters() {
  88. return _MANDATORY_VAR_COUNT;
  89. }
  90. /*
  91. * (non-Javadoc)
  92. *
  93. * @see org.mobicents.protocols.ss7.isup.ISUPMessageImpl#hasAllMandatoryParameters()
  94. */
  95. public boolean hasAllMandatoryParameters() {
  96. return true;
  97. }
  98. protected boolean optionalPartIsPossible() {
  99. return false;
  100. }
  101. }