Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/utm-link-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: UTM link lint

on:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
utm-link-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout common-ci
uses: actions/checkout@v4
with:
repository: 51Degrees/common-ci
path: utm-lint-common-ci

- name: Lint 51degrees.com links
shell: pwsh
run: ./utm-lint-common-ci/scripts/utm-lint.ps1 -RepoRoot .
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 51Degrees IP Intelligence Engines - Examples

![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=repository&utm_content=readme_main&utm_campaign=java-open-source "Data rewards the curious") **Java IP Intelligence**
![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=51degrees-ip-intelligence-engines-examples "Data rewards the curious") **Java IP Intelligence**

[Developer Documentation](https://51degrees.com/ip-intelligence-java/index.html?utm_source=github&utm_medium=repository&utm_content=documentation&utm_campaign=java-open-source "developer documentation")
[Developer Documentation](https://51degrees.com/ip-intelligence-java/index.html?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=51degrees-ip-intelligence-engines-examples "developer documentation")

## Introduction

Expand Down Expand Up @@ -68,9 +68,9 @@ documentation now reflect what is free and what needs a paid subscription.
and AccuracyRadiusMin.

A free resource key selecting the free tier properties can be created at
https://configure.51degrees.com/Wkqxf3Bs. A resource key that also includes
https://configure.51degrees.com/Wkqxf3Bs?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon. A resource key that also includes
the paid properties used by the examples can be created at
https://configure.51degrees.com/hYzn3TV3. See https://51degrees.com/pricing
https://configure.51degrees.com/hYzn3TV3?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon. See https://51degrees.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon
to get a paid subscription with more properties.

### On-Premise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java).
*
* This example requires an enterprise IP Intelligence data file (.ipi).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=header).
*
* Required Maven Dependencies:
* - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence)
Expand Down Expand Up @@ -96,7 +96,7 @@ public class GettingStartedOnPrem {
For production use, you will eventually need to use a Distributor service and license key
to keep your data file updated.

To obtain access to enterprise data files for hosting, please contact us: https://51degrees.com/contact-us */
To obtain access to enterprise data files for hosting, please contact us: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=main */

public static void main(String[] args) throws Exception {
configureLogback(getFilePath("logback.xml"));
Expand Down Expand Up @@ -130,7 +130,7 @@ public static void run(String dataFile,
"Please provide a valid path to an IP Intelligence data file (.ipi). " +
"An explicit path can be supplied via the {} environment variable. " +
"For testing, you can obtain an enterprise data file by contacting us at " +
"https://51degrees.com/contact-us",
"https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=data-file-not-found",
dataFile, DataFileHelper.IPI_PATH_ENV_VAR);
throw e;
}
Expand All @@ -139,7 +139,7 @@ public static void run(String dataFile,
options contained in the file "gettingStartedOnPrem.xml".

For more information about pipelines in general see the documentation at
http://51degrees.com/documentation/_concepts__configuration__builders__index.html
https://51degrees.com/documentation/_concepts__configuration__builders__index.html?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=run

Note that we wrap the creation of a pipeline in a try/resources to control its lifecycle */
// the configuration file is in the resources directory
Expand Down Expand Up @@ -207,7 +207,7 @@ private static void analyzeEvidence(Map<String, String> evidence,
IPIntelligenceData ipData = data.get(IPIntelligenceData.class);

/* Display the results of the detection, which are called IP Intelligence properties. See the
property dictionary at https://51degrees.com/developers/property-dictionary for
property dictionary at https://51degrees.com/developers/property-dictionary?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=analyzeevidence for
details of all available properties. */

// Output all the properties using shared PropertyHelper methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
* - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence)
*
* This example requires an enterprise IP Intelligence data file (.ipi).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-metadataonprem.java&utm_term=header).
*/
public class MetadataOnPrem {
private static final Logger logger = LoggerFactory.getLogger(GettingStartedOnPrem.class);

/* In this example, by default, the 51degrees IP Intelligence data file needs to be somewhere in the project
space, or you may specify another file as a command line parameter.

For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us */
For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-metadataonprem.java&utm_term=main */

public static void main(String[] args) throws Exception {
configureLogback(getFilePath("logback.xml"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java).
*
* This example requires an enterprise IP Intelligence data file (.ipi).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=header).
*
* Required Maven Dependencies:
* - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence)
Expand Down Expand Up @@ -95,7 +95,7 @@ public class OfflineProcessing {
// This 51degrees IP Intelligence data file (distributed with the source) needs to
// be somewhere in the project space
//
// For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us
// For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=datadir
private static final String dataDir = "ip-intelligence-data";
// This 51degrees file of 20,000 examples (distributed with the source)
// needs to be somewhere in the project space. Additional evidence files
Expand Down Expand Up @@ -242,7 +242,7 @@ public static void run(String dataFile, InputStream is, OutputStream os) throws
"limited properties and is of limited accuracy");
logger.info("The example requires an Enterprise data file " +
"to work fully. Find out about the Enterprise " +
"data file here: https://51degrees.com/pricing");
"data file here: https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=enterprise-data-file");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java).
*
* This example requires an enterprise IP Intelligence data file (.ipi).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us).
* To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-performancebenchmark.java&utm_term=header).
*
* Required Maven Dependencies:
* - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* to keep your data file updated. However, for now this example requires a custom URL where
* an updated data file will be hosted.
*
* To obtain access to enterprise data files, please [contact us](https://51degrees.com/contact-us).
* To obtain access to enterprise data files, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=header).
*
* ## Configuration
* - the pipeline must be configured to use a temp file
Expand Down Expand Up @@ -161,7 +161,7 @@
* For production use, you will eventually need to use a Distributor service and license key
* to keep your data file updated.
*
* To obtain access to enterprise data files for hosting, please [contact us](https://51degrees.com/contact-us).
* To obtain access to enterprise data files for hosting, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=header-2).
*
*/

Expand All @@ -181,7 +181,7 @@
* to keep your data file updated. However, for now this example requires a custom URL where
* an updated data file will be hosted.
*
* To obtain access to enterprise data files, please <a href="https://51degrees.com/contact-us">contact us</a>.
* To obtain access to enterprise data files, please <a href="https://51degrees.com/contact-us?utm_source=code&amp;utm_medium=example&amp;utm_campaign=ip-intelligence-java-examples&amp;utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&amp;utm_term=updatedatafile">contact us</a>.
* This license key must be supplied as a command line argument or by setting
* an environment variable or system property called {@link UpdateDataFile#UPDATE_EXAMPLE_LICENSE_KEY_NAME}
*/
Expand Down Expand Up @@ -225,7 +225,7 @@ static void run(String dataFilename, String licenseKey, boolean interactive) thr
logger.error("For production use, you will eventually need to use a Distributor service and " +
"license key to keep your data file updated. However, for now this example requires " +
"a custom URL where an updated data file will be hosted. To obtain access to enterprise " +
"data files, please contact us at https://51degrees.com/contact-us. You must supply the " +
"data files, please contact us at https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=license-key-required. You must supply the " +
"license key as an argument to this program, or as an environment or system variable " +
"named '{}'", UPDATE_EXAMPLE_LICENSE_KEY_NAME);
throw new IllegalArgumentException("No license key available");
Expand Down Expand Up @@ -308,7 +308,7 @@ static void run(String dataFilename, String licenseKey, boolean interactive) thr
// For production use, you will eventually need to use a Distributor service and
// license key to keep your data file updated. However, for now this example
// requires a custom URL where an updated data file will be hosted.
// To obtain access to enterprise data files, please contact us at https://51degrees.com/contact-us
// To obtain access to enterprise data files, please contact us at https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=run
.setDataUpdateLicenseKey(licenseKey)
// Enable update on startup, the auto update system
// will be used to check for an update before the
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/tacCloud.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
<BuildParameters>
<!-- TAC lookup and native model are not available with a free resource key.

See https://51degrees.com/pricing to get a paid subscription with more properties.
See https://51degrees.com/pricing?utm_source=code&amp;utm_medium=comment&amp;utm_campaign=ip-intelligence-java-examples&amp;utm_content=console-src-main-resources-taccloud.xml&amp;utm_term=buildparameters to get a paid subscription with more properties.

Once subscribed, a resource key with the properties required by this example
can be created at https://configure.51degrees.com/hYzn3TV3.
can be created at https://configure.51degrees.com/hYzn3TV3?utm_source=code&amp;utm_medium=comment&amp;utm_campaign=ip-intelligence-java-examples&amp;utm_content=console-src-main-resources-taccloud.xml&amp;utm_term=buildparameters.

You can paste the resource key here, or set an environment
variable or System property called "SuperResourceKey"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<packaging>pom</packaging>

<name>51Degrees :: IP Intelligence :: Examples</name>
<url>https://51degrees.com</url>
<url>https://51degrees.com?utm_source=maven&amp;utm_medium=package&amp;utm_campaign=ip-intelligence-java-examples&amp;utm_content=pom.xml&amp;utm_term=url
<description>IP Intelligence examples</description>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void logDataFileInfo(IPIntelligenceOnPremiseEngine engine) {
"This is used for illustration, and has limited " +
"accuracy and capabilities. Find out about the " +
"Enterprise data file on our pricing page: " +
"https://51degrees.com/pricing");
"https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-datafilehelper.java&utm_term=lite-data-file");
}
if (daysOld > 28) {
logger.warn("This example is using a data file that is more " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public static String getOrSetTestResourceKey(boolean shouldThrow) {
public static String getOrSetTestResourceKey(String value, boolean shouldThrow) {
return getOrSetResourceKey(value, TEST_RESOURCE_KEY,
"A free resource key may be obtained from " +
"https://configure.51degrees.com/Wkqxf3Bs. A free key " +
"https://configure.51degrees.com/Wkqxf3Bs?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-keyhelper.java&utm_term=resource-key-required. A free key " +
"populates the free tier properties only. See " +
"https://51degrees.com/pricing to get a paid subscription " +
"https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-keyhelper.java&utm_term=resource-key-required to get a paid subscription " +
"with more properties.",
shouldThrow);
}
Expand Down Expand Up @@ -102,11 +102,11 @@ public static String getOrSetSuperResourceKey(String value, String variablename)
public static String getOrSetSuperResourceKey(String value, String variablename, boolean shouldThrow) {
return getOrSetResourceKey(value, variablename, "TAC lookup and native model are not " +
"available with a free resource key. " +
"See https://51degrees.com/pricing to get a paid subscription " +
"See https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-keyhelper.java&utm_term=super-resource-key-required to get a paid subscription " +
"with more properties. " +
"Once subscribed, a resource key with the properties required " +
"by this example can be created at " +
"https://configure.51degrees.com/hYzn3TV3.",
"https://configure.51degrees.com/hYzn3TV3?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-keyhelper.java&utm_term=super-resource-key-required.",
shouldThrow);
}
}
Loading
Loading