1 /** 2 * Copyright 2012 Florian Schmaus 3 * 4 * All rights reserved. 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 org.jivesoftware.smackx.ping.packet; 18 19 import org.jivesoftware.smack.packet.IQ; 20 import org.jivesoftware.smackx.ping.PingManager; 21 22 public class Ping extends IQ { 23 24 public Ping() { 25 } 26 27 public Ping(String from, String to) { 28 setTo(to); 29 setFrom(from); 30 setType(IQ.Type.GET); 31 setPacketID(getPacketID()); 32 } 33 34 public String getChildElementXML() { 35 return "<" + PingManager.ELEMENT + " xmlns=\'" + PingManager.NAMESPACE + "\' />"; 36 } 37 38 } 39