# GeoIP2 Java API #

## Description ##

This distribution provides an API for the GeoIP2 and GeoLite2 [web
services](https://dev.maxmind.com/geoip/docs/web-services?lang=en) and
[databases](https://dev.maxmind.com/geoip/docs/databases?lang=en).

## Installation ##

### Maven ###

We recommend installing this package with [Maven](https://maven.apache.org/).
To do this, add the dependency to your pom.xml:

```xml
    <dependency>
        <groupId>com.maxmind.geoip2</groupId>
        <artifactId>geoip2</artifactId>
        <version>4.2.0</version>
    </dependency>
```

### Gradle ###

Add the following to your `build.gradle` file:

```
repositories {
    mavenCentral()
}
dependencies {
    compile 'com.maxmind.geoip2:geoip2:4.2.0'
}
```

### JAR Files ###

If you are unable to use Maven or Gradle, you may include the `geoip2.jar`
file and its dependencies in your classpath. Download the JAR files from the
[GitHub Releases page](https://github.com/maxmind/GeoIP2-java/releases).

## IP Geolocation Usage ##

IP geolocation is inherently imprecise. Locations are often near the center of
the population. Any location provided by a GeoIP2 database or web service
should not be used to identify a particular address or household.

## Web Service Usage ##

To use the web service API, you must create a new `WebServiceClient` using the
`WebServiceClient.Builder`. You must provide the `Builder` constructor your
MaxMind `accountId` and `licenseKey`. To use the GeoLite2 web services instead
of GeoIP2, set the `host` method on the builder to `geolite.info`. To use
the Sandbox GeoIP2 web services intead of the production GeoIP2 web
services, set the `host` method on the builder to `sandbox.maxmind.com`.
You may also set a `timeout` or set the `locales` fallback order using the
methods on the `Builder`. After you have created the `WebServiceClient`,
you may then call the method corresponding to a specific web service, passing
it the IP address you want to look up.

If the request succeeds, the method call will return a model class for the end
point you called. This model in turn contains multiple record classes, each of
which represents part of the data returned by the web service.

If the request fails, the client class throws an exception.

The `WebServiceClient` object is safe to share across threads. If you are
making multiple requests, the object should be reused so that new connections
are not created for each request.

See the [API documentation](https://maxmind.github.io/GeoIP2-java/) for
more details.

## Web Service Example ##

### Country Service ###

```java
// This creates a WebServiceClient object that is thread-safe and can be
// reused across requests. Reusing the object will allow it to keep
// connections alive for future requests.
//
// Replace "42" with your account ID and "license_key" with your license key.
// To use the GeoLite2 web service instead of the GeoIP2 web service, call the
// host method on the builder with "geolite.info", e.g.
// new WebServiceClient.Builder(42, "license_key").host("geolite.info").build()
// To use the Sandbox GeoIP2 web service instead of the production GeoIP2
// web service, call the host method on the builder with
// "sandbox.maxmind.com", e.g.
// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
WebServiceClient client = new WebServiceClient.Builder(42, "license_key")
    .build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

// Do the lookup
CountryResponse response = client.country(ipAddress);

Country country = response.getCountry();
System.out.println(country.getIsoCode());            // 'US'
System.out.println(country.getName());               // 'United States'
System.out.println(country.getNames().get("zh-CN")); // '美国'
```

### City Plus Service ###

```java
// This creates a WebServiceClient object that is thread-safe and can be
// reused across requests. Reusing the object will allow it to keep
// connections alive for future requests.
//
// Replace "42" with your account ID and "license_key" with your license key.
// To use the GeoLite2 web service instead of the GeoIP2 web service, call the
// host method on the builder with "geolite.info", e.g.
// new WebServiceClient.Builder(42, "license_key").host("geolite.info").build()
// To use the Sandbox GeoIP2 web service instead of the production GeoIP2
// web service, call the host method on the builder with
// "sandbox.maxmind.com", e.g.
// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
WebServiceClient client = new WebServiceClient.Builder(42, "license_key")
    .build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

// Do the lookup
CityResponse response = client.city(ipAddress);

Country country = response.getCountry();
System.out.println(country.getIsoCode());            // 'US'
System.out.println(country.getName());               // 'United States'
System.out.println(country.getNames().get("zh-CN")); // '美国'

Subdivision subdivision = response.getMostSpecificSubdivision();
System.out.println(subdivision.getName());       // 'Minnesota'
System.out.println(subdivision.getIsoCode());    // 'MN'

City city = response.getCity();
System.out.println(city.getName());       // 'Minneapolis'

Postal postal = response.getPostal();
System.out.println(postal.getCode());       // '55455'

Location location = response.getLocation();
System.out.println(location.getLatitude());        // 44.9733
System.out.println(location.getLongitude());       // -93.2323
```

### Insights Service ###

```java
// This creates a WebServiceClient object that is thread-safe and can be
// reused across requests. Reusing the object will allow it to keep
// connections alive for future requests.
//
// Replace "42" with your account ID and "license_key" with your license key.
// Please note that the GeoLite2 web service does not support Insights.
// To use the Sandbox GeoIP2 web service instead of the production GeoIP2
// web service, call the host method on the builder with
// "sandbox.maxmind.com", e.g.
// new WebServiceClient.Builder(42, "license_key").host("sandbox.maxmind.com").build()
WebServiceClient client = new WebServiceClient.Builder(42, "license_key")
    .build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

// Do the lookup
InsightsResponse response = client.insights(ipAddress);

Country country = response.getCountry();
System.out.println(country.getIsoCode());            // 'US'
System.out.println(country.getName());               // 'United States'
System.out.println(country.getNames().get("zh-CN")); // '美国'
System.out.println(country.getConfidence());         // 99

Subdivision subdivision = response.getMostSpecificSubdivision();
System.out.println(subdivision.getName());       // 'Minnesota'
System.out.println(subdivision.getIsoCode());    // 'MN'
System.out.println(subdivision.getConfidence()); // 90

City city = response.getCity();
System.out.println(city.getName());       // 'Minneapolis'
System.out.println(city.getConfidence()); // 50

Postal postal = response.getPostal();
System.out.println(postal.getCode());       // '55455'
System.out.println(postal.getConfidence()); // 40

Location location = response.getLocation();
System.out.println(location.getLatitude());        // 44.9733
System.out.println(location.getLongitude());       // -93.2323
System.out.println(location.getAccuracyRadius());  // 3
System.out.println(location.getTimeZone());        // 'America/Chicago'

System.out.println(response.getTraits().getUserType()); // 'college'
```

## Database Usage ##

To use the database API, you must create a new `DatabaseReader` using the
`DatabaseReader.Builder`. You must provide the `Builder` constructor either an
`InputStream` or `File` for your GeoIP2 database. You may also specify the
`fileMode` and the `locales` fallback order using the methods on the `Builder`
object.

After you have created the `DatabaseReader`, you may then call one of the
appropriate methods, e.g., `city` or `tryCity`, for your database. These
methods take the IP address to be looked up. The methods with the `try`
prefix return an `Optional` object, which will be empty if the value is
not present in the database. The method without the prefix will throw an
`AddressNotFoundException` if the address is not in the database. If you
are looking up many IPs that are not contained in the database, the `try`
method will be slightly faster as they do not need to construct and throw
an exception. These methods otherwise behave the same.

If the lookup succeeds, the method call will return a response class for the
GeoIP2 lookup. The class in turn contains multiple record classes, each of
which represents part of the data returned by the database.

We recommend reusing the `DatabaseReader` object rather than creating a new
one for each lookup. The creation of this object is relatively expensive as it
must read in metadata for the file. It is safe to share the object across
threads.

See the [API documentation](https://maxmind.github.io/GeoIP2-java/) for
more details.

### Caching ###

The database API supports pluggable caching (by default, no caching is
performed). A simple implementation is provided by `com.maxmind.db.CHMCache`.
Using this cache, lookup performance is significantly improved at the cost of
a small (~2MB) memory overhead.

Usage:

```java
new DatabaseReader.Builder(file).withCache(new CHMCache()).build();
```

### Packaging Database in a JAR ###

If you are packaging the database file as a resource in a JAR file using
Maven, you must
[disable binary file filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/binaries-filtering.html).
Failure to do so will result in `InvalidDatabaseException` exceptions being
thrown when querying the database.

## Database Example ##

### City ###

```java
// A File object pointing to your GeoIP2 or GeoLite2 database
File database = new File("/path/to/GeoIP2-City.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
DatabaseReader reader = new DatabaseReader.Builder(database).build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

// Replace "city" with the appropriate method for your database, e.g.,
// "country".
CityResponse response = reader.city(ipAddress);

Country country = response.getCountry();
System.out.println(country.getIsoCode());            // 'US'
System.out.println(country.getName());               // 'United States'
System.out.println(country.getNames().get("zh-CN")); // '美国'

Subdivision subdivision = response.getMostSpecificSubdivision();
System.out.println(subdivision.getName());    // 'Minnesota'
System.out.println(subdivision.getIsoCode()); // 'MN'

City city = response.getCity();
System.out.println(city.getName()); // 'Minneapolis'

Postal postal = response.getPostal();
System.out.println(postal.getCode()); // '55455'

Location location = response.getLocation();
System.out.println(location.getLatitude());  // 44.9733
System.out.println(location.getLongitude()); // -93.2323
```

### Anonymous IP ###

```java
// A File object pointing to your GeoIP2 Anonymous IP database
File database = new File("/path/to/GeoIP2-Anonymous-IP.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
    InetAddress ipAddress = InetAddress.getByName("85.25.43.84");

    AnonymousIpResponse response = reader.anonymousIp(ipAddress);

    System.out.println(response.isAnonymous()); // true
    System.out.println(response.isAnonymousVpn()); // false
    System.out.println(response.isHostingProvider()); // false
    System.out.println(response.isPublicProxy()); // false
    System.out.println(response.isResidentialProxy()); // false
    System.out.println(response.isTorExitNode()); //true
}

```

### ASN ###

```java
// A File object pointing to your GeoLite2 ASN database
File database = new File("/path/to/GeoLite2-ASN.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {

    InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

    AsnResponse response = reader.asn(ipAddress);

    System.out.println(response.getAutonomousSystemNumber());       // 217
    System.out.println(response.getAutonomousSystemOrganization()); // 'University of Minnesota'
}
```

### Connection-Type ###

```java
// A File object pointing to your GeoIP2 Connection-Type database
File database = new File("/path/to/GeoIP2-Connection-Type.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
DatabaseReader reader = new DatabaseReader.Builder(database).build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

ConnectionTypeResponse response = reader.connectionType(ipAddress);

// getConnectionType() returns a ConnectionType enum
ConnectionType type = response.getConnectionType();

System.out.println(type); // 'Corporate'
```

### Domain ###

```java
// A File object pointing to your GeoIP2 Domain database
File database = new File("/path/to/GeoIP2-Domain.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
DatabaseReader reader = new DatabaseReader.Builder(database).build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

DomainResponse response = reader.domain(ipAddress);

System.out.println(response.getDomain()); // 'umn.edu'
```

### Enterprise ###

```java
// A File object pointing to your GeoIP2 Enterprise database
File database = new File("/path/to/GeoIP2-Enterprise.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
try (DatabaseReader reader = new DatabaseReader.Builder(database).build()) {
    InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

    //  Use the enterprise(ip) method to do a lookup in the Enterprise database
    EnterpriseResponse response = reader.enterprise(ipAddress);

    Country country = response.getCountry();
    System.out.println(country.getIsoCode());            // 'US'
    System.out.println(country.getName());               // 'United States'
    System.out.println(country.getNames().get("zh-CN")); // '美国'
    System.out.println(country.getConfidence());         // 99

    Subdivision subdivision = response.getMostSpecificSubdivision();
    System.out.println(subdivision.getName());           // 'Minnesota'
    System.out.println(subdivision.getIsoCode());        // 'MN'
    System.out.println(subdivision.getConfidence());     // 77

    City city = response.getCity();
    System.out.println(city.getName());       // 'Minneapolis'
    System.out.println(city.getConfidence()); // 11

    Postal postal = response.getPostal();
    System.out.println(postal.getCode()); // '55455'
    System.out.println(postal.getConfidence()); // 5

    Location location = response.getLocation();
    System.out.println(location.getLatitude());  // 44.9733
    System.out.println(location.getLongitude()); // -93.2323
    System.out.println(location.getAccuracyRadius()); // 50
}
```

### ISP ###

```java
// A File object pointing to your GeoIP2 ISP database
File database = new File("/path/to/GeoIP2-ISP.mmdb");

// This creates the DatabaseReader object. To improve performance, reuse
// the object across lookups. The object is thread-safe.
DatabaseReader reader = new DatabaseReader.Builder(database).build();

InetAddress ipAddress = InetAddress.getByName("128.101.101.101");

IspResponse response = reader.isp(ipAddress);

System.out.println(response.getAutonomousSystemNumber());       // 217
System.out.println(response.getAutonomousSystemOrganization()); // 'University of Minnesota'
System.out.println(response.getIsp());                          // 'University of Minnesota'
System.out.println(response.getOrganization());                 // 'University of Minnesota'
```

## Exceptions ##

For details on the possible errors returned by the web service itself, [see
the GeoIP2 web service
documentation](https://dev.maxmind.com/geoip/docs/web-services?lang=en).

If the web service returns an explicit error document, this is thrown as an
`AddressNotFoundException`, an `AuthenticationException`, an
`InvalidRequestException`, or an `OutOfQueriesException`.

If some sort of transport error occurs, an `HttpException` is thrown. This
is thrown when some sort of unanticipated error occurs, such as the web
service returning a 500 or an invalid error document. If the web service
request returns any status code besides 200, 4xx, or 5xx, this also becomes
an `HttpException`.

Finally, if the web service returns a 200 but the body is invalid, the client
throws a `GeoIp2Exception`. This exception also is the parent exception to
the above exceptions.

## Values to use for Database or Map Keys ##

**We strongly discourage you from using a value from any `getNames` method as
a key in a database or map.**

These names may change between releases. Instead we recommend using one of the
following:

* `com.maxmind.geoip2.record.City` - `City.getGeoNameId`
* `com.maxmind.geoip2.record.Continent` - `Continent.getCode` or `Continent.getGeoNameId`
* `com.maxmind.geoip2.record.Country` and `com.maxmind.geoip2.record.RepresentedCountry` - `Country.getIsoCode`
  or `Country.getGeoNameId`
* `com.maxmind.geoip2.record.Subdivision` - `Subdivision.getIsoCode` or `Subdivision.getGeoNameId`

## Multi-Threaded Use ##

This API fully supports use in multi-threaded applications. When using the
`DatabaseReader` or the `WebServiceClient` in a multi-threaded application,
we suggest creating one object and sharing that across threads.

## What data is returned? ##

While many of the location databases and web services return the same
basic records, the attributes poplulated can vary. In addition, MaxMind does
not always have every piece of data for any given IP address.

Because of these factors, it is possible for any web service to return a record
where some or all of the attributes are unpopulated.

[See our web-service developer
documentation](https://dev.maxmind.com/geoip/docs/web-services?lang=en) for
details on what data each web service may return.

The only piece of data which is always returned is the `ip_address`
available at `lookup.getTraits().getIpAddress()`.

## Integration with GeoNames ##

[GeoNames](https://www.geonames.org/) offers web services and downloadable
databases with data on geographical features around the world, including
populated places. They offer both free and paid premium data. Each
feature is uniquely identified by a `geonameId`, which is an integer.

Many of the records returned by the GeoIP2 web services and databases
include a `getGeoNameId()` method. This is the ID of a geographical
feature (city, region, country, etc.) in the GeoNames database.

Some of the data that MaxMind provides is also sourced from GeoNames. We
source things like place names, ISO codes, and other similar data from
the GeoNames premium data set.

## Reporting data problems ##

If the problem you find is that an IP address is incorrectly mapped,
please
[submit your correction to MaxMind](https://www.maxmind.com/en/correction).

If you find some other sort of mistake, like an incorrect spelling,
please check [the GeoNames site](https://www.geonames.org/) first. Once
you've searched for a place and found it on the GeoNames map view, there
are a number of links you can use to correct data ("move", "edit",
"alternate names", etc.). Once the correction is part of the GeoNames
data set, it will be automatically incorporated into future MaxMind
releases.

If you are a paying MaxMind customer and you're not sure where to submit
a correction, please [contact MaxMind support](https://www.maxmind.com/en/support)
for help.

## Other Support ##

Please report all issues with this code using the
[GitHub issue tracker](https://github.com/maxmind/GeoIP2-java/issues).

If you are having an issue with a MaxMind service that is not specific
to the client API, please
[contact MaxMind support](https://www.maxmind.com/en/support).

## Requirements  ##

MaxMind has tested this API with Java 11 and above.

## Contributing ##

Patches and pull requests are encouraged. Please include unit tests
whenever possible.

## Versioning ##

The GeoIP2 Java API uses [Semantic Versioning](https://semver.org/).

## Copyright and License ##

This software is Copyright (c) 2013-2023 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.


# killbill-commons
![Maven Central](https://img.shields.io/maven-central/v/org.kill-bill.commons/killbill-commons?color=blue&label=Maven%20Central)

Kill Bill reusable Java components:

* **automaton**: framework to build state machines
* **clock**: clock library
* **concurrent**: extensions to java.util.concurrent.Executors
* **config-magic**: fork of [config-magic](https://github.com/brianm/config-magic)
* **embeddeddb**: library to embed databases
* **jdbi**: fork of [jDBI](https://github.com/jdbi/jdbi)
* **locker**: locking library
* **metrics**: annotation-based metrics
* **queue**: provides persistent bus events and notifications
* **skeleton**: framework to build web services
* **utils**: provides utility methods for core Java(tm) classes (lang, IO, collection) and Cache
* **xmlloader**: library to load, parse and validate XML files

## Kill Bill compatibility

| Commons version | Kill Bill version |
| --------------: | ----------------: |
| 0.15.y          | 0.16.z            |
| 0.20.y          | 0.18.z            |
| 0.21.y          | 0.19.z            |
| 0.23.y          | 0.20.z            |
| 0.23.y          | 0.22.z            |
| 0.24.y          | 0.22.z            |
| 0.26.y          | 0.24.z            |

We've upgraded numerous dependencies in 0.24.x (required for Java 11 support).

## Usage

Add the relevant submodule(s) to a project:

```xml
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-automaton</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-clock</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-concurrent</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-config-magic</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-embeddeddb-common</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-embeddeddb-h2</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-embeddeddb-mysql</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-embeddeddb-postgresql</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-jdbi</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-locker</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-metrics</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-queue</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
    <groupId>org.kill-bill.commons</groupId>
    <artifactId>killbill-skeleton</artifactId>
    <version>... release version ...</version>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-utils</artifactId>
<version>... release version ...</version>
</dependency>
```

## About

Kill Bill is the leading Open-Source Subscription Billing & Payments Platform. For more information about the project, go to https://killbill.io/.


### ⚠ Maintenance ⚠
This library is in maintenance mode. It will send data as intended, but receive no new feature support and only critical maintenance updates from Segment.

We highly recommend using our upgraded [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin) to benefit from feature enhancements and ongoing support.

analytics-android
=================

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.android/analytics/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.segment.analytics.android/analytics)
[![Javadocs](http://javadoc-badge.appspot.com/com.segment.analytics.android/analytics.svg?label=javadoc)](http://javadoc-badge.appspot.com/com.segment.analytics.android/analytics)
[![CircleCI](https://circleci.com/gh/segmentio/analytics-android.svg?style=svg)](https://circleci.com/gh/segmentio/analytics-android)
[![codecov](https://codecov.io/gh/segmentio/analytics-android/branch/master/graph/badge.svg)](https://codecov.io/gh/segmentio/analytics-android)

analytics-android is an Android client for [Segment](https://segment.com)

You can't fix what you can't measure

Analytics helps you measure your users, product, and business. It unlocks insights into your app's funnel, core business metrics, and whether you have product-market fit.

## How to get started
1. **Collect analytics data** from your app(s).
    - The top 200 Segment companies collect data from 5+ source types (web, mobile, server, CRM, etc.).
2. **Send the data to analytics tools** (for example, Google Analytics, Amplitude, Mixpanel).
    - Over 250+ Segment companies send data to eight categories of destinations such as analytics tools, warehouses, email marketing and remarketing systems, session recording, and more.
3. **Explore your data** by creating metrics (for example, new signups, retention cohorts, and revenue generation).
    - The best Segment companies use retention cohorts to measure product market fit. Netflix has 70% paid retention after 12 months, 30% after 7 years.

[Segment](https://segment.com) collects analytics data and allows you to send it to more than 250 apps (such as Google Analytics, Mixpanel, Optimizely, Facebook Ads, Slack, Sentry) just by flipping a switch. You only need one Segment code snippet, and you can turn integrations on and off at will, with no additional code. [Sign up with Segment today](https://app.segment.com/signup).

### Why?
1. **Power all your analytics apps with the same data**. Instead of writing code to integrate all of your tools individually, send data to Segment, once.

2. **Install tracking for the last time**. We're the last integration you'll ever need to write. You only need to instrument Segment once. Reduce all of your tracking code and advertising tags into a single set of API calls.

3. **Send data from anywhere**. Send Segment data from any device, and we'll transform and send it on to any tool.

4. **Query your data in SQL**. Slice, dice, and analyze your data in detail with Segment SQL. We'll transform and load your customer behavioral data directly from your apps into Amazon Redshift, Google BigQuery, or Postgres. Save weeks of engineering time by not having to invent your own data warehouse and ETL pipeline.

    For example, you can capture data on any app:
    ```js
    analytics.track('Order Completed', { price: 99.84 })
    ```
    Then, query the resulting data in SQL:
    ```sql
    select * from app.order_completed
    order by price desc
    ```

### 🚀 Startup Program

If you are part of a new startup  (<$5M raised, <2 years since founding), we just launched a new startup program for you. You can get a Segment Team plan  (up to $25,000 value in Segment credits) for free up to 2 years — apply here!

## Documentation

You can find usage documentation at [https://segment.com/docs/sources/mobile/android/](https://segment.com/docs/sources/mobile/android/).

## Integrating with Segment

Interested in integrating your service with us? Check out our [Partners page](https://segment.com/partners/) for more details.

## License

```
WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

The MIT License (MIT)

Copyright (c) 2016 Segment, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```


[![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/openzipkin/zipkin)
[![Build Status](https://github.com/openzipkin/brave/workflows/test/badge.svg)](https://github.com/openzipkin/brave/actions?query=workflow%3Atest)
[![Maven Central](https://img.shields.io/maven-central/v/io.zipkin.brave/brave.svg)](https://search.maven.org/search?q=g:io.zipkin.brave%20AND%20a:brave)

# Brave

Brave is a distributed tracing instrumentation library. Brave typically
intercepts production requests to gather timing data, correlate and
propagate trace contexts. While typically trace data is sent to
[Zipkin server](https://github.com/openzipkin/zipkin/tree/master/zipkin-server),
third-party plugins are available to send to alternate services such as
[Amazon X-Ray](https://github.com/openzipkin/zipkin-aws/tree/master/storage/xray-udp).

This repository includes dependency-free Java libraries and
instrumentation for common components used in production services. For
example, this includes trace filters for Servlet and log correlation for
Apache Log4J.

You can look at our [example project](https://github.com/openzipkin/brave-webmvc-example)
for how to trace a simple web application.

## What's included

Brave's dependency-free [tracer library](brave/) works against JRE6+.
This is the underlying api that instrumentation use to time operations
and add tags that describe them. This library also includes code that
parses `X-B3-TraceId` headers.

Most users won't write tracing code directly. Rather, they reuse
instrumentation others have written. Check our
[instrumentation](instrumentation/) and
[Zipkin's list](https://zipkin.io/pages/tracers_instrumentation.html)
before rolling your own. Common tracing libraries like JDBC, Servlet
and Spring already exist. Instrumentation written here are tested and
benchmarked.

If you are trying to trace legacy applications, you may be interested in
[Spring XML Configuration](spring-beans/). This allows you to set up
tracing without any custom code.

You may want to put trace IDs into your log files, or change thread local
behavior. Look at our [context libraries](context/), for integration with
tools such as SLF4J.

## Version Compatibility policy
All Brave libraries match the minimum Java version of what's being
traced or integrated with, and adds no 3rd party dependencies. The goal
is to neither impact your projects' choices, nor subject your project
to dependency decisions made by others.

For example, even including a basic reporting library,
[zipkin-sender-urlconnection](https://github.com/openzipkin/zipkin-reporter-java),
Brave transitively includes no json,
logging, protobuf or thrift dependency. This means zero concern if your
application chooses a specific version of SLF4J, Gson or Guava.
Moreover, the entire dependency tree including basic reporting in json,
thrift or protobuf is less than 512KiB of jars.

There is a floor Java version of 1.6, which allows older JREs and older
Android runtimes, yet may limit some applications. For example, Servlet
2.5 works with Java 1.5, but due to Brave being 1.6, you will not be
able to trace Servlet 2.5 applications until you use at least JRE 1.6.

All integrations set their associated library to "provided" scope. This
ensures Brave doesn't interfere with the versions you choose.

Some libraries update often which leads to api drift. In some cases, we
test versions ranges to reduce the impact of this. For example, we test
[gRPC](instrumentation/grpc) and [Kafka](instrumentation/kafka-clients)
against multiple library versions.

## Artifacts
All artifacts publish to the group ID "io.zipkin.brave". We use a common
release version for all components.

### Library Releases
Snapshots are uploaded to
[Sonatype](https://oss.sonatype.org/content/repositories/releases) which
synchronizes with
[Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.zipkin.brave%22)

### Library Snapshots
Snapshots are uploaded to
[Sonatype](https://oss.sonatype.org/content/repositories/snapshots) after
commits to master.

### Version alignments
When using multiple brave components, you'll want to align versions in
one place. This allows you to more safely upgrade, with less worry about
conflicts.

You can use our Maven instrumentation BOM (Bill of Materials) for this:

Ex. in your dependencies section, import the BOM like this:
```xml
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.zipkin.brave</groupId>
        <artifactId>brave-bom</artifactId>
        <version>${brave.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
```

Now, you can leave off the version when choosing any supported
instrumentation. Also, any indirect use will have versions aligned:
```xml
<dependency>
  <groupId>io.zipkin.brave</groupId>
  <artifactId>brave-instrumentation-okhttp3</artifactId>
</dependency>
```

With the above in place, you can use the property `brave.version` to
override dependency versions coherently. This is most commonly to test a
new feature or fix.

Note: If you override a version, always double check that your version
is valid (equal to or later) than what you are updating. This will avoid
class conflicts.


IntelliJ IDEA / PhpStorm Symfony Plugin
========================
[![Build Status](https://github.com/Haehnchen/idea-php-symfony2-plugin/actions/workflows/gradle.yml/badge.svg?branch=master)](https://github.com/Haehnchen/idea-php-symfony2-plugin/actions/workflows/gradle.yml)
[![Version](http://phpstorm.espend.de/badge/7219/version)](https://plugins.jetbrains.com/plugin/7219)
[![Downloads](http://phpstorm.espend.de/badge/7219/downloads)](https://plugins.jetbrains.com/plugin/7219)
[![Downloads last month](http://phpstorm.espend.de/badge/7219/last-month)](https://plugins.jetbrains.com/plugin/7219)
[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/DanielEspendiller)

| Key                  | Value                                     |
|----------------------|-------------------------------------------|
| Plugin Url           | https://plugins.jetbrains.com/plugin/7219 |
| ID                   | fr.adrienbrault.idea.symfony2plugin       |
| Documentation        | https://espend.de/phpstorm/plugin/symfony |
| Changelog            | [CHANGELOG](CHANGELOG.md)                 |
| Build and Deployment | [MAINTENANCE](MAINTENANCE.md)             |

Install
---------------------
* Install the plugin by going to `Settings -> Plugins -> Browse repositories` and then search for `Symfony`.
* Enabled it per project (File -> Settings -> Languages & Framework -> PHP -> Symfony)
* Install [Php Annotation](http://plugins.jetbrains.com/plugin/7320) plugin to enjoy all the annotation stuff
* Plugin needs a valid PhpStorm indexer, use "File > Invalidate Caches / Restart" if something crazy is going on

Freemium
---------------------

Since PhpStorm 2022.1 this plugin is marked a "Freemium".

* All features which are inside [GitHub](https://github.com/Haehnchen/idea-php-symfony2-plugin) are free to use, unless there is reason (e.g. Supporting old Symfony Version, ...)
* Non-free features are flagged with _[paid]_ inside [Documentation](https://espend.de/phpstorm/plugin/symfony) and inside the [CHANGELOG](https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/master/CHANGELOG.md)
* There is ~15min grace period after project opening where all features are available
* A license must be activated via PhpStorm / Intellij: use menu "Help -> Register" or use "Search Everywhere" by searching for "Manage License..." action

_A license can be bought at [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/7219-symfony-support/pricing)_

Version
---------------------

* This plugin supports Symfony 2, 3, 4, ...

Documentation and tutorials
---------------------

* Documentation / Feature List [read online](https://espend.de/phpstorm/plugin/symfony)
* JetBrains: [Symfony Development using PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/Symfony+Development+using+PhpStorm)
* KnpUniversity: [Lean and Mean Dev with PhpStorm (for Symfony)](https://knpuniversity.com/screencast/phpstorm)
* Slides: [PhpStorm: Symfony2 Plugin](https://www.slideshare.net/Haehnchen/phpstorm-symfony2-plugin)

Autocomplete (or something else) is not working! Help! :open_mouth:
-------------------------------------------------------------------

* You usually need to trigger the autocomplete popup yourself, by pressing CTRL+SPACE (maybe a different shortcut depending on your keymap).
* Check your File -> Settings -> PHP -> Symfony -> Enable Plugin for this Project

Technical Diagram (Work In Progress)
--------------------

![Symfony Plugin Technical Diagram](plugin-diagram.webp)

Building, debugging and other
--------------------

* Install IntelliJ IDEA (Community Edition works fine)
* Open this project
* Choose `View > Tool Windows > Gradle`
* Double click `idea-php-symfony2-plugin > Tasks > intellij > runIde`

If you are having difficulties, consult the documentation: http://confluence.jetbrains.com/display/PhpStorm/Setting-up+environment+for+PhpStorm+plugin+development

* Want to sponsor my development? Nice! You can sponsor me via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5ZTGW6H4Y7MT8) or [Github](https://github.com/sponsors/Haehnchen). Github matches your donation so the total donation will be doubled.

What? Something still does not work? Damn! :cry:
------------------------------------------------

You can browse the existing issues at https://github.com/Haehnchen/idea-php-symfony2-plugin/issues

If your issue already exists, don't hesitate to add a comment to help contributors resolve the issue more easily.
If your issue does not exist, open a new issue :smiley:.

Make sure to provide the maximum amount of information, such as:
* What version of PhpStorm are you using?
* What version of the plugin are you using?
* The stack trace if an error occurred
* Check if you are in PhpStorm eap channel


.. image:: docs/_static/crate-logo.svg
    :alt: CrateDB
    :target: https://cratedb.com

----

.. image:: https://github.com/crate/crate/workflows/CrateDB%20SQL/badge.svg?branch=master
    :target: https://github.com/crate/crate/actions?query=workflow%3A%22CrateDB+SQL%22

.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
    :target: https://cratedb.com/docs/crate/reference/en/latest/

.. image:: https://img.shields.io/badge/container-docker-green.svg
    :target: https://hub.docker.com/_/crate/

|

`Help us improve CrateDB by taking our User Survey! <https://cratedb.com/user-survey>`_

About
=====

CrateDB is a distributed SQL database that makes it simple to store and analyze
massive amounts of data in real-time.

CrateDB offers the `benefits`_ of an SQL database *and* the scalability and
flexibility typically associated with NoSQL databases. Modest CrateDB clusters
can ingest tens of thousands of records per second without breaking a
sweat. You can run ad-hoc queries using `standard SQL`_. CrateDB's blazing-fast
distributed query execution engine parallelizes query workloads across the
whole cluster.

CrateDB is well suited to `containerization`_, can be `scaled horizontally`_
using ephemeral virtual machines (e.g., `Kubernetes`_, `AWS`_, and `Azure`_)
with `no shared state`_. You can deploy and run CrateDB on any sort of network
— from personal computers to `multi-region hybrid clouds and the edge`_.

Features
========

- Use `standard SQL`_ via the `PostgreSQL wire protocol`_ or an `HTTP API`_.

- Dynamic table schemas and queryable objects provide
  document-oriented features in addition to the relational features of SQL.

- Support for time-series data, real-time full-text search, geospatial data
  types and search capabilities.

- Horizontally scalable, highly available and fault-tolerant clusters that run
  very well in virtualized and containerized environments.

- Extremely fast distributed query execution.

- Auto-partitioning, auto-sharding, and auto-replication.

- Self-healing and auto-rebalancing.

- `User-defined functions`_ (UDFs) can be used to extend the functionality of CrateDB.

Screenshots
===========

CrateDB provides an `Admin UI`_:

.. image:: crate-admin.gif
    :alt: Screenshots of the CrateDB Admin UI

Try CrateDB
===========

The fastest way to try CrateDB out is by running:

.. code-block:: console

    sh$ bash -c "$(curl -L try.crate.io)"

Or spin up the official `Docker image`_:

.. code-block:: console

    sh$ docker run --publish 4200:4200 --publish 5432:5432 --env CRATE_HEAP_SIZE=1g crate -Cdiscovery.type=single-node

Visit the `installation documentation`_ to see all the available download and
install options.

Once you're up and running, head over to the `introductory docs`_. To interact
with CrateDB, you can use the Admin UI `sql console`_ or the `CrateDB shell`_
CLI tool. Alternatively, review the list of recommended `clients and tools`_
that work with CrateDB.

For container-specific documentation, check out the `CrateDB on Docker how-to
guide`_ or the `CrateDB on Kubernetes how-to guide`_.

Contributing
============

This project is primarily maintained by `Crate.io`_, but we welcome community
contributions!

See the `developer docs`_ and the `contribution docs`_ for more information.

Security
========

The CrateDB team and community take security bugs seriously. We appreciate your
efforts to `responsibly disclose`_ your findings, and will make every effort to
acknowledge your contributions.

If you think you discovered a security flaw, please follow the guidelines at
`SECURITY.md`_.

Help
====

Looking for more help?

- Try one of our `beginner tutorials`_, `how-to guides`_, or consult the
  `reference manual`_.

- Check out our `support channels`_.

- `Crate.io`_ also offers `CrateDB Cloud`_, a fully-managed *CrateDB Database
  as a Service* (DBaaS). The `CrateDB Cloud Tutorials`_ will get you started.

.. _Admin UI: https://cratedb.com/docs/crate/admin-ui/
.. _AWS: https://cratedb.com/docs/crate/tutorials/en/latest/cloud/aws/index.html
.. _Azure: https://cratedb.com/docs/crate/tutorials/en/latest/cloud/azure/index.html
.. _beginner tutorials: https://cratedb.com/docs/crate/tutorials/
.. _benefits: https://cratedb.com/product#compare
.. _clients and tools: https://cratedb.com/docs/crate/clients-tools/
.. _containerization: https://cratedb.com/docs/crate/tutorials/en/latest/containers/docker.html
.. _contribution docs: CONTRIBUTING.rst
.. _Crate.io: https://cratedb.com/company/team
.. _CrateDB clients and tools: https://cratedb.com/docs/crate/clients-tools/
.. _CrateDB Cloud Tutorials: https://cratedb.com/docs/cloud/
.. _CrateDB Cloud: https://cratedb.com/product/pricing
.. _CrateDB on Docker how-to guide: https://cratedb.com/docs/crate/tutorials/en/latest/containers/docker.html
.. _CrateDB on Kubernetes how-to guide: https://cratedb.com/docs/crate/tutorials/en/latest/containers/kubernetes/index.html
.. _CrateDB shell: https://cratedb.com/docs/crate/crash/
.. _developer docs: devs/docs/index.rst
.. _Docker image: https://hub.docker.com/_/crate/
.. _document-oriented: https://en.wikipedia.org/wiki/Document-oriented_database
.. _Dynamic table schemas: https://cratedb.com/docs/crate/reference/en/master/general/ddl/column-policy.html
.. _fulltext search: https://cratedb.com/docs/crate/reference/en/latest/general/dql/fulltext.html
.. _geospatial features: https://cratedb.com/docs/crate/reference/en/master/general/dql/geo.html
.. _how-to guides: https://cratedb.com/docs/crate/howtos/
.. _HTTP API: https://cratedb.com/docs/crate/reference/en/latest/interfaces/http.html
.. _installation documentation: https://cratedb.com/docs/crate/tutorials/en/latest/basic/index.html
.. _introductory docs: https://cratedb.com/docs/crate/tutorials/
.. _Kubernetes: https://cratedb.com/docs/crate/tutorials/en/latest/containers/kubernetes/index.html
.. _multi-region hybrid clouds and the edge: https://cratedb.com/docs/cloud/en/latest/tutorials/edge/index.html
.. _no shared state: https://en.wikipedia.org/wiki/Shared-nothing_architecture
.. _PostgreSQL wire protocol: https://cratedb.com/docs/crate/reference/en/latest/interfaces/postgres.html
.. _queryable objects: https://cratedb.com/docs/crate/reference/en/master/general/dql/selects.html#container-data-types
.. _reference manual: https://cratedb.com/docs/crate/reference/
.. _relational: https://en.wikipedia.org/wiki/Relational_model
.. _responsibly disclose: https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure
.. _scaled horizontally: https://stackoverflow.com/questions/11707879/difference-between-scaling-horizontally-and-vertically-for-databases
.. _SECURITY.md: https://github.com/crate/crate/blob/master/SECURITY.md
.. _sql console: https://cratedb.com/docs/crate/admin-ui/en/latest/console.html#sql-console
.. _standard SQL: https://cratedb.com/docs/crate/reference/en/latest/sql/index.html
.. _support channels: https://cratedb.com/support
.. _time-series data: https://cratedb.com/docs/crate/howtos/en/latest/getting-started/normalize-intervals.html
.. _user-defined functions: https://cratedb.com/docs/crate/reference/en/latest/general/user-defined-functions.html


![logo](http://webmagic.io/images/logo.jpeg)

[Readme in Chinese](https://github.com/code4craft/webmagic/tree/master/README-zh.md)

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/us.codecraft/webmagic-parent/badge.svg?subject=Maven%20Central)](https://maven-badges.herokuapp.com/maven-central/us.codecraft/webmagic-parent/)
[![License](https://img.shields.io/badge/License-Apache%20License%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://travis-ci.org/code4craft/webmagic.png?branch=master)](https://travis-ci.org/code4craft/webmagic)

>A scalable crawler framework. It covers the whole lifecycle of crawler: downloading, url management, content extraction and persistent. It can simplify the development of a  specific crawler.

## Features:

* Simple core with high flexibility.
* Simple API for html extracting.
* Annotation with POJO to customize a crawler, no configuration.
* Multi-thread and Distribution support.
* Easy to be integrated.

## Install:

Add dependencies to your pom.xml:

```xml
<dependency>
    <groupId>us.codecraft</groupId>
    <artifactId>webmagic-core</artifactId>
    <version>${webmagic.version}</version>
</dependency>
<dependency>
    <groupId>us.codecraft</groupId>
    <artifactId>webmagic-extension</artifactId>
    <version>${webmagic.version}</version>
</dependency>
```

WebMagic use slf4j with slf4j-log4j12 implementation. If you customized your slf4j implementation, please exclude slf4j-log4j12.

```xml
<exclusions>
    <exclusion>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
    </exclusion>
</exclusions>
```

## Get Started:

### First crawler:

Write a class implements PageProcessor. For example, I wrote a crawler of github repository infomation.

```java
public class GithubRepoPageProcessor implements PageProcessor {

    private Site site = Site.me().setRetryTimes(3).setSleepTime(1000);

    @Override
    public void process(Page page) {
        page.addTargetRequests(page.getHtml().links().regex("(https://github\\.com/\\w+/\\w+)").all());
        page.putField("author", page.getUrl().regex("https://github\\.com/(\\w+)/.*").toString());
        page.putField("name", page.getHtml().xpath("//h1[@class='public']/strong/a/text()").toString());
        if (page.getResultItems().get("name")==null){
            //skip this page
            page.setSkip(true);
        }
        page.putField("readme", page.getHtml().xpath("//div[@id='readme']/tidyText()"));
    }

    @Override
    public Site getSite() {
        return site;
    }

    public static void main(String[] args) {
        Spider.create(new GithubRepoPageProcessor()).addUrl("https://github.com/code4craft").thread(5).run();
    }
}
```

* `page.addTargetRequests(links)`

	Add urls for crawling.

You can also use annotation way:

```java
@TargetUrl("https://github.com/\\w+/\\w+")
@HelpUrl("https://github.com/\\w+")
public class GithubRepo {

    @ExtractBy(value = "//h1[@class='public']/strong/a/text()", notNull = true)
    private String name;

    @ExtractByUrl("https://github\\.com/(\\w+)/.*")
    private String author;

    @ExtractBy("//div[@id='readme']/tidyText()")
    private String readme;

    public static void main(String[] args) {
        OOSpider.create(Site.me().setSleepTime(1000)
                , new ConsolePageModelPipeline(), GithubRepo.class)
                .addUrl("https://github.com/code4craft").thread(5).run();
    }
}
```

### Docs and samples:

Documents: [http://webmagic.io/docs/](http://webmagic.io/docs/)

The architecture of webmagic (refered to [Scrapy](http://scrapy.org/))

![image](http://code4craft.github.io/images/posts/webmagic.png)

There are more examples in `webmagic-samples` package.

### License:

Licensed under [Apache 2.0 license](http://opensource.org/licenses/Apache-2.0)

### Thanks:

To write webmagic, I refered to the projects below :

* **Scrapy**

	A crawler framework in Python.

	[http://scrapy.org/](http://scrapy.org/)

* **Spiderman**

	Another crawler framework in Java.

	[http://git.oschina.net/l-weiwei/spiderman](http://git.oschina.net/l-weiwei/spiderman)

### Mail-list:

[https://groups.google.com/forum/#!forum/webmagic-java](https://groups.google.com/forum/#!forum/webmagic-java)

[http://list.qq.com/cgi-bin/qf_invite?id=023a01f505246785f77c5a5a9aff4e57ab20fcdde871e988](http://list.qq.com/cgi-bin/qf_invite?id=023a01f505246785f77c5a5a9aff4e57ab20fcdde871e988)

QQ Group: 373225642 542327088

### Related Project

* Gather Platform

	A web console based on WebMagic for Spider configuration and management.


[![Java Version Builds](https://github.com/jitsi/jitsi/actions/workflows/java.yml/badge.svg?branch=new-build)](https://github.com/jitsi/jitsi/actions/workflows/java.yml)
[![Installers](https://github.com/jitsi/jitsi/actions/workflows/installers.yml/badge.svg?branch=new-build)](https://github.com/jitsi/jitsi/actions/workflows/installers.yml)

Jitsi Desktop
=============

Jitsi Desktop is a free open-source audio/video and chat communicator that
supports protocols such as SIP, XMPP/Jabber, IRC and many other useful features.

Please do not confuse this project
with [Jitsi Meet](https://github.com/jitsi/jitsi-meet), the online video
conferencing solution with a free instance at https://meet.jit.si.

<img align=right src="docs/jitsi-main-window.png" alt="Jitsi Desktop" width=210>

## Support

Jitsi Desktop is the heritage of Jitsi Meet. While some components are still
used in e.g. [Jigasi](https://github.com/jitsi/jigasi), the project is not
actively developed anymore. Improvements, bugfixes and builds are entirely based
on community contributions.

## Installation

### Releases

#### Windows and macOS

Download the installers
from [GitHub releases](https://github.com/jitsi/jitsi/releases/latest/).

#### Debian/Ubuntu
An APT repository is available at https://nexus.ingo.ch/jitsi-desktop/.
Note the trailing slash at the end of the distro-name.
This is required since the repository has no components.
```deb
deb https://nexus.ingo.ch/jitsi-desktop-unstable/ <distro>/
```

#### RPM Distros

Sorry, there are currently no rpm packages available.

### Snapshots

Snapshot or pre-release builds are also available in additional repositories.

- Windows and macOS: See https://github.com/jitsi/jitsi/releases
- Debian/Ubuntu: https://nexus.ingo.ch/jitsi-desktop-unstable/

## Helpful Resources

- [Documentation Wiki](https://github.com/jitsi/jitsi/wiki)
- [Community Forums](https://community.jitsi.org/c/jitsi-desktop/)
- [The old website](https://desktop.jitsi.org)

## Contributing

Please, read the [contribution guidelines](CONTRIBUTING.md) before opening a new
issue or pull request.


libjitsi
========

libjitsi is an advanced Java media library for secure real-time audio/video communication. It allows applications to capture, playback, stream, encode/decode and encrypt audio and video flows. It also allows for advanced features such as audio mixing, handling multiple streams, participation in audio and video conferences.  Originally libjitsi was part of the Jitsi client source code but we decided to spin it off so that other projects can also use it.  libjitsi is distributed under the terms of the Apache license.


# Morphia

[![Build Status](https://github.com/MorphiaOrg/morphia/actions/workflows/build.yml/badge.svg)](https://github.com/MorphiaOrg/morphia/actions?query=workflow%3ATests)

See [here](https://morphia.dev) for the official documentation.  To see the roadmap, please see [here](Roadmap.md).  A
list of the resolved issues can be found [here](CHANGELOG.md) or in the [milestones](https://github.com/MorphiaOrg/morphia/milestones)
section on github.

Fancy a more real time chat?  Join the discord server [here](https://discord.gg/saZsJescBa).


# Cloning the repository

If you are getting an error while cloning the repository, try running:
git config --global http.postBuffer 5000000

This will increase the size of the buffer from the default 1MiB to 5MiB.

To revert this value to the default, use:
git config --global http.postBuffer 1000000

The Courses
==============================

Here's the new "Learn Spring" course:

**[>> LEARN SPRING - THE MASTER CLASS](https://www.baeldung.com/learn-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=ls#master-class)**

Here's the Master Class of "REST With Spring" (along with the new announced Boot 2 material):

**[>> THE REST WITH SPRING - MASTER CLASS](https://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=rws#master-class)**

And here's the Master Class of "Learn Spring Security":

**[>> LEARN SPRING SECURITY - MASTER CLASS](https://www.baeldung.com/learn-spring-security-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=lss#master-class)**

Java and Spring Tutorials
================

This project is **a collection of small and focused tutorials** - each covering a single and well defined area of development in the Java ecosystem.
A strong focus of these is, of course, the Spring Framework - Spring, Spring Boot and Spring Security.
In addition to Spring, the modules here cover a number of aspects of Java.

Profile based segregation
====================

We are using maven build profiles to segregate the huge list of individual projects we have in our repository.

The projects are broadly divided into 3 lists: default, default-jdk8 and default-heavy.

Next, they are segregated further on the basis of the tests that we want to execute.

Additionally, there are 2 profiles dedicated for JDK17 and above builds - **which require JDK 17**.

We also have a parents profile to build only parent modules.

Therefore, we have a total of 7 profiles:

| Profile           | Includes                    | Type of test enabled |
|-------------------|-----------------------------| -------------------- |
| default           | JDK17 and above projects    | *UnitTest            |
| integration       | JDK17 and above projects    | *IntegrationTest     |
| default-heavy     | Heavy/long running projects | *UnitTest            |
| integration-heavy | Heavy/long running projects | *IntegrationTest     |
| default-jd8       | JDK8  projects              | *UnitTest            |
| integration-jdk8  | JDK8  projects              | *IntegrationTest     |
| parents           | Set of parent modules       | None                 |

Building the project
====================

Though it should not be needed often to build the entire repository at once because we are usually concerned with a specific module.

But if we want to, we can invoke the below command from the root of the repository if we want to build the entire repository with only Unit Tests enabled:

`mvn clean install -Pdefault,default-heavy`

or if we want to build the entire repository with Integration Tests enabled, we can do:

`mvn clean install -Pintegration,integration-heavy`

Analogously, for the JDK8 projects the commands are:

`mvn clean install -Pdefault-jdk8`

and

`mvn clean install -Pintegration-jdk8`

Building a single module
====================
To build a specific module, run the command: `mvn clean install` in the module directory.

It can happen that your module is part of a parent module e.g. `parent-boot-1`,`parent-spring-5` etc, then you will need to build the parent module first so that you can build your module.
We have created a `parents` profile that you can use to build just the parent modules, just run the profile as:
`mvn clean install -Pparents`

Building modules from the root of the repository
====================
To build specific modules from the root of the repository, run the command: `mvn clean install --pl akka-modules,algorithms-modules -Pdefault` in the root directory.

Here `akka-modules` and `algorithms-modules` are the modules that we want to build and `default` is the maven profile in which these modules are present.

Running a Spring Boot module
====================
To run a Spring Boot module, run the command: `mvn spring-boot:run` in the module directory.

Working with the IDE
====================
This repo contains a large number of modules.
When you're working with an individual module, there's no need to import all of them (or build all of them) - you can simply import that particular module in either Eclipse or IntelliJ.

Running Tests
=============
The command `mvn clean install` from within a module will run the unit tests in that module.
For Spring modules this will also run the `SpringContextTest` if present.

To run the integration tests, use the command:

`mvn clean install -Pintegration` or

`mvn clean install -Pintegration-heavy` or

`mvn clean install -Pintegration-jdk8`

depending on the list where our module exists


= Spring Data for Elasticsearch image:https://jenkins.spring.io/buildStatus/icon?job=spring-data-elasticsearch%2Fmain&subject=Build[link=https://jenkins.spring.io/view/SpringData/job/spring-data-elasticsearch/] https://gitter.im/spring-projects/spring-data[image:https://badges.gitter.im/spring-projects/spring-data.svg[Gitter]] image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data Elasticsearch"]

The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.

The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine.
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with Elasticsearch Documents and easily writing a Repository style data access layer.

This project is lead and maintained by the community.

== Features

* Spring configuration support using Java based `@Configuration` classes or an XML namespace for an ES client instances.
* `ElasticsearchOperations` class and implementations that increases productivity performing common ES operations.
Includes integrated object mapping between documents and POJOs.
* Feature Rich Object Mapping integrated with Spring’s Conversion Service
* Annotation based mapping metadata
* Automatic implementation of `Repository` interfaces including support for custom search methods.
* CDI support for repositories

== Code of Conduct

This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].
By participating, you are expected to uphold this code of conduct.
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.

== Getting Started

Here is a quick teaser of an application using Spring Data Repositories in Java:

[source,java]
----
public interface PersonRepository extends CrudRepository<Person, Long> {

  List<Person> findByLastname(String lastname);

  List<Person> findByFirstnameLike(String firstname);
}

@Service
public class MyService {

  private final PersonRepository repository;

  public MyService(PersonRepository repository) {
    this.repository = repository;
  }

  public void doWork() {

    repository.deleteAll();

    Person person = new Person();
    person.setFirstname("Oliver");
    person.setLastname("Gierke");
    repository.save(person);

    List<Person> lastNameResults = repository.findByLastname("Gierke");
    List<Person> firstNameResults = repository.findByFirstnameLike("Oli");
 }
}
----

=== Using the RestClient

Please check the [official documentation](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration).

=== Maven configuration

Add the Maven dependency:

[source,xml]
----
<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-elasticsearch</artifactId>
  <version>${version}</version>
</dependency>
----

**Compatibility Matrix**

The compatibility between Spring Data Elasticsearch, Elasticsearch client drivers and Spring Boot versions can be found in the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions[reference documentation].

To use the Release candidate versions of the upcoming major version, use our Maven milestone repository and declare the appropriate dependency version:

[source,xml]
----
<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-elasticsearch</artifactId>
  <version>${version}.RCx</version> <!-- x being 1, 2, ... -->
</dependency>

<repository>
  <id>spring-snapshot</id>
  <name>Spring Snapshot Repository</name>
  <url>https://repo.spring.io/milestone</url>
</repository>
----

If you'd rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version:

[source,xml]
----
<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-elasticsearch</artifactId>
  <version>${version}-SNAPSHOT</version>
</dependency>

<repository>
  <id>spring-snapshot</id>
  <name>Spring Snapshot Repository</name>
  <url>https://repo.spring.io/snapshot</url>
</repository>
----

== Getting Help

Having trouble with Spring Data?
We’d love to help!

* Check the
https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/elasticsearch/docs/current/api/[Javadocs].
* Learn the Spring basics – Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation.
If you are just starting out with Spring, try one of the https://spring.io/guides[guides].
* Ask a question or chat with the community on https://app.gitter.im/#/room/#spring-projects_spring-data:gitter.im[Gitter].
* Report bugs with Spring Data for Elasticsearch at https://github.com/spring-projects/spring-data-elasticsearch/issues[https://github.com/spring-projects/spring-data-elasticsearch/issues].

== Reporting Issues

Spring Data uses GitHub as issue tracking system to record bugs and feature requests.
If you want to raise an issue, please follow the recommendations below:

* Before you log a bug, please search the
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
* If the issue doesn't already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data Elasticsearch that you are using and JVM version.
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
* If possible try to create a test-case or project that replicates the issue.
Attach a link to your code or a compressed file containing your code.

== Building from Source

You don’t need to build from source to use Spring Data (binaries in https://repo.spring.io[repo.spring.io]), but if you want to try out the latest and greatest, Spring Data can be easily built with the https://github.com/takari/maven-wrapper[maven wrapper].

You need JDK 17 or above to build the _main_ branch.
For the branches up to and including release 4.4, JDK 8 is required.

[source,bash]
----
 $ ./mvnw clean install
----

If you want to build with the regular `mvn` command, you will need https://maven.apache.org/run-maven/index.html[Maven v3.5.0 or above].

_Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests, and in particular please sign the https://cla.pivotal.io/sign/spring[Contributor’s Agreement] before submitting your first pull request._

IMPORTANT: When contributing, please make sure an issue exists in https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] and comment on this issue with how you want to address it.
By this we not only know that someone is working on an issue, we can also align architectural questions and possible solutions before work is invested . We so can prevent that much work is put into Pull Requests that have little or no chances of being merged.

=== Building reference documentation

Building the documentation builds also the project without running tests.

[source,bash]
----
 $ ./mvnw clean install -Pantora
----

The generated documentation is available from `target/antora/site/index.html`.

== Examples

For examples on using the Spring Data for Elasticsearch, see the https://github.com/spring-projects/spring-data-examples/tree/main/elasticsearch/example[spring-data-examples] project.

== License

Spring Data for Elasticsearch Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].


# Apache CloudStack [![Build Status](https://github.com/apache/cloudstack/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/build.yml) [![UI Build](https://github.com/apache/cloudstack/actions/workflows/ui.yml/badge.svg)](https://github.com/apache/cloudstack/actions/workflows/ui.yml) [![License Check](https://github.com/apache/cloudstack/actions/workflows/rat.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/rat.yml) [![Simulator CI](https://github.com/apache/cloudstack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_cloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_cloudstack) [![codecov](https://codecov.io/gh/apache/cloudstack/branch/main/graph/badge.svg)](https://codecov.io/gh/apache/cloudstack)

[![Apache CloudStack](tools/logo/apache_cloudstack.png)](https://cloudstack.apache.org/)

Apache CloudStack is open source software designed to deploy and manage large
networks of virtual machines, as a highly available, highly scalable
Infrastructure as a Service (IaaS) cloud computing platform. CloudStack is used
by a number of service providers to offer public cloud services, and by many
companies to provide an on-premises (private) cloud offering, or as part of a
hybrid cloud solution.

CloudStack is a turnkey solution that includes the entire "stack" of features
most organizations want with an IaaS cloud: compute orchestration,
Network-as-a-Service, user and account management, a full and open native API,
resource accounting, and a first-class User Interface (UI).

CloudStack currently supports the most popular hypervisors:
VMware vSphere, KVM, XenServer, XenProject and Hyper-V as well as
OVM and LXC containers.

Users can manage their cloud with an easy to use Web interface, command line
tools, and/or a full-featured query based API.

For more information on Apache CloudStack, please visit the [website](http://cloudstack.apache.org)

## Who Uses CloudStack?

* There are more than 150 known organizations using Apache CloudStack (or a commercial distribution of CloudStack). Our users include many major service providers running CloudStack to offer public cloud services, product vendors who incorporate or integrate with CloudStack in their own products, organizations who have used CloudStack to build their own private clouds, and systems integrators that offer CloudStack related services.

* See our [case studies](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Case+Studies) highlighting successful deployments of Apache CloudStack.

* See the up-to-date list of current [users](https://cloudstack.apache.org/users.html).

* If you are using CloudStack in your organization and your company is not listed above, please complete our brief adoption [survey](https://cloudstack.apache.org/survey.html). We're happy to keep your company name anonymous if you require.

## Demo

![Screenshot](ui/docs/screenshot-dashboard.png)

See the project user-interface QA website that runs CloudStack against simulator hypervisor:
https://qa.cloudstack.cloud/simulator/ (admin:password)

## Getting Started

* Download a released [version](https://cloudstack.apache.org/downloads.html)
* Build from source with the instructions in the [INSTALL.md](INSTALL.md) file.

## Getting Source Repository

Apache CloudStack project uses Git. The official Git repository is at:

    https://gitbox.apache.org/repos/asf/cloudstack.git

And a mirror is hosted on GitHub:

    https://github.com/apache/cloudstack

The GitHub mirror is strictly read only and provides convenience to users and
developers to explore the code and for the community to accept contributions
via GitHub pull requests.

## Documentation

* [Project Documentation](https://docs.cloudstack.apache.org)
* [Release notes](https://docs.cloudstack.apache.org/en/latest/releasenotes/index.html)
* Developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Home)
* Design [documents](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Design)
* API [documentation](https://cloudstack.apache.org/api.html)
* How to [contribute](CONTRIBUTING.md)

## News and Events

* [Blog](https://blogs.apache.org/cloudstack)
* [Twitter](https://twitter.com/cloudstack)
* [Events and meetup](http://cloudstackcollab.org/)
* [YouTube channel](https://www.youtube.com/ApacheCloudStack)

## Getting Involved and Contributing

Interested in helping out with Apache CloudStack? Great! We welcome
participation from anybody willing to work [The Apache Way](http://theapacheway.com) and make a
contribution. Note that you do not have to be a developer in order to contribute
to Apache CloudStack. We need folks to help with documentation, translation,
promotion etc. See our contribution [page](http://cloudstack.apache.org/contribute.html).

If you are a frequent contributors, you can request to be added as collaborators
(see https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features#Git.asf.yamlfeatures-AssigningexternalcollaboratorswiththetriageroleonGitHub)
to our GitHub repos. This allows you to use project GitHub with ability to report
issue with tags, and be assigned to issues and PRs. This is done via the .asf.yaml
file in this repo.
You may do so by sharing your GitHub users ID or raise a GitHub issue.

If you're interested in learning more or participating in the Apache CloudStack
project, the mailing lists are the best way to do that. While the project has
several communications channels, the [mailing lists](http://cloudstack.apache.org/mailing-lists.html) are the most active and the
official channels for making decisions about the project itself.

Mailing lists:
- [Development Mailing List](mailto:dev-subscribe@cloudstack.apache.org)
- [Users Mailing List](mailto:users-subscribe@cloudstack.apache.org)
- [Commits Mailing List](mailto:commits-subscribe@cloudstack.apache.org)
- [Issues Mailing List](mailto:issues-subscribe@cloudstack.apache.org)
- [Marketing Mailing List](mailto:marketing-subscribe@cloudstack.apache.org)

Report and/or check bugs on [GitHub](https://github.com/apache/cloudstack/issues) and check our
developer [page](https://cloudstack.apache.org/developers.html) for contributing code.

## Reporting Security Vulnerabilities

If you've found an issue that you believe is a security vulnerability in a
released version of CloudStack, please report it to `security@apache.org` with
details about the vulnerability, how it might be exploited, and any additional
information that might be useful.

For more details, please visit our security [page](http://cloudstack.apache.org/security.html).

## License

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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

  http://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.

Please see the [LICENSE](LICENSE) file included in the root directory
of the source tree for extended license details.

## Notice of Cryptographic Software

This distribution includes cryptographic software. The country in which you currently
reside may have restrictions on the import, possession, use, and/or re-export to another
country, of encryption software. BEFORE using any encryption software, please check your
country's laws, regulations and policies concerning the import, possession, or use, and
re-export of encryption software, to see if this is permitted. See [The Wassenaar Arrangement](http://www.wassenaar.org/)
for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has
classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which
includes information security software using or performing cryptographic functions with
asymmetric algorithms. The form and manner of this Apache Software Foundation distribution
makes it eligible for export under the License Exception ENC Technology Software
Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section
740.13) for both object code and source code.

The following provides more details on the included cryptographic software:

* CloudStack makes use of JaSypt cryptographic libraries.
* CloudStack has a system requirement of MySQL, and uses native database encryption functionality.
* CloudStack makes use of the Bouncy Castle general-purpose encryption library.
* CloudStack can optionally interact with and control OpenSwan-based VPNs.
* CloudStack has a dependency on and makes use of JSch - a java SSH2 implementation.


ARX - Open Source Data Anonymization Software
====

Note
------

ARX is the result of a research project. To support our research, please cite one of our papers instead of referencing our website in scientific articles. You can find an overview of papers about ARX [here](https://arx.deidentifier.org/publications/). If you are not sure which paper to cite, we recommend this one:

Prasser F., Eicher J., Spengler H., Bild R., Kuhn K. A. (2020) Flexible Data Anonymization Using ARX — Current Status and Challenges Ahead. Software Pract Exper 2020;1–28. [(Link)](https://doi.org/10.1002/spe.2812)

Thanks!

Introduction
------

ARX is a comprehensive open source software for anonymizing sensitive personal data.
It has been designed from the ground up to provide high scalability, ease of use and a
tight integration of the many different aspects relevant to data anonymization. Its highlights include:

 * Utility-focused anonymization using different statistical models
 * Syntactic privacy models, such as k-anonymity, ℓ-diversity, t-closeness and δ-presence
 * Semantic privacy models, such as (ɛ, δ)-differential privacy
 * Methods for optimizing the profitability of data publishing based on monetary cost-benefit analyses
 * Data transformation with generalization, suppression, microaggregation and top/bottom coding as well as global and local recoding
 * Methods for analyzing data utility
 * Methods for analyzing re-identification risks

The software is able to handle very large datasets on commodity hardware and features an intuitive cross-platform
graphical user interface. You can find further information on the project [website](https://arx.deidentifier.org/).

Development setup
------

Currently, the main development of ARX is carried out using Eclipse as an IDE and Ant as a build tool. Support for further IDEs such as IntelliJ IDEA and Maven is experimental.

The Ant build script features various targets that can be used to build different versions of ARX (e.g. including GUI code or not). To build only the core code using Maven, set the system property `core` to `true`. This will build a platform independent jar with the ARX main code module and no GUI components:

```$ mvn compile -Dcore=true```

Contributing and code of conduct
------

See [here](https://github.com/arx-deidentifier/arx/blob/master/contributing.md) and [here](https://github.com/arx-deidentifier/arx/blob/master/code_of_conduct.md).

License
------

ARX (C) 2012 - 2023 Fabian Prasser and Contributors.

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

http://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.

External Libraries
------

ARX uses external libraries. Their licenses are listed in the respective folders.


![Build Status](https://github.com/googlemaps/android-maps-utils/actions/workflows/test.yml/badge.svg?branch=main)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.google.maps.android/android-maps-utils/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.google.maps.android/android-maps-utils)
![GitHub contributors](https://img.shields.io/github/contributors/googlemaps/android-maps-utils?color=green)
[![Discord](https://img.shields.io/discord/676948200904589322)](https://discord.gg/hYsWbmk)
![Apache-2.0](https://img.shields.io/badge/license-Apache-blue)

# Maps SDK for Android Utility Library

## Description

This open-source library contains utilities that are useful for a wide
range of applications using the [Google Maps SDK for Android][android-site].

- **Marker animation** - animates a marker from one position to another
- **Marker clustering** — handles the display of a large number of points
- **Marker icons** — display text on your Markers
- **Heatmaps** — display a large number of points as a heat map
- **Import KML** — displays KML data on the map
- **Import GeoJSON** — displays and styles GeoJSON data on the map
- **Polyline encoding and decoding** — compact encoding for paths,
  interoperability with Maps API web services
- **Spherical geometry** — for example: computeDistance, computeHeading,
  computeArea
- **Street View metadata** — checks if a Street View panorama exists at a given location

You can also find Kotlin extensions for this library in [Maps Android KTX][android-maps-ktx].

## Requirements

* Android API level 21+
- An [API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key)

## Installation

```groovy
dependencies {
    // Utilities for Maps SDK for Android (requires Google Play Services)
    // You do not need to add a separate dependency for the Maps SDK for Android
    // since this library builds in the compatible version of the Maps SDK.
    implementation 'com.google.maps.android:android-maps-utils:3.8.3'

    // Optionally add the Kotlin Extensions (KTX) for full Kotlin language support
    // See latest version at https://github.com/googlemaps/android-maps-ktx
    // implementation 'com.google.maps.android:maps-utils-ktx:<latest-version>'
}
```

## Demo App

This repository includes a [sample app](demo) that illustrates the use of this library.

To run the demo app, you'll have to:

1. [Get a Maps API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key)
1. Add a file `local.properties` in the root project (this file should *NOT* be under version control to protect your API key)
1. Add a single line to `local.properties` that looks like `MAPS_API_KEY=YOUR_API_KEY`, where `YOUR_API_KEY` is the API key you obtained in the first step
1. Build and run the `debug` variant for the Maps SDK for Android version

## Documentation

See the [reference documentation][dokka] for a full list of classes and their methods.

## Usage

Full guides for using the utilities are published in
[Google Maps Platform documentation][devsite-guide].

  Marker utilities

### Marker utilities

- Marker animation [source](https://github.com/googlemaps/android-maps-utils/blob/main/library/src/main/java/com/google/maps/android/ui/AnimationUtil.java), [sample code](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/AnimationUtilDemoActivity.java)
- Marker clustering [source](https://github.com/googlemaps/android-maps-utils/tree/main/library/src/main/java/com/google/maps/android/clustering), [guide](https://developers.google.com/maps/documentation/android-sdk/utility/marker-clustering)
- Advanced Markers clustering [source](https://github.com/googlemaps/android-maps-utils/tree/main/library/src/main/java/com/google/maps/android/clustering), [sample code](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/CustomAdvancedMarkerClusteringDemoActivity.java)
- Marker icons [source](https://github.com/googlemaps/android-maps-utils/blob/main/library/src/main/java/com/google/maps/android/ui/IconGenerator.java), [sample code](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/IconGeneratorDemoActivity.java)

  Data visualization utilities

### Data visualization utilities

- Display heat maps [source](https://github.com/googlemaps/android-maps-utils/tree/main/library/src/main/java/com/google/maps/android/heatmaps), [guide](https://developers.google.com/maps/documentation/android-sdk/utility/heatmap)
- Import GeoJSON [source](https://github.com/googlemaps/android-maps-utils/tree/main/library/src/main/java/com/google/maps/android/data/geojson), [guide](https://developers.google.com/maps/documentation/android-sdk/utility/geojson)
- Import KML [source](https://github.com/googlemaps/android-maps-utils/tree/main/library/src/main/java/com/google/maps/android/data/kml), [guide](https://developers.google.com/maps/documentation/android-sdk/utility/kml)

  Polyline and spherical geometry utilities

### Additional utilities

- Polyline encoding and decoding [source](https://github.com/googlemaps/android-maps-utils/blob/main/library/src/main/java/com/google/maps/android/PolyUtil.java), [encoding sample](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/PolySimplifyDemoActivity.java), [decoding sample](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/PolyDecodeDemoActivity.java)
- Spherical geometry [source](https://github.com/googlemaps/android-maps-utils/blob/main/library/src/main/java/com/google/maps/android/SphericalUtil.java), [compute distance sample](https://github.com/googlemaps/android-maps-utils/blob/main/demo/src/main/java/com/google/maps/android/utils/demo/DistanceDemoActivity.java)

  Street View metadata utility

### Street View metadata utility

The StreetViewUtil class provides functionality to check whether a location is supported in StreetView. You can avoid errors when [adding a Street View panorama](https://developers.google.com/maps/documentation/android-sdk/streetview) to an Android app by calling this metadata utility and only adding a Street View panorama if the response is `OK`.

```kotlin
StreetViewUtils.fetchStreetViewData(LatLng(8.1425918, 11.5386121), BuildConfig.MAPS_API_KEY,Source.DEFAULT)
```

`fetchStreetViewData` will return `NOT_FOUND`, `OK`, `ZERO_RESULTS` or `REQUEST_DENIED`, depending on the response.

By default, the `Source` is set to `Source.DEFAULT`, but you can also specify `Source.OUTDOOR` to request outdoor Street View panoramas.

  Migration Guide from v0.x to 1.0

### Migrating from v0.x to 1.0

Improvements made in version [1.0.0](https://github.com/googlemaps/android-maps-utils/releases/tag/1.0.0) of the library to support multiple layers on the map caused breaking changes to versions prior to it. These changes also modify behaviors that are documented in the [Maps SDK for Android Maps documentation](https://developers.google.com/maps/documentation/android-sdk/intro) site. This section outlines all those changes and how you can migrate to use this library since version 1.0.0.

### Adding Click Events

Click events originate in the layer-specific object that added the marker/ground overlay/polyline/polygon. In each layer, the click handlers are passed to the marker, ground overlay, polyline, or polygon `Collection` object.

```java
// Clustering
ClusterManager<ClusterItem> clusterManager = // Initialize ClusterManager - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
clusterManager.setOnClusterItemClickListener(item -> {
    // Listen for clicks on a cluster item here
    return false;
});
clusterManager.setOnClusterClickListener(item -> {
    // Listen for clicks on a cluster here
    return false;
});

// GeoJson
GeoJsonLayer geoJsonLayer = // Initialize GeoJsonLayer - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
geoJsonLayer.setOnFeatureClickListener(feature -> {
    // Listen for clicks on GeoJson features here
});

// KML
KmlLayer kmlLayer = // Initialize KmlLayer - if you're using multiple maps features, use the constructor that passes in Manager objects (see next section)
kmlLayer.setOnFeatureClickListener(feature -> {
    // Listen for clicks on KML features here
});
```

#### Using Manager Objects

If you use one of Manager objects in the package `com.google.maps.android` (e.g. `GroundOverlayManager`, `MarkerManager`, etc.), say from adding a KML layer, GeoJson layer, or Clustering, you will have to rely on the Collection specific to add an object to the map rather than adding that object directly to `GoogleMap`. This is because each Manager sets itself as a click listener so that it can manage click events coming from multiple layers.

For example, if you have additional `GroundOverlay` objects:

_New_

```java
GroundOverlayManager groundOverlayManager = // Initialize

// Create a new collection first
GroundOverlayManager.Collection groundOverlayCollection = groundOverlayManager.newCollection();

// Add a new ground overlay
GroundOverlayOptions options = // ...
groundOverlayCollection.addGroundOverlay(options);
```

_Old_

```java
GroundOverlayOptions options = // ...
googleMap.addGroundOverlay(options);
```

This same pattern applies for `Marker`, `Circle`, `Polyline`, and `Polygon`.

### Adding a Custom Info Window
If you use `MarkerManager`, adding an `InfoWindowAdapter` and/or an `OnInfoWindowClickListener` should be done on the `MarkerManager.Collection` object.

_New_
```java
CustomInfoWindowAdapter adapter = // ...
OnInfoWindowClickListener listener = // ...

// Create a new Collection from a MarkerManager
MarkerManager markerManager = // ...
MarkerManager.Collection collection = markerManager.newCollection();

// Set InfoWindowAdapter and OnInfoWindowClickListener
collection.setInfoWindowAdapter(adapter);
collection.setOnInfoWindowClickListener(listener);

// Alternatively, if you are using clustering
ClusterManager<ClusterItem> clusterManager = // ...
MarkerManager.Collection markerCollection = clusterManager.getMarkerCollection();
markerCollection.setInfoWindowAdapter(adapter);
markerCollection.setOnInfoWindowClickListener(listener);
```

_Old_
```java
CustomInfoWindowAdapter adapter = // ...
OnInfoWindowClickListener listener = // ...
googleMap.setInfoWindowAdapter(adapter);
googleMap.setOnInfoWindowClickListener(listener);
```

### Adding a Marker Drag Listener

If you use `MarkerManager`, adding an `OnMarkerDragListener` should be done on the `MarkerManager.Collection` object.

_New_
```java
// Create a new Collection from a MarkerManager
MarkerManager markerManager = // ...
MarkerManager.Collection collection = markerManager.newCollection();

// Add markers to collection
MarkerOptions markerOptions = // ...
collection.addMarker(markerOptions);
// ...

// Set OnMarkerDragListener
GoogleMap.OnMarkerDragListener listener = // ...
collection.setOnMarkerDragListener(listener);

// Alternatively, if you are using clustering
ClusterManager<ClusterItem> clusterManager = // ...
MarkerManager.Collection markerCollection = clusterManager.getMarkerCollection();
markerCollection.setOnMarkerDragListener(listener);
```

_Old_
```java
// Add markers
MarkerOptions markerOptions = // ...
googleMap.addMarker(makerOptions);

// Add listener
GoogleMap.OnMarkerDragListener listener = // ...
googleMap.setOnMarkerDragListener(listener);
```

### Clustering

[A bug](https://github.com/googlemaps/android-maps-utils/issues/90) was fixed in v1 to properly clear and re-add markers via the `ClusterManager`.

For example, this didn't work pre-v1, but works for v1 and later:

```java
clusterManager.clearItems();
clusterManager.addItems(items);
clusterManager.cluster();
```

If you're using custom clustering (i.e, if you're extending `DefaultClusterRenderer`), you must override two additional methods in v1:
*  `onClusterItemUpdated()` - should be the same* as your `onBeforeClusterItemRendered()` method
*  `onClusterUpdated()` - should be the same* as your `onBeforeClusterRendered()` method

**Note that these methods can't be identical, as you need to use a `Marker` instead of `MarkerOptions`*

See the [`CustomMarkerClusteringDemoActivity`](demo/src/gms/java/com/google/maps/android/utils/demo/CustomMarkerClusteringDemoActivity.java) in the demo app for a complete example.

_New_

```java
    private class PersonRenderer extends DefaultClusterRenderer<Person> {
        ...
        @Override
        protected void onBeforeClusterItemRendered(Person person, MarkerOptions markerOptions) {
            // Draw a single person - show their profile photo and set the info window to show their name
            markerOptions
                    .icon(getItemIcon(person))
                    .title(person.name);
        }

        /**
         * New in v1
         */
        @Override
        protected void onClusterItemUpdated(Person person, Marker marker) {
            // Same implementation as onBeforeClusterItemRendered() (to update cached markers)
            marker.setIcon(getItemIcon(person));
            marker.setTitle(person.name);
        }

        @Override
        protected void onBeforeClusterRendered(Cluster<Person> cluster, MarkerOptions markerOptions) {
            // Draw multiple people.
            // Note: this method runs on the UI thread. Don't spend too much time in here (like in this example).
            markerOptions.icon(getClusterIcon(cluster));
        }

        /**
         * New in v1
         */
        @Override
        protected void onClusterUpdated(Cluster<Person> cluster, Marker marker) {
            // Same implementation as onBeforeClusterRendered() (to update cached markers)
            marker.setIcon(getClusterIcon(cluster));
        }
        ...
    }
```

_Old_

```java
    private class PersonRenderer extends DefaultClusterRenderer<Person> {
        ...
        @Override
        protected void onBeforeClusterItemRendered(Person person, MarkerOptions markerOptions) {
            // Draw a single person - show their profile photo and set the info window to show their name
            markerOptions
                    .icon(getItemIcon(person))
                    .title(person.name);
        }

        @Override
        protected void onBeforeClusterRendered(Cluster<Person> cluster, MarkerOptions markerOptions) {
            // Draw multiple people.
            // Note: this method runs on the UI thread. Don't spend too much time in here (like in this example).
            markerOptions.icon(getClusterIcon(cluster));
        }
        ...
    }
```

## Contributing

Contributions are welcome and encouraged! See the [contributing guide](CONTRIBUTING.md) for more info.

## Support

This library is offered via an open source [license](LICENSE). It is not governed by the Google Maps Platform [Technical Support Services Guidelines](https://cloud.google.com/maps-platform/terms/tssg?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components), the [SLA](https://cloud.google.com/maps-platform/terms/sla?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components), or the [Deprecation Policy](https://cloud.google.com/maps-platform/terms?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components) (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).

This library adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced.

If you find a bug, or have a feature request, please [file an issue] on GitHub.

If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our [developer community channels](https://developers.google.com/maps/developer-community?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components) including the Google Maps Platform [Discord server].

[file an issue]: https://github.com/googlemaps/android-maps-utils/issues/new/choose
[pull request]: https://github.com/googlemaps/android-maps-utils/compare
[code of conduct]: CODE_OF_CONDUCT.md
[Discord server]: https://discord.gg/hYsWbmk
[android-site]: https://developers.google.com/maps/documentation/android-sdk
[devsite-guide]: https://developers.google.com/maps/documentation/android-sdk/utility
[dokka]: https://googlemaps.github.io/android-maps-utils/
[android-maps-ktx]: https://github.com/googlemaps/android-maps-ktx


## About

Consulo - multi-language ide. Project was started in year 2013 by forking [IDEA Community Edition](https://github.com/JetBrains/intellij-community).

Main goal - to create an **open** IDE, where you don't need to select an IDE for different languages. Instead, provide a standard for language implementation inside the IDE.

## Contributing

If you can't describe the issue, you can use our [forum](https://discuss.consulo.io/), or you can read the [contributing guide](https://github.com/consulo/consulo/blob/master/CONTRIBUTING.md) and report the issue at GitHub

## Building & Running

### Build Status

| JVM           | Github Actions|
| ------------- |-----------------:|
| Java 21       | ![jdk21](https://github.com/consulo/consulo/workflows/jdk21/badge.svg) |

First of all, you need these tools:

 * Maven 3.9+
 * JDK 21+

Then execute from command line:

```sh
mvn package
```

If you want run Consulo from repository
 * as a desktop application

   ```sh
    mvn install

    mvn consulo:run-desktop -pl consulo:consulo-sandbox-desktop
   ```

 * as a web application

   first need build web sandbox
   ```
   mvn package -am -pl consulo:consulo-sandbox-web
   ```

   then need start code server (since we used gwt as frontend)

   ```sh
   cd modules/web/web-ui-impl-client

   mvn -am vaadin:run-codeserver
   ```

   and start web server

   ```sh
   cd modules/web/web-bootstrap

   mvn -am jetty:run
   ```

## Sandbox Projects

 * Profiler API [link](https://github.com/consulo/profiler-sandbox)
 * Diagram support [link](https://github.com/consulo/consulo/tree/master/modules/base/graph-api)
 * Web IDE [link](https://github.com/consulo/consulo/tree/master/modules/web)
 * SWT UI [link](https://github.com/consulo/consulo/tree/master/modules/desktop-swt)

## Links

* [Contributing Guide](https://github.com/consulo/consulo/blob/master/CONTRIBUTING.md)
* [Download](https://consulo.app)
* [Issues](https://github.com/consulo/consulo/issues)
* [Forum](https://https://github.com/consulo/consulo/discussions/)
* [Discord Channel](https://discord.gg/Ab3Ka5gTFv)