Skip to content

Commit

Permalink
v1.3.0 public release
Browse files Browse the repository at this point in the history
  • Loading branch information
zzavidd committed Jul 23, 2021
1 parent 0e4cc15 commit 20412a7
Show file tree
Hide file tree
Showing 65 changed files with 28,120 additions and 1,668 deletions.
541 changes: 541 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ search all the data in an external source, or a subset of the data that
satisfies a set of specified conditions. The connectors also perform
server-side validation to prohibit invalid requests.

- [Read the documentation](http://ibm-i2.github.io/analyze-connect/index.html)
- [Download a ZIP archive of this repository](https://github.com/IBM-i2/analyze-connect/releases)
- [Read the documentation](http://ibm-i2.github.io/analyze-connect)
- [Download a ZIP archive of this repository](https://github.com/IBM-i2/Analyze-Connect/releases)

You can raise issues and questions about the example connectors for the i2
Connect gateway [here](https://github.com/IBM-i2/analyze-connect/issues).
Connect gateway [here](https://github.com/IBM-i2/Analyze-Connect/issues).
Original file line number Diff line number Diff line change
Expand Up @@ -86,41 +86,41 @@ public Resource chartingSchemes() {
}

/**
* Defines the /people endpoint.
* Defines the /async endpoint.
*
* @return The query response.
*/
@RequestMapping(method = RequestMethod.POST, value = "/people", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
@RequestMapping(method = RequestMethod.POST, value = "/async", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
public AsyncQueryResponse asyncAcquireService(@Valid @RequestBody ConnectorRequest request) {
return connectorDataService.asyncAcquire(request.payload.conditions);
}

/**
* Defines the /people/{queryId} endpoint.
* Defines the /async/{queryId} endpoint.
*
* @return The status response.
*/
@RequestMapping(method = RequestMethod.GET, value = "/people/{queryId}", produces = APPLICATION_JSON_VALUE)
@RequestMapping(method = RequestMethod.GET, value = "/async/{queryId}", produces = APPLICATION_JSON_VALUE)
public AsyncStatusResponse asyncStatusService(@Valid @PathVariable("queryId") String queryId) {
return connectorDataService.asyncStatus(queryId);
}

/**
* Defines the /people/{queryId}/results endpoint.
* Defines the /async/{queryId}/results endpoint.
*
* @return The results of the query.
*/
@RequestMapping(method = RequestMethod.GET, value = "/people/{queryId}/results", produces = APPLICATION_JSON_VALUE)
@RequestMapping(method = RequestMethod.GET, value = "/async/{queryId}/results", produces = APPLICATION_JSON_VALUE)
public ConnectorResponse asyncResultsService(@Valid @PathVariable("queryId") String queryId) {
return connectorDataService.asyncResults(queryId);
}

/**
* Defines the /people/{queryId} endpoint.
* Defines the /async/{queryId} endpoint.
*
* @return The response with the removed query.
*/
@RequestMapping(method = RequestMethod.DELETE, value = "/people/{queryId}", produces = APPLICATION_JSON_VALUE)
@RequestMapping(method = RequestMethod.DELETE, value = "/async/{queryId}", produces = APPLICATION_JSON_VALUE)
public @ResponseBody ConnectorResponse asyncDeleteService(@Valid @PathVariable("queryId") String queryId) {
return connectorDataService.asyncDelete(queryId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<chart:ChartingSchemeList xmlns:chart="http://www.i2group.com/Schemas/2012-05-29/ModelData/v2">
<ChartingSchemes>
<ChartingScheme Name="Example Connector">
<ChartingScheme Name="Async Connector">
<XmlChartingScheme>
<ChartItemAttributes />
<EntityMappings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</LinkStrengths>
</LinkStrengthInfo>
<LabelingSchemes>
<LabelingScheme Id="8355f4c5-1444-4a2f-b4da-f9374fbd80e6" Name="Example Connector Labeling Scheme">
<LabelingScheme Id="8355f4c5-1444-4a2f-b4da-f9374fbd80e6" Name="Async Connector Labeling Scheme">
<LabelDefinitions>
<LabelDefinition ItemTypeId="Person">
<LabelParts>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"name": "Async Connector: Async Acquire",
"description": "An async query that returns all the people and has a default polling interval of 1s.\n\nThe query will also provide a substatus with the query start time",
"async": {
"queriesResource": "/people",
"queriesResource": "/async",
"pollingIntervalInSeconds": 1
},
"clientConfigType": "FORM",
Expand Down
117 changes: 117 additions & 0 deletions connector/auth/auth-connector/.mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed 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
*
* https://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.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
Loading

0 comments on commit 20412a7

Please sign in to comment.