Java Code Examples for javax.servlet.http.HttpServletResponse#SC_NOT_IMPLEMENTED

The following examples show how to use javax.servlet.http.HttpServletResponse#SC_NOT_IMPLEMENTED . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: attic-rave   File: DefaultPersonService.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public List<org.apache.rave.model.Person> getPeople(Set<UserId> userIds, GroupId groupId,
                                                               CollectionOptions collectionOptions,
                                                               SecurityToken token) {
    switch (groupId.getType()) {
        case all:
            return getUniqueListOfConnectedPeople(userIds, collectionOptions, token);
        case friends:
            return getUniqueListOfFriends(userIds, collectionOptions, token);
        case objectId:
            return getGroupMembersFromRepository(collectionOptions, groupId.getObjectId().toString(), token.getAppId());
        case self:
            UserId id = userIds.size() == 1 ? userIds.iterator().next() : new UserId(UserId.Type.me, null);
            return Lists.newArrayList(getPersonForId(id, token));
        case custom:
            throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Custom GroupIDs are not tracked by the container");
        default:
            throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST, "Invalid group id specified by request");
    }
}
 
Example 2
/**
 * Handles a GET request. Note this method is meant to be overridden in descendant classes.
 * @param request The GET request being handled.
 * @param response The response associated with the request.
 * @param path Path suffix required to handle the request.
 * @return A {@link JazzJob} which returns the requested resource on completion.
 */
protected CFJob handleGet(T resource, final HttpServletRequest request, final HttpServletResponse response, final String path) {
	return new CFJob(request, false) {
		@Override
		protected IStatus performJob() {
			String msg = NLS.bind("Failed to handle request for {0}", path); //$NON-NLS-1$
			return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_IMPLEMENTED, msg, null);
		}
	};
}
 
Example 3
/**
 * Handles an idempotent PUT request. Note this method is meant to be overridden in descendant classes.
 * @param request The PUT request being handled.
 * @param response The response associated with the request.
 * @param path Path suffix required to handle the request.
 * @return A {@link JazzJob} which returns the PUT request result on completion. 
 */
protected CFJob handlePut(T resource, final HttpServletRequest request, final HttpServletResponse response, final String path) {
	return new CFJob(request, false) {
		@Override
		protected IStatus performJob() {
			String msg = NLS.bind("Failed to handle request for {0}", path); //$NON-NLS-1$
			return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_IMPLEMENTED, msg, null);
		}
	};
}
 
Example 4
/**
 * Handles a POST request. Note this method is meant to be overridden in descendant classes.
 * The POST request is not idempotent as PUT, although it may handle similar operations.
 * @param request The POST request being handled.
 * @param response The response associated with the request.
 * @param path Path suffix required to handle the request.
 * @return A {@link JazzJob} which returns the POST request result on completion.
 */
protected CFJob handlePost(final T resource, final HttpServletRequest request, final HttpServletResponse response, final String path) {
	return new CFJob(request, false) {
		@Override
		protected IStatus performJob() {
			String msg = NLS.bind("Failed to handle request for {0}", path); //$NON-NLS-1$
			return new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_NOT_IMPLEMENTED, msg, null);
		}
	};
}
 
Example 5
@Override
public Future<Void> deleteMediaItem(UserId userId, String appId, String albumId, String mediaItemId, SecurityToken token) throws ProtocolException {

    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 6
private static RestException fromStatusRuntimeException(StatusRuntimeException e) {
    int statusCode;
    switch (e.getStatus().getCode()) {
        case OK:
            statusCode = HttpServletResponse.SC_OK;
            break;
        case INVALID_ARGUMENT:
            statusCode = HttpServletResponse.SC_BAD_REQUEST;
            break;
        case DEADLINE_EXCEEDED:
            statusCode = HttpServletResponse.SC_REQUEST_TIMEOUT;
            break;
        case NOT_FOUND:
            statusCode = HttpServletResponse.SC_NOT_FOUND;
            break;
        case ALREADY_EXISTS:
            statusCode = HttpServletResponse.SC_CONFLICT;
            break;
        case PERMISSION_DENIED:
            statusCode = HttpServletResponse.SC_FORBIDDEN;
            break;
        case RESOURCE_EXHAUSTED:
            statusCode = TOO_MANY_REQUESTS;
            break;
        case FAILED_PRECONDITION:
            statusCode = HttpServletResponse.SC_CONFLICT;
            break;
        case UNIMPLEMENTED:
            statusCode = HttpServletResponse.SC_NOT_IMPLEMENTED;
            break;
        case UNAVAILABLE:
            statusCode = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
            break;
        case UNAUTHENTICATED:
            statusCode = HttpServletResponse.SC_UNAUTHORIZED;
            break;
        default:
            statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }
    return RestException.newBuilder(statusCode, e.getMessage())
            .withCause(e)
            .build();
}
 
Example 7
@Override
public Future<Void> createMediaItem(UserId userId, String appId, String albumId, MediaItem mediaItem, SecurityToken token) throws ProtocolException {

    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 8
@Override
public Future<RestfulCollection<Activity>> getActivities(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, SecurityToken token) throws ProtocolException {

  throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 9
@Override
public Future<RestfulCollection<Activity>> getActivities(UserId userId, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, Set<String> activityIds, SecurityToken token) throws ProtocolException {

  throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 10
Source Project: attic-rave   File: DefaultGroupService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Future<RestfulCollection<Group>> getGroups(UserId userId, CollectionOptions options, Set<String> fields, SecurityToken token) {
  throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 11
@Override
public Future<Void> deleteActivities(UserId userId, GroupId groupId, String appId, Set<String> activityIds, SecurityToken token) throws ProtocolException {

  throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 12
@Override
public Future<Void> createActivity(UserId userId, GroupId groupId, String appId, Set<String> fields, Activity activity, SecurityToken token) throws ProtocolException {

   throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 13
Source Project: attic-rave   File: DefaultPersonService.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Future<Person> updatePerson(UserId id, Person person, SecurityToken token) throws ProtocolException {
    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 14
Source Project: attic-rave   File: DefaultOAuth2Service.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public OAuth2DataService getDataService() {
    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 15
Source Project: attic-rave   File: DefaultOAuth2Service.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void authenticateClient(OAuth2NormalizedRequest req) throws OAuth2Exception {
    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 16
@Override
public Future<MediaItem> getMediaItem(UserId userId, String appId, String albumId, String mediaItemId, Set<String> fields, SecurityToken token) throws ProtocolException {

    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 17
@Override
public Future<RestfulCollection<MediaItem>> getMediaItems(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, SecurityToken token) throws ProtocolException {

    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 18
Source Project: attic-rave   File: DefaultOAuth2Service.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void validateRequestForResource(OAuth2NormalizedRequest req, Object resourceRequest) throws OAuth2Exception {
    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 19
@Override
public Future<Void> updateMediaItem(UserId userId, String appId, String albumId, String mediaItemId, MediaItem mediaItem, SecurityToken token) throws ProtocolException {

    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}
 
Example 20
Source Project: attic-rave   File: DefaultOAuth2Service.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public OAuth2Code generateRefreshToken(OAuth2NormalizedRequest req) {
    throw new ProtocolException(HttpServletResponse.SC_NOT_IMPLEMENTED, "Not Implemented");
}