PageRenderTime 32ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/protocols/smpp/src/main/java/org/mobicents/protocols/smpp/version/SMPPVersion.java

http://mobicents.googlecode.com/
Java | 134 lines | 39 code | 14 blank | 81 comment | 0 complexity | 5b29d3a1baacceaad7db50158532db01 MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  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. package org.mobicents.protocols.smpp.version;
  23. import java.io.Serializable;
  24. import org.mobicents.protocols.smpp.Address;
  25. /**
  26. * Representation of an SMPP version.
  27. * @version $Id: SMPPVersion.java 457 2009-01-15 17:37:42Z orank $
  28. */
  29. public interface SMPPVersion extends Serializable {
  30. /**
  31. * SMPP version 3.3.
  32. */
  33. SMPPVersion VERSION_3_3 = new SMPPVersion33();
  34. /**
  35. * SMPP version 3.4.
  36. */
  37. SMPPVersion VERSION_3_4 = new SMPPVersion34();
  38. /**
  39. * SMPP version 5.0.
  40. */
  41. SMPPVersion VERSION_5_0 = new SMPPVersion50();
  42. /**
  43. * Get an integer value representing this SMPP version. At present, the
  44. * SMPP specification uses a hex representation to identify versions;
  45. * version 3.3 is represented by <code>0x33</code>, version 3.4 is
  46. * <code>0x34</code>.
  47. * @return An integer value that represents this integer version.
  48. */
  49. int getVersionID();
  50. /**
  51. * Determine if this SMPP version is older than another version.
  52. * @param otherVersion The version to test against.
  53. * @return <code>true</code> if this version is older than
  54. * <code>otherVersion</code>, <code>false</code> if it
  55. * newer than it.
  56. */
  57. boolean isOlderThan(SMPPVersion otherVersion);
  58. /**
  59. * Determine if this SMPP version is equal to or newer than another
  60. * version.
  61. * @param otherVersion The version to test against.
  62. * @return <code>true</code> if this version is newer than
  63. * <code>otherVersion</code>, <code>false</code> if it is equal to or
  64. * older than it.
  65. */
  66. boolean isNewerThan(SMPPVersion otherVersion);
  67. /**
  68. * Determine if the specified <code>versionID</code> matches this
  69. * version&apos;s ID.
  70. * @param versionID The version ID to test against.
  71. * @return <code>true</code> if this version&apos;s ID matches
  72. * <code>versionID</code>.
  73. */
  74. boolean equals(int versionID);
  75. /**
  76. * Get the maximum allowed length for a specified field.
  77. * @param mandatoryParameter The enumerated field identifier to get the
  78. * maximum length for.
  79. * @return The maximum length of the specified field.
  80. */
  81. int getMaxLength(MandatoryParameter mandatoryParameter);
  82. /**
  83. * Determine if this SMPP version supports the specified command.
  84. * @param commandId The command ID of the packet.
  85. * @return <code>true</code> if the command is supported, <code>false
  86. * </code> otherwise.
  87. */
  88. boolean isSupported(int commandId);
  89. /**
  90. * Determine if this SMPP version supports TLVs. This will
  91. * be false for SMPP version 3.3 and true for versions 3.4 and later.
  92. * @return <code>true</code> if this version supports TLV parameters,
  93. * <code>false</code> otherwise.
  94. */
  95. boolean isSupportTLV();
  96. void validateAddress(Address address);
  97. void validateTon(int ton);
  98. void validateNpi(int npi);
  99. void validateAddressRange(String addressRange);
  100. void validateEsmClass(int c);
  101. void validateProtocolID(int id);
  102. void validateDataCoding(int dc);
  103. void validateDefaultMsg(int id);
  104. void validateMessage(byte[] message, int start, int length);
  105. void validateServiceType(String type);
  106. void validateMessageId(String id);
  107. void validateMessageState(int state);
  108. void validateErrorCode(int code);
  109. void validatePriorityFlag(int flag);
  110. void validateRegisteredDelivery(int flag);
  111. void validateReplaceIfPresent(int flag);
  112. void validateNumberOfDests(int num);
  113. void validateNumUnsuccessful(int num);
  114. void validateDistListName(String name);
  115. void validateSystemId(String sysId);
  116. void validatePassword(String password);
  117. void validateSystemType(String sysType);
  118. void validateParamName(String paramName);
  119. void validateParamValue(String paramValue);
  120. }