Author: bdaw
Date: 2009-11-05 07:19:23 -0500 (Thu, 05 Nov 2009)
New Revision: 906
Modified:
idm/trunk/idm-cache/pom.xml
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java
idm/trunk/idm-testsuite/pom.xml
idm/trunk/parent/logging.properties
Log:
- fix for some logging
Modified: idm/trunk/idm-cache/pom.xml
===================================================================
--- idm/trunk/idm-cache/pom.xml 2009-11-04 22:30:01 UTC (rev 905)
+++ idm/trunk/idm-cache/pom.xml 2009-11-05 12:19:23 UTC (rev 906)
@@ -57,6 +57,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
+ <useFile>true</useFile>
<systemProperties>
<property>
<name>dataSourceName</name>
@@ -66,6 +67,10 @@
<name>directoryName</name>
<value>${directoryName}</value>
</property>
+ <property>
+ <name>java.util.logging.config.file</name>
+ <value>../parent/logging.properties</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
Modified:
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java
===================================================================
---
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java 2009-11-04
22:30:01 UTC (rev 905)
+++
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java 2009-11-05
12:19:23 UTC (rev 906)
@@ -138,6 +138,10 @@
public void invalidate(String ns)
{
cache.getRoot().removeChild(getNamespacedFqn(ns));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating namespace:" + ns);
+ }
}
public String getNamespace(String realmId)
@@ -175,7 +179,7 @@
{
User user = (User)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && user != null)
{
log.finer(this.toString() + "User found in cache: id=" +
user.getId());
}
@@ -223,7 +227,7 @@
{
Collection<User> users =
(Collection<User>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && users != null)
{
log.finer(this.toString() + "User criteria search found in cache:
users.size()=" + users.size() +
"; criteria.hash()=" + criteria.hashCode());
@@ -241,6 +245,11 @@
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_USERS_COUNT));
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_USERS_CRITERIA));
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_USERS_QUERIES));
+ getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_USERS_SEARCHES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Users cache. Namespace:" +
ns);
+ }
}
public void putUserCount(String ns, int count)
@@ -272,7 +281,7 @@
count = i.intValue();
}
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && count != -1)
{
log.finer(this.toString() + "User count found in cache: " +
count);
}
@@ -286,6 +295,10 @@
public void invalidateUserCount(String ns)
{
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_USERS_COUNT));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating User count. Namespace:" +
ns);
+ }
}
public void putGroup(String ns, Group group)
@@ -312,7 +325,7 @@
{
Group group = (Group)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && group != null)
{
log.finer(this.toString() + "Group found in cache: id=" +
group.getId());
}
@@ -360,7 +373,7 @@
{
Collection<Group> groups =
(Collection<Group>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && groups != null)
{
log.finer(this.toString() + "Group criteria search found in cache:
groups.size()=" + groups.size() +
"; criteria.hash()=" + criteria.hashCode());
@@ -378,6 +391,11 @@
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_GROUPS_COUNT));
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_GROUPS_CRITERIA));
getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_GROUPS_QUERIES));
+ getCache().getRoot().removeChild(Fqn.fromElements(getNamespacedFqn(ns),
NODE_GROUPS_SEARCHES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Groups cache. Namespace:" +
ns);
+ }
}
public void putGroupCount(String ns, String groupType, int count)
@@ -409,7 +427,7 @@
count = i.intValue();
}
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && count != -1)
{
log.finer(this.toString() + "Group count found in cache:
groupType=" + groupType + "; count=" + count);
}
@@ -423,6 +441,10 @@
public void invalidateGroupCount(String ns, String groupType)
{
cache.getRoot().removeChild(getFqn(ns, NODE_GROUPS_COUNT, groupType));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Group count. Namespace:" +
ns);
+ }
}
public void putRole(String ns, Role role)
@@ -450,7 +472,7 @@
{
Role result = (Role)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && result != null)
{
log.finer(this.toString() + "Role found in cache: id=" + result);
}
@@ -491,7 +513,7 @@
{
RoleType result = (RoleType)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && result != null)
{
log.finer(this.toString() + "RoleType found in cache: name=" +
role.getName());
}
@@ -531,7 +553,7 @@
{
Map<String, Attribute> attributes = (Map<String,
Attribute>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && attributes != null)
{
log.finer(this.toString() + "Attributes search found in cache:
attributes.size()=" + attributes.size() +
"; id=" + id);
@@ -546,11 +568,19 @@
public void invalidateAttributes(String ns, String id)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ATTRIBUTES, id));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Attributes. id=" + id
+";namespace:" + ns);
+ }
}
public void invalidateAttributes(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ATTRIBUTES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Attributes. Namespace:" +
ns);
+ }
}
public void putProperties(String ns, Role role, Map<String, String> properties)
@@ -577,7 +607,7 @@
{
Map<String, String> props = (Map<String,
String>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && props != null)
{
log.finer(this.toString() + "Role properties found in cache:
properties.size()=" + props.size() +
"; role=" + role);
@@ -592,11 +622,19 @@
public void invalidateRoleProperties(String ns, Role role)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_PROPERTIES, role.hashCode()));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Role properties. role=" +
role + "; Namespace:" + ns);
+ }
}
public void invalidateRoleProperties(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_PROPERTIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Role properties. Namespace:"
+ ns);
+ }
}
public void putProperties(String ns, RoleType roleType, Map<String, String>
properties)
@@ -623,7 +661,7 @@
{
Map<String, String> props = (Map<String,
String>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && props != null)
{
log.finer(this.toString() + "RoleType properties found in cache:
properties.size()=" + props.size() +
"; roleType=" + roleType);
@@ -638,11 +676,19 @@
public void invalidateRoleTypeProperties(String ns, RoleType roleType)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_PROPERTIES,
roleType.hashCode()));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating RoleType properties.
roleType=" + roleType + "; Namespace:" + ns);
+ }
}
public void invalidateRoleTypeProperties(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_PROPERTIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating RoleType properties.
Namespace:" + ns);
+ }
}
public void invalidateAllSearches(String ns)
@@ -652,6 +698,10 @@
cache.getRoot().removeChild(getFqn(ns, NODE_RELATIONSHIP_SEARCHES));
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_SEARCHES));
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_TYPE_SEARCHES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating all searches. Namespace:" +
ns);
+ }
}
public void putUserSearch(String ns, UserSearch search, Collection<User>
results)
@@ -678,7 +728,7 @@
{
Collection<User> props =
(Collection<User>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && props != null)
{
log.finer(this.toString() + "User search found in cache:
properties.size()=" + props.size());
}
@@ -713,7 +763,7 @@
{
Collection<Group> results =
(Collection<Group>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && results != null)
{
log.finer(this.toString() + "Group search found in cache:
results.size()=" + results.size());
}
@@ -748,7 +798,7 @@
{
Boolean result = (Boolean)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && result != null)
{
log.finer(this.toString() + "Relationship search found in cache:
properties.size()=" + result);
}
@@ -783,7 +833,7 @@
{
Collection<Role> results =
(Collection<Role>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && results != null)
{
log.finer(this.toString() + "Role search found in cache:
results.size()=" + results.size());
}
@@ -818,7 +868,7 @@
{
Collection<RoleType> results =
(Collection<RoleType>)node.get(NODE_OBJECT_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && results != null)
{
log.finer(this.toString() + "RoleType search found in cache:
results.size()=" + results.size());
}
@@ -834,6 +884,10 @@
cache.getRoot().removeChild(getFqn(ns, NODE_USERS_QUERIES));
cache.getRoot().removeChild(getFqn(ns, NODE_GROUPS_QUERIES));
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_QUERIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating all queries. Namespace:" +
ns);
+ }
}
@@ -875,7 +929,7 @@
{
Collection<User> users =
(Collection<User>)node.get(NODE_QUERY_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && users != null)
{
log.finer(this.toString() + "User query found in cache:
users.size()=" + users.size() +
"; query.hash()=" + q.hashCode());
@@ -897,7 +951,7 @@
{
User users = (User)node.get(NODE_QUERY_UNIQUE_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && users != null)
{
log.finer(this.toString() + "User query found in cache: user=" +
users);
}
@@ -911,6 +965,10 @@
public void invalidateUserQueries(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_USERS_QUERIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating User queries. Namespace:" +
ns);
+ }
}
public void putGroupQuery(String ns, GroupQuery q, Collection<Group> results)
@@ -951,7 +1009,7 @@
{
Collection<Group> groups =
(Collection<Group>)node.get(NODE_QUERY_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && groups != null)
{
log.finer(this.toString() + "Group query found in cache:
groups.size()=" + groups.size() +
"; query.hash()=" + q.hashCode());
@@ -973,7 +1031,7 @@
{
Group group = (Group)node.get(NODE_QUERY_UNIQUE_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && group != null)
{
log.finer(this.toString() + "Group query found in cache: group=" +
group);
}
@@ -987,6 +1045,10 @@
public void invalidateGroupQueries(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_GROUPS_QUERIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Group queries. Namespace:" +
ns);
+ }
}
public void putRoleQuery(String ns, RoleQuery q, Collection<Role> results)
@@ -1026,7 +1088,7 @@
{
Collection<Role> roles =
(Collection<Role>)node.get(NODE_QUERY_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && roles != null)
{
log.finer(this.toString() + "Role query found in cache:
users.size()=" + roles.size() +
"; query.hash()=" + q.hashCode());
@@ -1048,7 +1110,7 @@
{
Role role = (Role)node.get(NODE_QUERY_UNIQUE_KEY);
- if (log.isLoggable(Level.FINER))
+ if (log.isLoggable(Level.FINER) && role != null)
{
log.finer(this.toString() + "Role query found in cache: role=" +
role);
}
@@ -1062,5 +1124,9 @@
public void invalidateRoleQueries(String ns)
{
cache.getRoot().removeChild(getFqn(ns, NODE_ROLE_QUERIES));
+ if (log.isLoggable(Level.FINER))
+ {
+ log.finer(this.toString() + "Invalidating Role queries. Namespace:" +
ns);
+ }
}
}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java 2009-11-04
22:30:01 UTC (rev 905)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java 2009-11-05
12:19:23 UTC (rev 906)
@@ -51,8 +51,6 @@
this.sessionContextMap = sessionContextMap;
}
-
-
public void close()
{
//TODO: close all sessions and put closed state?
Modified: idm/trunk/idm-testsuite/pom.xml
===================================================================
--- idm/trunk/idm-testsuite/pom.xml 2009-11-04 22:30:01 UTC (rev 905)
+++ idm/trunk/idm-testsuite/pom.xml 2009-11-05 12:19:23 UTC (rev 906)
@@ -172,6 +172,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
+ <useFile>true</useFile>
<systemProperties>
<property>
<name>dataSourceName</name>
@@ -189,6 +190,10 @@
<name>trustStorePassword</name>
<value>${trustStorePassword}</value>
</property>
+ <property>
+ <name>java.util.logging.config.file</name>
+ <value>../parent/logging.properties</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
Modified: idm/trunk/parent/logging.properties
===================================================================
--- idm/trunk/parent/logging.properties 2009-11-04 22:30:01 UTC (rev 905)
+++ idm/trunk/parent/logging.properties 2009-11-05 12:19:23 UTC (rev 906)
@@ -33,14 +33,15 @@
#myapp.business.level=CONFIG
#myapp.data.level=SEVERE
-org.jboss.identity.idm.level=FINER
+#org.jboss.identity.idm.level=FINE
+org.jboss.identity.idm.impl.cache.level=FINER
# Handlers
# -----------------------------------------
# --- ConsoleHandler ---
# Override of global logging level
-java.util.logging.ConsoleHandler.level=ALL
+java.util.logging.ConsoleHandler.level=FINER
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
# --- FileHandler ---