Commit b05d48b5 authored by Romain Ferrari's avatar Romain Ferrari

Tiny modifications and bugfixes on Policies. Removing AuditLog and AuditLevel...

Tiny modifications and bugfixes on Policies. Removing AuditLog and AuditLevel as well and upgrading gitignore
parent a78d1baf
......@@ -8,3 +8,4 @@
/.settings/org.eclipse.wst.common.component
/.settings/org.eclipse.wst.common.project.facet.core.xml
/.settings/org.sonar.ide.eclipse.core.prefs
*.log
......@@ -284,8 +284,7 @@ public class PolicyCollection
* @throws TopLevelPolicyException if multiple policies match but this
* instance wasn't setup to wrap policies
*/
public Object getPolicy(EvaluationCtx context)
throws TopLevelPolicyException
public Object getPolicy(EvaluationCtx context) throws TopLevelPolicyException
{
// setup a list of matching policies
ArrayList list = new ArrayList();
......
......@@ -152,8 +152,11 @@ public class Policy extends PolicyType {
metaData = new PolicyMetaData(root.getNamespaceURI(), null);
// Setting attributes
NamedNodeMap attrs = root.getAttributes();
//FIXME: NPE if policyId is null
policyId = attrs.getNamedItem("PolicyId").getNodeValue();
//FIXME: NPE if version is null
version = attrs.getNamedItem("Version").getNodeValue();
//FIXME: NPE if RuleCombiningAlg Id is null
ruleCombiningAlgId = attrs.getNamedItem("RuleCombiningAlgId")
.getNodeValue();
......
/**
* Copyright (C) 2011-2013 Thales Services - ThereSIS - All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.thalesgroup.authzforce.audit;
import org.apache.log4j.Level;
public class AuditLevel extends Level {
private static final long serialVersionUID = 1L;
/**
* Value of my trace level. This value is lesser than
* {@link org.apache.log4j.Priority#FATAL_INT}
*/
public static final int AUDIT_INT = FATAL_INT - 10000;
/**
* {@link Level} representing my log level
*/
public static final Level AUDIT = new AuditLevel(AUDIT_INT,
"AUDIT", 7);
/**
* Constructor
*
* @param arg0
* @param arg1
* @param arg2
*/
protected AuditLevel(int arg0, String arg1, int arg2) {
super(arg0, arg1, arg2);
}
}
///**
// * Copyright (C) 2011-2013 Thales Services - ThereSIS - All rights reserved.
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */
//package com.thalesgroup.authzforce.audit;
//
//import org.apache.log4j.Level;
//
//public class AuditLevel extends Level {
//
//
// private static final long serialVersionUID = 1L;
//
// /**
// * Value of my trace level. This value is lesser than
// * {@link org.apache.log4j.Priority#FATAL_INT}
// */
// public static final int AUDIT_INT = FATAL_INT - 10000;
//
// /**
// * {@link Level} representing my log level
// */
// public static final Level AUDIT = new AuditLevel(AUDIT_INT,
// "AUDIT", 7);
//
// /**
// * Constructor
// *
// * @param arg0
// * @param arg1
// * @param arg2
// */
// protected AuditLevel(int arg0, String arg1, int arg2) {
// super(arg0, arg1, arg2);
//
// }
//
//
//}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender class="org.apache.log4j.RollingFileAppender" name="Appender1">
<param value="/etc/AuthZForce/logs/cache.log" name="File" />
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param value="%-4r [%t] [%d] %5p [%C:%M] (%F:%L) - %m%n" name="ConversionPattern" />
</layout>
</appender>
<appender class="org.apache.log4j.RollingFileAppender" name="Appender2">
<param value="/etc/AuthZForce/logs/pdp.log" name="File" />
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param value="%-4r [%t] [%d] %5p [%C:%M] (%F:%L) - %m%n" name="ConversionPattern" />
</layout>
</appender>
<appender class="org.apache.log4j.RollingFileAppender" name="Appender3">
<param value="/etc/AuthZForce/logs/tests.log" name="File" />
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param value="%-4r [%t] [%d] %5p [%C:%M] (%F:%L) - %m%n" name="ConversionPattern" />
</layout>
</appender>
<appender class="org.apache.log4j.RollingFileAppender" name="AuditAppender">
<param value="/etc/AuthZForce/logs/pdp-audit-3.0.0.log" name="File" />
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param value="%-4r [%t] %5p [%C:%M] (%F:%L) - %m%n" name="ConversionPattern" />
</layout>
</appender>
<appender class="org.apache.log4j.ConsoleAppender" name="stdout">
<param value="System.out" name="Target" />
<layout class="org.apache.log4j.PatternLayout">
<param value="%-4r [%t] [%d] %5p [%C:%M] (%F:%L) - %m%n" name="ConversionPattern" />
</layout>
</appender>
<!-- AUDIT LOGGER -->
<logger name="com.thalesgroup.authzforce.audit.AuditLogs">
<appender-ref ref="AuditAppender" />
</logger>
<!-- /AUDIT LOGGER -->
<logger name="com.sun.xacml.cond.BaseFunctionFactory">
<level value="info" />
<appender-ref ref="Appender2" />
</logger>
<logger name="com.sun.xacml.cond.StandardFunctionFactory">
<level value="info" />
<appender-ref ref="Appender2" />
</logger>
<logger name="com.thalesgroup.authzforce.pdp.core.test.impl.BasicFunctionV3">
<level value="info" />
<appender-ref ref="stdout" />
</logger>
<logger
name="com.thalesgroup.authzforce.pdp.core.test.impl.BasicMultipleRequestV3">
<level value="info" />
<appender-ref ref="stdout" />
</logger>
<logger name="com.thalesgroup.authzforce.pdp.core.test.impl.BasicV3">
<level value="info" />
<appender-ref ref="stdout" />
</logger>
<logger name="com.thalesgroup.authzforce.pdp.core.test.impl.ConformanceV3">
<level value="debug" />
<appender-ref ref="stdout" />
</logger>
<logger name="com.thalesgroup.authzforce.pdp.core.test.utils.TestUtils">
<level value="debug" />
<appender-ref ref="stdout" />
</logger>
<logger name="com.thalesgroup.authzforce.pdp.core.test.impl.MainTest">
<level value="info" />
<appender-ref ref="stdout" />
</logger>
<logger name="net.sf.ehcache">
<level value="warn" />
<appender-ref ref="Appender1" />
</logger>
<logger name="org.apache.axis.ConfigurationException">
<level value="info" />
<appender-ref ref="stdout" />
</logger>
<logger name="org.apache.commons.digester">
<level value="debug" />
<appender-ref ref="stdout" />
</logger>
<root>
<level value="debug" />
<appender-ref ref="Appender2" />
</root>
</log4j:configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment