Compare commits

..
Author SHA1 Message Date
brian.long 449c352aa5 Merge branch 'develop-cxf' into stable-cxf 2025-04-08 14:59:21 -04:00
brian.long 0ed36d0faf using ApsProtectedRestCxfApi 2025-04-08 14:58:49 -04:00
brian.long 7f89bdae81 Merge branch 'stable' into stable-cxf 2025-04-08 14:57:38 -04:00
brian.long c035e9bec2 Merge branch 'stable' into stable-cxf 2024-09-23 16:31:02 -04:00
brian.long 24608d99c8 Merge branch 'develop-cxf' into stable-cxf 2024-09-23 16:29:38 -04:00
brian.long 19d879308d added protected API impl 2024-09-23 16:23:05 -04:00
brian.long 1bb80dd0e3 Merge branch 'develop' into develop-cxf 2024-09-23 16:19:57 -04:00
brian.long eacbcaae30 Merge branch 'develop-cxf' into stable-cxf 2024-08-15 12:38:18 -04:00
brian.long 5a509eeb82 v3.x; cxf v4.x 2024-08-15 12:32:20 -04:00
brian.long cf7f30328d v2.0.5-cxf 2023-06-29 11:54:22 -04:00
brian.long af43f12d72 Merge branch 'develop-cxf' into stable-cxf 2023-06-29 11:54:04 -04:00
brian.long 49a3255e4d Merge branch 'develop' into develop-cxf 2023-06-29 11:46:36 -04:00
brian.long d8a365eb37 v2.0.4-cxf 2023-05-30 11:23:49 -04:00
brian.long d8aa8253c4 Merge branch 'develop-cxf' into stable-cxf 2023-05-30 11:22:23 -04:00
brian.long 5ab46e19ac Merge branch 'develop' into develop-cxf 2023-05-30 11:22:05 -04:00
brian.long fd129b992c v2.0.3-cxf pom 2023-05-28 13:09:54 -04:00
brian.long c67a869fee v2.0.3-cxf pom 2023-05-28 13:07:58 -04:00
brian.long 06de852f2a Merge branch 'develop-cxf' into stable-cxf 2023-05-28 13:07:26 -04:00
brian.long 733310cf3e upgraded CXF version 2023-05-28 12:58:07 -04:00
brian.long 1618d9956d Merge branch 'develop' into develop-cxf 2023-05-28 12:57:48 -04:00
brian.long c48c9531bf Merge branch 'develop-cxf' into stable-cxf 2022-10-03 10:34:12 -04:00
brian.long ade7e9b5a0 added CXF back 2022-10-03 10:25:10 -04:00
11 changed files with 96 additions and 186 deletions
+56 -40
View File
@@ -5,11 +5,11 @@
<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.3-jersey</version> <version>3.0.2-cxf</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 Jersey-based REST API clients</description> <description>An APS Client library for building CXF-based REST API clients</description>
<url>https://git.inteligr8.com/inteligr8/aps-public-rest-client</url> <url>https://bitbucket.org/inteligr8/aps-public-rest-client</url>
<licenses> <licenses>
<license> <license>
@@ -19,9 +19,9 @@
</licenses> </licenses>
<scm> <scm>
<connection>scm:git:https://git.inteligr8.com/inteligr8/aps-public-rest-client.git</connection> <connection>scm:git:https://bitbucket.org/inteligr8/aps-public-rest-client.git</connection>
<developerConnection>scm:git:git@git.inteligr8.com:inteligr8/aps-public-rest-client.git</developerConnection> <developerConnection>scm:git:git@bitbucket.org:inteligr8/aps-public-rest-client.git</developerConnection>
<url>https://git.inteligr8.com/inteligr8/aps-public-rest-client</url> <url>https://bitbucket.org/inteligr8/aps-public-rest-client</url>
</scm> </scm>
<organization> <organization>
<name>Inteligr8</name> <name>Inteligr8</name>
@@ -41,27 +41,29 @@
<maven.compiler.source>11</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release> <maven.compiler.release>11</maven.compiler.release>
<maven.compiler.debuglevel>lines,vars,source</maven.compiler.debuglevel>
<spring.version>6.2.18</spring.version> <junit.version>5.10.0</junit.version>
<spring.version>6.0.19</spring.version>
<cxf.version>4.0.2</cxf.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.4-jersey</version> <version>3.0.0-cxf</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.inteligr8.alfresco</groupId> <groupId>com.inteligr8.alfresco</groupId>
<artifactId>aps-public-rest-api</artifactId> <artifactId>aps-public-rest-api</artifactId>
<version>3.1.0</version> <version>3.0.5</version>
<scope>provided</scope> <!-- explicitly, bring your own version --> <scope>provided</scope> <!-- explicitly, bring your own version -->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId> <artifactId>junit-jupiter-api</artifactId>
<version>5.14.3</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@@ -82,37 +84,29 @@
<version>2.20.0</version> <version>2.20.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Apache CXF libraries -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.5</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.6.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions> <executions>
<execution> <execution>
<id>add-jaxrs-src</id> <id>add-jaxrs-src</id>
<goals><goal>add-source</goal></goals> <goals><goal>add-source</goal></goals>
<configuration> <configuration>
<sources> <sources>
<source>src/main/jersey</source> <source>src/main/cxf</source>
</sources> </sources>
</configuration> </configuration>
</execution> </execution>
@@ -121,18 +115,40 @@
<goals><goal>add-test-source</goal></goals> <goals><goal>add-test-source</goal></goals>
<configuration> <configuration>
<sources> <sources>
<source>src/test/jersey</source> <source>src/test/cxf</source>
</sources> </sources>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>central-publish</id> <id>ossrh-release</id>
<properties> <properties>
<maven.deploy.skip>true</maven.deploy.skip> <maven.deploy.skip>true</maven.deploy.skip>
</properties> </properties>
@@ -150,6 +166,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<executions> <executions>
<execution> <execution>
<id>javadoc</id> <id>javadoc</id>
@@ -173,20 +190,19 @@
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.sonatype.central</groupId> <groupId>org.sonatype.plugins</groupId>
<artifactId>central-publishing-maven-plugin</artifactId> <artifactId>nexus-staging-maven-plugin</artifactId>
<version>0.10.0</version> <version>1.6.13</version>
<extensions>true</extensions>
<configuration> <configuration>
<publishingServerId>central</publishingServerId> <serverId>ossrh</serverId>
<autoPublish>true</autoPublish> <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration> </configuration>
<!-- for some reason this is required... -->
<executions> <executions>
<execution> <execution>
<id>deploy</id> <id>ossrh-deploy</id>
<phase>deploy</phase> <phase>deploy</phase>
<goals><goal>publish</goal></goals> <goals><goal>deploy</goal></goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
@@ -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.ClientJerseyConfiguration; import com.inteligr8.rs.ClientCxfConfiguration;
/** /**
* This class provides a POJO &amp; Spring-based implementation of the * This class provides a POJO &amp; Spring-based implementation of the
* ClientJerseyConfiguration interface. You can use it outside of the Spring * ClientCxfConfiguration 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.ClientJerseyConfiguration;
*/ */
@Configuration @Configuration
@ComponentScan @ComponentScan
public class ApsClientJerseyConfiguration extends ApsClientConfiguration implements ClientJerseyConfiguration { public class ApsClientCxfConfiguration extends ApsClientConfiguration implements ClientCxfConfiguration {
@Value("${process.service.jersey.putBodyRequired:true}") @Value("${process.service.cxf.defaultBusEnabled:true}")
private boolean putBodyRequired; private boolean defaultBusEnabled;
public boolean isPutBodyRequired() { public boolean isDefaultBusEnabled() {
return this.putBodyRequired; return this.defaultBusEnabled;
} }
public void setPutBodyRequired(boolean putBodyRequired) { public void setDefaultBusEnabled(boolean defaultBusEnabled) {
this.putBodyRequired = putBodyRequired; this.defaultBusEnabled = defaultBusEnabled;
} }
} }
@@ -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.ClientJerseyImpl; import com.inteligr8.rs.ClientCxfImpl;
/** /**
* This class provides a POJO &amp; Spring-based implementation of the Jersey * This class provides a POJO &amp; Spring-based implementation of the Apache
* client configured for APS. You can use it outside of the Spring context, * CXF client. You can use it outside of the Spring context, but you will need
* but you will need the spring-context and spring-beans libraries in your * the spring-context and spring-beans libraries in your non-Spring
* non-Spring application. * application.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.client.jersey") @Component("aps.client.cxf")
@Lazy @Lazy
public class ApsClientJerseyImpl extends ClientJerseyImpl { public class ApsClientCxfImpl extends ClientCxfImpl {
/** /**
* This constructor is for Spring and POJO use * This constructor is for Spring or POJO use
*/ */
@Autowired @Autowired
public ApsClientJerseyImpl(ApsClientJerseyConfiguration config) { public ApsClientCxfImpl(ApsClientCxfConfiguration config) {
super(config); super(config);
} }
@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* This class provides the Jersey client to the JAX-RS API for the Activiti & * This class provides the Apache CXF client to the JAX-RS API for the Activiti
* APS public ReST API and some non-public APS ReST API. * & APS public ReST APIs and some non-public APS ReST APIs.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.protected-api.jersey") @Component("aps.protected-api.cxf")
@Lazy @Lazy
public class ApsProtectedRestApiJerseyImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestJerseyApi { public class ApsProtectedRestApiCxfImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestCxfApi {
/** /**
* This constructor is for Spring or POJO use * This constructor is for Spring or POJO use
*/ */
@Autowired @Autowired
public ApsProtectedRestApiJerseyImpl(ApsClientJerseyImpl client) { public ApsProtectedRestApiCxfImpl(ApsClientCxfImpl client) {
super(client); super(client);
} }
@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* This class provides the Jersey client to the JAX-RS API for the APS Public * This class provides the Apache CXF client to the JAX-RS API for the APS
* ReST API. * Public ReST API.
* *
* @author brian@inteligr8.com * @author brian@inteligr8.com
*/ */
@Component("aps.api.jersey") @Component("aps.api.cxf")
@Lazy @Lazy
public class ApsPublicRestApiJerseyImpl extends ApsPublicRestApiImpl implements ApsPublicRestJerseyApi { public class ApsPublicRestApiCxfImpl extends ApsPublicRestApiImpl implements ApsPublicRestCxfApi {
/** /**
* This constructor is for Spring or POJO use * This constructor is for Spring or POJO use
*/ */
@Autowired @Autowired
public ApsPublicRestApiJerseyImpl(ApsClientJerseyImpl client) { public ApsPublicRestApiCxfImpl(ApsClientCxfImpl client) {
super(client); super(client);
} }
@@ -0,0 +1 @@
org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl
@@ -18,21 +18,22 @@ import org.junit.jupiter.api.BeforeAll;
import com.inteligr8.rs.ClientConfiguration; import com.inteligr8.rs.ClientConfiguration;
public class ConnectionJerseyClientPojoIT extends ConnectionClientIT { public class ConnectionCxfClientPojoIT extends ConnectionClientIT {
private static ApsPublicRestApiImpl api; private static ApsPublicRestApiImpl api;
@BeforeAll @BeforeAll
public static void initClient() { public static void initClient() {
ApsClientJerseyConfiguration config = new ApsClientJerseyConfiguration(); ApsClientCxfConfiguration config = new ApsClientCxfConfiguration();
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 ApsPublicRestApiJerseyImpl( api = new ApsPublicRestApiCxfImpl(
new ApsClientJerseyImpl(config)); new ApsClientCxfImpl(config));
} }
@Override
public ApsPublicRestApiImpl getApi() { public ApsPublicRestApiImpl getApi() {
return api; return api;
} }
@@ -21,14 +21,15 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import com.inteligr8.rs.ClientConfiguration; import com.inteligr8.rs.ClientConfiguration;
@TestPropertySource(locations = {"/local.properties"}) @TestPropertySource(locations = {"/local-oauth.properties"})
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class}) @SpringJUnitConfig(classes = {ApsClientCxfConfiguration.class, ApsPublicRestApiCxfImpl.class, ApsClientCxfImpl.class})
public class ConnectionJerseyClientSpringIT extends ConnectionClientIT { public class ConnectionCxfClientSpringIT extends ConnectionClientIT {
@Autowired @Autowired
@Qualifier("aps.api.jersey") @Qualifier("aps.api.cxf")
private ApsPublicRestApiImpl api; private ApsPublicRestApiImpl api;
@Override
public ApsPublicRestApiImpl getApi() { public ApsPublicRestApiImpl getApi() {
return this.api; return this.api;
} }
@@ -1 +0,0 @@
org.glassfish.jersey.client.JerseyClientBuilder
@@ -1,51 +0,0 @@
/*
* 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);
}
}
@@ -1,57 +0,0 @@
/*
* 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);
}
}
}