Fork me on GitHub

Rat (Release Audit Tool) results

The following document contains the results of Rat (Release Audit Tool).

*****************************************************
Summary
-------
Generated at: 2017-03-11T23:40:48-05:00

Notes: 0
Binaries: 0
Archives: 0
Standards: 57

Apache Licensed: 18
Generated Documents: 0

JavaDocs are generated, thus a license header is optional.
Generated files do not require license headers.

38 Unknown Licenses

*****************************************************

Files with unapproved licenses:

  C:/projects/fgsms/fgsms-common/encrypt.bat
  C:/projects/fgsms/fgsms-common/pom.xml
  C:/projects/fgsms/fgsms-common/run.bat
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AES.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AuditLogger.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/BundleLoader.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/CXFUserIdentifyUtil.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBSettingsLoader.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBUtils.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/IpAddressUtility.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Logger.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Main.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PropertyLoader.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PublicationConstants.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/SLAUtils.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/UserIdentityUtil.java
  C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Utility.java
  C:/projects/fgsms/fgsms-common/src/main/java-templates/org/miloss/fgsms/common/Constants.java
  C:/projects/fgsms/fgsms-common/src/main/resources/fgsms-aes128.key
  C:/projects/fgsms/fgsms-common/src/main/resources/log4j.properties
  C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/fgsms-aes128.key
  C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/SLAResources.properties
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AESTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AuditLoggerTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/CommonSuite.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/ConstantsTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/InitialContextFactoryForTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/IpAddressUtilityTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/LoggerTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MainTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyHttpServletRequest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyMessageContext.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyWebServiceContext.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/PropertyLoaderTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/SimplePrincipal.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UserIdentityUtilTest.java
  C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UtilityTest.java
  C:/projects/fgsms/fgsms-common/src/test/resources/log4j.properties

*****************************************************

*****************************************************
  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-common/encrypt.bat
 !????? C:/projects/fgsms/fgsms-common/pom.xml
 !????? C:/projects/fgsms/fgsms-common/run.bat
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AES.java
  MIT   C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AesCbcWithIntegrity.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AuditLogger.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/BundleLoader.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/Base64.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/BaseNCodec.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/BinaryCodec.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/BinaryDecoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/BinaryEncoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/CharEncoding.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/CharSequenceUtils.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/Charsets.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/Decoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/DecoderException.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/Encoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/EncoderException.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/Hex.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/package.html
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/StringDecoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/StringEncoder.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/StringEncoderComparator.java
  AL    C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/codec/StringUtils.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/CXFUserIdentifyUtil.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBSettingsLoader.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBUtils.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/IpAddressUtility.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Logger.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Main.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PropertyLoader.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PublicationConstants.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/SLAUtils.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/UserIdentityUtil.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Utility.java
 !????? C:/projects/fgsms/fgsms-common/src/main/java-templates/org/miloss/fgsms/common/Constants.java
 !????? C:/projects/fgsms/fgsms-common/src/main/resources/fgsms-aes128.key
 !????? C:/projects/fgsms/fgsms-common/src/main/resources/log4j.properties
 !????? C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/fgsms-aes128.key
 !????? C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/SLAResources.properties
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AESTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AuditLoggerTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/CommonSuite.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/ConstantsTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/InitialContextFactoryForTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/IpAddressUtilityTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/LoggerTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MainTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyHttpServletRequest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyMessageContext.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyWebServiceContext.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/PropertyLoaderTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/SimplePrincipal.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UserIdentityUtilTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UtilityTest.java
 !????? C:/projects/fgsms/fgsms-common/src/test/resources/log4j.properties
 
*****************************************************

 Printing headers for text files without a valid license header...
 
=====================================================
== File: C:/projects/fgsms/fgsms-common/encrypt.bat
=====================================================
java -cp fgsms.Common.jar;xercesImpl.jar;log4j-1.2.16.jar fgsms.common.Main en

=====================================================
== File: C:/projects/fgsms/fgsms-common/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-parent</artifactId>
        <version>7.0.0</version>
    </parent>
    <artifactId>fgsms-common</artifactId>
    <packaging>bundle</packaging>
    <name>fgsms Common</name>
    <properties>
        <cxf.version>2.7.11</cxf.version>
    </properties>
    <description>Common functions and utilities</description>
    <dependencies>
        <dependency>
            <groupId>org.mil-oss</groupId>
            <artifactId>fgsms-common-interfaces</artifactId>
            <version>${project.parent.version}</version>
            <type>jar</type>
        </dependency>


        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>

=====================================================
== File: C:/projects/fgsms/fgsms-common/run.bat
=====================================================
java -cp dist\fgsms.Common.jar;..\external\xercesImpl.jar;..\external\log4j\log4j-1.2.16.jar org.miloss.fgsms.common.Main en 

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AES.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.common;

import javax.crypto.*;
import javax.crypto.spec.*;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.GeneralSecurityException;
import org.apache.log4j.Level;
import org.miloss.fgsms.common.Logger;
import org.miloss.fgsms.common.codec.Base64;

;

/**
 * This program uses a AES key, retrieves its raw bytes, and then reinstantiates
 * a AES key from the key bytes. The reinstantiated key is used to initialize a
 * AES cipher for encryption and decryption. source :
 * http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html
 *
 * This is the encryption/decryption module of fgsms. used for passwords and
 * certain database columns
 */
public class AES {

    public final static boolean isJCEInstalled;

    public static final String logname = "fgsms.Utility";
    public static final Logger log = Logger.getLogger(logname);


=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/AuditLogger.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.common;

import java.sql.Connection;
import java.sql.PreparedStatement;
import javax.servlet.http.HttpServletRequest;
import javax.xml.ws.handler.MessageContext;
import org.apache.log4j.Level;

import org.miloss.fgsms.services.interfaces.common.SecurityWrapper;

/**
 * performs audit logging via the fgsms Configuration
 * database. This is only usable on the FGSMS server
 *
 * @author AO
 */
public class AuditLogger {

    static final Logger log = Logger.getLogger(AuditLogger.class.getCanonicalName());

    /**
     * adds an item to the audit log, this is a wrapper function
     *
     * @param classname
     * @param method
     * @param username
     * @param memo
     * @param classification, if null, not specified will be used, otherwise a
     * prettyprint version of the classificaiton level will be used

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/BundleLoader.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.common;

import java.util.Locale;
import java.util.ResourceBundle;
import org.apache.log4j.Level;


/**
 *
 * @author AO
 */
public class BundleLoader {

    private static ResourceBundle bundle = null;

    /**
     * loads a resource from the properties file
     *
     * @param key
     * @return
     */
    public static String getBundleString(String key) {
        SetupBundle();
        return bundle.getString(key);
    }
   private static Logger log = Logger.getLogger("org.miloss.fgsms.common/SLAResources");
    private static synchronized void SetupBundle() {
        if (bundle == null) {
            try {

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/CXFUserIdentifyUtil.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.common;

/**
 * A helper class for Apache CXF soap stack
 *
 * @author AO
 */
public class CXFUserIdentifyUtil {

     public static String getFirstIdentityToString(Object cxfAuthorizationPolicy) {
          if (cxfAuthorizationPolicy == null) {
               return null;
          }
          if (cxfAuthorizationPolicy instanceof org.apache.cxf.configuration.security.AuthorizationPolicy) {
               org.apache.cxf.configuration.security.AuthorizationPolicy obj = (org.apache.cxf.configuration.security.AuthorizationPolicy) cxfAuthorizationPolicy;
               return obj.getUserName();
          }
          return null;
     }
}

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBSettingsLoader.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.common;

import java.nio.charset.Charset;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import javax.xml.datatype.DatatypeFactory;
import org.miloss.fgsms.services.interfaces.policyconfiguration.KeyNameValue;
import org.miloss.fgsms.services.interfaces.policyconfiguration.KeyNameValueEnc;
import org.miloss.fgsms.services.interfaces.policyconfiguration.TransportAuthenticationStyle;
import org.apache.log4j.Level;

import org.miloss.fgsms.services.interfaces.common.SecurityWrapper;
import org.miloss.fgsms.services.interfaces.policyconfiguration.GlobalPolicy;
import us.gov.ic.ism.v2.ClassificationType;

/**
 * Provides a simple mechanism for loading configuration information from the
 * fgsms Config Database, table: settings. Primarily used for agents that run on
 * the server, SLA plugins and or federation jobs that run on the fgsms server.
 *
 * This is only usable on the FGSMS server.
 *
 * @author AO
 */
public class DBSettingsLoader {

    /**
     * Gets the General Settings from the config database for fgsms Aux Services
     * and some agents
     *

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/DBUtils.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.common;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import org.apache.log4j.Level;


/**
 *
 * @author AO
 */
public class DBUtils {

    static Logger log = Logger.getLogger("fgsms.DBUtils");

    public static void safeClose(Connection con) {
        if (con != null) {
            try {
                con.close();
            } catch (Throwable ex) {
                log.log(Level.INFO, null, ex);
            }
        }
    }
    
    public static void safeClose(ResultSet con) {
        if (con != null) {
            try {
                con.close();
            } catch (Throwable ex) {
                log.log(Level.INFO, null, ex);
            }
        }
    }
    
    public static void safeClose(PreparedStatement con) {
        if (con != null) {
            try {
                con.close();
            } catch (Throwable ex) {
                log.log(Level.INFO, null, ex);
            }
        }
    }

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/IpAddressUtility.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.common;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Level;


/**
 *Provides functionality to convert a requested URL to an absolute URL which is used by fgsms to uniquely identify services
 * 
 * @author AO
 */
public class IpAddressUtility {

    public static final String logname = "fgsms.Utility";
/**
     * Modifies URLs to absolute/unique URLs
     * if isClient
     * If an IPv4 address is present and it's one of my IPs, use the hostname
     * else it will attempt to resolve it
     * 
     * if !isClient
     * replace the server part with my hostname
     * 
     * in both cases, explicitly state the port number

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Logger.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.common;

import java.util.Enumeration;
import java.util.ResourceBundle;
import org.apache.log4j.Appender;
import org.apache.log4j.Category;
import org.apache.log4j.Level;
import org.apache.log4j.Priority;
import org.apache.log4j.spi.LoggerFactory;
import org.apache.log4j.spi.LoggingEvent;

/**
 * Mirrors Apache Log4j and acts as a wrapper. Modeled after the OWASP
 * Enterprise Security API ESAPI
 *
 * Primary function, protect against log forging
 *
 * @author alex.oree
 */
public class Logger {

    final static String CHAR_WHITELIST = "[^A-Za-z0-9 \\?\\\\\\!@#\\$%\\^&\\*\\(\\)\\;\\:/\\.,\\+\\<\\>\\-_\\=\\{\\}\\|'\"\\[\\]]";
    /**
     * this is the method that provides log forging prevention, basically, 
     * remove new lines from the log message, stack traces are excluded
     * @param message
     * @return 
     */
    private static String protect(Object message) {
        if (message == null) {
            return null;
        }
        String content = message.toString();
        if (content != null) {
            return content.replaceAll(CHAR_WHITELIST,"");//('\n', '_').replace('\r', '_');
        } else {
            return null;
        }
    }

    final org.apache.log4j.Logger parent;

    protected Logger(String name) {
        parent = org.apache.log4j.Logger.getLogger(name);
    }

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Main.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.common;

import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *  Command line utility to encrypt passwords and run database
 * connectivity tests for command line aux services (non pooled
 * connections)
 *
 * @author AO
 */
public class Main {

     public static void main(String[] args) {
          if (args==null || args.length == 0) {
               PrintUsage();
          } else if (args.length == 1 && args[0].equalsIgnoreCase("en")) {

               try {
                    System.out.print("Enter password: ");
                    String s = new String(System.console().readPassword());
                    System.out.print("Enter password to confirm: ");
                    String s2 = new String(System.console().readPassword());
                    if (s.equalsIgnoreCase(s2)) {
                         //String s = System.console().readLine();
                         System.out.println("Cipher Text: " + AES.EN(s));
                    } else {
                         System.out.println("Passwords do not match");
                    }
               } catch (Exception ex) {

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PropertyLoader.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.common;

import java.io.InputStream;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Properties;
import java.util.ResourceBundle;

/**
 * Loads a properties file from the classpathfrom
 * http://www.javaworld.com/javaqa/2003-08/01-qa-0808-property.html?page=2
 *
 * @author AO
 */
public abstract class PropertyLoader {

    /**
     * Looks up a resource named 'name' in the classpath. The resource must map
     * to a file with .properties extention. The name is assumed to be absolute
     * and can use either "/" or "." for package segment separation with an
     * optional leading "/" and optional ".properties" suffix. Thus, the
     * following names refer to the same resource:
     * <pre>
     * some.pkg.Resource
     * some.pkg.Resource.properties
     * some/pkg/Resource
     * some/pkg/Resource.properties
     * /some/pkg/Resource
     * /some/pkg/Resource.properties
     * </pre>

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/PublicationConstants.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.common;

/**
 *Publication Constants - these values are used for publishing data to federation targets 
 * <p>As of RC6, this class provides UDDI tModel key information.</p>
 * @author AO
 * @since RC6
 */
public class PublicationConstants {
    public static final String UDDI_USE_TYPE_ENDPOINT="endPoint";
    public static final String UDDI_USE_TYPE_BINDING_TEMPLATE_REFERENCE="bindingTemplate";
    public static final String UDDI_USE_TYPE_BINDING_HOSTING_REDIRECT="hostingRedirector";
    
    
 public static String[] getAllTmodelKeys()
        {
            return new String[]{
                    tmodelSuccessCount5min, tmodelFailureCount5min, tmodelAverageResponseTime5min, tmodelMTBF5min, tmodelSLAViolations5min, tmodelUpDownTimePercentage5min, tmodelMaxRequestSize5min, tmodelMaxResponseSize5min, tmodelMaxresponseTime5min,
                    tmodelSuccessCount15min, tmodelFailureCount15min, tmodelAverageResponseTime15min, tmodelMTBF15min, tmodelSLAViolations15min, tmodelUpDownTimePercentage15min, tmodelMaxRequestSize15min, tmodelMaxResponseSize15min, tmodelMaxresponseTime15min,
                    tmodelSuccessCount60min, tmodelFailureCount60min, tmodelAverageResponseTime60min, tmodelMTBF60min, tmodelSLAViolations60min, tmodelUpDownTimePercentage60min, tmodelMaxRequestSize60min, tmodelMaxResponseSize60min, tmodelMaxresponseTime60min,
                    tmodelSuccessCount24hr, tmodelFailureCount24hr, tmodelAverageResponseTime24hr, tmodelMTBF24hr, tmodelSLAViolations24hr, tmodelUpDownTimePercentage24hr, tmodelMaxRequestSize24hr, tmodelMaxResponseSize24hr, tmodelMaxresponseTime24hr,
                    tmodelOperationalStatus, tmodelTimeRange, tmodelPublishTimeStamp, tmodelOperationalMonitoredBy, tmodelOperationalStatusTimeStamp, tmodelOperationalStatuschange
                };  //30 items
        }
 
 public static boolean isTmodelFromfgsms(String tmodelKey)
 {
     if (tmodelKey==null)
         return false;

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/SLAUtils.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.common;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringWriter;
import java.util.GregorianCalendar;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.log4j.Level;

import org.miloss.fgsms.plugins.sla.AlertContainer;
import org.oasis_open.docs.wsdm.mows_2.AnyXmlContentsType;
import org.oasis_open.docs.wsdm.mows_2.BusyState;
import org.oasis_open.docs.wsdm.mows_2.CrashedState;
import org.oasis_open.docs.wsdm.mows_2.DownState;
import org.oasis_open.docs.wsdm.mows_2.DurationMetric;
import org.oasis_open.docs.wsdm.mows_2.EndpointDescriptions;
import org.oasis_open.docs.wsdm.mows_2.GetManageabilityReferencesResponse;
import org.oasis_open.docs.wsdm.mows_2.IdleState;
import org.oasis_open.docs.wsdm.mows_2.IntegerCounter;
import org.oasis_open.docs.wsdm.mows_2.MessageContentNotIncludedFlag;
import org.oasis_open.docs.wsdm.mows_2.MessageContentSizeType;
import org.oasis_open.docs.wsdm.mows_2.MessageContentType;
import org.oasis_open.docs.wsdm.mows_2.MessageInformationType;
import org.oasis_open.docs.wsdm.mows_2.MessageSizeUnitType;
import org.oasis_open.docs.wsdm.mows_2.OperationDurationMetric;

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/UserIdentityUtil.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.common;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.http.HttpServletRequest;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
import org.apache.log4j.Level;

import org.miloss.fgsms.services.interfaces.common.SecurityWrapper;

/**
 * Performs all access control functions of fgsms based on ACLs and Roles.
 * Function of this class is critical has is it the sole location for access
 * control processing
 *
 * @author AO
 */
public class UserIdentityUtil {

    public static final String logname = "fgsms.UserIdentityUtil";
    static final Logger log = Logger.getLogger(logname);

    /**
     * assertReadAccess , checks the servlet context first, then the database
     *
     * @param uri
     * @param currentUser
     * @param fromFunction
     * @param classification

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java/org/miloss/fgsms/common/Utility.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.common;

import com.sun.org.apache.xerces.internal.dom.DeferredElementImpl;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.InetAddress;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Properties;
import java.util.UUID;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.datatype.Duration;
import java.util.Calendar;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.log4j.Level;

import org.miloss.fgsms.services.interfaces.automatedreportingservice.*;

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/java-templates/org/miloss/fgsms/common/Constants.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.common;

/**
 * A collection of constants, also versioning information
 *
 * @author AO
 */
public class Constants {
    public static final String CHARSET="UTF-8";
    /**
     * Used for OS Agent Property Pair callbacks
     * @since 6.3
     */
    public static final String PROPERTYPAIR_OS_AGENT_CALLBACK_URL = "org.miloss.fgsms.osagent.callbackaddress";
    /**
     * @since 6.3
     */
    public static final String PROPERTYPAIR_OS_AGENT_STARTED = "org.miloss.fgsms.osagent.startedat.epoch";
    public static final String oneway = "fgsms.oneway";
    public static final String DAS_META = "DASv8.wsdl";
    public static final String DCS_META = "DCS8.wsdl";
    public static final String PCS_META = "PCS8.wsdl";
    public static final String RS_META = "RSv6.wsdl";
    public static final String SS_META = "Statusv6.wsdl";
    public static final String ARS_META = "ARSv1.wsdl";
    public static final String ACS_META = "AgentConf.wsdl";
    public static final String ACSA_META = "AgentConfAdmin.wsdl";
    /**
     * @since 6.3
     */

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/resources/fgsms-aes128.key
=====================================================
m0b3b70CH0P4Ua7rxksnRw==:o1QNVJ/KY453VEB3VsQn39tQpu5yKovGAH/LQvyzawI=

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/resources/log4j.properties
=====================================================

log4j.rootLogger=INFO, CONSOLE



log4j.appender.jaxws.JAXWSWebServiceMetaDataBuilder=ERROR,CONSOLE
log4j.appender.jaxws=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata.builder=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata.builder.MetaDataBuilder=ERROR,CONSOLE
log4j.appender.builder.MetaDataBuilder=ERROR,CONSOLE
log4j.appender.builder=ERROR,CONSOLE

log4j.appender.handler.HandlerChainExecutor=ERROR,CONSOLE
log4j.appender.handler=ERROR,CONSOLE
log4j.appender.soap.MessageContextAssociation=ERROR,CONSOLE

log4j.appender.httpclient.wire.content=WARN, CONSOLE
log4j.appender.httpclient.wire=WARN, CONSOLE
log4j.appender.org.apache.commons.httpclient=WARN, CONSOLE

log4j.appender.httpclient.wire.content=WARN, CONSOLE
log4j.appender.httpclient.wire=WARN, CONSOLE
log4j.appender.org.apache.commons.httpclient=WARN, CONSOLE

log4j.appender.umdm.EndpointMetaData==ERROR, CONSOLE
log4j.appender.handler.HandlerResolverImpl==ERROR, CONSOLE
log4j.appender.binding.BindingImpl==ERROR, CONSOLE
log4j.appender.jaxws.JAXWSWebServiceMetaDataBuilder==ERROR, CONSOLE
log4j.appender.utils.JBossWSEntityResolver==ERROR, CONSOLE
log4j.appender.fgsms.ServiceMixJMX=INFO,CONSOLE
log4j.appender.fgsms.Utility=INFO,CONSOLE
log4j.appender.fgsms.StatusBueller=INFO,CONSOLE
log4j.appender.fgsms.DataCollectorService=INFO,CONSOLE
log4j.appender.fgsms.DataAccessService=INFO,CONSOLE
log4j.appender.org.miloss.fgsms.common.AuditLogger=INFO,CONSOLE
log4j.appender.fgsms.UserIdentityUtil=INFO,CONSOLE
log4j.appender.fgsms.StatusBueller=INFO,CONSOLE
log4j.appender.fgsms.QpidPython=INFO,CONSOLE
log4j.appender.fgsms.QpidJMX=INFO,CONSOLE
log4j.appender.fgsms.DataPruner=INFO,CONSOLE
log4j.appender.fgsms.UDDIPublisher=INFO,CONSOLE
log4j.appender.fgsms.MulticastAlerting=INFO,CONSOLE
log4j.appender.fgsms.SLAProcessor=INFO,CONSOLE

#the following items are used for sending SLA Alerts to specific loggers. Configure them as necessary to pipe log output whereever you need it
log4j.appender.fgsms.SLAProcessor.SysLog=INFO,CONSOLE 
log4j.appender.fgsms.SLAProcessor.UdpLog=INFO,CONSOLE
log4j.appender.fgsms.SLAProcessor.EventLog=INFO,CONSOLE
log4j.appender.fgsms.SLAProcessor.FileLog=INFO,CONSOLE

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/fgsms-aes128.key
=====================================================
m0b3b70CH0P4Ua7rxksnRw==:o1QNVJ/KY453VEB3VsQn39tQpu5yKovGAH/LQvyzawI=

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/main/resources/org/miloss/fgsms/common/SLAResources.properties
=====================================================
#To access these messages, try SLACommon.getBundleString("key")

MachinePolicyNull=policy is unexpectedly null or empty
ProcessPolicyNull=policy is unexpectedly null or empty
WSPolicyNull=policy is unexpectedly null or empty
StatusPolicyNull=policy is unexpectedly null or empty
BrokerPolicyNull=policy is unexpectedly null or empty
ErrorLoadingPolicyForSLA=Error obtaining service policies for SLA processing
ErrorLoadingPolicy=unable to load service policy list
ErrorClosingDB=trouble closing the sql connection, this is probably ignorable
ErrorMarshallingPolicy=error retrieving policy from database, serialization error
ErrorSQLException=unexpected error talking to the database
ErrorUncaughtException=an unexpected error occurred
ErrorExceptionPolicyCreation=Error writing policy to database, this could be ignorable if the policy exists already. The transaction will be rolled back

WSDMLangauge=english
WSDMEventIdPrefix=urn:
ErrorDataTypeFactorLoad=unable to load the Datatype Factory, date and time stamps may not be available
ErrorWSDMMarshalling=unable to marshal WSDM message
ErrorWSDMCreateDomElement=can't create dom element, WSDM based alerts may not be sendable via WSN, OMG DDS, DDS

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AESTest.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.common;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.Ignore;

/**
 *
 * @author AO
 */
public class AESTest {
    
    public AESTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    
    
    /**

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/AuditLoggerTest.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.common;

import org.miloss.fgsms.common.AuditLogger;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import javax.naming.Context;
import javax.xml.ws.handler.MessageContext;
import org.miloss.fgsms.services.interfaces.common.SecurityWrapper;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import us.gov.ic.ism.v2.ClassificationType;
import static org.junit.Assert.*;
import org.postgresql.ds.PGPoolingDataSource;

/**
 *
 * @author *
 */
public class AuditLoggerTest {

    public AuditLoggerTest() throws Exception {
        File f = new File("../resources/test-database.properties");
        Properties db = new Properties();
        if (f.exists()) {
            FileInputStream fis = new FileInputStream(f);

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/CommonSuite.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.common;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

/**
 *
 * @author *
 */

@RunWith(Suite.class)
@Suite.SuiteClasses({org.miloss.fgsms.common.IpAddressUtilityTest.class, org.miloss.fgsms.common.UserIdentityUtilTest.class, org.miloss.fgsms.common.AuditLoggerTest.class, org.miloss.fgsms.common.UtilityTest.class, org.miloss.fgsms.common.PropertyLoaderTest.class, org.miloss.fgsms.common.ConstantsTest.class})
public class CommonSuite {

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
    }

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/ConstantsTest.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.common;

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.*;

/**
 *
 * @author *
 */
public class ConstantsTest {
    
    public ConstantsTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/InitialContextFactoryForTest.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.common;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;

/**
 *
 * @author AO
 */

public class InitialContextFactoryForTest implements InitialContextFactory {

    private static Context context;

    static {
        try {
            context = new InitialContext(true) {
                Map<String, Object> bindings = new HashMap<String, Object>();

                @Override
                public void bind(String name, Object obj)
                        throws NamingException {
                    bindings.put(name, obj);
                }


=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/IpAddressUtilityTest.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.common;

import org.miloss.fgsms.common.IpAddressUtility;
import org.miloss.fgsms.common.Utility;
import java.net.InetAddress;
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.*;

/**
 *
 * @author *
 */
public class IpAddressUtilityTest {

    public IpAddressUtilityTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }


=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/LoggerTest.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.common;

import java.util.Date;
import org.junit.Test;

/**
 *
 * @author alex.oree
 */
public class LoggerTest {
    
    @Test
    public void testLogger(){
        Logger logger = Logger.getLogger(LoggerTest.class);
        logger.info("test");
        logger.info("something happened\n[INFO] LOG FORGE " + new Date() + " bob logged in");
        logger.info("something happened\r[INFO] LOG FORGE " + new Date() + " bob logged in");
        org.apache.log4j.Logger logger1 = org.apache.log4j.Logger.getLogger(LoggerTest.class);
        logger1.info("test");
        logger1.info("something happened\n[INFO] LOG FORGE " + new Date() + " bob logged in");
        logger1.info("something happened\r[INFO] LOG FORGE " + new Date() + " bob logged in");
    }
    
}

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MainTest.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.common;

import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author AO
 */
public class MainTest {
    
    public MainTest() {
    }

    @org.junit.BeforeClass
    public static void setUpClass() throws Exception {
    }

    @org.junit.AfterClass
    public static void tearDownClass() throws Exception {
    }

    @org.junit.Test
    public void testSomeMethod() {
    }
}

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyHttpServletRequest.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.common;

import java.io.*;
import java.security.Principal;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;


/**
 *
 * @author AO
 */
public class MyHttpServletRequest implements HttpServletRequest {

    public MyHttpServletRequest(String username) {
        uname = username;
    }
    String url = "http://localhost:8180/fgsmsServices/DCS";

    public MyHttpServletRequest(String username, String requesturl) {
        uname = username;
        url = requesturl;
    }

    public String getAuthType() {
        return "Basic";
    }


=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyMessageContext.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.common;
import java.util.*;
import javax.xml.ws.handler.MessageContext;

/**
 *
 * @author AO
 */
    public class MyMessageContext implements MessageContext {

        public MyMessageContext() {
            map = new HashMap();
        }

        public void setScope(String name, Scope scope) {
        }

        public Scope getScope(String name) {
            return null;
        }

        public int size() {
            return map.size();
        }

        public boolean isEmpty() {
            return map.isEmpty();
        }


=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/MyWebServiceContext.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.common;

import java.security.Principal;
import java.util.*;
import javax.xml.ws.*;
import javax.xml.ws.handler.MessageContext;
import org.w3c.dom.Element;
/**
 *
 * @author AO
 */
    public class MyWebServiceContext implements WebServiceContext {

        public MyWebServiceContext() {
        }

        public MyWebServiceContext(MyMessageContext mc, String username) {
            here = mc;
            uname = username;
        }
        public MyMessageContext here;
        public String uname;

        public MyWebServiceContext(String username) {
            uname = username;
        }

        public MessageContext getMessageContext() {
            return here;

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/PropertyLoaderTest.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.common;

import java.util.Properties;
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.junit.Ignore;

/**
 *
 * @author *
 */
public class PropertyLoaderTest {
    
    public PropertyLoaderTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/SimplePrincipal.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.common;

import java.security.Principal;

/**
 *
 * @author alex
 */
public class SimplePrincipal implements Principal {

     String name;
     public SimplePrincipal(String uname) {
          name=uname;
     }

     @Override
     public String getName() {
          return name;
     }
     
}

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UserIdentityUtilTest.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.common;

import org.miloss.fgsms.common.Constants;
import org.miloss.fgsms.common.UserIdentityUtil;
import org.miloss.fgsms.common.Utility;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import javax.naming.Context;
import javax.xml.ws.handler.MessageContext;
import org.miloss.fgsms.services.interfaces.common.SecurityWrapper;
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.postgresql.ds.PGPoolingDataSource;

/**
 *
 * @author *
 */
public class UserIdentityUtilTest {

    static String testuser = "testuser";

    public UserIdentityUtilTest() throws Exception {

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/java/org/miloss/fgsms/common/UtilityTest.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.common;

import java.io.File;
import java.io.FileInputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import org.apache.commons.lang3.StringEscapeUtils;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.DailySchedule;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.Daynames;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ExportCSVDataRequestMsg;
import org.miloss.fgsms.services.interfaces.automatedreportingservice.ExportDataRequestMsg;

=====================================================
== File: C:/projects/fgsms/fgsms-common/src/test/resources/log4j.properties
=====================================================

log4j.rootLogger=INFO, CONSOLE



log4j.appender.jaxws.JAXWSWebServiceMetaDataBuilder=ERROR,CONSOLE
log4j.appender.jaxws=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata.builder=ERROR,CONSOLE
log4j.appender.org.jboss.ws.metadata.builder.MetaDataBuilder=ERROR,CONSOLE
log4j.appender.builder.MetaDataBuilder=ERROR,CONSOLE
log4j.appender.builder=ERROR,CONSOLE
log4j.appender.org.apache.cxf.service.factory.ReflectionServiceFactoryBean=ERROR,CONSOLE

log4j.appender.handler.HandlerChainExecutor=ERROR,CONSOLE
log4j.appender.handler=ERROR,CONSOLE
log4j.appender.soap.MessageContextAssociation=ERROR,CONSOLE

log4j.appender.httpclient.wire.content=WARN, CONSOLE
log4j.appender.httpclient.wire=WARN, CONSOLE
log4j.appender.org.apache.commons.httpclient=WARN, CONSOLE

log4j.appender.httpclient.wire.content=WARN, CONSOLE
log4j.appender.httpclient.wire=WARN, CONSOLE
log4j.appender.org.apache.commons.httpclient=WARN, CONSOLE

log4j.appender.umdm.EndpointMetaData==ERROR, CONSOLE
log4j.appender.handler.HandlerResolverImpl==ERROR, CONSOLE
log4j.appender.binding.BindingImpl==ERROR, CONSOLE
log4j.appender.jaxws.JAXWSWebServiceMetaDataBuilder==ERROR, CONSOLE
log4j.appender.utils.JBossWSEntityResolver==ERROR, CONSOLE
log4j.appender.fgsms.ServiceMixJMX=INFO,CONSOLE
log4j.appender.fgsms.Utility=INFO,CONSOLE
log4j.appender.fgsms.StatusBueller=INFO,CONSOLE
log4j.appender.fgsms.DataCollectorService=INFO,CONSOLE
log4j.appender.fgsms.DataAccessService=INFO,CONSOLE
log4j.appender.org.miloss.fgsms.common.AuditLogger=INFO,CONSOLE
log4j.appender.fgsms.UserIdentityUtil=INFO,CONSOLE
log4j.appender.fgsms.StatusBueller=INFO,CONSOLE
log4j.appender.fgsms.QpidPython=INFO,CONSOLE
log4j.appender.fgsms.QpidJMX=INFO,CONSOLE
log4j.appender.fgsms.DataPruner=INFO,CONSOLE
log4j.appender.fgsms.UDDIPublisher=INFO,CONSOLE
log4j.appender.fgsms.MulticastAlerting=INFO,CONSOLE
log4j.appender.fgsms.SLAProcessor=INFO,CONSOLE

#the following items are used for sending SLA Alerts to specific loggers. Configure them as necessary to pipe log output whereever you need it
log4j.appender.fgsms.SLAProcessor.SysLog=INFO,CONSOLE 
log4j.appender.fgsms.SLAProcessor.UdpLog=INFO,CONSOLE
log4j.appender.fgsms.SLAProcessor.EventLog=INFO,CONSOLE