PageRenderTime 35ms CodeModel.GetById 30ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/message/ContextInfoReq.java

http://mobicents.googlecode.com/
Java | 83 lines | 15 code | 5 blank | 63 comment | 2 complexity | 93f37c84a7cb4e380987b13eef1584c5 MD5 | raw file
 1package javax.megaco.message;
 2
 3import javax.megaco.CommandEvent;
 4
 5/**
 6 * The class extends JAIN MEGACO Command Events. This class is used to represent
 7 * megaco action request event i.e. when an action comes or is to be sent
 8 * without a command, but has context parameters.
 9 * 
10 * 
11 */
12public class ContextInfoReq extends CommandEvent {
13	/**
14	 * Constructs a Context Information Request Event object.
15	 * 
16	 * @param source
17	 *            - A reference to the object, the "source", that is logically
18	 *            deemed to be the object upon which the Event in question
19	 *            initially occurred.
20	 * @param assocHandle
21	 *            - The association handle to uniquely identify the MG-MGC pair.
22	 *            This is allocated by the stack when the Listener registers
23	 *            with the provider with a unique MG-MGC identity.
24	 * @param transactionHandle
25	 *            - The transaction handle that shall uniquely identify the
26	 *            transaction id for the transaction in which the command shall
27	 *            be sent.
28	 * 
29	 * <br>
30	 *            1. The transaction handle is allocated by the stack either on
31	 *            request from User application or on receipt of the transaction
32	 *            indication from peer. <br>
33	 *            2. If the response is to be sent for the transaction received,
34	 *            then the application sends the same transaction handle that
35	 *            has been received by it in the indication. <br>
36	 *            3. If the confirmation is to be sent by the stack to the
37	 *            application due to receipt of a response from the peer stack
38	 *            for a request sent by the stack, then the transaction handle
39	 *            shall be same as received in the command request by the stack.
40	 * 
41	 * @param actionHandle
42	 *            - The action handle uniquely identifies the action within a
43	 *            transaction. The action handle field is used for
44	 *            request-response synchronisation.
45	 * 
46	 * <br>
47	 *            1. If the request is sent from application to the remote
48	 *            entity, then the action handle is allocated by the
49	 *            application. On receipt of the response from the peer for the
50	 *            same request, the stack will use the same action handle when
51	 *            giving the confirmation to the application. <br>
52	 *            2. If the indication received from stack is to be sent to the
53	 *            application, then the action handle is allocated by the stack.
54	 *            The response sent by the application to the stack mus have the
55	 *            same action handle as received in the indication.
56	 * 
57	 *            Note: The action handle can be different from the context id
58	 *            when there are multiple action in the same transaction all
59	 *            having context id as 'null' or 'choose' or '*'.
60	 * @param isLastActionInTransaction
61	 *            - This parameter specifies whether the action is last action
62	 *            in the transaction.
63	 * @throws IllegalArgumentException 
64	 *             : This exception is raised if the value of transaction handle
65	 *             or the action handle passed to this method is less than 0.
66	 */
67	public ContextInfoReq(java.lang.Object source, int assocHandle, int transactionHandle, int actionHandle, boolean isLastActionInTransaction) throws IllegalArgumentException {
68		super(source, assocHandle, transactionHandle, actionHandle, false, isLastActionInTransaction);
69
70		if (transactionHandle < 0 || actionHandle < 0) {
71			IllegalArgumentException invalidArgumentException = new IllegalArgumentException("txnHandle or actionHandle cannot be less than 0 for ContextInfoReq");
72			// invalidArgumentException.setAssocHandle(assocHandle);
73			throw invalidArgumentException;
74		}
75	}
76
77	@Override
78	public int getCommandIdentifier() {
79		// TODO Auto-generated method stub
80		return CommandType.M_ACTION_REQ;
81	}
82
83}