2013-02-07 15:19:47 +01:00
|
|
|
/**
|
2014-02-19 10:38:30 +01:00
|
|
|
*
|
|
|
|
* Copyright the original author or authors
|
2013-02-07 15:19:47 +01:00
|
|
|
*
|
2014-02-17 18:57:38 +01:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
2013-02-07 15:19:47 +01:00
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2008-05-21 06:35:42 +02:00
|
|
|
package org.jivesoftware.smackx.jingle;
|
|
|
|
|
2014-02-19 10:38:30 +01:00
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
2008-05-21 06:35:42 +02:00
|
|
|
import org.jivesoftware.smack.packet.IQ;
|
2014-03-03 11:31:06 +01:00
|
|
|
import org.jivesoftware.smackx.jingle.packet.Jingle;
|
|
|
|
import org.jivesoftware.smackx.jingle.packet.JingleError;
|
2008-05-21 06:35:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Jeff Williams
|
|
|
|
* @see JingleSessionState
|
|
|
|
*/
|
|
|
|
public class JingleSessionStateEnded extends JingleSessionState {
|
2008-10-30 22:20:29 +01:00
|
|
|
|
2014-02-19 10:38:30 +01:00
|
|
|
private static final Logger LOGGER = Logger.getLogger(JingleSessionStateEnded.class.getName());
|
2008-10-30 22:20:29 +01:00
|
|
|
|
|
|
|
private static JingleSessionStateEnded INSTANCE = null;
|
2008-05-21 06:35:42 +02:00
|
|
|
|
|
|
|
protected JingleSessionStateEnded() {
|
|
|
|
// Prevent instantiation of the class.
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A thread-safe means of getting the one instance of this class.
|
|
|
|
* @return The singleton instance of this class.
|
|
|
|
*/
|
|
|
|
public synchronized static JingleSessionState getInstance() {
|
|
|
|
if (INSTANCE == null) {
|
|
|
|
INSTANCE = new JingleSessionStateEnded();
|
|
|
|
}
|
|
|
|
|
|
|
|
return INSTANCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void enter() {
|
2014-02-19 10:38:30 +01:00
|
|
|
LOGGER.fine("Session Ended");
|
|
|
|
LOGGER.fine("-------------------------------------------------------------------");
|
2008-05-21 06:35:42 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void exit() {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pretty much nothing is valid for receiving once we've ended the session.
|
|
|
|
*/
|
|
|
|
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) {
|
|
|
|
IQ response = null;
|
|
|
|
|
|
|
|
response = session.createJingleError(jingle, JingleError.MALFORMED_STANZA);
|
|
|
|
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|