001/** 002 * 003 * Copyright the original author or authors 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.jivesoftware.smackx.jingleold; 018 019import java.util.logging.Logger; 020 021import org.jivesoftware.smack.packet.IQ; 022import org.jivesoftware.smackx.jingleold.packet.Jingle; 023import org.jivesoftware.smackx.jingleold.packet.JingleError; 024 025/** 026 * Jingle. 027 * @author Jeff Williams 028 * @see JingleSessionState 029 */ 030public class JingleSessionStateEnded extends JingleSessionState { 031 032 private static final Logger LOGGER = Logger.getLogger(JingleSessionStateEnded.class.getName()); 033 034 private static JingleSessionStateEnded INSTANCE = null; 035 036 protected JingleSessionStateEnded() { 037 // Prevent instantiation of the class. 038 } 039 040 /** 041 * A thread-safe means of getting the one instance of this class. 042 * @return The singleton instance of this class. 043 */ 044 public synchronized static JingleSessionState getInstance() { 045 if (INSTANCE == null) { 046 INSTANCE = new JingleSessionStateEnded(); 047 } 048 049 return INSTANCE; 050 } 051 052 @Override 053 public void enter() { 054 LOGGER.fine("Session Ended"); 055 LOGGER.fine("-------------------------------------------------------------------"); 056 057 } 058 059 @Override 060 public void exit() { 061 // TODO Auto-generated method stub 062 063 } 064 065 /** 066 * Pretty much nothing is valid for receiving once we've ended the session. 067 */ 068 @Override 069 public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) { 070 IQ response = null; 071 072 response = session.createJingleError(jingle, JingleError.MALFORMED_STANZA); 073 074 return response; 075 } 076}