2017-07-21 23:05:46 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Copyright 2017 Paul Schaub
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* 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.
|
|
|
|
*/
|
2017-07-27 15:18:18 +02:00
|
|
|
package org.jivesoftware.smackx.jingle.components;
|
2017-07-21 23:05:46 +02:00
|
|
|
|
|
|
|
import org.jivesoftware.smackx.jingle.element.JingleAction;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Object that represents a pending jingle action. A pending jingle action is an action that was sent to the peer,
|
|
|
|
* but a response hasn't yet received.
|
|
|
|
*/
|
|
|
|
public abstract class PendingJingleAction {
|
|
|
|
private final JingleAction action;
|
2017-07-21 23:51:06 +02:00
|
|
|
private final JingleContent affectedContent;
|
2017-07-21 23:05:46 +02:00
|
|
|
|
2017-07-21 23:51:06 +02:00
|
|
|
public PendingJingleAction(JingleAction action, JingleContent content) {
|
2017-07-21 23:05:46 +02:00
|
|
|
this.action = action;
|
|
|
|
this.affectedContent = content;
|
|
|
|
}
|
|
|
|
|
|
|
|
public JingleAction getAction() {
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2017-07-21 23:51:06 +02:00
|
|
|
public JingleContent getAffectedContent() {
|
2017-07-21 23:05:46 +02:00
|
|
|
return affectedContent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class TransportReplace extends PendingJingleAction {
|
2017-07-21 23:51:06 +02:00
|
|
|
private final JingleTransport<?> newTransport;
|
2017-07-21 23:05:46 +02:00
|
|
|
|
2017-07-21 23:51:06 +02:00
|
|
|
public TransportReplace(JingleContent content, JingleTransport<?> newTransport) {
|
2017-07-21 23:05:46 +02:00
|
|
|
super(JingleAction.transport_replace, content);
|
|
|
|
this.newTransport = newTransport;
|
|
|
|
}
|
|
|
|
|
2017-07-21 23:51:06 +02:00
|
|
|
public JingleTransport<?> getNewTransport() {
|
2017-07-21 23:05:46 +02:00
|
|
|
return newTransport;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|