// Path: src/org/onesocialweb/client/exception/AuthenticationRequired.java
// @SuppressWarnings("serial")
// public class AuthenticationRequired extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/ConnectionException.java
// @SuppressWarnings("serial")
// public class ConnectionException extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/ConnectionRequired.java
// @SuppressWarnings("serial")
// public class ConnectionRequired extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/RequestException.java
// @SuppressWarnings("serial")
// public class RequestException extends Exception {
// 
// 	public RequestException(String message) {
// 		super(message);
// 	}
// }


import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;
import org.onesocialweb.client.exception.AuthenticationRequired;
import org.onesocialweb.client.exception.ConnectionException;
import org.onesocialweb.client.exception.ConnectionRequired;
import org.onesocialweb.client.exception.RequestException;
import org.onesocialweb.model.activity.ActivityEntry;
import org.onesocialweb.model.relation.Relation;
import org.onesocialweb.model.vcard4.Profile;
/*
 *  Copyright 2010 Vodafone Group Services Ltd.
 *
 *  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.onesocialweb.client;




public interface OswService {
 
	/* Connection related commands */
	
    /**
     * Sets if the connection is going to use stream compression. Stream compression
     * will be requested after TLS was established (if TLS was enabled) and only if the server
     * offered stream compression. With stream compression network traffic can be reduced
     * up to 90%. By default compression is disabled.
     *
     * @param compressionEnabled if the connection is going to use stream compression.
     */
	public void setCompressionEnabled(boolean compressionEnabled);
	
    /**
     * Sets if the reconnection mechanism is allowed to be used. By default
     * reconnection is allowed.
     * 
     * @param isAllowed if the reconnection mechanism is allowed to use.
     */
	public void setReconnectionAllowed(boolean isAllowed);
	
	/**
	 * Connects to the specified XMPP server
	 * 
	 * @param server       				hostname of the XMPP server to connect to.
	 * @param port         				port number in which the XMPP Server is running.
	 * @param parameters   				other connection parameters
	 * @return             				true if the connection was successful, false otherwise.
	 * @throws ConnectionException		throws a ConnectionException if it doesn't succeed in 
	 * 									establishing the XMPP Connection
	 */	
	public boolean connect(String server, Integer port, Map<String, String> parameters) throws ConnectionException;

	
	/**
	 * Disconnects from the XMPP server
	 * 
	 * @return  true if it succeeds in disconnecting, false otherwise.
	 * @throws ConnectionRequired   will throw an exception if the service was not connected.
	 */
// Path: src/org/onesocialweb/client/exception/AuthenticationRequired.java
// @SuppressWarnings("serial")
// public class AuthenticationRequired extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/ConnectionException.java
// @SuppressWarnings("serial")
// public class ConnectionException extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/ConnectionRequired.java
// @SuppressWarnings("serial")
// public class ConnectionRequired extends Exception {
// 
// }
// 
// Path: src/org/onesocialweb/client/exception/RequestException.java
// @SuppressWarnings("serial")
// public class RequestException extends Exception {
// 
// 	public RequestException(String message) {
// 		super(message);
// 	}
// }


// Path: src/org/onesocialweb/client/OswService.java
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;
import org.onesocialweb.client.exception.AuthenticationRequired;
import org.onesocialweb.client.exception.ConnectionException;
import org.onesocialweb.client.exception.ConnectionRequired;
import org.onesocialweb.client.exception.RequestException;
import org.onesocialweb.model.activity.ActivityEntry;
import org.onesocialweb.model.relation.Relation;
import org.onesocialweb.model.vcard4.Profile;

/*
 *  Copyright 2010 Vodafone Group Services Ltd.
 *
 *  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.onesocialweb.client;




public interface OswService {
 
	/* Connection related commands */
	
    /**
     * Sets if the connection is going to use stream compression. Stream compression
     * will be requested after TLS was established (if TLS was enabled) and only if the server
     * offered stream compression. With stream compression network traffic can be reduced
     * up to 90%. By default compression is disabled.
     *
     * @param compressionEnabled if the connection is going to use stream compression.
     */
	public void setCompressionEnabled(boolean compressionEnabled);
	
    /**
     * Sets if the reconnection mechanism is allowed to be used. By default
     * reconnection is allowed.
     * 
     * @param isAllowed if the reconnection mechanism is allowed to use.
     */
	public void setReconnectionAllowed(boolean isAllowed);
	
	/**
	 * Connects to the specified XMPP server
	 * 
	 * @param server       				hostname of the XMPP server to connect to.
	 * @param port         				port number in which the XMPP Server is running.
	 * @param parameters   				other connection parameters
	 * @return             				true if the connection was successful, false otherwise.
	 * @throws ConnectionException		throws a ConnectionException if it doesn't succeed in 
	 * 									establishing the XMPP Connection
	 */	
	public boolean connect(String server, Integer port, Map<String, String> parameters) throws ConnectionException;

	
	/**
	 * Disconnects from the XMPP server
	 * 
	 * @return  true if it succeeds in disconnecting, false otherwise.
	 * @throws ConnectionRequired   will throw an exception if the service was not connected.
	 */
	public boolean disconnect() throws ConnectionRequired;