refactor
This commit is contained in:
parent
6bc3b273b3
commit
03ad7c5cf4
@ -101,8 +101,7 @@ public abstract class AbstractProcess {
|
|||||||
System.setProperty("javax.net.ssl.trustStorePassword", config.getTrustStore().getPassword());
|
System.setProperty("javax.net.ssl.trustStorePassword", config.getTrustStore().getPassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
private SSLContext createSSLContext(String trustStorePath, String trustStorePassword)
|
private SSLContext createSSLContext(String trustStorePath, String trustStorePassword) throws Exception {
|
||||||
throws Exception {
|
|
||||||
// Vytvoříme TrustStore
|
// Vytvoříme TrustStore
|
||||||
KeyStore trustStore = KeyStore.getInstance("JKS");
|
KeyStore trustStore = KeyStore.getInstance("JKS");
|
||||||
try (FileInputStream fis = new FileInputStream(trustStorePath)) {
|
try (FileInputStream fis = new FileInputStream(trustStorePath)) {
|
||||||
@ -120,10 +119,8 @@ public abstract class AbstractProcess {
|
|||||||
return sslContext;
|
return sslContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void configureHttpsConnection(HttpsURLConnection connection)
|
protected void configureHttpsConnection(HttpsURLConnection connection) throws Exception {
|
||||||
throws Exception {
|
SSLContext sslContext = createSSLContext(System.getProperty("javax.net.ssl.trustStore"),
|
||||||
SSLContext sslContext = createSSLContext(
|
|
||||||
System.getProperty("javax.net.ssl.trustStore"),
|
|
||||||
System.getProperty("javax.net.ssl.trustStorePassword"));
|
System.getProperty("javax.net.ssl.trustStorePassword"));
|
||||||
connection.setSSLSocketFactory(sslContext.getSocketFactory());
|
connection.setSSLSocketFactory(sslContext.getSocketFactory());
|
||||||
}
|
}
|
||||||
@ -134,15 +131,14 @@ public abstract class AbstractProcess {
|
|||||||
String clientId = register.getClientId();
|
String clientId = register.getClientId();
|
||||||
log.info("Registered with clientId: {}", clientId);
|
log.info("Registered with clientId: {}", clientId);
|
||||||
|
|
||||||
TokenResponse token = getToken(endpoints.getPublisherTokenUrl(), endpoints.getWso2User(),
|
TokenResponse token = getToken(endpoints.getPublisherTokenUrl(), endpoints.getWso2User(), register,
|
||||||
register,
|
"apim:api_view apim:api_create apim:api_manage apim:api_delete apim:api_publish apim:subscription_view apim:subscription_block "
|
||||||
"apim:api_view apim:api_create apim:api_manage apim:api_delete apim:api_publish apim:subscription_view apim:subscription_block "+
|
+ "apim:subscription_manage apim:external_services_discover apim:threat_protection_policy_create apim:threat_protection_policy_manage "
|
||||||
"apim:subscription_manage apim:external_services_discover apim:threat_protection_policy_create apim:threat_protection_policy_manage "+
|
+ "apim:document_create apim:document_manage apim:mediation_policy_view apim:mediation_policy_create apim:mediation_policy_manage "
|
||||||
"apim:document_create apim:document_manage apim:mediation_policy_view apim:mediation_policy_create apim:mediation_policy_manage "+
|
+ "apim:client_certificates_view apim:client_certificates_add apim:client_certificates_update apim:ep_certificates_view apim:ep_certificates_add "
|
||||||
"apim:client_certificates_view apim:client_certificates_add apim:client_certificates_update apim:ep_certificates_view apim:ep_certificates_add "+
|
+ "apim:ep_certificates_update apim:publisher_settings apim:pub_alert_manage apim:shared_scope_manage apim:app_import_export apim:api_import_export "
|
||||||
"apim:ep_certificates_update apim:publisher_settings apim:pub_alert_manage apim:shared_scope_manage apim:app_import_export apim:api_import_export "+
|
+ "apim:api_product_import_export apim:api_generate_key apim:common_operation_policy_view apim:common_operation_policy_manage apim:comment_write "
|
||||||
"apim:api_product_import_export apim:api_generate_key apim:common_operation_policy_view apim:common_operation_policy_manage apim:comment_write "+
|
+ "apim:comment_view apim:admin apim:subscribe apim:api_key apim:app_manage apim:sub_manage apim:store_settings apim:sub_alert_manage");
|
||||||
"apim:comment_view apim:admin apim:subscribe apim:api_key apim:app_manage apim:sub_manage apim:store_settings apim:sub_alert_manage");
|
|
||||||
|
|
||||||
log.debug("Access token received – {}", token.getAccess_token());
|
log.debug("Access token received – {}", token.getAccess_token());
|
||||||
|
|
||||||
@ -516,8 +512,8 @@ public abstract class AbstractProcess {
|
|||||||
String username = decodedstringparts[0];
|
String username = decodedstringparts[0];
|
||||||
String password = decodedstringparts[1];
|
String password = decodedstringparts[1];
|
||||||
|
|
||||||
httpHeaders.put("Authorization", "Basic ".concat(Base64.getEncoder()
|
httpHeaders.put("Authorization",
|
||||||
.encodeToString(username.concat(":").concat(password).getBytes())));
|
"Basic ".concat(Base64.getEncoder().encodeToString(username.concat(":").concat(password).getBytes())));
|
||||||
return httpHeaders;
|
return httpHeaders;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,152 +27,147 @@ import lombok.extern.log4j.Log4j2;
|
|||||||
@Log4j2
|
@Log4j2
|
||||||
public class Wso2AppsToApicurio extends AbstractProcess {
|
public class Wso2AppsToApicurio extends AbstractProcess {
|
||||||
|
|
||||||
private final AtomicInteger appCounter = new AtomicInteger(1);
|
private final AtomicInteger appCounter = new AtomicInteger(1);
|
||||||
|
|
||||||
private final RegistryClient client;
|
private final RegistryClient client;
|
||||||
|
|
||||||
public Wso2AppsToApicurio() throws Exception {
|
public Wso2AppsToApicurio() throws Exception {
|
||||||
this.client = RegistryClientFactory.create(config.getApicurio().getApiUrl());
|
this.client = RegistryClientFactory.create(config.getApicurio().getApiUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point for the import process.
|
* Main entry point for the import process.
|
||||||
*
|
*
|
||||||
* @throws RuntimeException if any error occurs
|
* @throws RuntimeException if any error occurs
|
||||||
*/
|
*/
|
||||||
public void process() {
|
public void process() {
|
||||||
try {
|
try {
|
||||||
log.info("Starting API import to Apicurio from WSO2...");
|
log.info("Starting API import to Apicurio from WSO2...");
|
||||||
|
|
||||||
TokenResponse token = authenticateToWso2AndGetToken(config.getSource());
|
TokenResponse token = authenticateToWso2AndGetToken(config.getSource());
|
||||||
|
|
||||||
ApplicationList apps = getApplicationList(config.getSource().getAdminApiUrl(), token);
|
ApplicationList apps = getApplicationList(config.getSource().getAdminApiUrl(), token);
|
||||||
|
|
||||||
if (apps == null || apps.getList() == null || apps.getList().size() == 0) {
|
if (apps == null || apps.getList() == null || apps.getList().size() == 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"No Applications to export that match your criteria! Check the name of the Application you want to export.");
|
"No Applications to export that match your criteria! Check the name of the Application you want to export.");
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Found {} Applications", apps.getCount());
|
log.info("Found {} Applications", apps.getCount());
|
||||||
|
|
||||||
int maxThreads = config.getMaxThreads();
|
int maxThreads = config.getMaxThreads();
|
||||||
ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
||||||
|
|
||||||
for (ApplicationInfo app : apps.getList()) {
|
for (ApplicationInfo app : apps.getList()) {
|
||||||
final int index = appCounter.getAndIncrement();
|
final int index = appCounter.getAndIncrement();
|
||||||
executor.submit(() -> processApplication(app, token, index, apps.getCount()));
|
executor.submit(() -> processApplication(app, token, index, apps.getCount()));
|
||||||
}
|
}
|
||||||
|
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
||||||
log.warn("Timeout waiting for API import tasks to finish");
|
log.warn("Timeout waiting for API import tasks to finish");
|
||||||
}
|
}
|
||||||
log.info("Finished processing Applications.");
|
log.info("Finished processing Applications.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error while exporting Applications.", e);
|
log.error("Error while exporting Applications.", e);
|
||||||
throw new RuntimeException("Export failed", e);
|
throw new RuntimeException("Export failed", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processApplication(ApplicationInfo app, TokenResponse tokenResponse, int index, int total) {
|
private void processApplication(ApplicationInfo app, TokenResponse tokenResponse, int index, int total) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("Processing API {} of {}", index, total);
|
log.info("Processing API {} of {}", index, total);
|
||||||
|
|
||||||
Map<String, String> httpHeaders = Collections.singletonMap("Authorization",
|
Map<String, String> httpHeaders = Collections.singletonMap("Authorization",
|
||||||
"Bearer " + tokenResponse.getAccess_token());
|
"Bearer " + tokenResponse.getAccess_token());
|
||||||
|
|
||||||
HttpResponse exportedZip = makeRequest("GET",
|
HttpResponse exportedZip = makeRequest(
|
||||||
config.getSource().getAdminApiUrl() + "/export/applications?appName=" + app.getName() + "&appOwner="
|
"GET", config.getSource().getAdminApiUrl() + "/export/applications?appName=" + app.getName()
|
||||||
+ app.getOwner() + "&withKeys=true",
|
+ "&appOwner=" + app.getOwner() + "&withKeys=true",
|
||||||
httpHeaders,
|
httpHeaders, Collections.emptyMap(), true);
|
||||||
Collections.emptyMap(), true);
|
|
||||||
|
|
||||||
List<ZipEntryData> zipEntries = ZipUtils.extractFilesFromZip(exportedZip.getResponseBytes());
|
List<ZipEntryData> zipEntries = ZipUtils.extractFilesFromZip(exportedZip.getResponseBytes());
|
||||||
|
|
||||||
for (ZipEntryData entry : zipEntries) {
|
for (ZipEntryData entry : zipEntries) {
|
||||||
ApplicationDetail appDetail = mapper.readValue(entry.getContent(), ApplicationDetail.class);
|
ApplicationDetail appDetail = mapper.readValue(entry.getContent(), ApplicationDetail.class);
|
||||||
|
|
||||||
String group = ARTIFACT_GROUP_APPLICATIONS;
|
String group = ARTIFACT_GROUP_APPLICATIONS;
|
||||||
String mainArtifactId = appDetail.getName() + "(" + appDetail.getOwner() + ")";
|
String mainArtifactId = appDetail.getName() + "(" + appDetail.getOwner() + ")";
|
||||||
|
|
||||||
VersionSearchResults existingArtifacts;
|
VersionSearchResults existingArtifacts;
|
||||||
try {
|
try {
|
||||||
existingArtifacts = client.listArtifactVersions(group, mainArtifactId, 0, Integer.MAX_VALUE);
|
existingArtifacts = client.listArtifactVersions(group, mainArtifactId, 0, Integer.MAX_VALUE);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("No Application {} exists – will create it", mainArtifactId);
|
log.debug("No Application {} exists – will create it", mainArtifactId);
|
||||||
existingArtifacts = null;
|
existingArtifacts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingArtifacts == null || existingArtifacts.getCount() == 0) {
|
if (existingArtifacts == null || existingArtifacts.getCount() == 0) {
|
||||||
createApplicationInApicurio(appDetail, group, mainArtifactId, entry.getContent());
|
createApplicationInApicurio(appDetail, group, mainArtifactId, entry.getContent());
|
||||||
} else if (existingArtifacts != null && existingArtifacts.getCount() > 0
|
} else if (existingArtifacts != null && existingArtifacts.getCount() > 0
|
||||||
&& config.getApicurio().isOverwriteExistingApplication()) {
|
&& config.getApicurio().isOverwriteExistingApplication()) {
|
||||||
try {
|
try {
|
||||||
log.info("Deleting existing Application in Apicurio '{}' ({}).", appDetail.getName(),
|
log.info("Deleting existing Application in Apicurio '{}' ({}).", appDetail.getName(),
|
||||||
appDetail.getOwner());
|
appDetail.getOwner());
|
||||||
client.deleteArtifact(group, mainArtifactId);
|
client.deleteArtifact(group, mainArtifactId);
|
||||||
createApplicationInApicurio(appDetail, group, mainArtifactId, entry.getContent());
|
createApplicationInApicurio(appDetail, group, mainArtifactId, entry.getContent());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error deleting existing Application '{}' ({}): {}", appDetail.getName(),
|
log.error("Error deleting existing Application '{}' ({}): {}", appDetail.getName(),
|
||||||
appDetail.getOwner(), e.getMessage());
|
appDetail.getOwner(), e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Successfully imported Application '{}' ({}). Took {} ms", app.getName(), app.getOwner(),
|
log.info("Successfully imported Application '{}' ({}). Took {} ms", app.getName(), app.getOwner(),
|
||||||
System.currentTimeMillis() - start);
|
System.currentTimeMillis() - start);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error processing Application {} of {}: {}", index, total, e.getMessage());
|
log.error("Error processing Application {} of {}: {}", index, total, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createApplicationInApicurio(ApplicationDetail appDetail, String group, String mainArtifactId,
|
private void createApplicationInApicurio(ApplicationDetail appDetail, String group, String mainArtifactId,
|
||||||
byte[] content)
|
byte[] content) throws Exception {
|
||||||
throws Exception {
|
log.info("Creating new Application to Apicurio '{}' ({}).", appDetail.getName(), appDetail.getOwner());
|
||||||
log.info("Creating new Application to Apicurio '{}' ({}).", appDetail.getName(),
|
// Create new artifact
|
||||||
appDetail.getOwner());
|
ArtifactMetaData meta = client.createArtifact(group, mainArtifactId, ARTIFACT_APPLICATION_DEFAULT_VERSION, null,
|
||||||
// Create new artifact
|
null, null, appDetail.getName(), appDetail.getName(), null, null, null,
|
||||||
ArtifactMetaData meta = client.createArtifact(group, mainArtifactId,
|
new ByteArrayInputStream(content), null);
|
||||||
ARTIFACT_APPLICATION_DEFAULT_VERSION, null, null,
|
|
||||||
null,
|
|
||||||
appDetail.getName(), appDetail.getName(), null, null, null,
|
|
||||||
new ByteArrayInputStream(content), null);
|
|
||||||
|
|
||||||
// Create the three required rules
|
// Create the three required rules
|
||||||
createRule(meta, "NONE", RuleType.COMPATIBILITY);
|
createRule(meta, "NONE", RuleType.COMPATIBILITY);
|
||||||
createRule(meta, "NONE", RuleType.VALIDITY);
|
createRule(meta, "NONE", RuleType.VALIDITY);
|
||||||
createRule(meta, "NONE", RuleType.INTEGRITY);
|
createRule(meta, "NONE", RuleType.INTEGRITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApplicationList getApplicationList(String adminApiUrl, TokenResponse tokenResponse) throws Exception {
|
private ApplicationList getApplicationList(String adminApiUrl, TokenResponse tokenResponse) throws Exception {
|
||||||
|
|
||||||
ApplicationList listOfApps = null;
|
ApplicationList listOfApps = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String url = adminApiUrl.concat(String.format("/applications"));
|
String url = adminApiUrl.concat(String.format("/applications"));
|
||||||
|
|
||||||
log.debug("Getting Applications with token: '" + tokenResponse.getAccess_token() + "' URL: " + url);
|
log.debug("Getting Applications with token: '" + tokenResponse.getAccess_token() + "' URL: " + url);
|
||||||
|
|
||||||
Map<String, String> httpHeaders = new HashMap<>();
|
Map<String, String> httpHeaders = new HashMap<>();
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
|
|
||||||
httpHeaders.put("Authorization", "Bearer ".concat(tokenResponse.getAccess_token()));
|
httpHeaders.put("Authorization", "Bearer ".concat(tokenResponse.getAccess_token()));
|
||||||
|
|
||||||
HttpResponse response = makeRequest("GET", url, httpHeaders, params);
|
HttpResponse response = makeRequest("GET", url, httpHeaders, params);
|
||||||
|
|
||||||
log.debug("Listing APIs: HTTP Code " + response.getResponseCode() + " Data: " + response.getResponse());
|
log.debug("Listing APIs: HTTP Code " + response.getResponseCode() + " Data: " + response.getResponse());
|
||||||
|
|
||||||
listOfApps = mapper.readValue(response.getResponse(), ApplicationList.class);
|
listOfApps = mapper.readValue(response.getResponse(), ApplicationList.class);
|
||||||
|
|
||||||
if (response.getResponseCode() != 200)
|
if (response.getResponseCode() != 200)
|
||||||
log.error("Cannot list API. Something bad happened.");
|
log.error("Cannot list API. Something bad happened.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Cannot list API:" + e);
|
log.error("Cannot list API:" + e);
|
||||||
throw new Exception("Cannot list API:" + e.getMessage());
|
throw new Exception("Cannot list API:" + e.getMessage());
|
||||||
}
|
}
|
||||||
return listOfApps;
|
return listOfApps;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,8 +148,7 @@ public class ExportApisToWso2FromV32 extends AbstractProcess {
|
|||||||
return responseCode;
|
return responseCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] prepareApiZipFile32to45(SearchedVersion ver, List<ArtifactReference> ref)
|
public byte[] prepareApiZipFile32to45(SearchedVersion ver, List<ArtifactReference> ref) throws Exception {
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
String baseDir = ver.getName() + "-" + ver.getVersion() + "/";
|
String baseDir = ver.getName() + "-" + ver.getVersion() + "/";
|
||||||
|
|
||||||
|
|||||||
@ -28,285 +28,280 @@ import lombok.extern.log4j.Log4j2;
|
|||||||
@Log4j2
|
@Log4j2
|
||||||
public class ExportAppsToWso2FromV32 extends AbstractProcess {
|
public class ExportAppsToWso2FromV32 extends AbstractProcess {
|
||||||
|
|
||||||
private static final int DEFAULT_TIMEOUT_MINUTES = 10;
|
private static final int DEFAULT_TIMEOUT_MINUTES = 10;
|
||||||
private static final String APPLICATIONS_ENDPOINT_PATH = "/applications";
|
private static final String APPLICATIONS_ENDPOINT_PATH = "/applications";
|
||||||
private static final String CHANGE_OWNER_PATH = "/change-owner";
|
private static final String CHANGE_OWNER_PATH = "/change-owner";
|
||||||
|
|
||||||
private final AtomicInteger appCounter = new AtomicInteger(1);
|
private final AtomicInteger appCounter = new AtomicInteger(1);
|
||||||
private SearchedArtifact adminsDefaultApplication;
|
private SearchedArtifact adminsDefaultApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main entry point for the export process.
|
* Main entry point for the export process.
|
||||||
*
|
*
|
||||||
* @throws RuntimeException if any error occurs
|
* @throws RuntimeException if any error occurs
|
||||||
*/
|
*/
|
||||||
public void process() {
|
public void process() {
|
||||||
try {
|
try {
|
||||||
log.info("Starting App export to WSO2 from Apicurio...");
|
log.info("Starting App export to WSO2 from Apicurio...");
|
||||||
|
|
||||||
TokenResponse token = authenticateToWso2AndGetToken(config.getTarget());
|
TokenResponse token = authenticateToWso2AndGetToken(config.getTarget());
|
||||||
|
|
||||||
ArtifactSearchResults apps = client.searchArtifacts(ARTIFACT_GROUP_APPLICATIONS, null, null,
|
ArtifactSearchResults apps = client.searchArtifacts(ARTIFACT_GROUP_APPLICATIONS, null, null, null, null,
|
||||||
null, null, null, null, null, null);
|
null, null, null, null);
|
||||||
|
|
||||||
log.info("Found {} Apps", apps.getCount());
|
log.info("Found {} Apps", apps.getCount());
|
||||||
|
|
||||||
processApplications(apps, token);
|
processApplications(apps, token);
|
||||||
|
|
||||||
if (adminsDefaultApplication != null) {
|
if (adminsDefaultApplication != null) {
|
||||||
log.info("Found default application for admin: {}", adminsDefaultApplication.getName());
|
log.info("Found default application for admin: {}", adminsDefaultApplication.getName());
|
||||||
processApp(adminsDefaultApplication, token, 1, 1, true);
|
processApp(adminsDefaultApplication, token, 1, 1, true);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error while exporting Apps.", e);
|
log.error("Error while exporting Apps.", e);
|
||||||
throw new RuntimeException("Export failed", e);
|
throw new RuntimeException("Export failed", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processApplications(ArtifactSearchResults apps, TokenResponse token) throws InterruptedException {
|
private void processApplications(ArtifactSearchResults apps, TokenResponse token) throws InterruptedException {
|
||||||
int maxThreads = config.getMaxThreads();
|
int maxThreads = config.getMaxThreads();
|
||||||
ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
ExecutorService executor = Executors.newFixedThreadPool(maxThreads);
|
||||||
|
|
||||||
for (SearchedArtifact app : apps.getArtifacts()) {
|
for (SearchedArtifact app : apps.getArtifacts()) {
|
||||||
final int index = appCounter.getAndIncrement();
|
final int index = appCounter.getAndIncrement();
|
||||||
executor.submit(() -> processApp(app, token, index, apps.getCount(), false));
|
executor.submit(() -> processApp(app, token, index, apps.getCount(), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
if (!executor.awaitTermination(DEFAULT_TIMEOUT_MINUTES, TimeUnit.MINUTES)) {
|
if (!executor.awaitTermination(DEFAULT_TIMEOUT_MINUTES, TimeUnit.MINUTES)) {
|
||||||
log.warn("Timeout waiting for App export tasks to finish");
|
log.warn("Timeout waiting for App export tasks to finish");
|
||||||
}
|
}
|
||||||
log.info("Finished processing Apps.");
|
log.info("Finished processing Apps.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processApp(SearchedArtifact app, TokenResponse tokenResponse, int index, int total,
|
private void processApp(SearchedArtifact app, TokenResponse tokenResponse, int index, int total,
|
||||||
boolean createAdminApp) {
|
boolean createAdminApp) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("Processing App {} of {}", index, total);
|
log.info("Processing App {} of {}", index, total);
|
||||||
|
|
||||||
VersionSearchResults versions = client.listArtifactVersions(ARTIFACT_GROUP_APPLICATIONS,
|
VersionSearchResults versions = client.listArtifactVersions(ARTIFACT_GROUP_APPLICATIONS, app.getId(), null,
|
||||||
app.getId(), null, null);
|
null);
|
||||||
|
|
||||||
for (SearchedVersion ver : versions.getVersions()) {
|
for (SearchedVersion ver : versions.getVersions()) {
|
||||||
processAppVersion(app, tokenResponse, ver, createAdminApp);
|
processAppVersion(app, tokenResponse, ver, createAdminApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
log.info("Finished processing App {} of {} in {} ms", index, total, (end - start));
|
log.info("Finished processing App {} of {} in {} ms", index, total, (end - start));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("IO error while importing App {}: {}", app.getId(), e.getMessage(), e);
|
log.error("IO error while importing App {}: {}", app.getId(), e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processAppVersion(SearchedArtifact app, TokenResponse tokenResponse, SearchedVersion version,
|
private void processAppVersion(SearchedArtifact app, TokenResponse tokenResponse, SearchedVersion version,
|
||||||
boolean createAdminApp) {
|
boolean createAdminApp) {
|
||||||
try {
|
try {
|
||||||
log.info(" - Found version: {}", version.getVersion());
|
log.info(" - Found version: {}", version.getVersion());
|
||||||
|
|
||||||
ArtifactMetaData amd = client.getArtifactMetaData(app.getGroupId(), app.getId());
|
ArtifactMetaData amd = client.getArtifactMetaData(app.getGroupId(), app.getId());
|
||||||
byte[] content = client.getContentByGlobalId(amd.getGlobalId()).readAllBytes();
|
byte[] content = client.getContentByGlobalId(amd.getGlobalId()).readAllBytes();
|
||||||
|
|
||||||
if (content != null && content.length > 0) {
|
if (content != null && content.length > 0) {
|
||||||
ApplicationDetail appDetail = mapper.readValue(content, ApplicationDetail.class);
|
ApplicationDetail appDetail = mapper.readValue(content, ApplicationDetail.class);
|
||||||
|
|
||||||
// Skip default admin application unless explicitly requested
|
// Skip default admin application unless explicitly requested
|
||||||
if (DEFAULT_APPLICATION_NAME.equals(appDetail.getName())
|
if (DEFAULT_APPLICATION_NAME.equals(appDetail.getName()) && ADMIN_USERNAME.equals(appDetail.getOwner())
|
||||||
&& ADMIN_USERNAME.equals(appDetail.getOwner()) && !createAdminApp) {
|
&& !createAdminApp) {
|
||||||
adminsDefaultApplication = app;
|
adminsDefaultApplication = app;
|
||||||
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
||||||
log.info(" - Skipping import of admins-default-application for now.");
|
log.info(" - Skipping import of admins-default-application for now.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationCreateRequest appCreateRequest = mapAppDetailToCreateRequest(appDetail);
|
ApplicationCreateRequest appCreateRequest = mapAppDetailToCreateRequest(appDetail);
|
||||||
byte[] data = mapper.writeValueAsBytes(appCreateRequest);
|
byte[] data = mapper.writeValueAsBytes(appCreateRequest);
|
||||||
log.info(" - Application {} with owner {} prepared for WSO2 export", appDetail.getName(),
|
log.info(" - Application {} with owner {} prepared for WSO2 export", appDetail.getName(),
|
||||||
appDetail.getOwner());
|
appDetail.getOwner());
|
||||||
|
|
||||||
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
||||||
|
|
||||||
HttpResponse response = publishAppToWso2(appDetail.getName(), data, tokenResponse);
|
HttpResponse response = publishAppToWso2(appDetail.getName(), data, tokenResponse);
|
||||||
|
|
||||||
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
||||||
log.info(" - Application {} imported successfully", appDetail.getName());
|
log.info(" - Application {} imported successfully", appDetail.getName());
|
||||||
|
|
||||||
ApplicationCreateResponse createdApp = mapper.readValue(response.getResponse(),
|
ApplicationCreateResponse createdApp = mapper.readValue(response.getResponse(),
|
||||||
ApplicationCreateResponse.class);
|
ApplicationCreateResponse.class);
|
||||||
log.info(" - Created Application ID in WSO2: {}", createdApp.getApplicationId());
|
log.info(" - Created Application ID in WSO2: {}", createdApp.getApplicationId());
|
||||||
|
|
||||||
if (appDetail.getKeyManagerWiseOAuthApp() != null
|
if (appDetail.getKeyManagerWiseOAuthApp() != null
|
||||||
&& !appDetail.getKeyManagerWiseOAuthApp().isEmpty()) {
|
&& !appDetail.getKeyManagerWiseOAuthApp().isEmpty()) {
|
||||||
log.info(" - Application {} has {} Key Mappings to create",
|
log.info(" - Application {} has {} Key Mappings to create", appDetail.getName(),
|
||||||
appDetail.getName(), appDetail.getKeyManagerWiseOAuthApp().size());
|
appDetail.getKeyManagerWiseOAuthApp().size());
|
||||||
for (Entry<String, Map<String, KeyManagerApp>> entry : appDetail
|
for (Entry<String, Map<String, KeyManagerApp>> entry : appDetail.getKeyManagerWiseOAuthApp()
|
||||||
.getKeyManagerWiseOAuthApp().entrySet()) {
|
.entrySet()) {
|
||||||
String keyType = entry.getKey();
|
String keyType = entry.getKey();
|
||||||
|
|
||||||
Map<String, KeyManagerApp> keyManagerApp = entry.getValue();
|
Map<String, KeyManagerApp> keyManagerApp = entry.getValue();
|
||||||
|
|
||||||
for (Entry<String, KeyManagerApp> kmEntry : keyManagerApp.entrySet()) {
|
for (Entry<String, KeyManagerApp> kmEntry : keyManagerApp.entrySet()) {
|
||||||
String keyManager = kmEntry.getKey();
|
String keyManager = kmEntry.getKey();
|
||||||
KeyManagerApp oauthInfo = kmEntry.getValue();
|
KeyManagerApp oauthInfo = kmEntry.getValue();
|
||||||
|
|
||||||
log.info(" - Creating Key Mapping for Key Manager: {}", keyManager);
|
log.info(" - Creating Key Mapping for Key Manager: {}", keyManager);
|
||||||
// Map to v4.5 request
|
// Map to v4.5 request
|
||||||
ApplicationKeyMappingRequest45 keyMappingRequest = ApplicationKeyMappingRequest45
|
ApplicationKeyMappingRequest45 keyMappingRequest = ApplicationKeyMappingRequest45
|
||||||
.builder()
|
.builder().consumerKey(oauthInfo.getClientId())
|
||||||
.consumerKey(oauthInfo.getClientId())
|
.consumerSecret(oauthInfo.getClientSecret()).keyManager(keyManager)
|
||||||
.consumerSecret(oauthInfo.getClientSecret())
|
.keyType(ApplicationKeyMappingRequest45.KeyType.valueOf(keyType)).build();
|
||||||
.keyManager(keyManager)
|
|
||||||
.keyType(ApplicationKeyMappingRequest45.KeyType
|
|
||||||
.valueOf(keyType))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
byte[] kmData = mapper.writeValueAsBytes(keyMappingRequest);
|
byte[] kmData = mapper.writeValueAsBytes(keyMappingRequest);
|
||||||
publishApplicationKeyMappingToWso2(createdApp.getApplicationId(), kmData,
|
publishApplicationKeyMappingToWso2(createdApp.getApplicationId(), kmData,
|
||||||
tokenResponse);
|
tokenResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createdApp.getOwner().equals(appDetail.getOwner())) {
|
if (!createdApp.getOwner().equals(appDetail.getOwner())) {
|
||||||
log.info(" - Changing owner of Application {} to {}", createdApp.getApplicationId(),
|
log.info(" - Changing owner of Application {} to {}", createdApp.getApplicationId(),
|
||||||
appDetail.getOwner());
|
appDetail.getOwner());
|
||||||
changeApplicationOwner(createdApp, appDetail.getOwner(), tokenResponse);
|
changeApplicationOwner(createdApp, appDetail.getOwner(), tokenResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error processing application version: {}", e.getMessage(), e);
|
log.error("Error processing application version: {}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void publishApplicationKeyMappingToWso2(String applicationId, byte[] kmData, TokenResponse tokenResponse) {
|
private void publishApplicationKeyMappingToWso2(String applicationId, byte[] kmData, TokenResponse tokenResponse) {
|
||||||
try {
|
try {
|
||||||
// Publish the application key mapping data to WSO2
|
// Publish the application key mapping data to WSO2
|
||||||
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
||||||
httpHeaders.put("Content-Type", "application/json");
|
httpHeaders.put("Content-Type", "application/json");
|
||||||
|
|
||||||
String endpoint = config.getTarget().getDevPortalApiUrl() + "/v3/applications/" + applicationId
|
String endpoint = config.getTarget().getDevPortalApiUrl() + "/v3/applications/" + applicationId
|
||||||
+ "/map-keys";
|
+ "/map-keys";
|
||||||
|
|
||||||
HttpResponse response = makeDataRequest(endpoint, httpHeaders, kmData);
|
HttpResponse response = makeDataRequest(endpoint, httpHeaders, kmData);
|
||||||
|
|
||||||
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
||||||
log.info(" - Key Mapping for Application {} created successfully in WSO2", applicationId);
|
log.info(" - Key Mapping for Application {} created successfully in WSO2", applicationId);
|
||||||
} else {
|
} else {
|
||||||
log.warn(" - Key Mapping for Application {} creation in WSO2 failed with response code {}",
|
log.warn(" - Key Mapping for Application {} creation in WSO2 failed with response code {}",
|
||||||
applicationId, response.getResponseCode());
|
applicationId, response.getResponseCode());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("IO error while creating Key Mapping for Application {}: {}", applicationId,
|
log.error("IO error while creating Key Mapping for Application {}: {}", applicationId, e.getMessage(), e);
|
||||||
e.getMessage(), e);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void deleteWso2ApplicationIfExists(ApplicationDetail appDetail, TokenResponse tokenResponse) {
|
private void deleteWso2ApplicationIfExists(ApplicationDetail appDetail, TokenResponse tokenResponse) {
|
||||||
// Resolve application id by name first (WSO2 Admin API works with applicationId
|
// Resolve application id by name first (WSO2 Admin API works with applicationId
|
||||||
// in paths)
|
// in paths)
|
||||||
String resolvedAppId = getExistingApplicationId(config.getTarget().getAdminApiUrl(), appDetail, tokenResponse);
|
String resolvedAppId = getExistingApplicationId(config.getTarget().getAdminApiUrl(), appDetail, tokenResponse);
|
||||||
|
|
||||||
if (resolvedAppId == null) {
|
if (resolvedAppId == null) {
|
||||||
log.warn(" - Application {} not found in WSO2, cannot delete", appDetail.getName());
|
log.warn(" - Application {} not found in WSO2, cannot delete", appDetail.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String endpoint = config.getTarget().getAdminApiUrl() + APPLICATIONS_ENDPOINT_PATH + "/" + resolvedAppId;
|
String endpoint = config.getTarget().getAdminApiUrl() + APPLICATIONS_ENDPOINT_PATH + "/" + resolvedAppId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
||||||
|
|
||||||
HttpResponse response = makeRequest("DELETE", endpoint, httpHeaders, null);
|
HttpResponse response = makeRequest("DELETE", endpoint, httpHeaders, null);
|
||||||
|
|
||||||
if (response.getResponseCode() == 200 || response.getResponseCode() == 204) {
|
if (response.getResponseCode() == 200 || response.getResponseCode() == 204) {
|
||||||
log.info(" - Application {} (id={}) deleted successfully from WSO2", appDetail.getName(),
|
log.info(" - Application {} (id={}) deleted successfully from WSO2", appDetail.getName(),
|
||||||
resolvedAppId);
|
resolvedAppId);
|
||||||
} else {
|
} else {
|
||||||
log.info(" - Application {} (id={}) deletion from WSO2 returned response code {}",
|
log.info(" - Application {} (id={}) deletion from WSO2 returned response code {}", appDetail.getName(),
|
||||||
appDetail.getName(), resolvedAppId, response.getResponseCode());
|
resolvedAppId, response.getResponseCode());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("IO error while deleting Application {} (id={}): {}", appDetail.getName(), resolvedAppId,
|
log.error("IO error while deleting Application {} (id={}): {}", appDetail.getName(), resolvedAppId,
|
||||||
e.getMessage(), e);
|
e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getExistingApplicationId(String adminApiUrl, ApplicationDetail appDetail,
|
private String getExistingApplicationId(String adminApiUrl, ApplicationDetail appDetail,
|
||||||
TokenResponse tokenResponse) {
|
TokenResponse tokenResponse) {
|
||||||
try {
|
try {
|
||||||
String url = adminApiUrl.concat(APPLICATIONS_ENDPOINT_PATH);
|
String url = adminApiUrl.concat(APPLICATIONS_ENDPOINT_PATH);
|
||||||
|
|
||||||
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
|
|
||||||
HttpResponse response = makeRequest("GET", url, httpHeaders, params);
|
HttpResponse response = makeRequest("GET", url, httpHeaders, params);
|
||||||
|
|
||||||
if (response.getResponseCode() != 200) {
|
if (response.getResponseCode() != 200) {
|
||||||
log.warn("Cannot list Applications (HTTP {}). Will not attempt delete.", response.getResponseCode());
|
log.warn("Cannot list Applications (HTTP {}). Will not attempt delete.", response.getResponseCode());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationListResponse45 listOfApps = mapper.readValue(response.getResponse(),
|
ApplicationListResponse45 listOfApps = mapper.readValue(response.getResponse(),
|
||||||
ApplicationListResponse45.class);
|
ApplicationListResponse45.class);
|
||||||
|
|
||||||
if (listOfApps != null && listOfApps.getList() != null) {
|
if (listOfApps != null && listOfApps.getList() != null) {
|
||||||
for (ApplicationListResponse45.Application info : listOfApps.getList()) {
|
for (ApplicationListResponse45.Application info : listOfApps.getList()) {
|
||||||
if (appDetail.getName().equals(info.getName()) && appDetail.getOwner().equals(info.getOwner())) {
|
if (appDetail.getName().equals(info.getName()) && appDetail.getOwner().equals(info.getOwner())) {
|
||||||
return info.getApplicationId();
|
return info.getApplicationId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error while resolving Application id for name {}: {}", appDetail.getName(), e.getMessage(), e);
|
log.error("Error while resolving Application id for name {}: {}", appDetail.getName(), e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpResponse publishAppToWso2(String name, byte[] data, TokenResponse tokenResponse) throws Exception {
|
private HttpResponse publishAppToWso2(String name, byte[] data, TokenResponse tokenResponse) throws Exception {
|
||||||
// Publish the application data to WSO2
|
// Publish the application data to WSO2
|
||||||
Map<String, String> httpHeaders = createBasicAuthHeaders(config.getTarget().getWso2User());
|
Map<String, String> httpHeaders = createBasicAuthHeaders(config.getTarget().getWso2User());
|
||||||
httpHeaders.put("Content-Type", "application/json");
|
httpHeaders.put("Content-Type", "application/json");
|
||||||
|
|
||||||
String endpoint = config.getTarget().getDevPortalApiUrl() + "/v3/applications";
|
String endpoint = config.getTarget().getDevPortalApiUrl() + "/v3/applications";
|
||||||
|
|
||||||
return makeDataRequest(endpoint, httpHeaders, data);
|
return makeDataRequest(endpoint, httpHeaders, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeApplicationOwner(ApplicationCreateResponse createdApp, String origOwner,
|
private void changeApplicationOwner(ApplicationCreateResponse createdApp, String origOwner,
|
||||||
TokenResponse tokenResponse) {
|
TokenResponse tokenResponse) {
|
||||||
String endpoint = config.getTarget().getAdminApiUrl() + APPLICATIONS_ENDPOINT_PATH + "/"
|
String endpoint = config.getTarget().getAdminApiUrl() + APPLICATIONS_ENDPOINT_PATH + "/"
|
||||||
+ createdApp.getApplicationId() + CHANGE_OWNER_PATH + "?owner=" + origOwner;
|
+ createdApp.getApplicationId() + CHANGE_OWNER_PATH + "?owner=" + origOwner;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
Map<String, String> httpHeaders = createBearerAuthHeaders(tokenResponse);
|
||||||
|
|
||||||
HttpResponse response = makeRequest("POST", endpoint, httpHeaders, null);
|
HttpResponse response = makeRequest("POST", endpoint, httpHeaders, null);
|
||||||
|
|
||||||
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
if (response.getResponseCode() == 200 || response.getResponseCode() == 201) {
|
||||||
log.info(" - Application {} owner changed successfully to {}", createdApp.getApplicationId(),
|
log.info(" - Application {} owner changed successfully to {}", createdApp.getApplicationId(),
|
||||||
origOwner);
|
origOwner);
|
||||||
} else {
|
} else {
|
||||||
log.warn(" - Application {} owner change to {} failed with response code {}",
|
log.warn(" - Application {} owner change to {} failed with response code {}",
|
||||||
createdApp.getApplicationId(), origOwner, response.getResponseCode());
|
createdApp.getApplicationId(), origOwner, response.getResponseCode());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("IO error while changing owner of Application {}: {}", createdApp.getApplicationId(),
|
log.error("IO error while changing owner of Application {}: {}", createdApp.getApplicationId(),
|
||||||
e.getMessage(), e);
|
e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApplicationCreateRequest mapAppDetailToCreateRequest(ApplicationDetail appDetail) {
|
private ApplicationCreateRequest mapAppDetailToCreateRequest(ApplicationDetail appDetail) {
|
||||||
ApplicationCreateRequest request = new ApplicationCreateRequest();
|
ApplicationCreateRequest request = new ApplicationCreateRequest();
|
||||||
request.setName(appDetail.getName());
|
request.setName(appDetail.getName());
|
||||||
request.setDescription(appDetail.getDescription());
|
request.setDescription(appDetail.getDescription());
|
||||||
request.setThrottlingPolicy(appDetail.getTier());
|
request.setThrottlingPolicy(appDetail.getTier());
|
||||||
request.setTokenType(appDetail.getTokenType());
|
request.setTokenType(appDetail.getTokenType());
|
||||||
request.setGroups(List.of(appDetail.getGroupId()));
|
request.setGroups(List.of(appDetail.getGroupId()));
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +42,8 @@ public class ApiDefinitionMapper32to45 {
|
|||||||
: "");
|
: "");
|
||||||
data.setVersion(oldApi.getId() != null ? oldApi.getId().getVersion() : null);
|
data.setVersion(oldApi.getId() != null ? oldApi.getId().getVersion() : null);
|
||||||
data.setProvider(oldApi.getId() != null ? oldApi.getId().getProviderName() : null);
|
data.setProvider(oldApi.getId() != null ? oldApi.getId().getProviderName() : null);
|
||||||
//data.setContext(swaggerData.get("basePath") != null ? swaggerData.get("basePath").toString() : "");
|
// data.setContext(swaggerData.get("basePath") != null ?
|
||||||
|
// swaggerData.get("basePath").toString() : "");
|
||||||
data.setContext(oldApi.getContext());
|
data.setContext(oldApi.getContext());
|
||||||
data.setLifeCycleStatus(oldApi.getStatus());
|
data.setLifeCycleStatus(oldApi.getStatus());
|
||||||
data.setDefaultVersion(oldApi.isDefaultVersion());
|
data.setDefaultVersion(oldApi.isDefaultVersion());
|
||||||
|
|||||||
@ -1,111 +1,111 @@
|
|||||||
package cz.trask.migration.model.v32;
|
package cz.trask.migration.model.v32;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ApplicationDetail {
|
public class ApplicationDetail {
|
||||||
private int id;
|
private int id;
|
||||||
private String name;
|
private String name;
|
||||||
private String uuid;
|
private String uuid;
|
||||||
private Subscriber subscriber;
|
private Subscriber subscriber;
|
||||||
private List<SubscribedAPI> subscribedAPIs;
|
private List<SubscribedAPI> subscribedAPIs;
|
||||||
private List<?> keys;
|
private List<?> keys;
|
||||||
private Map<String, Map<String, KeyManagerApp>> keyManagerWiseOAuthApp;
|
private Map<String, Map<String, KeyManagerApp>> keyManagerWiseOAuthApp;
|
||||||
private String tier;
|
private String tier;
|
||||||
private String description;
|
private String description;
|
||||||
private String status;
|
private String status;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
private String owner;
|
private String owner;
|
||||||
private Map<String, Object> applicationAttributes;
|
private Map<String, Object> applicationAttributes;
|
||||||
private String tokenType;
|
private String tokenType;
|
||||||
private int subscriptionCount;
|
private int subscriptionCount;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Subscriber {
|
public static class Subscriber {
|
||||||
private String name;
|
private String name;
|
||||||
private int id;
|
private int id;
|
||||||
private int tenantId;
|
private int tenantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class SubscribedAPI {
|
public static class SubscribedAPI {
|
||||||
private int subscriptionId;
|
private int subscriptionId;
|
||||||
private Tier tier;
|
private Tier tier;
|
||||||
private Subscriber subscriber;
|
private Subscriber subscriber;
|
||||||
private ApiId apiId;
|
private ApiId apiId;
|
||||||
private Application application;
|
private Application application;
|
||||||
private String subStatus;
|
private String subStatus;
|
||||||
private String subCreatedStatus;
|
private String subCreatedStatus;
|
||||||
private List<?> keys;
|
private List<?> keys;
|
||||||
private String uuid;
|
private String uuid;
|
||||||
private boolean isBlocked;
|
private boolean isBlocked;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Tier {
|
public static class Tier {
|
||||||
private String name;
|
private String name;
|
||||||
private String displayName;
|
private String displayName;
|
||||||
private int requestsPerMin;
|
private int requestsPerMin;
|
||||||
private int requestCount;
|
private int requestCount;
|
||||||
private int unitTime;
|
private int unitTime;
|
||||||
private String timeUnit;
|
private String timeUnit;
|
||||||
private boolean stopOnQuotaReached;
|
private boolean stopOnQuotaReached;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class ApiId {
|
public static class ApiId {
|
||||||
private String providerName;
|
private String providerName;
|
||||||
private String apiName;
|
private String apiName;
|
||||||
private String version;
|
private String version;
|
||||||
private int id;
|
private int id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Application {
|
public static class Application {
|
||||||
private int id;
|
private int id;
|
||||||
private String name;
|
private String name;
|
||||||
private String uuid;
|
private String uuid;
|
||||||
private Subscriber subscriber;
|
private Subscriber subscriber;
|
||||||
private List<?> subscribedAPIs;
|
private List<?> subscribedAPIs;
|
||||||
private List<?> keys;
|
private List<?> keys;
|
||||||
private Map<String, Object> keyManagerWiseOAuthApp;
|
private Map<String, Object> keyManagerWiseOAuthApp;
|
||||||
private Map<String, Object> applicationAttributes;
|
private Map<String, Object> applicationAttributes;
|
||||||
private int subscriptionCount;
|
private int subscriptionCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class KeyManagerApp {
|
public static class KeyManagerApp {
|
||||||
private String clientId;
|
private String clientId;
|
||||||
private String clientName;
|
private String clientName;
|
||||||
private String callBackURL;
|
private String callBackURL;
|
||||||
private String clientSecret;
|
private String clientSecret;
|
||||||
private Map<String, Object> parameters = new HashMap<String, Object>();
|
private Map<String, Object> parameters = new HashMap<String, Object>();
|
||||||
private boolean isSaasApplication;
|
private boolean isSaasApplication;
|
||||||
private String appOwner;
|
private String appOwner;
|
||||||
private String jsonString;
|
private String jsonString;
|
||||||
private Map<String, String> appAttributes = new HashMap<>();
|
private Map<String, String> appAttributes = new HashMap<>();
|
||||||
private String jsonAppAttribute;
|
private String jsonAppAttribute;
|
||||||
private String applicationUUID;
|
private String applicationUUID;
|
||||||
private String tokenType;
|
private String tokenType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,19 +10,19 @@ import lombok.NoArgsConstructor;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ApplicationList {
|
public class ApplicationList {
|
||||||
private int count;
|
private int count;
|
||||||
private String next;
|
private String next;
|
||||||
private String previous;
|
private String previous;
|
||||||
private List<ApplicationInfo> list;
|
private List<ApplicationInfo> list;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class ApplicationInfo {
|
public static class ApplicationInfo {
|
||||||
private String applicationId;
|
private String applicationId;
|
||||||
private String name;
|
private String name;
|
||||||
private String owner;
|
private String owner;
|
||||||
private String status;
|
private String status;
|
||||||
private Object groupId;
|
private Object groupId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,28 +26,15 @@ public class Documents32 {
|
|||||||
private String lastUpdatedBy = null;
|
private String lastUpdatedBy = null;
|
||||||
|
|
||||||
public enum TypeEnum {
|
public enum TypeEnum {
|
||||||
HOWTO,
|
HOWTO, SAMPLES, PUBLIC_FORUM, SUPPORT_FORUM, API_MESSAGE_FORMAT, SWAGGER_DOC, OTHER
|
||||||
SAMPLES,
|
|
||||||
PUBLIC_FORUM,
|
|
||||||
SUPPORT_FORUM,
|
|
||||||
API_MESSAGE_FORMAT,
|
|
||||||
SWAGGER_DOC,
|
|
||||||
OTHER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SourceTypeEnum {
|
public enum SourceTypeEnum {
|
||||||
INLINE,
|
INLINE, MARKDOWN, URL, FILE
|
||||||
MARKDOWN,
|
|
||||||
URL,
|
|
||||||
FILE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public enum VisibilityEnum {
|
public enum VisibilityEnum {
|
||||||
OWNER_ONLY,
|
OWNER_ONLY, PRIVATE, API_LEVEL
|
||||||
PRIVATE,
|
|
||||||
API_LEVEL
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package cz.trask.migration.model.v32;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@ -1,51 +1,55 @@
|
|||||||
package cz.trask.migration.model.v45;
|
package cz.trask.migration.model.v45;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ApplicationCreateRequest {
|
public class ApplicationCreateRequest {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Size(min = 1, max = 100)
|
@Size(min = 1, max = 100)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String throttlingPolicy;
|
private String throttlingPolicy;
|
||||||
|
|
||||||
@Size(max = 512)
|
@Size(max = 512)
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Pattern(regexp = "JWT|OAUTH")
|
@Pattern(regexp = "JWT|OAUTH")
|
||||||
private String tokenType = "JWT";
|
private String tokenType = "JWT";
|
||||||
|
|
||||||
private List<String> groups;
|
private List<String> groups;
|
||||||
|
|
||||||
private Map<String, Object> attributes;
|
private Map<String, Object> attributes;
|
||||||
|
|
||||||
private List<SubscriptionScope> subscriptionScopes;
|
private List<SubscriptionScope> subscriptionScopes;
|
||||||
|
|
||||||
@Pattern(regexp = "PRIVATE|SHARED_WITH_ORG")
|
@Pattern(regexp = "PRIVATE|SHARED_WITH_ORG")
|
||||||
private String visibility;
|
private String visibility;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class SubscriptionScope {
|
public static class SubscriptionScope {
|
||||||
@NotNull
|
@NotNull
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private List<String> roles;
|
private List<String> roles;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,87 +1,88 @@
|
|||||||
package cz.trask.migration.model.v45;
|
package cz.trask.migration.model.v45;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ApplicationCreateResponse {
|
public class ApplicationCreateResponse {
|
||||||
@JsonProperty("applicationId")
|
@JsonProperty("applicationId")
|
||||||
private String applicationId;
|
private String applicationId;
|
||||||
|
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@JsonProperty("throttlingPolicy")
|
@JsonProperty("throttlingPolicy")
|
||||||
private String throttlingPolicy;
|
private String throttlingPolicy;
|
||||||
|
|
||||||
@JsonProperty("description")
|
@JsonProperty("description")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@JsonProperty("tokenType")
|
@JsonProperty("tokenType")
|
||||||
private String tokenType = "JWT";
|
private String tokenType = "JWT";
|
||||||
|
|
||||||
@JsonProperty("status")
|
@JsonProperty("status")
|
||||||
private String status = "";
|
private String status = "";
|
||||||
|
|
||||||
@JsonProperty("groups")
|
@JsonProperty("groups")
|
||||||
private List<String> groups;
|
private List<String> groups;
|
||||||
|
|
||||||
@JsonProperty("subscriptionCount")
|
@JsonProperty("subscriptionCount")
|
||||||
private Integer subscriptionCount;
|
private Integer subscriptionCount;
|
||||||
|
|
||||||
@JsonProperty("keys")
|
@JsonProperty("keys")
|
||||||
private List<ApplicationKey> keys;
|
private List<ApplicationKey> keys;
|
||||||
|
|
||||||
@JsonProperty("attributes")
|
@JsonProperty("attributes")
|
||||||
private Map<String, Object> attributes;
|
private Map<String, Object> attributes;
|
||||||
|
|
||||||
@JsonProperty("subscriptionScopes")
|
@JsonProperty("subscriptionScopes")
|
||||||
private List<SubscriptionScope> subscriptionScopes;
|
private List<SubscriptionScope> subscriptionScopes;
|
||||||
|
|
||||||
@JsonProperty("owner")
|
@JsonProperty("owner")
|
||||||
private String owner;
|
private String owner;
|
||||||
|
|
||||||
@JsonProperty("hashEnabled")
|
@JsonProperty("hashEnabled")
|
||||||
private Boolean hashEnabled;
|
private Boolean hashEnabled;
|
||||||
|
|
||||||
@JsonProperty("createdTime")
|
@JsonProperty("createdTime")
|
||||||
private String createdTime;
|
private String createdTime;
|
||||||
|
|
||||||
@JsonProperty("updatedTime")
|
@JsonProperty("updatedTime")
|
||||||
private String updatedTime;
|
private String updatedTime;
|
||||||
|
|
||||||
@JsonProperty("visibility")
|
@JsonProperty("visibility")
|
||||||
private String visibility;
|
private String visibility;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ApplicationKey {
|
public static class ApplicationKey {
|
||||||
@JsonProperty("key")
|
@JsonProperty("key")
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
@JsonProperty("keyType")
|
@JsonProperty("keyType")
|
||||||
private String keyType;
|
private String keyType;
|
||||||
|
|
||||||
@JsonProperty("state")
|
@JsonProperty("state")
|
||||||
private String state;
|
private String state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class SubscriptionScope {
|
public static class SubscriptionScope {
|
||||||
@JsonProperty("name")
|
@JsonProperty("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@JsonProperty("description")
|
@JsonProperty("description")
|
||||||
private String description;
|
private String description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,25 +1,26 @@
|
|||||||
package cz.trask.migration.model.v45;
|
package cz.trask.migration.model.v45;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
public class ApplicationKeyMappingRequest45 {
|
public class ApplicationKeyMappingRequest45 {
|
||||||
@JsonProperty("consumerKey")
|
@JsonProperty("consumerKey")
|
||||||
private String consumerKey;
|
private String consumerKey;
|
||||||
|
|
||||||
@JsonProperty("consumerSecret")
|
@JsonProperty("consumerSecret")
|
||||||
private String consumerSecret;
|
private String consumerSecret;
|
||||||
|
|
||||||
@JsonProperty("keyManager")
|
@JsonProperty("keyManager")
|
||||||
private String keyManager;
|
private String keyManager;
|
||||||
|
|
||||||
@JsonProperty("keyType")
|
@JsonProperty("keyType")
|
||||||
private KeyType keyType;
|
private KeyType keyType;
|
||||||
|
|
||||||
public enum KeyType {
|
public enum KeyType {
|
||||||
PRODUCTION, SANDBOX
|
PRODUCTION, SANDBOX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,61 +13,61 @@ import lombok.NoArgsConstructor;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ApplicationKeyMappingResponse45 {
|
public class ApplicationKeyMappingResponse45 {
|
||||||
@JsonProperty("keyMappingId")
|
@JsonProperty("keyMappingId")
|
||||||
private String keyMappingId;
|
private String keyMappingId;
|
||||||
|
|
||||||
@JsonProperty("keyManager")
|
@JsonProperty("keyManager")
|
||||||
private String keyManager;
|
private String keyManager;
|
||||||
|
|
||||||
@JsonProperty("consumerKey")
|
@JsonProperty("consumerKey")
|
||||||
private String consumerKey;
|
private String consumerKey;
|
||||||
|
|
||||||
@JsonProperty("consumerSecret")
|
@JsonProperty("consumerSecret")
|
||||||
private String consumerSecret;
|
private String consumerSecret;
|
||||||
|
|
||||||
@JsonProperty("supportedGrantTypes")
|
@JsonProperty("supportedGrantTypes")
|
||||||
private List<String> supportedGrantTypes;
|
private List<String> supportedGrantTypes;
|
||||||
|
|
||||||
@JsonProperty("callbackUrl")
|
@JsonProperty("callbackUrl")
|
||||||
private String callbackUrl;
|
private String callbackUrl;
|
||||||
|
|
||||||
@JsonProperty("keyState")
|
@JsonProperty("keyState")
|
||||||
private String keyState;
|
private String keyState;
|
||||||
|
|
||||||
@JsonProperty("keyType")
|
@JsonProperty("keyType")
|
||||||
private KeyType keyType;
|
private KeyType keyType;
|
||||||
|
|
||||||
@JsonProperty("mode")
|
@JsonProperty("mode")
|
||||||
private Mode mode;
|
private Mode mode;
|
||||||
|
|
||||||
@JsonProperty("groupId")
|
@JsonProperty("groupId")
|
||||||
private String groupId;
|
private String groupId;
|
||||||
|
|
||||||
@JsonProperty("token")
|
@JsonProperty("token")
|
||||||
private Token token;
|
private Token token;
|
||||||
|
|
||||||
@JsonProperty("additionalProperties")
|
@JsonProperty("additionalProperties")
|
||||||
private Map<String, Object> additionalProperties;
|
private Map<String, Object> additionalProperties;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Token {
|
public static class Token {
|
||||||
@JsonProperty("accessToken")
|
@JsonProperty("accessToken")
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
@JsonProperty("tokenScopes")
|
@JsonProperty("tokenScopes")
|
||||||
private List<String> tokenScopes;
|
private List<String> tokenScopes;
|
||||||
|
|
||||||
@JsonProperty("validityTime")
|
@JsonProperty("validityTime")
|
||||||
private Long validityTime;
|
private Long validityTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Mode {
|
enum Mode {
|
||||||
MAPPED, CREATED
|
MAPPED, CREATED
|
||||||
}
|
}
|
||||||
|
|
||||||
enum KeyType {
|
enum KeyType {
|
||||||
PRODUCTION, SANDBOX
|
PRODUCTION, SANDBOX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package cz.trask.migration.model.v45;
|
package cz.trask.migration.model.v45;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -9,29 +9,29 @@ import lombok.NoArgsConstructor;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class ApplicationListResponse45 {
|
public class ApplicationListResponse45 {
|
||||||
|
|
||||||
private int count;
|
private int count;
|
||||||
private Application[] list;
|
private Application[] list;
|
||||||
private Pagination pagination;
|
private Pagination pagination;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Application {
|
public static class Application {
|
||||||
private String applicationId;
|
private String applicationId;
|
||||||
private String name;
|
private String name;
|
||||||
private String owner;
|
private String owner;
|
||||||
private String status;
|
private String status;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public static class Pagination {
|
public static class Pagination {
|
||||||
private int offset;
|
private int offset;
|
||||||
private int limit;
|
private int limit;
|
||||||
private int total;
|
private int total;
|
||||||
private String next;
|
private String next;
|
||||||
private String previous;
|
private String previous;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user