format and imports
This commit is contained in:
parent
02c7bf1c3c
commit
b614988674
@ -323,7 +323,7 @@ public abstract class AbstractProcess {
|
||||
protected static HttpResponse makeFileRequest(String method, String urlStr, Map<String, String> httpHeaders,
|
||||
byte[] buff, String attachmentFileName) throws Exception {
|
||||
|
||||
if (buff==null) {
|
||||
if (buff == null) {
|
||||
log.error("Cannot send NULL payload to rest service.");
|
||||
}
|
||||
|
||||
@ -369,14 +369,14 @@ public abstract class AbstractProcess {
|
||||
int responseCode = con.getResponseCode();
|
||||
|
||||
if (responseCode == 200 || responseCode == 201) {
|
||||
in = con.getInputStream();
|
||||
in = con.getInputStream();
|
||||
} else {
|
||||
in = con.getErrorStream();
|
||||
in = con.getErrorStream();
|
||||
}
|
||||
|
||||
while (in.available() > 0) {
|
||||
int read = in.read(buf);
|
||||
res = res.concat(new String(buf, 0, read));
|
||||
int read = in.read(buf);
|
||||
res = res.concat(new String(buf, 0, read));
|
||||
}
|
||||
|
||||
resp.setHeaders(con.getHeaderFields());
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package cz.trask.apioperator.impl;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -138,7 +137,8 @@ public class ExportToWso2 extends AbstractProcess {
|
||||
private int publishApiToWso2(String fileName, byte[] data, TokenResponse tokenResponse) {
|
||||
int responseCode = -1;
|
||||
try {
|
||||
String url = config.getTargetPublisherApiUrl().concat(String.format("?preserveProvider=false&overwrite=true"));
|
||||
String url = config.getTargetPublisherApiUrl()
|
||||
.concat(String.format("?preserveProvider=false&overwrite=true"));
|
||||
|
||||
log.info("API Import URL: " + url);
|
||||
|
||||
|
||||
@ -4,93 +4,93 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ApiDefinition {
|
||||
private String id;
|
||||
private String name;
|
||||
private Object description;
|
||||
private String context;
|
||||
private String version;
|
||||
private String provider;
|
||||
private String apiDefinition;
|
||||
private Object wsdlUri;
|
||||
private String lifeCycleStatus;
|
||||
private boolean isDefaultVersion;
|
||||
private String type;
|
||||
private List<String> transport;
|
||||
private List<Object> operations;
|
||||
private String authorizationHeader;
|
||||
private List<String> securityScheme;
|
||||
private List<String> tags;
|
||||
private List<Tier> tiers;
|
||||
private boolean hasThumbnail;
|
||||
private Map<String, Object> additionalProperties;
|
||||
private Monetization monetization;
|
||||
private List<Object> ingressURLs;
|
||||
private List<EndpointURLs> endpointURLs;
|
||||
private BusinessInformation businessInformation;
|
||||
private List<String> labels;
|
||||
private List<String> environmentList;
|
||||
private List<Object> scopes;
|
||||
private String avgRating;
|
||||
private AdvertiseInfo advertiseInfo;
|
||||
private boolean isSubscriptionAvailable;
|
||||
private List<String> categories;
|
||||
private List<String> keyManagers;
|
||||
private String id;
|
||||
private String name;
|
||||
private Object description;
|
||||
private String context;
|
||||
private String version;
|
||||
private String provider;
|
||||
private String apiDefinition;
|
||||
private Object wsdlUri;
|
||||
private String lifeCycleStatus;
|
||||
private boolean isDefaultVersion;
|
||||
private String type;
|
||||
private List<String> transport;
|
||||
private List<Object> operations;
|
||||
private String authorizationHeader;
|
||||
private List<String> securityScheme;
|
||||
private List<String> tags;
|
||||
private List<Tier> tiers;
|
||||
private boolean hasThumbnail;
|
||||
private Map<String, Object> additionalProperties;
|
||||
private Monetization monetization;
|
||||
private List<Object> ingressURLs;
|
||||
private List<EndpointURLs> endpointURLs;
|
||||
private BusinessInformation businessInformation;
|
||||
private List<String> labels;
|
||||
private List<String> environmentList;
|
||||
private List<Object> scopes;
|
||||
private String avgRating;
|
||||
private AdvertiseInfo advertiseInfo;
|
||||
private boolean isSubscriptionAvailable;
|
||||
private List<String> categories;
|
||||
private List<String> keyManagers;
|
||||
|
||||
// Getters and Setters
|
||||
// Getters and Setters
|
||||
|
||||
public static class Tier {
|
||||
private String tierName;
|
||||
private String tierPlan;
|
||||
private Object monetizationAttributes;
|
||||
public static class Tier {
|
||||
private String tierName;
|
||||
private String tierPlan;
|
||||
private Object monetizationAttributes;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
|
||||
public static class EndpointURLs {
|
||||
private String environmentName;
|
||||
private String environmentType;
|
||||
private URLs URLs;
|
||||
private DefaultVersionURLs defaultVersionURLs;
|
||||
public static class EndpointURLs {
|
||||
private String environmentName;
|
||||
private String environmentType;
|
||||
private URLs URLs;
|
||||
private DefaultVersionURLs defaultVersionURLs;
|
||||
|
||||
public static class URLs {
|
||||
private String http;
|
||||
private String https;
|
||||
private Object ws;
|
||||
private Object wss;
|
||||
public static class URLs {
|
||||
private String http;
|
||||
private String https;
|
||||
private Object ws;
|
||||
private Object wss;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
|
||||
public static class DefaultVersionURLs {
|
||||
private Object http;
|
||||
private Object https;
|
||||
private Object ws;
|
||||
private Object wss;
|
||||
public static class DefaultVersionURLs {
|
||||
private Object http;
|
||||
private Object https;
|
||||
private Object ws;
|
||||
private Object wss;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
}
|
||||
|
||||
public static class Monetization {
|
||||
private boolean enabled;
|
||||
public static class Monetization {
|
||||
private boolean enabled;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
|
||||
public static class BusinessInformation {
|
||||
private String businessOwner;
|
||||
private String businessOwnerEmail;
|
||||
private String technicalOwner;
|
||||
private String technicalOwnerEmail;
|
||||
public static class BusinessInformation {
|
||||
private String businessOwner;
|
||||
private String businessOwnerEmail;
|
||||
private String technicalOwner;
|
||||
private String technicalOwnerEmail;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
|
||||
public static class AdvertiseInfo {
|
||||
private boolean advertised;
|
||||
private String originalStoreUrl;
|
||||
private String apiOwner;
|
||||
public static class AdvertiseInfo {
|
||||
private boolean advertised;
|
||||
private String originalStoreUrl;
|
||||
private String apiOwner;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
// Getters and Setters
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,95 +2,120 @@ package cz.trask.apioperator.model;
|
||||
|
||||
public class EventAPIInfo {
|
||||
|
||||
String apiName;
|
||||
String apiId;
|
||||
String uuid;
|
||||
String apiVersion;
|
||||
String apiContext;
|
||||
String apiProvider;
|
||||
String apiType;
|
||||
String apiStatus;
|
||||
String eventId;
|
||||
String timeStamp;
|
||||
String type;
|
||||
String tenantId;
|
||||
String tenantDomain;
|
||||
String apiName;
|
||||
String apiId;
|
||||
String uuid;
|
||||
String apiVersion;
|
||||
String apiContext;
|
||||
String apiProvider;
|
||||
String apiType;
|
||||
String apiStatus;
|
||||
String eventId;
|
||||
String timeStamp;
|
||||
String type;
|
||||
String tenantId;
|
||||
String tenantDomain;
|
||||
|
||||
public String getApiName() {
|
||||
return apiName;
|
||||
}
|
||||
|
||||
public void setApiName(String apiName) {
|
||||
this.apiName = apiName;
|
||||
}
|
||||
|
||||
public String getApiId() {
|
||||
return apiId;
|
||||
}
|
||||
|
||||
public void setApiId(String apiId) {
|
||||
this.apiId = apiId;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getApiVersion() {
|
||||
return apiVersion;
|
||||
}
|
||||
|
||||
public void setApiVersion(String apiVersion) {
|
||||
this.apiVersion = apiVersion;
|
||||
}
|
||||
|
||||
public String getApiContext() {
|
||||
return apiContext;
|
||||
}
|
||||
|
||||
public void setApiContext(String apiContext) {
|
||||
this.apiContext = apiContext;
|
||||
}
|
||||
|
||||
public String getApiProvider() {
|
||||
return apiProvider;
|
||||
}
|
||||
|
||||
public void setApiProvider(String apiProvider) {
|
||||
this.apiProvider = apiProvider;
|
||||
}
|
||||
|
||||
public String getApiType() {
|
||||
return apiType;
|
||||
}
|
||||
|
||||
public void setApiType(String apiType) {
|
||||
this.apiType = apiType;
|
||||
}
|
||||
|
||||
public String getApiStatus() {
|
||||
return apiStatus;
|
||||
}
|
||||
|
||||
public void setApiStatus(String apiStatus) {
|
||||
this.apiStatus = apiStatus;
|
||||
}
|
||||
|
||||
public String getEventId() {
|
||||
return eventId;
|
||||
}
|
||||
|
||||
public void setEventId(String eventId) {
|
||||
this.eventId = eventId;
|
||||
}
|
||||
|
||||
public String getTimeStamp() {
|
||||
return timeStamp;
|
||||
}
|
||||
|
||||
public void setTimeStamp(String timeStamp) {
|
||||
this.timeStamp = timeStamp;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
public void setTenantId(String tenantId) {
|
||||
this.tenantId = tenantId;
|
||||
}
|
||||
|
||||
public String getTenantDomain() {
|
||||
return tenantDomain;
|
||||
}
|
||||
|
||||
public void setTenantDomain(String tenantDomain) {
|
||||
this.tenantDomain = tenantDomain;
|
||||
}
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
package cz.trask.apioperator.model;
|
||||
|
||||
public enum FileType {
|
||||
APIDEF,
|
||||
OPENAPI,
|
||||
WSDL,
|
||||
POLICY,
|
||||
UNKNOWN
|
||||
APIDEF, OPENAPI, WSDL, POLICY, UNKNOWN
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user