View Javadoc

1   /*
2    * Copyright  2004-2005 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package net.sf.asterisk.manager.action;
18  
19  import net.sf.asterisk.manager.event.PeerlistCompleteEvent;
20  
21  /***
22   * Retrieves a the details about a given SIP peer.<br>
23   * For a PeerEntryEvent is sent by Asterisk containing the details of the peer
24   * followed by a PeerlistCompleteEvent.<br>
25   * Available since Asterisk 1.2
26   * 
27   * @see net.sf.asterisk.manager.event.PeerEntryEvent
28   * @see net.sf.asterisk.manager.event.PeerlistCompleteEvent
29   * @author srt
30   * @version $Id: SIPShowPeerAction.java,v 1.3 2005/08/27 10:18:05 srt Exp $
31   * @since 0.2
32   */
33  public class SIPShowPeerAction extends AbstractManagerAction
34          implements
35              EventGeneratingAction
36  {
37      /***
38       * Serial version identifier
39       */
40      private static final long serialVersionUID = 921037572305993779L;
41      private String peer;
42  
43      /***
44       * Creates a new empty SIPShowPeerAction.
45       */
46      public SIPShowPeerAction()
47      {
48  
49      }
50  
51      /***
52       * Creates a new SIPShowPeerAction that requests the details about the given
53       * SIP peer.
54       * 
55       * @param peer the name of the SIP peer to retrieve details for.
56       * @since 0.2
57       */
58      public SIPShowPeerAction(String peer)
59      {
60          this.peer = peer;
61      }
62  
63      public String getAction()
64      {
65          return "SIPShowPeer";
66      }
67  
68      /***
69       * Returns the name of the peer to retrieve.<br>
70       * This parameter is mandatory.
71       * 
72       * @return the name of the peer to retrieve.
73       */
74      public String getPeer()
75      {
76          return peer;
77      }
78  
79      /***
80       * Sets the name of the peer to retrieve.<br>
81       * This parameter is mandatory.
82       * 
83       * @param peer the name of the peer to retrieve.
84       */
85      public void setPeer(String peer)
86      {
87          this.peer = peer;
88      }
89  
90      public Class getActionCompleteEventClass()
91      {
92          return PeerlistCompleteEvent.class;
93      }
94  }