1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Fix checkstyle

This commit is contained in:
vanitasvitae 2017-06-09 23:16:15 +02:00
parent df69c8a81c
commit 327e63f52d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
25 changed files with 249 additions and 123 deletions

View file

@ -1,3 +1,19 @@
/**
*
* 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.
*/
package org.jivesoftware.smackx.jingle;
import java.io.IOException;
@ -16,12 +32,12 @@ import org.jivesoftware.smackx.jingle.provider.JingleContentTransportProvider;
import org.jxmpp.jid.FullJid;
/**
* Created by vanitas on 09.06.17.
* This class defines the shape that JingleTransportManager must be of.
*/
public abstract class JingleBytestreamManager<D extends JingleContentTransport>
public abstract class AbstractJingleTransportManager<D extends JingleContentTransport>
extends Manager {
public JingleBytestreamManager(XMPPConnection connection) {
public AbstractJingleTransportManager(XMPPConnection connection) {
super(connection);
JingleTransportManager.getInstanceFor(connection).registerJingleContentTransportManager(this);
JingleContentProviderManager.addJingleContentTransportProvider(getNamespace(), createJingleContentTransportProvider());

View file

@ -1,40 +0,0 @@
/**
*
* 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.
*/
package org.jivesoftware.smackx.jingle;
import java.io.InputStream;
/**
* Wrapper object that binds together an inputStream with a blockSize.
*/
public class JingleInputStream {
private final InputStream inputStream;
private final int blockSize;
public JingleInputStream(InputStream inputStream, int blockSize) {
this.inputStream = inputStream;
this.blockSize = blockSize;
}
public InputStream getInputStream() {
return inputStream;
}
public int getBlockSize() {
return blockSize;
}
}

View file

@ -1,25 +0,0 @@
/**
*
* 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.
*/
package org.jivesoftware.smackx.jingle;
/**
* Created by vanitas on 06.06.17.
*/
public interface JingleTransportInputStreamCallback {
void onInputStream(JingleInputStream inputStream);
}

View file

@ -34,7 +34,7 @@ public final class JingleTransportManager extends Manager {
public static final WeakHashMap<XMPPConnection, JingleTransportManager> INSTANCES = new WeakHashMap<>();
private final HashMap<String, JingleBytestreamManager<?>> contentTransportManagers = new HashMap<>();
private final HashMap<String, AbstractJingleTransportManager<?>> contentTransportManagers = new HashMap<>();
private JingleTransportManager(XMPPConnection connection) {
super(connection);
@ -49,27 +49,27 @@ public final class JingleTransportManager extends Manager {
return manager;
}
public JingleBytestreamManager<?> getJingleContentTransportManager(String namespace) throws UnsupportedJingleTransportException {
JingleBytestreamManager<?> manager = contentTransportManagers.get(namespace);
public AbstractJingleTransportManager<?> getJingleContentTransportManager(String namespace) throws UnsupportedJingleTransportException {
AbstractJingleTransportManager<?> manager = contentTransportManagers.get(namespace);
if (manager == null) {
throw new UnsupportedJingleTransportException("Cannot find registered JingleContentTransportManager for " + namespace);
}
return manager;
}
public JingleBytestreamManager<?> getJingleContentTransportManager(Jingle jingle) throws UnsupportedJingleTransportException {
public AbstractJingleTransportManager<?> getJingleContentTransportManager(Jingle jingle) throws UnsupportedJingleTransportException {
return getJingleContentTransportManager(jingle.getContents().get(0).getJingleTransports().get(0).getNamespace());
}
public void registerJingleContentTransportManager(JingleBytestreamManager<?> manager) {
public void registerJingleContentTransportManager(AbstractJingleTransportManager<?> manager) {
contentTransportManagers.put(manager.getNamespace(), manager);
}
public void unregisterJingleContentTransportManager(JingleBytestreamManager<?> manager) {
public void unregisterJingleContentTransportManager(AbstractJingleTransportManager<?> manager) {
contentTransportManagers.remove(manager.getNamespace());
}
public Collection<JingleBytestreamManager<?>> getAvailableJingleBytestreamManagers() {
public Collection<AbstractJingleTransportManager<?>> getAvailableJingleBytestreamManagers() {
return Collections.unmodifiableCollection(contentTransportManagers.values());
}

View file

@ -1,15 +0,0 @@
package org.jivesoftware.smackx.jingle;
import java.io.File;
import org.jivesoftware.smackx.jingle.element.Jingle;
/**
* Created by vanitas on 09.06.17.
*/
public class PendingJingleSession {
public PendingJingleSession(Jingle initiation, File file) {
}
}