/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/association/DeleteTxnReq.java

http://mobicents.googlecode.com/ · Java · 52 lines · 24 code · 14 blank · 14 comment · 2 complexity · 6b7102581cdd71c8ed0e7595b42a0c3d MD5 · raw file

  1. package javax.megaco.association;
  2. import javax.megaco.AssociationEvent;
  3. public class DeleteTxnReq extends AssociationEvent {
  4. private int txnHandle = -1;
  5. public DeleteTxnReq(Object source, int assocHandle)
  6. throws IllegalArgumentException {
  7. super(source, assocHandle);
  8. // TODO Auto-generated constructor stub
  9. }
  10. @Override
  11. public final int getAssocOperIdentifier() {
  12. return AssocEventType.M_DELETE_TXN_REQ;
  13. }
  14. /**
  15. * Gets an object identifier that specifies the transaction identifier. If
  16. * the transaction identifier is set to 0, then this would be the case when
  17. * the transaction identifier is to represent all transactions.<br><br>
  18. * If the transaction identifier is not set, then this method returns 0, indicating all transactions.
  19. *
  20. * @return Returns an integer value that specifies the transaction identifier.
  21. */
  22. public final int getTxnHandle() {
  23. if(txnHandle==-1)
  24. return 0;
  25. return txnHandle;
  26. }
  27. /**
  28. * This method sets the transaction identifier. To delete all transactions, the transaction identifier is set to 0.
  29. * @param transactionHandle A reference to transaction identifier.
  30. * @throws IllegalArgumentException This exception is raised if the value of transaction handle passed to this method is less than 0.
  31. */
  32. public final void setTxnHandle(int transactionHandle) throws IllegalArgumentException
  33. {
  34. if(transactionHandle<0)
  35. throw new IllegalArgumentException("Txn Handle can not be less than zero");
  36. this.txnHandle=transactionHandle;
  37. }
  38. }