Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAMES-1644 JMAP Authentication Servlet Handle authentication response
git-svn-id: https://svn.apache.org/repos/asf/james/project/trunk@1719307 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
5 changed files
with
291 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
server/protocols/jmap/src/main/java/org/apache/james/jmap/BadRequestException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/**************************************************************** | ||
* Licensed to the Apache Software Foundation (ASF) under one * | ||
* or more contributor license agreements. See the NOTICE file * | ||
* distributed with this work for additional information * | ||
* regarding copyright ownership. The ASF licenses this file * | ||
* to you 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.apache.james.jmap; | ||
|
||
public class BadRequestException extends RuntimeException { | ||
|
||
public BadRequestException(String message) { | ||
super(message); | ||
} | ||
|
||
public BadRequestException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
100 changes: 100 additions & 0 deletions
100
server/protocols/jmap/src/main/java/org/apache/james/jmap/model/AccessTokenResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/**************************************************************** | ||
* Licensed to the Apache Software Foundation (ASF) under one * | ||
* or more contributor license agreements. See the NOTICE file * | ||
* distributed with this work for additional information * | ||
* regarding copyright ownership. The ASF licenses this file * | ||
* to you 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.apache.james.jmap.model; | ||
|
||
public class AccessTokenResponse { | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static class Builder { | ||
private String accessToken; | ||
private String api; | ||
private String eventSource; | ||
private String upload; | ||
private String download; | ||
|
||
private Builder() {} | ||
|
||
public Builder accessToken(String accessToken) { | ||
this.accessToken = accessToken; | ||
return this; | ||
} | ||
|
||
public Builder api(String api) { | ||
this.api = api; | ||
return this; | ||
} | ||
|
||
public Builder eventSource(String eventSource) { | ||
this.eventSource = eventSource; | ||
return this; | ||
} | ||
|
||
public Builder upload(String upload) { | ||
this.upload = upload; | ||
return this; | ||
} | ||
|
||
public Builder download(String download) { | ||
this.download = download; | ||
return this; | ||
} | ||
|
||
public AccessTokenResponse build() { | ||
return new AccessTokenResponse(accessToken, api, eventSource, upload, download); | ||
} | ||
} | ||
|
||
private final String accessToken; | ||
private final String api; | ||
private final String eventSource; | ||
private final String upload; | ||
private final String download; | ||
|
||
private AccessTokenResponse(String accessToken, String api, String eventSource, String upload, String download) { | ||
this.accessToken = accessToken; | ||
this.api = api; | ||
this.eventSource = eventSource; | ||
this.upload = upload; | ||
this.download = download; | ||
} | ||
|
||
public String getAccessToken() { | ||
return accessToken; | ||
} | ||
|
||
public String getApi() { | ||
return api; | ||
} | ||
|
||
public String getEventSource() { | ||
return eventSource; | ||
} | ||
|
||
public String getUpload() { | ||
return upload; | ||
} | ||
|
||
public String getDownload() { | ||
return download; | ||
} | ||
|
||
} |
Oops, something went wrong.