Examples of ProtocolException


Examples of org.apache.http.ProtocolException

            requestURI = ((HttpUriRequest) request).getURI();
        } else {
            try {
                requestURI = new URI(request.getRequestLine().getUri());
            } catch (URISyntaxException ex) {
                throw new ProtocolException("Invalid request URI: " +
                        request.getRequestLine().getUri(), ex);
            }
        }
       
        String hostName = targetHost.getHostName();
View Full Code Here

Examples of org.apache.james.imapserver.ProtocolException

                byte[] messageBytes = mailString.getBytes( "US-ASCII" );
                source = new MimeMessageByteArraySource( "Mail" + System.currentTimeMillis(),
                                                         messageBytes);
            }
            catch ( Exception e ) {
                throw new ProtocolException( "UnexpectedException: " + e.getMessage() );
            }

            return new MimeMessageWrapper( source );
        }
View Full Code Here

Examples of org.apache.oodt.cas.protocol.exceptions.ProtocolException

            LOG.log(Level.WARNING, "Failed to instanciate protocol " + clazz
                + " for " + remoteSite.getURL());
          }
        }
        if (protocol == null)
          throw new ProtocolException("Failed to get appropriate protocol for "
              + remoteSite);
      } else {
        connect(protocol = protocolFactory.newInstance(), remoteSite, false);
      }
      if (allowReuse)
View Full Code Here

Examples of org.apache.oodt.cas.pushpull.exceptions.ProtocolException

  public void abortCurFileTransfer() throws ProtocolException {
      try {
          ftp.abort();
      } catch (Exception e) {
          throw new ProtocolException("Failed to abort file transfer : "
                  + e.getMessage());
      }
  }
View Full Code Here

Examples of org.apache.shindig.protocol.ProtocolException

            if (fields == null || fields.size() == 0) {
                applicationData.setData(values);
            }
            //if there are keys in the values map that aren't in the fields set, its a bad request
            else if (!fields.containsAll(values.keySet())) {
                throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Fields parameter must either be empty or contain keys " +
                        "for all name value pairs sent in request.");
            }
            //we have a partial update - we know that the fields set contains keys for all the entries in the values
            //map (due to the check above), so we can just enumerate over it now to finish our work.  So we want to remove
            //any fields found in the fields set that are not found in the values map and update the rest.
View Full Code Here

Examples of org.apache.shindig.protocol.ProtocolException

        Set<UserId> userIds = new HashSet<UserId>(Arrays.asList(userId));
        List<String> personIds = validateReadRequest(userIds, groupId, appId, token);

        //and now check the write level validation which is "only the VIEWER's data is writable"
        if (personIds.size() != 1 || !personIds.get(0).equalsIgnoreCase(token.getViewerId())) {
            throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Writing appdata for anyone but the " +
                    "current viewer is forbidden.");
        }

        return personIds.get(0);
    }
View Full Code Here

Examples of org.apache.shindig.protocol.ProtocolException

        return personIds.get(0);
    }

    private void validateAppIdMatches(String appId, SecurityToken token) {
        if (StringUtils.isBlank(appId) || !appId.equalsIgnoreCase(token.getAppId())) {
            throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Requesting appdata for a different " +
                    "application is forbidden.");
        }
    }
View Full Code Here

Examples of org.codehaus.stomp.ProtocolException

            }
            else if (action.startsWith(Stomp.Commands.DISCONNECT)) {
                onStompDisconnect(command);
            }
            else {
                throw new ProtocolException("Unknown STOMP action: " + action);
            }
        }
        catch (Exception e) {

            // Let the stomp client know about any protocol errors.
View Full Code Here

Examples of org.eclipse.jetty.websocket.api.ProtocolException

        parser.setIncomingFramesHandler(capture);
        parser.parseQuietly(expected);

        Assert.assertEquals("error on invalid close payload",1,capture.getErrorCount(ProtocolException.class));

        ProtocolException known = (ProtocolException)capture.getErrors().poll();

        Assert.assertThat("Payload.message",known.getMessage(),containsString("Invalid close frame payload length"));
    }
View Full Code Here

Examples of org.glassfish.tyrus.core.ProtocolException

            case 0x09:
                return new PingFrame(frame);
            case 0x0A:
                return new PongFrame(frame);
            default:
                throw new ProtocolException(String.format("Unknown wrappedFrame type: %s",
                        Integer.toHexString(frame.getOpcode()).toUpperCase(Locale.US)));
        }
    }
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.