25 Commits

Author SHA1 Message Date
76447b9d41 Merge branch 'develop-jersey' into stable-jersey 2025-04-08 14:55:08 -04:00
fc0bb2e73f Merge branch 'stable' into stable-jersey 2025-04-08 14:55:02 -04:00
93875d74ac using ApsProtectedRestJerseyApi 2025-04-08 14:51:28 -04:00
4cd82b9afb Merge branch 'stable' into stable-jersey 2024-09-23 16:33:36 -04:00
a96e5f2a02 Merge branch 'develop-jersey' into stable-jersey 2024-09-23 16:33:17 -04:00
889c94af0e added protected API impl 2024-09-23 16:24:44 -04:00
24c9484712 Merge branch 'develop' into develop-jersey 2024-09-23 16:23:18 -04:00
a5d09e2fa8 Merge branch 'develop-jersey' into stable-jersey 2024-08-15 12:40:13 -04:00
b1c32b5adf v3.x; jersey v3.x 2024-08-15 12:33:49 -04:00
ef2784696c v2.0.5-jersey pom 2023-06-29 11:52:12 -04:00
8f08c1d979 Merge branch 'develop-jersey' into stable-jersey 2023-06-29 11:51:57 -04:00
27c43862d7 Merge branch 'develop' into develop-jersey 2023-06-29 11:47:11 -04:00
fd8c74037d addressing library version conflict 2023-05-30 18:43:42 -04:00
cd237cc929 v2.0.4-jersey pom 2023-05-30 11:19:40 -04:00
afbbb0f997 Merge branch 'develop-jersey' into stable-jersey 2023-05-30 11:18:44 -04:00
a59757ce02 Merge branch 'develop' into develop-jersey 2023-05-30 11:07:00 -04:00
8543001da2 upgraded common-rest-client; requiring jersey media; optional jersey hk2 2023-05-30 11:03:32 -04:00
f2f12e1b1f Merge branch 'develop-jersey' into stable-jersey 2023-05-28 13:21:38 -04:00
b8381ed006 fixed jersey test compile 2023-05-28 13:21:26 -04:00
be02e86d7d v2.0.3-jersey pom 2023-05-28 13:17:21 -04:00
537d9c773d Merge branch 'develop-jersey' into stable-jersey 2023-05-28 13:16:27 -04:00
712058d328 upgraded jersey version 2023-05-28 12:56:05 -04:00
e9dacca5f7 Merge branch 'develop' into develop-jersey 2023-05-28 12:55:30 -04:00
4e9d9f1d49 Merge branch 'develop-jersey' into stable-jersey 2022-10-03 10:38:09 -04:00
a4df532d70 added Jersey back 2022-10-03 10:32:26 -04:00
11 changed files with 170 additions and 51 deletions

35
pom.xml
View File

@@ -5,10 +5,10 @@
<groupId>com.inteligr8.alfresco</groupId> <groupId>com.inteligr8.alfresco</groupId>
<artifactId>aps-public-rest-client</artifactId> <artifactId>aps-public-rest-client</artifactId>
<version>3.0.2-cxf</version> <version>3.0.2-jersey</version>
<name>Alfresco Process Services ReST API Client for Java</name> <name>Alfresco Process Services ReST API Client for Java</name>
<description>An APS Client library for building CXF-based REST API clients</description> <description>An APS Client library for building Jersey-based REST API clients</description>
<url>https://bitbucket.org/inteligr8/aps-public-rest-client</url> <url>https://bitbucket.org/inteligr8/aps-public-rest-client</url>
<licenses> <licenses>
@@ -45,14 +45,15 @@
<junit.version>5.10.0</junit.version> <junit.version>5.10.0</junit.version>
<spring.version>6.0.19</spring.version> <spring.version>6.0.19</spring.version>
<cxf.version>4.0.2</cxf.version> <jersey.version>3.1.8</jersey.version>
<jackson.version>2.17.2</jackson.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.inteligr8</groupId> <groupId>com.inteligr8</groupId>
<artifactId>common-rest-client</artifactId> <artifactId>common-rest-client</artifactId>
<version>3.0.0-cxf</version> <version>3.0.0-jersey</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.inteligr8.alfresco</groupId> <groupId>com.inteligr8.alfresco</groupId>
@@ -85,12 +86,24 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Apache CXF libraries --> <!-- Jersey libraries -->
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.glassfish.jersey.inject</groupId>
<artifactId>cxf-rt-rs-client</artifactId> <artifactId>jersey-hk2</artifactId>
<version>${cxf.version}</version> <version>${jersey.version}</version>
<scope>provided</scope> <optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- Jersey inclusion fallout -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@@ -106,7 +119,7 @@
<goals><goal>add-source</goal></goals> <goals><goal>add-source</goal></goals>
<configuration> <configuration>
<sources> <sources>
<source>src/main/cxf</source> <source>src/main/jersey</source>
</sources> </sources>
</configuration> </configuration>
</execution> </execution>
@@ -115,7 +128,7 @@
<goals><goal>add-test-source</goal></goals> <goals><goal>add-test-source</goal></goals>
<configuration> <configuration>
<sources> <sources>
<source>src/test/cxf</source> <source>src/test/jersey</source>
</sources> </sources>
</configuration> </configuration>
</execution> </execution>

View File

@@ -18,11 +18,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.inteligr8.rs.ClientCxfConfiguration; import com.inteligr8.rs.ClientJerseyConfiguration;
/** /**
* This class provides a POJO &amp; Spring-based implementation of the * This class provides a POJO &amp; Spring-based implementation of the
* ClientCxfConfiguration interface. You can use it outside of the Spring * ClientJerseyConfiguration interface. You can use it outside of the Spring
* context, but you will need the spring-context and spring-beans libraries in * context, but you will need the spring-context and spring-beans libraries in
* your non-Spring application. * your non-Spring application.
* *
@@ -30,17 +30,17 @@ import com.inteligr8.rs.ClientCxfConfiguration;
*/ */
@Configuration @Configuration
@ComponentScan @ComponentScan
public class ApsClientCxfConfiguration extends ApsClientConfiguration implements ClientCxfConfiguration { public class ApsClientJerseyConfiguration extends ApsClientConfiguration implements ClientJerseyConfiguration {
@Value("${process.service.cxf.defaultBusEnabled:true}")
private boolean defaultBusEnabled;
public boolean isDefaultBusEnabled() { @Value("${process.service.jersey.putBodyRequired:true}")
return this.defaultBusEnabled; private boolean putBodyRequired;
public boolean isPutBodyRequired() {
return this.putBodyRequired;
} }
public void setDefaultBusEnabled(boolean defaultBusEnabled) { public void setPutBodyRequired(boolean putBodyRequired) {
this.defaultBusEnabled = defaultBusEnabled; this.putBodyRequired = putBodyRequired;
} }
} }

View File

@@ -18,25 +18,25 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.inteligr8.rs.ClientCxfImpl; import com.inteligr8.rs.ClientJerseyImpl;
/** /**
* This class provides a POJO &amp; Spring-based implementation of the Apache * This class provides a POJO &amp; Spring-based implementation of the Jersey
* CXF client. You can use it outside of the Spring context, but you will need * client configured for APS. You can use it outside of the Spring context,
* the spring-context and spring-beans libraries in your non-Spring * but you will need the spring-context and spring-beans libraries in your
* application. * non-Spring application.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.client.cxf") @Component("aps.client.jersey")
@Lazy @Lazy
public class ApsClientCxfImpl extends ClientCxfImpl { public class ApsClientJerseyImpl extends ClientJerseyImpl {
/** /**
* This constructor is for Spring or POJO use * This constructor is for Spring and POJO use
*/ */
@Autowired @Autowired
public ApsClientCxfImpl(ApsClientCxfConfiguration config) { public ApsClientJerseyImpl(ApsClientJerseyConfiguration config) {
super(config); super(config);
} }

View File

@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* This class provides the Apache CXF client to the JAX-RS API for the Activiti * This class provides the Jersey client to the JAX-RS API for the Activiti &
* & APS public ReST APIs and some non-public APS ReST APIs. * APS public ReST API and some non-public APS ReST API.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.protected-api.cxf") @Component("aps.protected-api.jersey")
@Lazy @Lazy
public class ApsProtectedRestApiCxfImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestCxfApi { public class ApsProtectedRestApiJerseyImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestJerseyApi {
/** /**
* This constructor is for Spring or POJO use * This constructor is for Spring or POJO use
*/ */
@Autowired @Autowired
public ApsProtectedRestApiCxfImpl(ApsClientCxfImpl client) { public ApsProtectedRestApiJerseyImpl(ApsClientJerseyImpl client) {
super(client); super(client);
} }

View File

@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* This class provides the Apache CXF client to the JAX-RS API for the APS * This class provides the Jersey client to the JAX-RS API for the APS Public
* Public ReST API. * ReST API.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.api.cxf") @Component("aps.api.jersey")
@Lazy @Lazy
public class ApsPublicRestApiCxfImpl extends ApsPublicRestApiImpl implements ApsPublicRestCxfApi { public class ApsPublicRestApiJerseyImpl extends ApsPublicRestApiImpl implements ApsPublicRestJerseyApi {
/** /**
* This constructor is for Spring or POJO use * This constructor is for Spring or POJO use
*/ */
@Autowired @Autowired
public ApsPublicRestApiCxfImpl(ApsClientCxfImpl client) { public ApsPublicRestApiJerseyImpl(ApsClientJerseyImpl client) {
super(client); super(client);
} }

View File

@@ -1 +0,0 @@
org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl

View File

@@ -0,0 +1 @@
org.glassfish.jersey.client.JerseyClientBuilder

View File

@@ -0,0 +1,51 @@
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.inteligr8.alfresco.activiti;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import com.inteligr8.alfresco.activiti.model.Tenant;
import com.inteligr8.rs.ClientConfiguration;
@TestPropertySource(locations = {"/local.properties"})
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
public class ArrayResponseUnitTest extends ConditionalIT {
@Autowired
@Qualifier("aps.api.jersey")
private ApsPublicRestApiImpl api;
@Override
public ClientConfiguration getConfiguration() {
return this.api.getClient().getConfig();
}
@Test
@EnabledIf("hostExists")
public void testTenants() {
List<Tenant> objs = this.api.getAdminApi().getTenants();
Assertions.assertNotNull(objs);
}
}

View File

@@ -18,22 +18,21 @@ import org.junit.jupiter.api.BeforeAll;
import com.inteligr8.rs.ClientConfiguration; import com.inteligr8.rs.ClientConfiguration;
public class ConnectionCxfClientPojoIT extends ConnectionClientIT { public class ConnectionJerseyClientPojoIT extends ConnectionClientIT {
private static ApsPublicRestApiImpl api; private static ApsPublicRestApiImpl api;
@BeforeAll @BeforeAll
public static void initClient() { public static void initClient() {
ApsClientCxfConfiguration config = new ApsClientCxfConfiguration(); ApsClientJerseyConfiguration config = new ApsClientJerseyConfiguration();
config.setBaseUrl("http://localhost:8080/activiti-app"); config.setBaseUrl("http://localhost:8080/activiti-app");
config.setBasicAuthUsername("admin"); config.setBasicAuthUsername("admin");
config.setBasicAuthPassword("admin"); config.setBasicAuthPassword("admin");
api = new ApsPublicRestApiCxfImpl( api = new ApsPublicRestApiJerseyImpl(
new ApsClientCxfImpl(config)); new ApsClientJerseyImpl(config));
} }
@Override
public ApsPublicRestApiImpl getApi() { public ApsPublicRestApiImpl getApi() {
return api; return api;
} }

View File

@@ -21,15 +21,14 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import com.inteligr8.rs.ClientConfiguration; import com.inteligr8.rs.ClientConfiguration;
@TestPropertySource(locations = {"/local-oauth.properties"}) @TestPropertySource(locations = {"/local.properties"})
@SpringJUnitConfig(classes = {ApsClientCxfConfiguration.class, ApsPublicRestApiCxfImpl.class, ApsClientCxfImpl.class}) @SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
public class ConnectionCxfClientSpringIT extends ConnectionClientIT { public class ConnectionJerseyClientSpringIT extends ConnectionClientIT {
@Autowired @Autowired
@Qualifier("aps.api.cxf") @Qualifier("aps.api.jersey")
private ApsPublicRestApiImpl api; private ApsPublicRestApiImpl api;
@Override
public ApsPublicRestApiImpl getApi() { public ApsPublicRestApiImpl getApi() {
return this.api; return this.api;
} }

View File

@@ -0,0 +1,57 @@
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.inteligr8.alfresco.activiti;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import com.inteligr8.alfresco.activiti.model.GroupLight;
import com.inteligr8.activiti.model.ResultList;
import com.inteligr8.alfresco.activiti.model.UserLight;
import com.inteligr8.rs.ClientConfiguration;
@TestPropertySource(locations = {"/local.properties"})
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
public class ResultListResponseUnitTest extends ConditionalIT {
@Autowired
@Qualifier("aps.api.jersey")
private ApsPublicRestApiImpl api;
@Override
public ClientConfiguration getConfiguration() {
return this.api.getClient().getConfig();
}
@Test
@EnabledIf("hostExists")
public void testGroupMembers() {
List<GroupLight> groups = this.api.getAdminApi().getGroups(1L, false, false);
Assertions.assertFalse(groups.isEmpty());
for (GroupLight group : groups) {
ResultList<UserLight> users = this.api.getAdminApi().getMembers(group.getId(), null, null, null);
Assertions.assertNotNull(users);
}
}
}