The following document contains the results of Rat (Release Audit Tool).
*****************************************************
Summary
-------
Generated at: 2017-03-11T23:59:25-05:00
Notes: 0
Binaries: 0
Archives: 0
Standards: 11
Apache Licensed: 0
Generated Documents: 0
JavaDocs are generated, thus a license header is optional.
Generated files do not require license headers.
11 Unknown Licenses
*****************************************************
Files with unapproved licenses:
C:/projects/fgsms/fgsms-server/fgsms-report-generator/nbproject/project.properties
C:/projects/fgsms/fgsms-server/fgsms-report-generator/pom.xml
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/CalendarCalculator.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/FgsmsReportGenerator.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/ReportDefinitionExtension.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorController.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorControllerMBean.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorSingleton.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSRunner.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSWorker.java
C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/test/java/org/miloss/fgsms/services/rs/impl/CalendarCalculatorTest.java
*****************************************************
*****************************************************
Files with Apache License headers will be marked AL
Binary files (which do not require any license headers) will be marked B
Compressed archives will be marked A
Notices, licenses etc. will be marked N
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/nbproject/project.properties
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/pom.xml
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/CalendarCalculator.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/FgsmsReportGenerator.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/ReportDefinitionExtension.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorController.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorControllerMBean.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorSingleton.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSRunner.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSWorker.java
!????? C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/test/java/org/miloss/fgsms/services/rs/impl/CalendarCalculatorTest.java
*****************************************************
Printing headers for text files without a valid license header...
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/nbproject/project.properties
=====================================================
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/pom.xml
=====================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
U.S. Government, Department of the Army
Army Materiel Command
Research Development Engineering Command
Communications Electronics Research Development and Engineering Center
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mil-oss</groupId>
<artifactId>fgsms-server</artifactId>
<version>7.0.0</version>
</parent>
<artifactId>fgsms-report-generator</artifactId>
<packaging>bundle</packaging>
<name>fgsms Asynchronous Report Generator</name>
<description>Processes scheduled reports based on user selection and schedule</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mil-oss</groupId>
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/CalendarCalculator.java
=====================================================
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.miloss.fgsms.services.rs.impl;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.apache.log4j.Level;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.DailySchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.Daynames;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ImmediateSchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.MonthlySchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.Monthnames;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.OneTimeSchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ReportDefinition;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.WeeklySchedule;
import static org.miloss.fgsms.services.rs.impl.FgsmsReportGenerator.log;
/**
*
* @author AO
*/
public class CalendarCalculator {
public static boolean isTimeToRun(ReportDefinition get, Calendar now) {
if (get == null) {
throw new IllegalArgumentException();
}
Calendar cal = now;
if (cal == null) {
cal = Calendar.getInstance();
}
//TODO compare rules to the last time it was ran, if a report exists already for that defined timestamp, then we skip execution
//basically if the time different from the last report is greater than say 1 minute
for (int i = 0; i < get.getSchedule().getTriggers().size(); i++) {
Date starton = null;
if (get.getSchedule().getTriggers().get(i).getStartingAt() != null) {
starton = get.getSchedule().getTriggers().get(i).getStartingAt().getTime();
}
Date nowDate = cal.getTime();
//are we past the start date?
if (starton != null && (starton.before(cal.getTime()) || starton.equals(cal.getTime()))) {
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/FgsmsReportGenerator.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.math.BigInteger;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import org.apache.log4j.Level;
import org.miloss.fgsms.common.DBSettingsLoader;
import org.miloss.fgsms.common.DBUtils;
import org.miloss.fgsms.common.Logger;
import org.miloss.fgsms.common.Utility;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.*;
import org.miloss.fgsms.services.interfaces.common.TimeRange;
import org.miloss.fgsms.services.interfaces.policyconfiguration.KeyNameValueEnc;
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/ReportDefinitionExtension.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ReportDefinition;
/**
*
* @author AO
*/
public class ReportDefinitionExtension {
public ReportDefinition def;
public boolean pooled;
}
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorController.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
/**
* This is a managed bean adapter instance for the singleton SLA
* Processor Only needed when jboss thread pools are not available
*
* @author AO
*/
public class RSProcessorController implements RSProcessorControllerMBean {
@Override
public void Start() {
RSProcessorSingleton instance = RSProcessorSingleton.getInstance();
RSProcessorSingleton.running = true;
RSProcessorSingleton.run();
}
@Override
public void Stop() {
RSProcessorSingleton instance = RSProcessorSingleton.getInstance();
RSProcessorSingleton.running = false;
}
@Override
public int SizeOfQueue() {
RSProcessorSingleton instance = RSProcessorSingleton.getInstance();
return RSProcessorSingleton.GetQueueSize();
}
}
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorControllerMBean.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
/**
*
* @author AO
*/
public interface RSProcessorControllerMBean {
void Start();
void Stop();
int SizeOfQueue();
}
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSProcessorSingleton.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
import java.util.Queue;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.ReentrantLock;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ReportDefinition;
import org.apache.log4j.Level;
import org.miloss.fgsms.common.Logger;;
/**
* ARS Processor Singleton Provides basic thread pool
* management and is only used when jboss's thread pooling isn't available
*
* @author AO
*/
public class RSProcessorSingleton {
protected static boolean running = true;
static synchronized void Enqueue(ReportDefinitionExtension alertContainer) {
queue.add(alertContainer);
// log.log(Level.DEBUG, "Enqueue alert " + alertContainer.SLAID);
run();
}
private RSProcessorSingleton() {
}
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSRunner.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
import java.util.Queue;
import org.apache.log4j.Level;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ReportDefinition;
import org.miloss.fgsms.common.Logger;;
/**
* Performs alerting functions when not running in Jboss (i.e. thread
* pooling)
*
* @author AO
*/
public class RSRunner implements Runnable {
private Queue<ReportDefinitionExtension> queue = null;
RSRunner(Queue<ReportDefinitionExtension> q) {
queue = q;
}
static final Logger log = Logger.getLogger("fgsms.RSProcessor");
@Override
public void run() {
ReportDefinitionExtension poll = queue.poll();
while (poll != null) {
try {
FgsmsReportGenerator r = new FgsmsReportGenerator();
String id = r.GenerateReport(poll.def, poll.pooled);
r.ProcessAlerts(poll.def, id, poll.pooled);
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/main/java/org/miloss/fgsms/services/rs/impl/RSWorker.java
=====================================================
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* If it is not possible or desirable to put the notice in a particular
* file, then You may include the notice in a location (such as a LICENSE
* file in a relevant directory) where a recipient would be likely to look
* for such a notice.
*
*/
/* ---------------------------------------------------------------------------
* U.S. Government, Department of the Army
* Army Materiel Command
* Research Development Engineering Command
* Communications Electronics Research Development and Engineering Center
* ---------------------------------------------------------------------------
*/
package org.miloss.fgsms.services.rs.impl;
import javax.resource.spi.work.Work;
/**
*
* @author AO
*/
public class RSWorker implements Work {
public RSWorker(ReportDefinitionExtension alert) {
a = alert;
}
ReportDefinitionExtension a=null;
@Override
public void release() {
}
@Override
public void run() {
if (a==null)
return;
FgsmsReportGenerator r = new FgsmsReportGenerator();
try {
String s=r.GenerateReport(a.def, a.pooled);
r.ProcessAlerts(a.def, s,a.pooled);
} catch (Exception ex) {
=====================================================
== File: C:/projects/fgsms/fgsms-server/fgsms-report-generator/src/test/java/org/miloss/fgsms/services/rs/impl/CalendarCalculatorTest.java
=====================================================
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.miloss.fgsms.services.rs.impl;
import java.util.Calendar;
import java.util.UUID;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ImmediateSchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.MonthlySchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.Monthnames;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.OneTimeSchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ReportDefinition;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ScheduleDefinition;
/**
*
* @author AO
*/
public class CalendarCalculatorTest {
/**
* Test of isTimeToRun method, of class CalendarCalculator.
*/
@Test
public void testItsTimeToRun() {
System.out.println("itsTimeToRun");
ReportDefinition get = new ReportDefinition();
get.setEnabled(true);
get.setJobId(UUID.randomUUID().toString());
get.setLastRanAt(null);
get.setSchedule(new ScheduleDefinition());
get.getSchedule().getTriggers().add(new ImmediateSchedule());
Calendar now = Calendar.getInstance();
boolean expResult = true;
boolean result = CalendarCalculator.isTimeToRun(get, now);
assertEquals(expResult, result);
}
@Test
public void testItsTimeToRunOnce() {