Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Commit

Permalink
Fixing findbugs issues with wso2 parent pom 5
Browse files Browse the repository at this point in the history
  • Loading branch information
madurangasiriwardena committed Nov 29, 2016
1 parent 166e9da commit e12a308
Show file tree
Hide file tree
Showing 70 changed files with 1,317 additions and 1,291 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
*.class
*.iml
*.ipr
*.iws
.idea
.DS_Store

# Mobile Tools for Java (J2ME)
.mtj.tmp/
Expand All @@ -10,3 +15,5 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

target/
36 changes: 23 additions & 13 deletions components/org.wso2.carbon.identity.common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you 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
~ 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
~ 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.
~ 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.
-->

<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">
Expand All @@ -28,7 +26,7 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.commons</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Identity Common</name>
<description>
This is a Carbon bundle that represents the Identity Common module.
Expand Down Expand Up @@ -93,4 +91,16 @@
</plugins>
</build-->

<properties>
<private.package>org.wso2.carbon.identity.common.internal</private.package>
<export.package>
!org.wso2.carbon.identity.common.internal,
org.wso2.carbon.identity.common.*; version="${identity.base.package.export.version}"
</export.package>
<import.package>
org.slf4j.*; version="${slf4j.package.import.version}",
</import.package>
<dynamic.import.package>*</dynamic.import.package>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) 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.
Expand All @@ -16,16 +16,16 @@

package org.wso2.carbon.identity.common.base;

/**
* Identity common constants.
*/
public class Constants {

private Constants() {
}

public static final String CLOCK_SKEW_DEFAULT = "300";
public static final String IP_UNKNOWN = "unknown";
public static final String WSO2CARBON_CLAIM_DIALECT = "http://wso2.org/claims";
public final static String CLAIM_TENANT_DOMAIN = "http://wso2.org/claims/tenant";
public final static String SELF_SIGNUP_ROLE = "selfsignup";
public static final String CLAIM_TENANT_DOMAIN = "http://wso2.org/claims/tenant";
public static final String SELF_SIGNUP_ROLE = "selfsignup";
public static final String CASE_INSENSITIVE_USERNAME = "CaseInsensitiveUsername";
public static final int HTTPS_PORT_DEFAULT = 443;
public static final String IDENTITY_CONFIG = "identity.xml";
Expand All @@ -40,50 +40,81 @@ private Constants() {
public static final String RANDOM_PHRASE_PREFIX = "random-password-generated!@#$%^&*(0)+_";
public static final String HMAC_SHA1 = "HmacSHA1";
public static final String NULL = "null";
// HTTP headers which may contain IP address of the client in the order of priority
public static final String[] HEADERS_WITH_IP = {
"X-Forwarded-For",
"Proxy-Client-IP",
"WL-Proxy-Client-IP",
"HTTP_X_FORWARDED_FOR",
"HTTP_X_FORWARDED",
"HTTP_X_CLUSTER_CLIENT_IP",
"HTTP_CLIENT_IP",
"HTTP_FORWARDED_FOR",
"HTTP_FORWARDED",
"HTTP_VIA",
"REMOTE_ADDR"
};

private Constants() {
}

/**
* Server configuration.
*/
public static class ServerConfig {

// Interceptor Config attributes
// Server Synchronization Tolerance Config
public static final String CLOCK_SKEW = "ClockSkew";
public static final String PROXY_CONTEXT_PATH = "ProxyContextPath";
public static final String WEB_CONTEXT_ROOT = "WebContextRoot";

/**
* Interceptor Config attributes
*/
public static class Interceptor {
public final static String ROOT = "Interceptors";
public final static String INTERCEPTOR = "Interceptor";
public final static String TYPE = "type";
public final static String NAME = "name";
public final static String ORDER = "order";
public final static String ENABLE = "enable";
public final static String PROPERTY = "Property";
public final static String PROPERTY_NAME = "name";
public static final String ROOT = "Interceptors";
public static final String INTERCEPTOR = "Interceptor";
public static final String TYPE = "type";
public static final String NAME = "name";
public static final String ORDER = "order";
public static final String ENABLE = "enable";
public static final String PROPERTY = "Property";
public static final String PROPERTY_NAME = "name";
}

// Cache Config attributes
/**
* Cache Config attributes
*/
public static class Cache {
public final static String ROOT = "CacheConfig";
public final static String MANAGER = "CacheManager";
public final static String MANAGER_NAME = "name";
public final static String CACHE = "Cache";
public final static String NAME = "name";
public final static String ENABLE = "enable";
public final static String TIMEOUT = "timeout";
public final static String CAPACITY = "capacity";
public static final String ROOT = "CacheConfig";
public static final String MANAGER = "CacheManager";
public static final String MANAGER_NAME = "name";
public static final String CACHE = "Cache";
public static final String NAME = "name";
public static final String ENABLE = "enable";
public static final String TIMEOUT = "timeout";
public static final String CAPACITY = "capacity";
}

// Cookie Config attributes
/**
* Cookie Config attributes
*/
public static class Cookie {
public final static String ROOT = "Cookies";
public final static String COOKIE = "Cookie";
public final static String NAME = "name";
public final static String DOMAIN = "domain";
public final static String COMMENT = "comment";
public final static String VERSION = "version";
public final static String PATH = "path";
public final static String MAX_AGE = "maxAge";
public final static String SECURE = "secure";
public final static String HTTP_ONLY = "httpOnly";
public static final String ROOT = "Cookies";
public static final String COOKIE = "Cookie";
public static final String NAME = "name";
public static final String DOMAIN = "domain";
public static final String COMMENT = "comment";
public static final String VERSION = "version";
public static final String PATH = "path";
public static final String MAX_AGE = "maxAge";
public static final String SECURE = "secure";
public static final String HTTP_ONLY = "httpOnly";
}

// Server Synchronization Tolerance Config
public static final String CLOCK_SKEW = "ClockSkew";

/**
* Carbon place holders
*/
public static class CarbonPlaceholders {

public static final String CARBON_HOST = "${carbon.host}";
Expand All @@ -99,6 +130,9 @@ public static class CarbonPlaceholders {
public static final String CARBON_PORT_HTTPS_PROPERTY = "mgt.transport.https.port";
}

/**
* Config elements.
*/
public static class ConfigElements {

public static final String PROPERTIES = "Properties";
Expand All @@ -114,29 +148,16 @@ private ConfigElements() {

}

public static final String PROXY_CONTEXT_PATH = "ProxyContextPath";
public static final String WEB_CONTEXT_ROOT = "WebContextRoot";

}

// HTTP headers which may contain IP address of the client in the order of priority
public static final String[] HEADERS_WITH_IP = {
"X-Forwarded-For",
"Proxy-Client-IP",
"WL-Proxy-Client-IP",
"HTTP_X_FORWARDED_FOR",
"HTTP_X_FORWARDED",
"HTTP_X_CLUSTER_CLIENT_IP",
"HTTP_CLIENT_IP",
"HTTP_FORWARDED_FOR",
"HTTP_FORWARDED",
"HTTP_VIA",
"REMOTE_ADDR"
};


/**
* XML
*/
public static class XML {

/**
* Signature algorithms.
*/
public static class SignatureAlgorithm {
public static final String DSA_SHA1 = "DSA with SHA1";
public static final String ECDSA_SHA1 = "ECDSA with SHA1";
Expand All @@ -151,6 +172,9 @@ public static class SignatureAlgorithm {
public static final String RSA_SHA512 = "RSA with SHA512";
}

/**
* Signature algorithm URIs.
*/
public static class SignatureAlgorithmURI {
public static final String DSA_SHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1";
public static final String ECDSA_SHA1 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1";
Expand All @@ -165,6 +189,9 @@ public static class SignatureAlgorithmURI {
public static final String RSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
}

/**
* Digest algorithm.
*/
public static class DigestAlgorithm {
public static final String MD5 = "MD5";
public static final String RIPEMD160 = "RIPEMD160";
Expand All @@ -174,6 +201,9 @@ public static class DigestAlgorithm {
public static final String SHA512 = "SHA512";
}

/**
* Digest algorithm URIs.
*/
public static class DigestAlgorithmURI {
public static final String MD5 = "http://www.w3.org/2001/04/xmldsig-more#md5";
public static final String RIPEMD160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* 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.
* 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 org.wso2.carbon.identity.common.base.cache;

import org.apache.commons.lang3.StringUtils;
import org.wso2.carbon.identity.common.util.IdentityUtils;
import org.wso2.carbon.identity.common.internal.handler.HandlerConfig;
import org.wso2.carbon.identity.common.internal.handler.HandlerConfigKey;
import org.wso2.carbon.identity.common.util.IdentityUtils;

import javax.cache.event.CacheEntryListener;

/**
* Abstract Cache Entry Listener.
* @param <K>
* @param <V>
*/
public abstract class AbstractCacheEntryListener<K, V> implements CacheEntryListener<K, V> {

/**
Expand Down
Loading

0 comments on commit e12a308

Please sign in to comment.