1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Bump "Error Prone" to 2.0.15

and fix a few things :)
This commit is contained in:
Florian Schmaus 2017-02-11 16:16:41 +01:00
parent ef0af66b21
commit 4c646436a5
246 changed files with 1122 additions and 124 deletions

View file

@ -60,6 +60,7 @@ public class ContentNegotiator extends JingleNegotiator {
transportNegotiators = new ArrayList<TransportNegotiator>();
}
@Override
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException {
List<IQ> responses = new ArrayList<IQ>();
@ -139,6 +140,7 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Called from above when starting a new session.
*/
@Override
protected void doStart() {
// JingleContent result = new JingleContent(creator, name);
@ -154,6 +156,7 @@ public class ContentNegotiator extends JingleNegotiator {
/**
* Prepare to close the media manager.
*/
@Override
public void close() {
destroyMediaNegotiator();
destroyTransportNegotiator();
@ -324,6 +327,7 @@ public class ContentNegotiator extends JingleNegotiator {
* The negotiator state for the ContentNegotiators is a special case.
* It is a roll-up of the sub-negotiator states.
*/
@Override
public JingleNegotiatorState getNegotiatorState() {
JingleNegotiatorState result = JingleNegotiatorState.PENDING;

View file

@ -36,7 +36,7 @@ public enum JingleActionEnum {
SESSION_TERMINATE("session-terminate"),
TRANSPORT_INFO("transport-info");
private String actionCode;
private final String actionCode;
private JingleActionEnum(String inActionCode) {
actionCode = inActionCode;
@ -46,6 +46,7 @@ public enum JingleActionEnum {
* Returns the String value for an Action.
*/
@Override
public String toString() {
return actionCode;
}

View file

@ -219,15 +219,19 @@ public class JingleManager implements JingleSessionListener {
Roster.getInstanceFor(connection).addRosterListener(new RosterListener() {
@Override
public void entriesAdded(Collection<Jid> addresses) {
}
@Override
public void entriesUpdated(Collection<Jid> addresses) {
}
@Override
public void entriesDeleted(Collection<Jid> addresses) {
}
@Override
public void presenceChanged(Presence presence) {
if (!presence.isAvailable()) {
Jid xmppAddress = presence.getFrom();
@ -264,6 +268,7 @@ public class JingleManager implements JingleSessionListener {
// The ServiceDiscoveryManager class should have been already
// initialized
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
@Override
public void connectionCreated(XMPPConnection connection) {
JingleManager.setServiceEnabled(connection, true);
}
@ -411,9 +416,11 @@ public class JingleManager implements JingleSessionListener {
}
}
@Override
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) {
}
@Override
public void sessionDeclined(String reason, JingleSession jingleSession) {
jingleSession.removeListener(this);
jingleSessions.remove(jingleSession);
@ -421,21 +428,25 @@ public class JingleManager implements JingleSessionListener {
LOGGER.severe("Declined:" + reason);
}
@Override
public void sessionRedirected(String redirection, JingleSession jingleSession) {
jingleSession.removeListener(this);
jingleSessions.remove(jingleSession);
}
@Override
public void sessionClosed(String reason, JingleSession jingleSession) {
jingleSession.removeListener(this);
jingleSessions.remove(jingleSession);
}
@Override
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
jingleSession.removeListener(this);
jingleSessions.remove(jingleSession);
}
@Override
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
@ -447,6 +458,7 @@ public class JingleManager implements JingleSessionListener {
private void initJingleSessionRequestListeners() {
StanzaFilter initRequestFilter = new StanzaFilter() {
// Return true if we accept this packet
@Override
public boolean accept(Stanza pin) {
if (pin instanceof IQ) {
IQ iq = (IQ) pin;
@ -467,6 +479,7 @@ public class JingleManager implements JingleSessionListener {
// Start a packet listener for session initiation requests
connection.addAsyncStanzaListener(new StanzaListener() {
@Override
public void processStanza(Stanza packet) {
triggerSessionRequested((Jingle) packet);
}

View file

@ -158,6 +158,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
return initiator;
}
@Override
public XMPPConnection getConnection() {
return connection;
}
@ -350,6 +351,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
* @throws SmackException
* @throws InterruptedException
*/
@Override
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException {
List<IQ> responses = new ArrayList<IQ>();
IQ response = null;
@ -534,6 +536,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return Jingle.getSessionHash(getSid(), getInitiator());
}
@ -543,6 +546,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@ -678,6 +682,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
LOGGER.fine("UpdatePacketListener");
packetListener = new StanzaListener() {
@Override
public void processStanza(Stanza packet) {
try {
receivePacketAndRespond((IQ) packet);
@ -688,6 +693,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
};
packetFilter = new StanzaFilter() {
@Override
public boolean accept(Stanza packet) {
if (packet instanceof IQ) {
@ -803,9 +809,11 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
public void setupListeners() {
JingleMediaListener jingleMediaListener = new JingleMediaListener() {
@Override
public void mediaClosed(PayloadType cand) {
}
@Override
public void mediaEstablished(PayloadType pt) throws NotConnectedException, InterruptedException {
if (isFullyEstablished()) {
Jingle jout = new Jingle(JingleActionEnum.SESSION_ACCEPT);
@ -827,6 +835,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
JingleTransportListener jingleTransportListener = new JingleTransportListener() {
@Override
public void transportEstablished(TransportCandidate local, TransportCandidate remote) throws NotConnectedException, InterruptedException {
if (isFullyEstablished()) {
// CHECKSTYLE:OFF
@ -855,9 +864,11 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
}
}
@Override
public void transportClosed(TransportCandidate cand) {
}
@Override
public void transportClosedOnError(XMPPException e) {
}
};
@ -995,6 +1006,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
/**
* Terminate negotiations.
*/
@Override
public void close() {
if (isClosed())
return;
@ -1056,6 +1068,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
/**
* Called when new Media is received.
*/
@Override
public void mediaReceived(String participant) {
triggerMediaReceived(participant);
}
@ -1131,6 +1144,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
//updatePacketListener();
}
@Override
protected void doStart() {
}

View file

@ -61,6 +61,7 @@ public abstract class JingleSessionState {
/**
* For debugging just emit the short name of the class.
*/
@Override
public String toString() {
return this.getClass().getSimpleName();
}

View file

@ -48,16 +48,19 @@ public class JingleSessionStateActive extends JingleSessionState {
return INSTANCE;
}
@Override
public void enter() {
// TODO Auto-generated method stub
}
@Override
public void exit() {
// TODO Auto-generated method stub
}
@Override
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) {
IQ response = null;

View file

@ -49,12 +49,14 @@ public class JingleSessionStateEnded extends JingleSessionState {
return INSTANCE;
}
@Override
public void enter() {
LOGGER.fine("Session Ended");
LOGGER.fine("-------------------------------------------------------------------");
}
@Override
public void exit() {
// TODO Auto-generated method stub
@ -63,6 +65,7 @@ public class JingleSessionStateEnded extends JingleSessionState {
/**
* Pretty much nothing is valid for receiving once we've ended the session.
*/
@Override
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) {
IQ response = null;

View file

@ -48,16 +48,19 @@ public class JingleSessionStatePending extends JingleSessionState {
return INSTANCE;
}
@Override
public void enter() {
// TODO Auto-generated method stub
}
@Override
public void exit() {
// TODO Auto-generated method stub
}
@Override
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) {
IQ response = null;

View file

@ -59,16 +59,19 @@ public class JingleSessionStateUnknown extends JingleSessionState {
return INSTANCE;
}
@Override
public void enter() {
// TODO Auto-generated method stub
}
@Override
public void exit() {
// TODO Auto-generated method stub
}
@Override
public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) throws SmackException, InterruptedException {
IQ response = null;

View file

@ -49,6 +49,7 @@ public abstract class ContentInfo {
this.value = value;
}
@Override
public String toString() {
return value;
}

View file

@ -105,6 +105,7 @@ public class MediaNegotiator extends JingleNegotiator {
* @throws NotConnectedException
* @throws InterruptedException
*/
@Override
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, NotConnectedException, InterruptedException {
List<IQ> responses = new ArrayList<IQ>();
IQ response = null;
@ -510,6 +511,7 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Called from above when starting a new session.
*/
@Override
protected void doStart() {
}
@ -517,6 +519,7 @@ public class MediaNegotiator extends JingleNegotiator {
/**
* Terminate the jmf negotiator.
*/
@Override
public void close() {
super.close();
triggerMediaClosed(getBestCommonAudioPt());

View file

@ -149,6 +149,7 @@ public class PayloadType {
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int PRIME = 31;
int result = 1;
@ -163,6 +164,7 @@ public class PayloadType {
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@ -333,6 +335,7 @@ public class PayloadType {
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int PRIME = 31;
int result = super.hashCode();
@ -345,6 +348,7 @@ public class PayloadType {
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;

View file

@ -78,6 +78,7 @@ public class JMFInit extends Frame implements Runnable {
*/
}
@Override
public void run() {
detectDirectAudio();
detectS8DirectAudio();
@ -108,7 +109,7 @@ public class JMFInit extends Frame implements Runnable {
Class<?> dsauto;
try {
dsauto = Class.forName("DirectSoundAuto");
dsauto.newInstance();
dsauto.getConstructor().newInstance();
message("Finished detecting DirectSound capturer");
}
catch (ThreadDeath td) {
@ -121,7 +122,7 @@ public class JMFInit extends Frame implements Runnable {
Class<?> jsauto;
try {
jsauto = Class.forName("JavaSoundAuto");
jsauto.newInstance();
jsauto.getConstructor().newInstance();
message("Finished detecting javasound capturer");
}
catch (ThreadDeath td) {
@ -194,7 +195,7 @@ public class JMFInit extends Frame implements Runnable {
// Find the renderer class and instantiate it.
cls = Class.forName(dar);
Renderer rend = (Renderer) cls.newInstance();
Renderer rend = (Renderer) cls.getConstructor().newInstance();
try {
// Set the format and open the device
AudioFormat af = new AudioFormat(AudioFormat.LINEAR, 44100, 16,
@ -239,7 +240,7 @@ public class JMFInit extends Frame implements Runnable {
// Find the renderer class and instantiate it.
cls = Class.forName(dar);
Renderer rend = (Renderer) cls.newInstance();
Renderer rend = (Renderer) cls.getConstructor().newInstance();
if (rend instanceof ExclusiveUse
&& !((ExclusiveUse) rend).isExclusive()) {

View file

@ -482,6 +482,7 @@ public class AudioChannel {
class StateListener implements ControllerListener {
@Override
public void controllerUpdate(ControllerEvent ce) {
// If there was an error during configure or

View file

@ -61,6 +61,7 @@ public class AudioMediaSession extends JingleMediaSession {
/**
* Initialize the Audio Channel to make it able to send and receive audio.
*/
@Override
public void initialize() {
String ip;
@ -90,6 +91,7 @@ public class AudioMediaSession extends JingleMediaSession {
/**
* Starts transmission and for NAT Traversal reasons start receiving also.
*/
@Override
public void startTrasmit() {
audioChannel.start();
}
@ -100,6 +102,7 @@ public class AudioMediaSession extends JingleMediaSession {
*
* @param active active state
*/
@Override
public void setTrasmit(boolean active) {
audioChannel.setTrasmit(active);
}
@ -107,6 +110,7 @@ public class AudioMediaSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void startReceive() {
// Do nothing
}
@ -114,6 +118,7 @@ public class AudioMediaSession extends JingleMediaSession {
/**
* Stops transmission and for NAT Traversal reasons stop receiving also.
*/
@Override
public void stopTrasmit() {
if (audioChannel != null)
audioChannel.stop();
@ -122,6 +127,7 @@ public class AudioMediaSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void stopReceive() {
// Do nothing
}

View file

@ -62,6 +62,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
/**
* JingleSessionListener.
*/
@Override
public synchronized void update(SessionEvent evt) {
if (evt instanceof NewParticipantEvent) {
Participant p = ((NewParticipantEvent) evt).getParticipant();
@ -72,6 +73,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
/**
* ReceiveStreamListener.
*/
@Override
public synchronized void update(ReceiveStreamEvent evt) {
Participant participant = evt.getParticipant(); // could be null.
@ -147,6 +149,7 @@ public class AudioReceiver implements ReceiveStreamListener, SessionListener,
/**
* ControllerListener for the Players.
*/
@Override
public synchronized void controllerUpdate(ControllerEvent ce) {
Player p = (Player) ce.getSourceController();

View file

@ -75,6 +75,7 @@ public class JmfMediaManager extends JingleMediaManager {
* @param local local Candidate
* @return JingleMediaSession
*/
@Override
public JingleMediaSession createMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
return new AudioMediaSession(payloadType, remote, local, mediaLocator, jingleSession);
}
@ -93,6 +94,7 @@ public class JmfMediaManager extends JingleMediaManager {
*
* @return The Payload List
*/
@Override
public List<PayloadType> getPayloads() {
return payloads;
}
@ -160,6 +162,7 @@ public class JmfMediaManager extends JingleMediaManager {
// @TODO Implement Linux Pre-Install
}
@Override
public String getName() {
return MEDIA_NAME;
}

View file

@ -112,6 +112,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
/**
* Initialize the Audio Channel to make it able to send and receive audio.
*/
@Override
public void initialize() {
String ip;
@ -155,6 +156,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
/**
* Starts transmission and for NAT Traversal reasons start receiving also.
*/
@Override
public void startTrasmit() {
try {
LOGGER.fine("start");
@ -172,6 +174,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
*
* @param active active state
*/
@Override
public void setTrasmit(boolean active) {
// Do nothing
}
@ -179,6 +182,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void startReceive() {
// Do nothing
}
@ -186,6 +190,7 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
/**
* Stops transmission and for NAT Traversal reasons stop receiving also.
*/
@Override
public void stopTrasmit() {
if (mediaSession != null)
mediaSession.close();
@ -194,16 +199,20 @@ public class AudioMediaSession extends JingleMediaSession implements MediaSessio
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void stopReceive() {
// Do nothing
}
@Override
public void newStreamIdentified(StreamPlayer streamPlayer) {
}
@Override
public void senderReportReceived(SenderReport report) {
}
@Override
public void streamClosed(StreamPlayer stream, boolean timeout) {
}

View file

@ -60,6 +60,7 @@ public class SpeexMediaManager extends JingleMediaManager {
* @param local local Candidate
* @return JingleMediaSession
*/
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
return new AudioMediaSession(payloadType, remote, local, null,null);
}
@ -76,6 +77,7 @@ public class SpeexMediaManager extends JingleMediaManager {
*
* @return The Payload List
*/
@Override
public List<PayloadType> getPayloads() {
return payloads;
}
@ -125,6 +127,7 @@ public class SpeexMediaManager extends JingleMediaManager {
// @TODO Implement Linux Pre-Install
}
@Override
public String getName() {
return MEDIA_NAME;
}

View file

@ -58,6 +58,7 @@ public class MultiMediaManager extends JingleMediaManager {
*
* @return The Payload List
*/
@Override
public List<PayloadType> getPayloads() {
List<PayloadType> list = new ArrayList<PayloadType>();
if (preferredPayloadType != null) list.add(preferredPayloadType);
@ -78,6 +79,7 @@ public class MultiMediaManager extends JingleMediaManager {
* @param local local Candidate
* @return JingleMediaSession JingleMediaSession
*/
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
for (JingleMediaManager manager : managers) {
if (manager.getPayloads().contains(payloadType)) {
@ -87,6 +89,7 @@ public class MultiMediaManager extends JingleMediaManager {
return null;
}
@Override
public PayloadType getPreferredPayloadType() {
if (preferredPayloadType != null) return preferredPayloadType;
return super.getPreferredPayloadType();
@ -96,6 +99,7 @@ public class MultiMediaManager extends JingleMediaManager {
this.preferredPayloadType = preferredPayloadType;
}
@Override
public String getName() {
return MEDIA_NAME;
}

View file

@ -61,6 +61,7 @@ public class ScreenShareMediaManager extends JingleMediaManager {
*
* @return The Payload List
*/
@Override
public List<PayloadType> getPayloads() {
return payloads;
}
@ -73,6 +74,7 @@ public class ScreenShareMediaManager extends JingleMediaManager {
* @param local local Candidate
* @return JingleMediaSession JingleMediaSession
*/
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, final JingleSession jingleSession) {
ScreenShareSession session = null;
session = new ScreenShareSession(payloadType, remote, local, "Screen", jingleSession);
@ -85,6 +87,7 @@ public class ScreenShareMediaManager extends JingleMediaManager {
return session;
}
@Override
public PayloadType getPreferredPayloadType() {
return super.getPreferredPayloadType();
}
@ -105,6 +108,7 @@ public class ScreenShareMediaManager extends JingleMediaManager {
this.encoder = encoder;
}
@Override
public String getName() {
return MEDIA_NAME;
}

View file

@ -74,6 +74,7 @@ public class ScreenShareSession extends JingleMediaSession {
/**
* Initialize the screen share channels.
*/
@Override
public void initialize() {
JingleSession session = getJingleSession();
@ -97,6 +98,7 @@ public class ScreenShareSession extends JingleMediaSession {
window.setSize(600, 600);
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
receiver.stop();
}
@ -120,6 +122,7 @@ public class ScreenShareSession extends JingleMediaSession {
/**
* Starts transmission and for NAT Traversal reasons start receiving also.
*/
@Override
public void startTrasmit() {
new Thread(transmitter).start();
}
@ -130,6 +133,7 @@ public class ScreenShareSession extends JingleMediaSession {
*
* @param active active state
*/
@Override
public void setTrasmit(boolean active) {
transmitter.setTransmit(true);
}
@ -137,6 +141,7 @@ public class ScreenShareSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void startReceive() {
// Do nothing
}
@ -144,6 +149,7 @@ public class ScreenShareSession extends JingleMediaSession {
/**
* Stops transmission and for NAT Traversal reasons stop receiving also.
*/
@Override
public void stopTrasmit() {
if (transmitter != null) {
transmitter.stop();
@ -153,6 +159,7 @@ public class ScreenShareSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void stopReceive() {
if (receiver != null) {
receiver.stop();

View file

@ -29,16 +29,19 @@ import java.awt.image.ColorModel;
*/
public abstract class AbstractBufferedImageOp implements BufferedImageOp, Cloneable {
@Override
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {
if (dstCM == null)
dstCM = src.getColorModel();
return new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dstCM.isAlphaPremultiplied(), null);
}
@Override
public Rectangle2D getBounds2D(BufferedImage src) {
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
}
@Override
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
if (dstPt == null)
dstPt = new Point2D.Double();
@ -46,6 +49,7 @@ public abstract class AbstractBufferedImageOp implements BufferedImageOp, Clonea
return dstPt;
}
@Override
public RenderingHints getRenderingHints() {
return null;
}
@ -88,6 +92,7 @@ public abstract class AbstractBufferedImageOp implements BufferedImageOp, Clonea
image.setRGB(x, y, width, height, pixels, 0, width);
}
@Override
public Object clone() {
try {
return super.clone();

View file

@ -26,6 +26,7 @@ import java.io.IOException;
*/
public class DefaultDecoder implements ImageDecoder {
@Override
public BufferedImage decode(ByteArrayInputStream stream) throws IOException {
return ImageIO.read(stream);
}

View file

@ -30,6 +30,7 @@ import java.util.logging.Logger;
public class DefaultEncoder implements ImageEncoder{
private static final Logger LOGGER = Logger.getLogger(DefaultEncoder.class.getName());
@Override
public ByteArrayOutputStream encode(BufferedImage bufferedImage) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {

View file

@ -61,6 +61,7 @@ public class ImageReceiver extends Canvas {
this.decoder = new DefaultDecoder();
new Thread(new Runnable() {
@Override
public void run() {
byte[] buf = new byte[1024];
DatagramPacket p = new DatagramPacket(buf, 1024);
@ -90,6 +91,7 @@ public class ImageReceiver extends Canvas {
}).start();
new Thread(new Runnable() {
@Override
public void run() {
byte[] buf = new byte[1024];
DatagramPacket p = new DatagramPacket(buf, 1024);
@ -148,6 +150,7 @@ public class ImageReceiver extends Canvas {
this.getGraphics().drawImage(bufferedImage, tileWidth * x, tileWidth * y, this);
}
@Override
public void paint(Graphics g) {
for (int i = 0; i < tiles.length; i++) {
for (int j = 0; j < tiles[0].length; j++) {

View file

@ -178,6 +178,7 @@ public class ImageTransmitter implements Runnable {
}
}
@Override
public void run() {
start();
}

View file

@ -39,7 +39,7 @@ public class OctTreeQuantizer implements Quantizer {
/**
* An Octtree node.
*/
class OctTreeNode {
static class OctTreeNode {
int children;
int level;
OctTreeNode parent;
@ -87,6 +87,7 @@ public class OctTreeQuantizer implements Quantizer {
* Initialize the quantizer. This should be called before adding any pixels.
* @param numColors the number of colors we're quantizing to.
*/
@Override
public void setup(int numColors) {
maximumColors = numColors;
reduceColors = Math.max(512, numColors * 2);
@ -98,6 +99,7 @@ public class OctTreeQuantizer implements Quantizer {
* @param offset the offset into the array
* @param count the count of pixels
*/
@Override
public void addPixels(int[] pixels, int offset, int count) {
for (int i = 0; i < count; i++) {
insertColor(pixels[i+offset]);
@ -111,6 +113,7 @@ public class OctTreeQuantizer implements Quantizer {
* @param rgb the color
* @return the index
*/
@Override
public int getIndexForColor(int rgb) {
int red = (rgb >> 16) & 0xff;
int green = (rgb >> 8) & 0xff;
@ -238,6 +241,7 @@ public class OctTreeQuantizer implements Quantizer {
* Build the color table.
* @return the color table
*/
@Override
public int[] buildColorTable() {
int[] table = new int[colors];
buildColorTable(root, table, 0);

View file

@ -163,6 +163,7 @@ public class QuantizeFilter extends WholeImageFilter {
}
}
@Override
protected int[] filterPixels(int width, int height, int[] inPixels, Rectangle transformedSpace) {
int[] outPixels = new int[width*height];
@ -171,6 +172,7 @@ public class QuantizeFilter extends WholeImageFilter {
return outPixels;
}
@Override
public String toString() {
return "Colors/Quantize...";
}

View file

@ -43,6 +43,7 @@ public abstract class WholeImageFilter extends AbstractBufferedImageOp {
public WholeImageFilter() {
}
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
int width = src.getWidth();
int height = src.getHeight();

View file

@ -49,6 +49,7 @@ public class TestMediaManager extends JingleMediaManager {
*
* @return The Payload List
*/
@Override
public List<PayloadType> getPayloads() {
return payloads;
}
@ -65,6 +66,7 @@ public class TestMediaManager extends JingleMediaManager {
* @param local local Candidate
* @return JingleMediaSession JingleMediaSession
*/
@Override
public JingleMediaSession createMediaSession(PayloadType payloadType, final TransportCandidate remote,
final TransportCandidate local, final JingleSession jingleSession) {
TestMediaSession session = null;
@ -74,6 +76,7 @@ public class TestMediaManager extends JingleMediaManager {
return session;
}
@Override
public PayloadType getPreferredPayloadType() {
if (preferredPayloadType != null)
return preferredPayloadType;
@ -84,6 +87,7 @@ public class TestMediaManager extends JingleMediaManager {
this.preferredPayloadType = preferredPayloadType;
}
@Override
public String getName() {
return MEDIA_NAME;
}

View file

@ -45,6 +45,7 @@ public class TestMediaSession extends JingleMediaSession {
/**
* Initialize the screen share channels.
*/
@Override
public void initialize() {
}
@ -52,6 +53,7 @@ public class TestMediaSession extends JingleMediaSession {
/**
* Starts transmission and for NAT Traversal reasons start receiving also.
*/
@Override
public void startTrasmit() {
}
@ -62,6 +64,7 @@ public class TestMediaSession extends JingleMediaSession {
*
* @param active active state
*/
@Override
public void setTrasmit(boolean active) {
}
@ -69,6 +72,7 @@ public class TestMediaSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void startReceive() {
// Do nothing
}
@ -76,6 +80,7 @@ public class TestMediaSession extends JingleMediaSession {
/**
* Stops transmission and for NAT Traversal reasons stop receiving also.
*/
@Override
public void stopTrasmit() {
}
@ -83,6 +88,7 @@ public class TestMediaSession extends JingleMediaSession {
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
@Override
public void stopReceive() {
}

View file

@ -50,6 +50,7 @@ public class BasicResolver extends TransportResolver {
* @throws NotConnectedException
* @throws InterruptedException
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
setResolveInit();
@ -115,10 +116,12 @@ public class BasicResolver extends TransportResolver {
}
@Override
public void initialize() throws XMPPException {
setInitialized();
}
@Override
public void cancel() throws XMPPException {
// Nothing to do here
}

View file

@ -24,6 +24,7 @@ import org.jivesoftware.smackx.jingleold.JingleSession;
*/
public class BasicTransportManager extends JingleTransportManager{
@Override
protected TransportResolver createResolver(JingleSession session) {
return new BasicResolver();
}

View file

@ -65,6 +65,7 @@ public class BridgedResolver extends TransportResolver {
* @throws NotConnectedException
* @throws InterruptedException
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
setResolveInit();
@ -102,6 +103,7 @@ public class BridgedResolver extends TransportResolver {
setResolveEnd();
}
@Override
public void initialize() throws SmackException, XMPPErrorException, InterruptedException {
clearCandidates();
@ -114,6 +116,7 @@ public class BridgedResolver extends TransportResolver {
}
@Override
public void cancel() throws XMPPException {
// Nothing to do here
}

View file

@ -46,6 +46,7 @@ public class BridgedTransportManager extends JingleTransportManager implements J
* @param session correspondent Jingle Session
* @return resolver
*/
@Override
protected TransportResolver createResolver(JingleSession session) {
BridgedResolver bridgedResolver = new BridgedResolver(this.xmppConnection);
return bridgedResolver;
@ -53,28 +54,35 @@ public class BridgedTransportManager extends JingleTransportManager implements J
// Implement a Session Listener to relay candidates after establishment
@Override
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) throws NotConnectedException, InterruptedException {
RTPBridge rtpBridge = RTPBridge.relaySession(lc.getConnection(), lc.getSessionId(), lc.getPassword(), rc, lc);
}
@Override
public void sessionDeclined(String reason, JingleSession jingleSession) {
}
@Override
public void sessionRedirected(String redirection, JingleSession jingleSession) {
}
@Override
public void sessionClosed(String reason, JingleSession jingleSession) {
}
@Override
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
}
@Override
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
// Session Created
@Override
public void sessionCreated(JingleSession jingleSession) {
jingleSession.addListener(this);
}

View file

@ -54,6 +54,7 @@ public class FixedResolver extends TransportResolver {
* @throws NotConnectedException
* @throws InterruptedException
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
if (!isResolving()) {
setResolveInit();
@ -76,10 +77,12 @@ public class FixedResolver extends TransportResolver {
*
* @throws XMPPException
*/
@Override
public void initialize() throws XMPPException {
setInitialized();
}
@Override
public void cancel() throws XMPPException {
// Nothing to do here
}

View file

@ -34,29 +34,37 @@ public class FixedTransportManager extends JingleTransportManager implements Jin
resolver = inResolver;
}
@Override
protected TransportResolver createResolver(JingleSession session) {
return resolver;
}
@Override
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) {
}
@Override
public void sessionDeclined(String reason, JingleSession jingleSession) {
}
@Override
public void sessionRedirected(String redirection, JingleSession jingleSession) {
}
@Override
public void sessionClosed(String reason, JingleSession jingleSession) {
}
@Override
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
}
@Override
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
@Override
public void sessionCreated(JingleSession jingleSession) {
jingleSession.addListener(this);
}

View file

@ -27,6 +27,8 @@ import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.util.StringUtils;
/**
* A very Simple HTTP Server.
*/
@ -73,7 +75,7 @@ public class HttpServer {
HttpServer httpServer = new HttpServer(Integer.parseInt(args[0]));
}
class HttpRequestHandler implements Runnable {
static class HttpRequestHandler implements Runnable {
final static String CRLF = "\r\n";
Socket socket;
@ -85,9 +87,10 @@ public class HttpServer {
this.socket = socket;
this.input = socket.getInputStream();
this.output = socket.getOutputStream();
this.br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
this.br = new BufferedReader(new InputStreamReader(socket.getInputStream(), StringUtils.UTF8));
}
@Override
public void run() {
try {
processRequest();
@ -115,19 +118,19 @@ public class HttpServer {
String contentLengthLine;
String statusLine = "HTTP/1.0 200 OK" + CRLF;
contentLengthLine = "Content-Length: "
+ (new Integer(entityBody.length())).toString() + CRLF;
+ entityBody.length() + CRLF;
contentTypeLine = "text/html";
output.write(statusLine.getBytes());
output.write(statusLine.getBytes(StringUtils.UTF8));
output.write(serverLine.getBytes());
output.write(serverLine.getBytes(StringUtils.UTF8));
output.write(contentTypeLine.getBytes());
output.write(contentLengthLine.getBytes());
output.write(contentTypeLine.getBytes(StringUtils.UTF8));
output.write(contentLengthLine.getBytes(StringUtils.UTF8));
output.write(CRLF.getBytes());
output.write(CRLF.getBytes(StringUtils.UTF8));
output.write(entityBody.getBytes());
output.write(entityBody.getBytes(StringUtils.UTF8));
}
}

View file

@ -219,6 +219,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
* <p/>
* ICE Candidate can check connectivity using UDP echo Test.
*/
@Override
public void check(final List<TransportCandidate> localCandidates) {
//TODO candidate is being checked trigger
//candidatesChecking.add(cand);
@ -226,6 +227,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
final ICECandidate checkingCandidate = this;
Thread checkThread = new Thread(new Runnable() {
@Override
public void run() {
final TestResult result = new TestResult();
@ -233,12 +235,13 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
// Media Proxy don't have Echo features.
// If its a relayed candidate we assumpt that is NOT Valid while other candidates still being checked.
// The negotiator MUST add then in the correct situations
if (getType().equals("relay")) {
if (getType().equals(Type.relay)) {
triggerCandidateChecked(false);
return;
}
ResultListener resultListener = new ResultListener() {
@Override
public void testFinished(TestResult testResult, TransportCandidate candidate) {
if (testResult.isReachable() && checkingCandidate.equals(candidate)) {
result.setResult(true);
@ -394,6 +397,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
return res;
}
@Override
public boolean isNull() {
if (super.isNull()) {
return true;
@ -415,6 +419,7 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
* object is less than, equal to, or greater than the specified
* object
*/
@Override
public int compareTo(ICECandidate arg) {
if (getPreference() < arg.getPreference()) {
return -1;

View file

@ -63,6 +63,7 @@ public class ICEResolver extends TransportResolver {
this.setType(Type.ice);
}
@Override
public void initialize() throws XMPPException {
if (!isResolving() && !isResolved()) {
LOGGER.fine("Initialized");
@ -87,6 +88,7 @@ public class ICEResolver extends TransportResolver {
this.setInitialized();
}
@Override
public void cancel() throws XMPPException {
}
@ -96,6 +98,7 @@ public class ICEResolver extends TransportResolver {
* @throws SmackException
* @throws InterruptedException
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, SmackException, InterruptedException {
this.setResolveInit();

View file

@ -27,6 +27,7 @@ import org.jivesoftware.smackx.jingleold.JingleSession;
import org.jivesoftware.smackx.jingleold.listeners.CreatedJingleSessionListener;
import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener;
import org.jivesoftware.smackx.jingleold.media.PayloadType;
import org.jivesoftware.smackx.jingleold.nat.ICECandidate.Type;
public class ICETransportManager extends JingleTransportManager implements JingleSessionListener, CreatedJingleSessionListener {
private static final Logger LOGGER = Logger.getLogger(ICETransportManager.class.getName());
@ -43,6 +44,7 @@ public class ICETransportManager extends JingleTransportManager implements Jingl
}
}
@Override
protected TransportResolver createResolver(JingleSession session) throws SmackException, InterruptedException {
try {
iceResolver.resolve(session);
@ -55,32 +57,39 @@ public class ICETransportManager extends JingleTransportManager implements Jingl
// Implement a Session Listener to relay candidates after establishment
@Override
public void sessionEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc, JingleSession jingleSession) throws NotConnectedException, InterruptedException {
if (lc instanceof ICECandidate) {
if (((ICECandidate) lc).getType().equals("relay")) {
if (((ICECandidate) lc).getType().equals(Type.relay)) {
RTPBridge rtpBridge = RTPBridge.relaySession(lc.getConnection(), lc.getSessionId(), lc.getPassword(), rc, lc);
}
}
}
@Override
public void sessionDeclined(String reason, JingleSession jingleSession) {
}
@Override
public void sessionRedirected(String redirection, JingleSession jingleSession) {
}
@Override
public void sessionClosed(String reason, JingleSession jingleSession) {
}
@Override
public void sessionClosedOnError(XMPPException e, JingleSession jingleSession) {
}
@Override
public void sessionMediaReceived(JingleSession jingleSession, String participant) {
// Do Nothing
}
// Session Created
@Override
public void sessionCreated(JingleSession jingleSession) {
jingleSession.addListener(this);
}

View file

@ -303,6 +303,7 @@ public class RTPBridge extends IQ {
*
* @return the Child Element XML of the Packet
*/
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder str) {
str.attribute("sid", sid);
str.rightAngleBracket();

View file

@ -87,6 +87,7 @@ public class STUNResolver extends TransportResolver {
*
* @see TransportResolver#isResolving()
*/
@Override
public boolean isResolving() {
return super.isResolving() && resolverThread != null;
}
@ -266,6 +267,7 @@ public class STUNResolver extends TransportResolver {
* @throws NotConnectedException
* @throws InterruptedException
*/
@Override
public synchronized void resolve(JingleSession session) throws XMPPException, NotConnectedException, InterruptedException {
setResolveInit();
@ -289,6 +291,7 @@ public class STUNResolver extends TransportResolver {
*
* @throws XMPPException
*/
@Override
public void initialize() throws XMPPException {
LOGGER.fine("Initialized");
if (!isResolving()&&!isResolved()) {
@ -302,6 +305,7 @@ public class STUNResolver extends TransportResolver {
clearCandidates();
resolverThread = new Thread(new Runnable() {
@Override
public void run() {
// Iterate through the list of interfaces, and ask
// to the STUN server for our address.
@ -386,6 +390,7 @@ public class STUNResolver extends TransportResolver {
*
* @see TransportResolver#cancel()
*/
@Override
public synchronized void cancel() throws XMPPException {
if (isResolving()) {
resolverThread.interrupt();
@ -398,6 +403,7 @@ public class STUNResolver extends TransportResolver {
*
* @see TransportResolver#clear()
*/
@Override
public synchronized void clear() throws XMPPException {
this.defaultPort = 0;
super.clear();
@ -406,7 +412,7 @@ public class STUNResolver extends TransportResolver {
/**
* STUN service definition.
*/
protected class STUNService {
protected static class STUNService {
private String hostname; // The hostname of the service

View file

@ -41,6 +41,7 @@ public class STUNTransportManager extends JingleTransportManager {
}
}
@Override
protected TransportResolver createResolver(JingleSession session) {
try {
stunResolver.resolve(session);

View file

@ -67,6 +67,7 @@ public class TcpUdpBridgeClient {
final Thread process = new Thread(new Runnable() {
@Override
public void run() {
try {
OutputStream out = localTcpSocket.getOutputStream();
@ -97,6 +98,7 @@ public class TcpUdpBridgeClient {
new Thread(new Runnable() {
@Override
public void run() {
try {

View file

@ -69,6 +69,7 @@ public class TcpUdpBridgeServer {
final Thread process = new Thread(new Runnable() {
@Override
public void run() {
try {
OutputStream out = localTcpSocket.getOutputStream();
@ -98,6 +99,7 @@ public class TcpUdpBridgeServer {
new Thread(new Runnable() {
@Override
public void run() {
try {

View file

@ -301,6 +301,7 @@ public abstract class TransportCandidate {
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@ -353,6 +354,7 @@ public abstract class TransportCandidate {
//candidatesChecking.add(cand);
Thread checkThread = new Thread(new Runnable() {
@Override
public void run() {
boolean isUsable;
@ -463,6 +465,7 @@ public abstract class TransportCandidate {
this.value = value;
}
@Override
public String toString() {
return value;
}
@ -551,6 +554,7 @@ public abstract class TransportCandidate {
this.value = value;
}
@Override
public String toString() {
return value;
}
@ -664,6 +668,7 @@ public abstract class TransportCandidate {
}
@Override
public void run() {
try {
LOGGER.fine("Listening for ECHO: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort());
@ -756,9 +761,11 @@ public abstract class TransportCandidate {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
DatagramListener listener = new DatagramListener() {
@Override
public boolean datagramReceived(DatagramPacket datagramPacket) {
try {

View file

@ -36,6 +36,7 @@ import org.jivesoftware.smackx.jingleold.JingleNegotiatorState;
import org.jivesoftware.smackx.jingleold.JingleSession;
import org.jivesoftware.smackx.jingleold.listeners.JingleListener;
import org.jivesoftware.smackx.jingleold.listeners.JingleTransportListener;
import org.jivesoftware.smackx.jingleold.nat.ICECandidate.Type;
import org.jivesoftware.smackx.jingleold.packet.Jingle;
import org.jivesoftware.smackx.jingleold.packet.JingleContent;
import org.jivesoftware.smackx.jingleold.packet.JingleTransport;
@ -158,6 +159,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Called from above to start the negotiator during a session-initiate.
*/
@Override
protected void doStart() {
try {
@ -173,6 +175,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Called from above to session-terminate.
*/
@Override
public void close() {
super.close();
@ -246,6 +249,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*/
private void checkRemoteCandidate(final TransportCandidate offeredCandidate) {
offeredCandidate.addListener(new TransportResolverListener.Checker() {
@Override
public void candidateChecked(TransportCandidate cand, final boolean validCandidate) {
if (validCandidate) {
if (getNegotiatorState() == JingleNegotiatorState.PENDING)
@ -253,6 +257,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
}
@Override
public void candidateChecking(TransportCandidate cand) {
}
@ -292,6 +297,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
if (resultThread == null && !getRemoteCandidates().isEmpty()) {
resultThread = new Thread(new Runnable() {
@Override
public void run() {
// Sleep for some time, waiting for the candidates checks
@ -351,7 +357,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
for (TransportCandidate candidate : remoteCandidates) {
if (candidate instanceof ICECandidate) {
ICECandidate iceCandidate = (ICECandidate) candidate;
if (iceCandidate.getType().equals("relay")) {
if (iceCandidate.getType().equals(Type.relay)) {
//TODO Check if the relay is reacheable
addValidRemoteCandidate(iceCandidate);
foundRemoteRelay = true;
@ -366,7 +372,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
for (TransportCandidate candidate : offeredCandidates) {
if (candidate instanceof ICECandidate) {
ICECandidate iceCandidate = (ICECandidate) candidate;
if (iceCandidate.getType().equals("relay")) {
if (iceCandidate.getType().equals(Type.relay)) {
foundLocalRelay = true;
}
}
@ -565,13 +571,16 @@ public abstract class TransportNegotiator extends JingleNegotiator {
if (resolverListener == null) {
// Add a listener that sends the offer when the resolver finishes...
resolverListener = new TransportResolverListener.Resolver() {
@Override
public void candidateAdded(TransportCandidate cand) throws NotConnectedException, InterruptedException {
sendTransportCandidateOffer(cand);
}
@Override
public void end() {
}
@Override
public void init() {
}
};
@ -597,6 +606,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
* @throws SmackException
* @throws InterruptedException
*/
@Override
public final List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException, InterruptedException {
List<IQ> responses = new ArrayList<IQ>();
IQ response = null;
@ -838,6 +848,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Get a TransportNegotiator instance.
*/
@Override
public org.jivesoftware.smackx.jingleold.packet.JingleTransport getJingleTransport(TransportCandidate bestRemote) {
org.jivesoftware.smackx.jingleold.packet.JingleTransport.RawUdp jt = new org.jivesoftware.smackx.jingleold.packet.JingleTransport.RawUdp();
jt.addCandidate(new org.jivesoftware.smackx.jingleold.packet.JingleTransport.RawUdp.Candidate(bestRemote));
@ -850,6 +861,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @return the bestRemoteCandidate
*/
@Override
public TransportCandidate getBestRemoteCandidate() {
// Hopefully, we only have one validRemoteCandidate
ArrayList<TransportCandidate> cands = getValidRemoteCandidatesList();
@ -865,6 +877,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Return true for fixed candidates.
*/
@Override
public boolean acceptableTransportCandidate(TransportCandidate tc, List<TransportCandidate> localCandidates) {
return tc instanceof TransportCandidate.Fixed;
}
@ -892,6 +905,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @param candidate
*/
@Override
public org.jivesoftware.smackx.jingleold.packet.JingleTransport getJingleTransport(TransportCandidate candidate) {
org.jivesoftware.smackx.jingleold.packet.JingleTransport.Ice jt = new org.jivesoftware.smackx.jingleold.packet.JingleTransport.Ice();
jt.addCandidate(new org.jivesoftware.smackx.jingleold.packet.JingleTransport.Ice.Candidate(candidate));
@ -903,6 +917,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*
* @return the bestRemoteCandidate
*/
@Override
public TransportCandidate getBestRemoteCandidate() {
ICECandidate result = null;
@ -922,7 +937,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
result = chose;
}
if (result != null && result.getType().equals("relay"))
if (result != null && result.getType().equals(Type.relay))
LOGGER.fine("Relay Type");
return result;
@ -931,6 +946,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
/**
* Return true for ICE candidates.
*/
@Override
public boolean acceptableTransportCandidate(TransportCandidate tc, List<TransportCandidate> localCandidates) {
return tc instanceof ICECandidate;
}

View file

@ -70,7 +70,7 @@ public class Jingle extends IQ {
this();
if (contents != null) {
contents.addAll(contents);
this.contents.addAll(contents);
}
setContentInfo(mi);
@ -343,6 +343,7 @@ public class Jingle extends IQ {
*
* @return the XML string
*/
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) {
if (getInitiator() != null) {
buf.append(" initiator=\"").append(getInitiator()).append('"');

View file

@ -62,6 +62,7 @@ public class JingleContent implements ExtensionElement {
*
* @return the XML element name of the element.
*/
@Override
public String getElementName() {
return NODENAME;
}
@ -71,6 +72,7 @@ public class JingleContent implements ExtensionElement {
*
* @return The namespace
*/
@Override
public String getNamespace() {
// There is no namespace for <content>
return "";
@ -157,6 +159,7 @@ public class JingleContent implements ExtensionElement {
*
* @return a string with the XML representation
*/
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();

View file

@ -51,6 +51,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
*
* @return the XML element name of the element.
*/
@Override
public String getElementName() {
return NODENAME;
}
@ -60,6 +61,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
*
* @return The namespace
*/
@Override
public abstract String getNamespace();
/**
@ -144,6 +146,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
*
* @return a string with the XML representation
*/
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();
@ -183,6 +186,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
addJinglePayloadType(pt);
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@ -279,6 +283,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
super(audio);
}
@Override
protected String getChildAttributes() {
StringBuilder buf = new StringBuilder();
PayloadType pt = getPayloadType();

View file

@ -59,6 +59,7 @@ public class JingleContentInfo implements ExtensionElement {
/**
* Get the element name.
*/
@Override
public String getElementName() {
// Media info is supposed to be just a single-word command...
return getMediaInfo().toString();
@ -76,10 +77,12 @@ public class JingleContentInfo implements ExtensionElement {
/**
* Get the publilc namespace.
*/
@Override
public String getNamespace() {
return namespace;
}
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();
buf.append('<').append(getElementName()).append(" xmlns=\"");
@ -100,6 +103,7 @@ public class JingleContentInfo implements ExtensionElement {
setNamespace(NAMESPACE);
}
@Override
public String getNamespace() {
return NAMESPACE;
}

View file

@ -54,6 +54,7 @@ public abstract class JingleDescription implements ExtensionElement {
*
* @return the XML element name of the element.
*/
@Override
public String getElementName() {
return NODENAME;
}
@ -63,6 +64,7 @@ public abstract class JingleDescription implements ExtensionElement {
*
* @return The namespace
*/
@Override
public abstract String getNamespace();
/**
@ -151,6 +153,7 @@ public abstract class JingleDescription implements ExtensionElement {
*
* @return a string with the XML representation
*/
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();
@ -190,6 +193,7 @@ public abstract class JingleDescription implements ExtensionElement {
addPayloadType(pt);
}
@Override
public String getNamespace() {
return NAMESPACE;
}

View file

@ -73,6 +73,7 @@ public class JingleError implements ExtensionElement {
*
* @return the error as XML.
*/
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();
if (message != null) {
@ -110,14 +111,17 @@ public class JingleError implements ExtensionElement {
return null;
}
@Override
public String toString() {
return getMessage();
}
@Override
public String getElementName() {
return message;
}
@Override
public String getNamespace() {
return NAMESPACE;
}

View file

@ -123,6 +123,7 @@ public class JingleTransport implements ExtensionElement {
*
* @return the XML element name of the element.
*/
@Override
public String getElementName() {
return NODENAME;
}
@ -141,6 +142,7 @@ public class JingleTransport implements ExtensionElement {
*
* @return The namespace
*/
@Override
public String getNamespace() {
return namespace;
}
@ -148,6 +150,7 @@ public class JingleTransport implements ExtensionElement {
/**
* Return the XML representation for this element.
*/
@Override
public String toXML() {
StringBuilder buf = new StringBuilder();
@ -278,6 +281,7 @@ public class JingleTransport implements ExtensionElement {
*
* @see org.jivesoftware.smackx.jingleold.packet.JingleTransport#addCandidate(org.jivesoftware.smackx.jingleold.packet.JingleTransport.JingleTransportCandidate)
*/
@Override
public void addCandidate(final JingleTransportCandidate candidate) {
super.addCandidate(candidate);
}
@ -288,6 +292,7 @@ public class JingleTransport implements ExtensionElement {
*
* @see org.jivesoftware.smackx.jingleold.packet.JingleTransport#getCandidates()
*/
@Override
public List<JingleTransportCandidate> getCandidatesList() {
List<JingleTransportCandidate> copy = new ArrayList<JingleTransportCandidate>();
List<JingleTransportCandidate> superCandidatesList = super.getCandidatesList();
@ -316,6 +321,7 @@ public class JingleTransport implements ExtensionElement {
/**
* Get the elements of this candidate.
*/
@Override
protected String getChildElements() {
StringBuilder buf = new StringBuilder();
@ -360,6 +366,7 @@ public class JingleTransport implements ExtensionElement {
*
* @see org.jivesoftware.smackx.jingleold.packet.JingleTransport#addCandidate(org.jivesoftware.smackx.jingleold.packet.JingleTransport.JingleTransportCandidate)
*/
@Override
public void addCandidate(final JingleTransportCandidate candidate) {
candidates.clear();
super.addCandidate(candidate);
@ -371,6 +378,7 @@ public class JingleTransport implements ExtensionElement {
*
* @see org.jivesoftware.smackx.jingleold.packet.JingleTransport#getCandidates()
*/
@Override
public List<JingleTransportCandidate> getCandidatesList() {
List<JingleTransportCandidate> copy = new ArrayList<JingleTransportCandidate>();
List<JingleTransportCandidate> superCandidatesList = super.getCandidatesList();
@ -402,6 +410,7 @@ public class JingleTransport implements ExtensionElement {
/**
* Get the elements of this candidate.
*/
@Override
protected String getChildElements() {
StringBuilder buf = new StringBuilder();

View file

@ -108,6 +108,7 @@ public abstract class JingleContentDescriptionProvider extends ExtensionElementP
/**
* Parse an audio payload type.
*/
@Override
public JinglePayloadType parsePayload(final XmlPullParser parser) {
JinglePayloadType pte = super.parsePayload(parser);
PayloadType.Audio pt = new PayloadType.Audio(pte.getPayloadType());
@ -125,6 +126,7 @@ public abstract class JingleContentDescriptionProvider extends ExtensionElementP
/**
* Get a new instance of this object.
*/
@Override
protected JingleContentDescription getInstance() {
return new JingleContentDescription.Audio();
}

View file

@ -69,6 +69,7 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
* @throws IOException
* @throws XmlPullParserException
*/
@Override
public JingleDescription parse(XmlPullParser parser, int initialDepth) throws SmackException, XmlPullParserException, IOException {
boolean done = false;
JingleDescription desc = getInstance();
@ -106,6 +107,7 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
/**
* Parse an audio payload type.
*/
@Override
public PayloadType parsePayload(final XmlPullParser parser) {
PayloadType pte = super.parsePayload(parser);
PayloadType.Audio pt = new PayloadType.Audio(pte);
@ -123,6 +125,7 @@ public abstract class JingleDescriptionProvider extends ExtensionElementProvider
/**
* Get a new instance of this object.
*/
@Override
protected JingleDescription getInstance() {
return new JingleDescription.Audio();
}

View file

@ -99,6 +99,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
*
* @return a new TransportNegotiator.Ice instance
*/
@Override
protected JingleTransport getInstance() {
return new JingleTransport.Ice();
}
@ -109,6 +110,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
* @param parser the structure to parse
* @return a candidate element
*/
@Override
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) {
ICECandidate mt = new ICECandidate();
@ -208,6 +210,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
*
* @return a new TransportNegotiator.RawUdp instance
*/
@Override
protected JingleTransport getInstance() {
return new JingleTransport.RawUdp();
}
@ -218,6 +221,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
* @param parser the structure to parse
* @return a candidate element
*/
@Override
protected JingleTransportCandidate parseCandidate(XmlPullParser parser) {
TransportCandidate.Fixed mt = new TransportCandidate.Fixed();