-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from szprutamich/master
Version 2.59
- Loading branch information
Showing
13 changed files
with
49 additions
and
193 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,6 @@ | |
import java.text.DateFormat; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
/** | ||
* @author Łukasz Kajda <[email protected]> | ||
|
@@ -206,12 +204,7 @@ private void checkClient(APIClient client) throws APIException { | |
|
||
@JsonIgnore | ||
public String toJson() throws JsonProcessingException { | ||
try { | ||
return new ObjectMapper().writeValueAsString(this); | ||
} catch (JsonProcessingException ex) { | ||
Logger.getLogger(APIEntity.class.getName()).log(Level.SEVERE, null, ex); | ||
} | ||
return ""; | ||
return new ObjectMapper().writeValueAsString(this); | ||
} | ||
|
||
@JsonIgnore | ||
|
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 |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
import com.google.api.client.http.HttpHeaders; | ||
import com.google.api.client.http.apache.ApacheHttpTransport; | ||
import com.google.api.client.http.javanet.NetHttpTransport; | ||
import com.testdroid.api.dto.Context; | ||
import com.testdroid.api.model.APIDevice; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.http.HttpHost; | ||
import org.apache.http.auth.AuthScope; | ||
|
@@ -16,16 +14,18 @@ | |
import org.apache.http.impl.auth.BasicScheme; | ||
import org.apache.http.impl.client.BasicAuthCache; | ||
import org.apache.http.impl.client.DefaultHttpClient; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.security.GeneralSecurityException; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
/** | ||
* @author Michał Szpruta <[email protected]> | ||
*/ | ||
public class APIKeyClient extends AbstractAPIClient { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(APIKeyClient.class); | ||
|
||
private String apiKey; | ||
|
||
public APIKeyClient(String cloudURL, String apiKey) { | ||
|
@@ -38,9 +38,7 @@ public APIKeyClient(String cloudURL, String apiKey, boolean skipCheckCertificate | |
try { | ||
netHttpBuilder = new NetHttpTransport.Builder().doNotValidateCertificate(); | ||
} catch (GeneralSecurityException ex) { | ||
Logger.getLogger(APIKeyClient.class.getName()) | ||
.log(Level.WARNING, "Cannot set not-validating certificate. Certificate will be validating.", | ||
ex); | ||
LOGGER.warn("Cannot set not-validating certificate. Certificate will be validating.", ex); | ||
netHttpBuilder = new NetHttpTransport.Builder(); | ||
} | ||
} else { | ||
|
@@ -57,9 +55,7 @@ public APIKeyClient(String cloudURL, String username, HttpHost proxy, boolean sk | |
try { | ||
apacheBuilder = new ApacheHttpTransport.Builder().setProxy(proxy).doNotValidateCertificate(); | ||
} catch (GeneralSecurityException ex) { | ||
Logger.getLogger(APIKeyClient.class.getName()) | ||
.log(Level.WARNING, "Cannot set not-validating certificate. Certificate will be validating.", | ||
ex); | ||
LOGGER.warn("Cannot set not-validating certificate. Certificate will be validating.", ex); | ||
apacheBuilder = new ApacheHttpTransport.Builder().setProxy(proxy); | ||
} | ||
} else { | ||
|
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
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
* @author Damian Sniezek <[email protected]> | ||
*/ | ||
public enum APIBillingPeriodType { | ||
|
||
BUY, | ||
CHARGE, | ||
CANCEL | ||
|
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
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
Oops, something went wrong.