Examples of ProtocolException


Examples of com.caucho.bam.ProtocolException

    try {
      os = _ws.startBinaryMessage();
     
      _hOut.messageError(os, to, from, payload, error);
    } catch (IOException e) {
      throw new ProtocolException(e);
    } finally {
      IoUtil.close(os);
    }
  }
View Full Code Here

Examples of com.guokr.simbase.errors.ProtocolException

                    discr = readDiscr(line);
                    if (discr == SimUtils.STAR) {
                        state = State.READ_NARGS;
                    } else {
                        String msg = String.format("wrong byte %s('%c')", discr, discr);
                        throw new ProtocolException(msg);
                    }
                }
                break;
            case READ_NARGS:
                if (line != null && line.length() != 0) {
                    nargs = readSize(line);
                    if (nargs < 1) {
                        throw new ProtocolException();
                    }
                    state = State.READ_ARGUMENT;
                    requests.request(nargs);
                    line = null;
                }
                break;
            case READ_ARGUMENT:
                if (nargs > 0) {
                    line = lineReader.readLine(buffer);
                    if (line != null && line.length() != 0) {
                        discr = readDiscr(line);
                        if (discr == SimUtils.DOLLAR) {
                            state = State.READ_NBYTES;
                        }
                    }
                } else if (nargs == 0) {
                    state = State.READ_END;
                } else {
                    throw new ProtocolException();
                }
                break;
            case READ_NBYTES:
                if (line != null && line.length() != 0) {
                    nbytes = readSize(line);
View Full Code Here

Examples of com.icegreen.greenmail.imap.ProtocolException

            throws ProtocolException, FolderException {
        String commandName = parser.atom(request);
        ImapCommand command = commandFactory.getCommand(commandName);
        if (command == null ||
                !(command instanceof UidEnabledCommand)) {
            throw new ProtocolException("Invalid UID command: '" + commandName + "'");
        }

        ((UidEnabledCommand) command).doProcess(request, response, session, true);
    }
View Full Code Here

Examples of com.kurento.tool.rom.server.ProtocolException

        }

        JsonObject subsObject = (JsonObject) subscription;
        Set<Entry<String, JsonElement>> entries = subsObject.entrySet();
        if (entries.size() != 1) {
          throw new ProtocolException(
              "Error format in response to subscription operation."
                  + "The response should have one property and it has "
                  + entries.size() + ". The response is: "
                  + subscription);
        }
View Full Code Here

Examples of com.sleepycat.je.rep.utilint.BinaryProtocol.ProtocolException

            String message = "Server requested protocol version:"
                    + serverVersion.getVersion()
                    + " but the client version is " +
                    candidateProtocol.getVersion();
            logger.info(message);
            throw new ProtocolException(message);
        }

        /*
         * In future we may switch protocol versions to accommodate the server.
         * For now, simply return the one and only version.
View Full Code Here

Examples of com.sun.jini.test.spec.jeri.mux.util.ProtocolException

        //extract the data message
        byte[] dataMessage = new byte[serverBytes.length-8];
        System.arraycopy(serverBytes,8,dataMessage,0,dataMessage.length);
        //Verify that the received message is a data message
        if ((dataMessage[0]&0x80)!=0x80) {
            throw new ProtocolException("Message received: "
                + Util.convert(dataMessage) + " is not a data message");
        }
        //Verify the length of the message
        int size = (dataMessage[2]<<8) + dataMessage[3];
        if (size!=dataMessage.length-4) {
            throw new ProtocolException("Data message received reported"
                + " incorrect size");
        }

    }
View Full Code Here

Examples of com.volantis.mcs.protocols.ProtocolException

     */
    private static ScriptAttributes assetToAttributes(
            final ScriptAssetReference scriptReference) throws ProtocolException {
        final ScriptAsset scriptAsset = scriptReference.getScriptAsset();
        if (scriptAsset == null) {
           throw new ProtocolException(exceptionLocalizer.format(
                    "widget-missing-script-policy-variant"));
       
        final ScriptAttributes attributes = new ScriptAttributes();
        attributes.setCharSet(scriptAsset.getCharacterSet());
        attributes.setLanguage(scriptAsset.getProgrammingLanguage());
View Full Code Here

Examples of cz.matfyz.aai.fantom.server.ProtocolException

          if(moves[0] == null) {
            moves[0] = m;
          } else if(moves[1] == null && mover.hasDoubleMove()) {
            moves[1] = m;
          } else {
            throw new ProtocolException("Too many moves for a single actor.", null);
          }
        }
      }

      if(!isMobile(mover, actors)) {
        immobile.add(mover);
      }

      for(MessageMoveBase.ActorMove move : moves) {
        if(move == null) {
          break;
        }

        assert(mover.equals(move.getActor()));

        if(!isMobile(mover, actors)) {
          throw new ProtocolException("Actor is immobile: " + mover.getId(), null);
        }

        Graph.Node target = move.getTargetNode();
        TransportType tt = move.getTransportType();

        for(Actor a : getActors()) {
          assert(a.getCurrentPosition() != null);
          // Note: It may be possible to move back to the origin.
          if(a.getCurrentPosition() == target
              && !a.equals(mover)
              && a.isDetective() == mover.isDetective()) { // Cannot place two actors of the same type to the same node.
            String errorMessage = String.format("Cannot place actor '%s' to node '%s', node is already occupied by actor '%s'",
                mover.getId(), target.getId(), a.getId());
            throw new ProtocolException(errorMessage, null);
          }
        }

        mover.moveTo(target, tt);
        didMove = true;
      }

      if(didMove) {
        moved.add(mover);
      }
    }

    if(moved.size() + immobile.size() != actors.size()) {
      StringBuilder sb = new StringBuilder();
      for(Actor a : actors) {
        if(!moved.contains(a) && !immobile.contains(a)) {
          if(sb.length() > 0) sb.append(", ");
          sb.append(a.getId());
        }
      }
      throw new ProtocolException("Some actor did not move: " + sb, null);
    }

    return immobile;
  }
View Full Code Here

Examples of java.net.ProtocolException

    }
    else if (sSourceURI.startsWith("ftp://") && sTargetURI.startsWith("ftp://")) {
      bRetVal = moveFTPToFTP(sSourceURI, sTargetURI);
    }
    else {
      throw new ProtocolException("");
    }
    return bRetVal;
  } // move
View Full Code Here

Examples of java.net.ProtocolException

    }

    Object url = _requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);

    if (url == null)
      throw new ProtocolException("No service endpoint address specified");
   
    if (! (url instanceof String))
      throw new IllegalArgumentException("Invalid service endpoint address specified");

    // XXX cache this and the HandlerChainInvoker
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.