Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #11 from recena/JENKINS-31574
[JENKINS-31574] Improved validation for Scan Credentials
- Loading branch information
Showing
with
194 additions
and 61 deletions.
- +37 −33 src/main/java/org/jenkinsci/plugins/github_branch_source/AbstractGitHubSCMSource.java
- +25 −1 src/main/java/org/jenkinsci/plugins/github_branch_source/Connector.java
- +61 −27 src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
- +71 −0 src/main/java/org/jenkinsci/plugins/github_branch_source/RateLimitExceededException.java
@@ -0,0 +1,71 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright 2015 CloudBees, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package org.jenkinsci.plugins.github_branch_source; | ||
|
||
import java.io.IOException; | ||
|
||
public class RateLimitExceededException extends IOException { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private long limit; | ||
|
||
private long remaining; | ||
|
||
private long reset; | ||
|
||
public RateLimitExceededException() { | ||
super(); | ||
} | ||
|
||
public RateLimitExceededException(String msg, long limit, long remaining, long reset) { | ||
super(msg); | ||
this.limit = limit; | ||
this.remaining = remaining; | ||
this.reset = reset; | ||
} | ||
|
||
public RateLimitExceededException(Throwable cause) { | ||
initCause(cause); | ||
} | ||
|
||
public RateLimitExceededException(String message, Throwable cause) { | ||
super(message); | ||
initCause(cause); | ||
} | ||
|
||
public long getReset() { | ||
return reset; | ||
} | ||
|
||
public long getRemaining() { | ||
return remaining; | ||
} | ||
|
||
public long getLimit() { | ||
return limit; | ||
} | ||
|
||
} |