Package org.itsnat.core

Examples of org.itsnat.core.ItsNatException


    {
        if (!super.processGlobalListeners())
        {
            RequestAttachedClientEventImpl request = getRequestAttachedClientEvent();
            ItsNatSessionImpl session = request.getItsNatSession();
            throw new ItsNatException("Remote observer does not exist with session/client id: " + session.getId() + "/" + lostClientId,session);
        }
        return true;
    }
View Full Code Here


   
    public String toJSNodeLocation(boolean errIfNullNode)
    {
        this.used = true;

        if (errIfNullNode) throw new ItsNatException("No specified node");
       
        return "null";
    }
View Full Code Here

    }

    public void checkAllClientsCanReceiveJSCode()
    {
        if (!clientDoc.isSendCodeEnabled())
            throw new ItsNatException("This client cannot receive JavaScript code",this);
    }
View Full Code Here

    public NodeLocationAlreadyCachedNotParentImpl(Node node,String id,ClientDocumentStfulImpl clientDoc)
    {
        super(node,id,clientDoc);
       
        if (isNull(id))
            throw new ItsNatException("INTERNAL ERROR",node);       
    }
View Full Code Here

    public String addNode(Node node)
    {
        // SE SUPONE QUE EL NODO NO ESTA CACHEADO

        if (node == null) throw new ItsNatException("Null node is not supported",clientDoc);

        if (!isCacheableNode(node,getItsNatStfulDocument().getDocument()))
            return null; // No se puede cachear

        /* Evitamos cachear cuando el cliente
View Full Code Here

    public void addNode(Node node,String id)
    {
        // Ha de existir la seguridad de que es cacheable y
        // SE SUPONE QUE EL NODO NO ESTA CACHEADO, si lo est� dar� error

        if (node == null) throw new ItsNatException("Null node is not supported",clientDoc);

        String idOld = mapByNode.put(node,id);
        Node nodeOld = mapById.put(id,node);

        if (idOld != null) throw new ItsNatException("INTERNAL ERROR");
        if (nodeOld != null) throw new ItsNatException("INTERNAL ERROR");
    }
View Full Code Here

    public boolean isEmpty()
    {
        boolean res = mapById.isEmpty();
        if (res != mapByNode.isEmpty())
            throw new ItsNatException("INTERNAL ERROR");
        return res;
    }
View Full Code Here

            if (writer != null)
                writer.write(text);
        }
        catch(IOException ex)
        {
            throw new ItsNatException(ex);
        }
    }
View Full Code Here

            if (writer != null) writer.close();
            this.writer = null;
        }
        catch(IOException ex)
        {
            throw new ItsNatException(ex,itsNatResponse);
        }

        postProcess();
    }
View Full Code Here

        if (node == doc.getDocumentElement())
            return "de";

        Node parentNode = node.getParentNode();
        if (parentNode == null)
            throw new ItsNatException("Unexpected error");

        int pos = 0; // la posici�n del nodo o la del nodo de texto pero ignorando los nodos de texto anteriores
        Node currNode = parentNode.getFirstChild();
        while(currNode != null)
        {
            if (!isFilteredInClient(currNode))
            {
                if (currNode == node)
                    return Integer.toString(pos)// As� admitimos que currNode pueda ser un Text Node
                if (currNode.getNodeType() != Node.TEXT_NODE)
                    pos++; // Ignoramos los nodos de texto excepto el dado como argumento (si es un Text Node)               
            }

            currNode = currNode.getNextSibling();
        }

        throw new ItsNatException("Node not found in document to calculate paths",node);
        //return "-1";
    }
View Full Code Here

TOP

Related Classes of org.itsnat.core.ItsNatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.