All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jivesoftware.smack.packet.StreamError Maven / Gradle / Ivy

The newest version!
/**
 *
 * Copyright 2003-2005 Jive Software.
 *
 * All rights reserved. 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.smack.packet;

/**
 * Represents a stream error packet. Stream errors are unrecoverable errors
 * where the server will close the unrelying TCP connection after the stream
 * error was sent to the client. These is the list of stream errors as defined
 * in the XMPP spec:
 * 

* *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CodeDescription
bad-formatthe entity has sent XML that cannot be processed
unsupported-encodingthe entity has sent a namespace prefix that is unsupported
bad-namespace-prefixRemote Server Timeout
conflictthe server is closing the active stream for this entity because a new * stream has been initiated that conflicts with the existing stream.
connection-timeoutthe entity has not generated any traffic over the stream for some period * of time.
host-gonethe value of the 'to' attribute provided by the initiating entity in the * stream header corresponds to a hostname that is no longer hosted by the * server.
host-unknownthe value of the 'to' attribute provided by the initiating entity in the * stream header does not correspond to a hostname that is hosted by the server. *
improper-addressinga stanza sent between two servers lacks a 'to' or 'from' attribute
internal-server-errorthe server has experienced a misconfiguration.
invalid-fromthe JID or hostname provided in a 'from' address does not match an * authorized JID.
invalid-namespacethe streams namespace name is invalid.
invalid-xmlthe entity has sent invalid XML over the stream.
not-authorizedthe entity has attempted to send data before the stream has been * authenticated
policy-violationthe entity has violated some local service policy.
remote-connection-failedRthe server is unable to properly connect to a remote entity.
resource-constraintRthe server lacks the system resources necessary to service the stream.
restricted-xmlthe entity has attempted to send restricted XML features.
see-other-hostthe server will not provide service to the initiating entity but is * redirecting traffic to another host.
system-shutdownthe server is being shut down and all active streams are being closed.
undefined-conditionthe error condition is not one of those defined by the other conditions * in this list.
unsupported-encodingthe initiating entity has encoded the stream in an encoding that is not * supported.
unsupported-stanza-typethe initiating entity has sent a first-level child of the stream that is * not supported.
unsupported-versionthe value of the 'version' attribute provided by the initiating entity in * the stream header specifies a version of XMPP that is not supported.
not-well-formedthe initiating entity has sent XML that is not well-formed.
* * @author Gaston Dombiak */ public class StreamError { public static final String NAMESPACE = "urn:ietf:params:xml:ns:xmpp-streams"; private String code; private String text; public StreamError(String code) { super(); this.code = code; } public StreamError(String code, String text) { this(code); this.text = text; } /** * Returns the error code. * * @return the error code. */ public String getCode() { return code; } /** * Returns the error text, which may be null. * * @return the error text. */ public String getText() { return text; } public String toString() { StringBuilder txt = new StringBuilder(); txt.append("stream:error (").append(code).append(")"); if (text != null) txt.append(" text: ").append(text); return txt.toString(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy