Skip to content

Commit e9e4405

Browse files
authored
Merge pull request #42 from nsip/master
v0.14.0 merged to master from AU repository.
2 parents 4360ad8 + 3c3c74a commit e9e4405

File tree

47 files changed

+1848
-117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1848
-117
lines changed

SIF3InfraREST/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Project (note that the version number will change over time):
2525
<dependency>
2626
<groupId>sif3.framework</groupId>
2727
<artifactId>sif3-infra-rest</artifactId>
28-
<version>0.13.0</version>
28+
<version>0.14.0</version>
2929
</dependency>
3030
```
3131

@@ -174,6 +174,16 @@ new framework version.**
174174

175175
**Please refer to the detailed release notes in "release/v0.13.0" carefully to ensure that your project is upgraded properly to the new framework version.**
176176

177+
## Version from Jan 22, 2019: v0.14.0 - Various changes
178+
___
179+
**AS OF THIS VERSION ALL FRAMEWORK LIBRARIES ARE COMPILED WITH JAVA 8. THE FRAMEWORK MAY NO LONGER SUPPORT OR RUN ON JAVA VERSIONS OLDER THAN JAVA 8.**
180+
___
181+
- Updated some test cases to use SIF AU 3.4.4 data model (draft)
182+
- Added Named Query functionality (Consumer & Provider). For details on how to use Named Queries, please refer to section 5.12
183+
in the Developer's Guide.
184+
185+
**Please refer to the detailed release notes in "release/v0.14.0" carefully to ensure that your project is upgraded properly to the new framework version.**
186+
177187
# Download Instructions
178188
How to download this project:
179189

SIF3InfraREST/SIF3Demo/sif3-demo-web/pom.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

56
<!-- =========== -->
@@ -8,7 +9,7 @@
89
<groupId>sif3.framework</groupId>
910
<artifactId>sif3-demo-web</artifactId>
1011
<packaging>war</packaging>
11-
<version>0.13.0-Demo</version>
12+
<version>0.14.0-Demo</version>
1213
<name>SIF3 Demo Provider</name>
1314

1415
<!-- =============================== -->
@@ -18,8 +19,8 @@
1819
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1920

2021
<!-- Set the Java Version compliance -->
21-
<maven.compiler.source>1.7</maven.compiler.source>
22-
<maven.compiler.target>1.7</maven.compiler.target>
22+
<maven.compiler.source>1.8</maven.compiler.source>
23+
<maven.compiler.target>1.8</maven.compiler.target>
2324

2425
<!-- Hardcoded Variable for the non-maven library location -->
2526
<!--project.lib.dir>C:/Development/GitHubRepositories/SIF3InfraRest/SIF3InfraREST/lib</project.lib.dir-->
@@ -41,7 +42,7 @@
4142
<dependency>
4243
<groupId>sif3.framework</groupId>
4344
<artifactId>sif3-infra-rest</artifactId>
44-
<version>0.13.0-beta</version>
45+
<version>0.14.0-beta</version>
4546
</dependency>
4647

4748
<!-- ====================== -->
@@ -51,7 +52,7 @@
5152
<dependency>
5253
<groupId>sifau</groupId>
5354
<artifactId>sif3-au-datamodel</artifactId>
54-
<version>3.4.3</version>
55+
<version>3.4.4</version>
5556
</dependency>
5657

5758
<!-- =============================== -->
@@ -167,7 +168,7 @@
167168
<plugin>
168169
<groupId>org.apache.maven.plugins</groupId>
169170
<artifactId>maven-war-plugin</artifactId>
170-
<!--version>3.0.0</version-->
171+
<!--version>3.2.2</version-->
171172
<configuration>
172173
<attachClasses>true</attachClasses>
173174
<archiveClasses>true</archiveClasses>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package systemic.sif3.demo.rest.consumer.namedquery;
2+
3+
import sif3.common.model.PagingInfo;
4+
import sif3.common.model.StringPayload;
5+
import sif3.common.model.delayed.DelayedResponseReceipt;
6+
import sif3.common.ws.ErrorDetails;
7+
import sif3.infra.rest.consumer.AbstractNamedQueryConsumer;
8+
9+
public class StudentsInYearConsumer extends AbstractNamedQueryConsumer
10+
{
11+
public StudentsInYearConsumer()
12+
{
13+
super();
14+
}
15+
16+
@Override
17+
public String getNamedQueryName()
18+
{
19+
return "StudentsInYear"; // Name of named query as it appears in the environment XML.
20+
}
21+
22+
@Override
23+
public void processDelayedNamedQuery(StringPayload responseData, PagingInfo pagingInfo, DelayedResponseReceipt receipt)
24+
{
25+
logger.debug("Received DELAYED NAMED QUERY Response:\nPagingInfo:\n"+pagingInfo+"\nDelayed Receipt Details:\n"+receipt+"\nResponse Data:\n"+responseData);
26+
}
27+
28+
@Override
29+
public void processDelayedError(ErrorDetails error, DelayedResponseReceipt receipt)
30+
{
31+
logger.debug("Received DELAYED ERROR Response:\n"+error+"\nDelayed Receipt Details:\n"+receipt);
32+
}
33+
34+
@Override
35+
public void shutdown()
36+
{
37+
logger.info("Shutting down Named Query Service Consumer '"+getNamedQueryName()+"'");
38+
}
39+
40+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* StudentsInYear.java
3+
* Created: 4 Dec 2018
4+
*
5+
* Copyright 2018 Systemic Pty Ltd
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8+
* in compliance with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software distributed under the License
13+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14+
* or implied. See the License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
package systemic.sif3.demo.rest.provider.namedquery;
19+
20+
import javax.ws.rs.core.MediaType;
21+
22+
import sif3.common.exception.DataTooLargeException;
23+
import sif3.common.exception.PersistenceException;
24+
import sif3.common.exception.SIFException;
25+
import sif3.common.exception.UnsupportedMediaTypeExcpetion;
26+
import sif3.common.model.PagingInfo;
27+
import sif3.common.model.QueryTemplateInfo;
28+
import sif3.common.model.RequestMetadata;
29+
import sif3.common.model.ResponseParameters;
30+
import sif3.common.model.SIFContext;
31+
import sif3.common.model.SIFZone;
32+
import sif3.common.model.StringPayload;
33+
import sif3.infra.rest.provider.namedquery.BaseNamedQueryProvider;
34+
35+
/**
36+
* @author Joerg Huber
37+
*
38+
*/
39+
public class StudentsInYearProvider extends BaseNamedQueryProvider
40+
{
41+
42+
/*
43+
* @see sif3.common.interfaces.NamedQueryProvider#retrieveData(sif3.common.model.QueryTemplateInfo, sif3.common.model.SIFZone, sif3.common.model.SIFContext, sif3.common.model.PagingInfo, sif3.common.model.RequestMetadata, sif3.common.model.ResponseParameters, javax.ws.rs.core.MediaType)
44+
*/
45+
@Override
46+
public StringPayload retrieveData(QueryTemplateInfo queryTemplateInfo,
47+
SIFZone zone,
48+
SIFContext context,
49+
PagingInfo pagingInfo,
50+
RequestMetadata metadata,
51+
ResponseParameters customResponseParams,
52+
MediaType returnMimeType)
53+
throws PersistenceException, UnsupportedMediaTypeExcpetion, DataTooLargeException, SIFException
54+
{
55+
logger.debug("StudentsInYearProvider.retrieveData request received with QueryTemplateInfo:\n"+queryTemplateInfo);
56+
if(returnMimeType.isCompatible(MediaType.APPLICATION_JSON_TYPE))
57+
{
58+
throw new UnsupportedMediaTypeExcpetion("JSON not supported for "+getServiceName()+" named query.");
59+
}
60+
StringPayload response = new StringPayload();
61+
response.setMimeType(returnMimeType);
62+
63+
response.setData(
64+
"<Students xmlns=\"http://www.au/StudentInYear/3.4.2\">\n"+
65+
" <school>4001</school>\n"+
66+
" <Student>\n"+
67+
" <LogonId>dan.petersen</LogonId>\n"+
68+
" </Student>\n"+
69+
" <Student>\n"+
70+
" <LogonId>leila.stone</LogonId>\n"+
71+
" </Student>\n"+
72+
"</Students>");
73+
74+
return response;
75+
}
76+
77+
/* Name of the service as it appears in the environment or the end-point.
78+
*
79+
* (non-Javadoc)
80+
* @see sif3.infra.rest.provider.CoreProvider#getServiceName()
81+
*/
82+
@Override
83+
public String getServiceName()
84+
{
85+
return "StudentsInYear";
86+
}
87+
88+
/* (non-Javadoc)
89+
* @see sif3.infra.rest.provider.CoreProvider#shutdown()
90+
*/
91+
@Override
92+
public void shutdown()
93+
{
94+
logger.debug("Shutdown Named Query Service for " + getPrettyName());
95+
}
96+
}

SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestRolloverStudentConsumer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ private org.w3c.dom.Element createInitPayload()
168168

169169
org.w3c.dom.Element child = domDocument.createElement("property");
170170
child.setAttribute("name", "contextId");
171-
child.setTextContent("future");
171+
// child.setTextContent("future");
172+
child.appendChild(domDocument.createTextNode("future"));
172173
rootElement.appendChild(child);
173174

174175
child = domDocument.createElement("property");
175176
child.setAttribute("name", "initiator");
176-
child.setTextContent("user1");
177+
// child.setTextContent("user1");
178+
child.appendChild(domDocument.createTextNode("user1"));
177179
rootElement.appendChild(child);
178180

179181
return rootElement;
@@ -508,7 +510,7 @@ public static void main(String[] args)
508510
//
509511
// Job Operations
510512
//
511-
// tester.createJob(consumer);
513+
tester.createJob(consumer);
512514
// tester.createJobs(consumer);
513515

514516

@@ -522,7 +524,7 @@ public static void main(String[] args)
522524
//
523525
// Phase State Operations
524526
//
525-
tester.updateJobPhaseState(consumer, "oldYearEnrolment", PhaseState.PENDING);
527+
// tester.updateJobPhaseState(consumer, "oldYearEnrolment", PhaseState.PENDING);
526528
// tester.getJobPhaseStates(consumer, "newYearEnrolment");
527529

528530
//

0 commit comments

Comments
 (0)