Skip to content

Commit 5aa4b0a

Browse files
glenheinJason Smith
authored and
Jason Smith
committed
CAL-137 Add email support to NSILI OrderMgr interface (codice#156)
1 parent 0cc303e commit 5aa4b0a

File tree

33 files changed

+1533
-380
lines changed

33 files changed

+1533
-380
lines changed

catalog/core/catalog-core-api-impl/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
<artifactId>catalog-core-api-impl</artifactId>
4343
<version>${ddf.version}</version>
4444
</dependency>
45+
<dependency>
46+
<groupId>org.apache.commons</groupId>
47+
<artifactId>commons-lang3</artifactId>
48+
</dependency>
4549
</dependencies>
4650

4751
<build>
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright (c) Codice Foundation
5+
*
6+
* This 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
7+
* version 3 of the License, or any later version.
8+
*
9+
* 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.
10+
* See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
11+
* <http://www.gnu.org/licenses/lgpl.html>.
12+
*
13+
**/
14+
-->
15+
<project xmlns="http://maven.apache.org/POM/4.0.0"
16+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<parent>
20+
<groupId>org.codice.alliance.catalog</groupId>
21+
<artifactId>core</artifactId>
22+
<version>0.2-SNAPSHOT</version>
23+
</parent>
24+
<groupId>org.codice.alliance.catalog.core</groupId>
25+
<artifactId>catalog-email-api</artifactId>
26+
<packaging>bundle</packaging>
27+
<name>Alliance :: Catalog :: Email :: API</name>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.apache.commons</groupId>
32+
<artifactId>commons-lang3</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>javax.mail</groupId>
36+
<artifactId>mail</artifactId>
37+
</dependency>
38+
</dependencies>
39+
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.apache.felix</groupId>
44+
<artifactId>maven-bundle-plugin</artifactId>
45+
<configuration>
46+
<instructions>
47+
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
48+
<Export-Package>
49+
org.codice.alliance.core.email
50+
</Export-Package>
51+
<Embed-Dependency/>
52+
</instructions>
53+
</configuration>
54+
</plugin>
55+
<plugin>
56+
<groupId>org.jacoco</groupId>
57+
<artifactId>jacoco-maven-plugin</artifactId>
58+
<executions>
59+
<execution>
60+
<id>default-check</id>
61+
<goals>
62+
<goal>check</goal>
63+
</goals>
64+
<configuration>
65+
<haltOnFailure>true</haltOnFailure>
66+
<rules>
67+
<rule>
68+
<element>BUNDLE</element>
69+
<limits>
70+
<limit>
71+
<counter>INSTRUCTION</counter>
72+
<value>COVEREDRATIO</value>
73+
<minimum>0</minimum>
74+
</limit>
75+
<limit>
76+
<counter>BRANCH</counter>
77+
<value>COVEREDRATIO</value>
78+
<minimum>0</minimum>
79+
</limit>
80+
<limit>
81+
<counter>COMPLEXITY</counter>
82+
<value>COVEREDRATIO</value>
83+
<minimum>0</minimum>
84+
</limit>
85+
<limit>
86+
<counter>LINE</counter>
87+
<value>COVEREDRATIO</value>
88+
<minimum>0</minimum>
89+
</limit>
90+
</limits>
91+
</rule>
92+
</rules>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
</plugins>
98+
</build>
99+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* Copyright (c) Codice Foundation
3+
* <p/>
4+
* This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
5+
* General Public License as published by the Free Software Foundation, either version 3 of the
6+
* License, or any later version.
7+
* <p/>
8+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9+
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details. A copy of the GNU Lesser General Public License
11+
* is distributed along with this program and can be found at
12+
* <http://www.gnu.org/licenses/lgpl.html>.
13+
*/
14+
15+
package org.codice.alliance.core.email;
16+
17+
import java.io.IOException;
18+
import java.io.InputStream;
19+
import java.util.List;
20+
21+
import org.apache.commons.lang3.tuple.Pair;
22+
23+
/**
24+
* Interface for sending email with optional attachments.
25+
*
26+
* <b> This code is experimental. While this interface is functional and tested, it may change or be
27+
* removed in a future version of the library. </b>
28+
*/
29+
public interface EmailSender {
30+
31+
/**
32+
* @param fromEmail non-null from email address
33+
* @param toEmail non-null to email address
34+
* @param subject non-null subject line of email to be sent
35+
* @param body non-null body of email to be sent
36+
* @param attachments non-null list of filename/input stream pairs, the caller is responsible for closing the input streams
37+
* @throws IOException exception thrown if failed to send email
38+
*/
39+
void sendEmail(String fromEmail, String toEmail, String subject, String body,
40+
List<Pair<String, InputStream>> attachments) throws IOException;
41+
42+
/**
43+
* @param fromEmail non-null from email address
44+
* @param toEmail non-null to email address
45+
* @param subject non-null subject line of email to be sent
46+
* @param body non-null body of email to be sent
47+
* @throws IOException exception thrown if failed to send email
48+
*/
49+
void sendEmail(String fromEmail, String toEmail, String subject, String body)
50+
throws IOException;
51+
52+
}
+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!--
3+
/**
4+
* Copyright (c) Codice Foundation
5+
*
6+
* This 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
7+
* version 3 of the License, or any later version.
8+
*
9+
* 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.
10+
* See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
11+
* <http://www.gnu.org/licenses/lgpl.html>.
12+
*
13+
**/
14+
-->
15+
<project xmlns="http://maven.apache.org/POM/4.0.0"
16+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<parent>
19+
<groupId>org.codice.alliance.catalog</groupId>
20+
<artifactId>core</artifactId>
21+
<version>0.2-SNAPSHOT</version>
22+
</parent>
23+
<modelVersion>4.0.0</modelVersion>
24+
<name>Alliance :: Catalog :: Email :: Impl</name>
25+
<groupId>org.codice.alliance.catalog.core</groupId>
26+
<artifactId>catalog-email-impl</artifactId>
27+
<packaging>bundle</packaging>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.codice.alliance.catalog.core</groupId>
32+
<artifactId>catalog-email-api</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.apache.commons</groupId>
37+
<artifactId>commons-lang3</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>javax.mail</groupId>
41+
<artifactId>mail</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.slf4j</groupId>
45+
<artifactId>slf4j-api</artifactId>
46+
</dependency>
47+
<dependency>
48+
<groupId>commons-io</groupId>
49+
<artifactId>commons-io</artifactId>
50+
<version>${commons-io.version}</version>
51+
<scope>test</scope>
52+
</dependency>
53+
</dependencies>
54+
<build>
55+
<resources>
56+
<resource>
57+
<directory>src/main/resources</directory>
58+
<filtering>true</filtering>
59+
</resource>
60+
</resources>
61+
<plugins>
62+
<plugin>
63+
<groupId>org.apache.felix</groupId>
64+
<artifactId>maven-bundle-plugin</artifactId>
65+
<extensions>true</extensions>
66+
<configuration>
67+
<instructions>
68+
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
69+
</instructions>
70+
</configuration>
71+
</plugin>
72+
<plugin>
73+
<groupId>org.jacoco</groupId>
74+
<artifactId>jacoco-maven-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<id>default-check</id>
78+
<goals>
79+
<goal>check</goal>
80+
</goals>
81+
<configuration>
82+
<haltOnFailure>true</haltOnFailure>
83+
<excludes>
84+
<exclude>
85+
/src/test/
86+
</exclude>
87+
</excludes>
88+
<rules>
89+
<rule>
90+
<element>BUNDLE</element>
91+
<limits>
92+
<limit>
93+
<counter>INSTRUCTION</counter>
94+
<value>COVEREDRATIO</value>
95+
<minimum>0.77</minimum>
96+
</limit>
97+
<limit>
98+
<counter>BRANCH</counter>
99+
<value>COVEREDRATIO</value>
100+
<minimum>0.50</minimum>
101+
</limit>
102+
<limit>
103+
<counter>COMPLEXITY</counter>
104+
<value>COVEREDRATIO</value>
105+
<minimum>0.40</minimum>
106+
</limit>
107+
<limit>
108+
<counter>LINE</counter>
109+
<value>COVEREDRATIO</value>
110+
<minimum>0.77</minimum>
111+
</limit>
112+
</limits>
113+
</rule>
114+
</rules>
115+
</configuration>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
</project>

0 commit comments

Comments
 (0)