Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Use basepom as parent instead of Sonatype OSS #377

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -82,4 +82,8 @@ crashlytics-build.properties
# OS X files
.DS_Store

# PMD and Checkstyle config files (auto generated)
.pmd
.pmdruleset.xml
.checkstyle

12 changes: 12 additions & 0 deletions connector-catalog/pom.xml
Expand Up @@ -30,6 +30,10 @@
<name>Syndesis REST :: Connector Catalog</name>

<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog</artifactId>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used dependencies need to be declared

</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog-connector</artifactId>
Expand All @@ -38,10 +42,18 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-catalog-maven</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>

</project>
Expand Up @@ -29,7 +29,7 @@

public class ConnectorCatalog {

private final static Logger log = LoggerFactory.getLogger(ConnectorCatalog.class);
private static final Logger log = LoggerFactory.getLogger(ConnectorCatalog.class);
Copy link
Member Author

@zregvart zregvart May 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JLS declaration order must be followed


private final CamelConnectorCatalog connectorCatalog;
private final CamelCatalog camelCatalog;
Expand Down
40 changes: 40 additions & 0 deletions controllers/pom.xml
Expand Up @@ -30,6 +30,16 @@
<name>Syndesis REST :: Controllers</name>

<dependencies>
<dependency>
<groupId>io.syndesis</groupId>
<artifactId>core</artifactId>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used dependencies need to be declared

</dependency>

<dependency>
<groupId>io.syndesis</groupId>
<artifactId>model</artifactId>
</dependency>

<dependency>
<groupId>io.syndesis</groupId>
<artifactId>dao</artifactId>
Expand All @@ -50,6 +60,36 @@
<artifactId>project-generator</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Expand Up @@ -15,9 +15,13 @@
*/
package io.syndesis.controllers.integration;

import java.util.*;
import java.util.Arrays;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

import java.util.Collections;
import java.util.List;
import java.util.Set;

import io.syndesis.model.integration.Integration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

Expand All @@ -34,7 +38,7 @@ public List<StatusChangeHandler> getStatusChangeHandlers() {
);
}

class DemoHandler implements StatusChangeHandler {
static class DemoHandler implements StatusChangeHandler {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inner classes that do not reference outer need to be static

private final Integration.Status status;
private final long waitMillis;

Expand Down
Expand Up @@ -16,8 +16,15 @@
package io.syndesis.controllers.integration;

import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
import java.util.Date;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
Expand All @@ -28,6 +35,7 @@
import io.syndesis.model.ChangeEvent;
import io.syndesis.model.Kind;
import io.syndesis.model.integration.Integration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -48,7 +56,7 @@ public class IntegrationController {
private ExecutorService executor;
private ScheduledExecutorService scheduler;

private final static long SCHEDULE_INTERVAL_IN_SECONDS = 60;
private static final long SCHEDULE_INTERVAL_IN_SECONDS = 60;
Copy link
Member Author

@zregvart zregvart May 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JLS declaration order

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a fan of enforcing JLS ordering as imo it doesn't add much value and is just nit picking.


@Autowired
public IntegrationController(DataManager dataManager, EventBus eventBus, StatusChangeHandlerProvider handlerFactory) {
Expand Down
Expand Up @@ -15,9 +15,14 @@
*/
package io.syndesis.controllers.integration;

import java.util.*;
import java.util.Arrays;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I almost never look at imports so don't mind much how they look like. But I'm fine with any import rule as along as IDEA supports it.

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import io.syndesis.model.integration.Integration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

Expand Down
Expand Up @@ -16,12 +16,20 @@
package io.syndesis.controllers.integration.online;

import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import io.fabric8.funktion.model.StepKinds;
import io.syndesis.controllers.integration.StatusChangeHandlerProvider;
import io.syndesis.core.SyndesisServerException;
import io.syndesis.core.Names;
import io.syndesis.core.SyndesisServerException;
import io.syndesis.core.Tokens;
import io.syndesis.dao.manager.DataManager;
import io.syndesis.github.GitHubService;
Expand All @@ -34,7 +42,7 @@
import io.syndesis.project.converter.GenerateProjectRequest;
import io.syndesis.project.converter.ImmutableGenerateProjectRequest;
import io.syndesis.project.converter.ProjectGenerator;
import io.fabric8.funktion.model.StepKinds;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -49,7 +57,7 @@ public class ActivateHandler implements StatusChangeHandlerProvider.StatusChange
private final GitHubService gitHubService;
private final ProjectGenerator projectConverter;

private final static Logger log = LoggerFactory.getLogger(ActivateHandler.class);
private static final Logger log = LoggerFactory.getLogger(ActivateHandler.class);
Copy link
Member Author

@zregvart zregvart May 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JLS declaration order


ActivateHandler(DataManager dataManager, OpenShiftService openShiftService,
GitHubService gitHubService, ProjectGenerator projectConverter) {
Expand Down
Expand Up @@ -15,14 +15,17 @@
*/
package io.syndesis.controllers.integration.online;

import java.util.Arrays;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import io.fabric8.kubernetes.client.KubernetesClientException;
import io.syndesis.controllers.integration.StatusChangeHandlerProvider;
import io.syndesis.core.Tokens;
import io.syndesis.model.integration.Integration;
import io.syndesis.openshift.OpenShiftDeployment;
import io.syndesis.openshift.OpenShiftService;
import io.fabric8.kubernetes.client.KubernetesClientException;

import java.util.*;

public class DeactivateHandler implements StatusChangeHandlerProvider.StatusChangeHandler {

Expand Down
Expand Up @@ -15,14 +15,15 @@
*/
package io.syndesis.controllers.integration.online;

import java.util.Collections;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No stars in imports

import java.util.Set;

import io.syndesis.controllers.integration.StatusChangeHandlerProvider;
import io.syndesis.core.Tokens;
import io.syndesis.model.integration.Integration;
import io.syndesis.openshift.OpenShiftDeployment;
import io.syndesis.openshift.OpenShiftService;

import java.util.*;

public class DeleteHandler implements StatusChangeHandlerProvider.StatusChangeHandler {

private final OpenShiftService openShiftService;
Expand Down
30 changes: 30 additions & 0 deletions core/pom.xml
Expand Up @@ -34,16 +34,46 @@
<!-- (none) -->
<!-- ===================================================================================== -->

<dependency>
<groupId>org.springframework.security</groupId>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used dependencies need to be declared

<artifactId>spring-security-core</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-security-adapter</artifactId>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-common</artifactId>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-adapter-core</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>junit</groupId>
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/io/syndesis/core/EventBus.java
Expand Up @@ -41,24 +41,24 @@ public interface Subscription {
* @param handler the callback that will receive the events.
* @return the previously registered subscription with that id or null.
*/
public Subscription subscribe(String subscriberId, Subscription handler);
Subscription subscribe(String subscriberId, Subscription handler);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant public modifier


/**
* Removes a subscription from the event bus.
* @param subscriberId unique id for the subscription.
* @return the previously registered subscription with that id or null if not registered.
*/
public Subscription unsubscribe(String subscriberId);
Subscription unsubscribe(String subscriberId);

/**
* Send an event to all subscribers in a bus. The event MAY get delivered to the subscriptions
* after this call returns.
*/
public void broadcast(String event, String data);
void broadcast(String event, String data);

/**
* Send an event to a specific subscriber on the bus. The event MAY get delivered to the subscriptions
* after this call returns.
*/
public void send(String subscriberId, String event, String data);
void send(String subscriberId, String event, String data);
}
10 changes: 5 additions & 5 deletions core/src/main/java/io/syndesis/core/KeyGenerator.java
Expand Up @@ -28,9 +28,9 @@
*/
public class KeyGenerator {

static private long lastTimestamp = System.currentTimeMillis();
static private final byte randomnessByte;
static private long randomnessLong;
private static long lastTimestamp = System.currentTimeMillis();
Copy link
Member Author

@zregvart zregvart May 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JLS declaration order

private static final byte randomnessByte;
private static long randomnessLong;

private KeyGenerator() {}

Expand All @@ -40,7 +40,7 @@ private KeyGenerator() {}
randomnessLong = random.nextLong();
}

static public String createKey() {
public static String createKey() {
long now = System.currentTimeMillis();

ByteBuffer buffer = ByteBuffer.wrap(new byte[8 + 1 + 8]);
Expand All @@ -55,7 +55,7 @@ static public String createKey() {
}
}

protected synchronized static long getRandomPart(long timeStamp) {
protected static synchronized long getRandomPart(long timeStamp) {
if( timeStamp == lastTimestamp ) {
// increment the randomness.
randomnessLong ++;
Expand Down