You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2014/11/25 19:39:18 UTC
[4/4] directory-fortress-core git commit: Removed all the warnings
associated with the lack of serialVersionUID (FC-24)
Removed all the warnings associated with the lack of serialVersionUID
(FC-24)
Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/083469b0
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/083469b0
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/083469b0
Branch: refs/heads/master
Commit: 083469b056955b5c3e2987c7f53bfc50ab0a674f
Parents: 9f28d20
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Tue Nov 25 19:38:51 2014 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Tue Nov 25 19:38:51 2014 +0100
----------------------------------------------------------------------
.../fortress/core/AuthorizationException.java | 9 +-
.../directory/fortress/core/BaseException.java | 37 +-
.../fortress/core/BaseRuntimeException.java | 57 +-
.../directory/fortress/core/CfgException.java | 13 +-
.../fortress/core/CfgRuntimeException.java | 15 +-
.../fortress/core/CreateException.java | 14 +-
.../fortress/core/FinderException.java | 14 +-
.../directory/fortress/core/GlobalErrIds.java | 3 +
.../fortress/core/PasswordException.java | 9 +-
.../fortress/core/RemoveException.java | 15 +-
.../directory/fortress/core/RestException.java | 12 +-
.../fortress/core/SecurityException.java | 13 +-
.../fortress/core/UpdateException.java | 15 +-
.../fortress/core/ValidationException.java | 11 +-
.../fortress/core/ant/AdminRoleAnt.java | 41 +-
.../fortress/core/ant/FortressAntTask.java | 77 +-
.../directory/fortress/core/ant/PermAnt.java | 16 +-
.../directory/fortress/core/ant/SDSetAnt.java | 27 +-
.../directory/fortress/core/ant/UserAnt.java | 127 ++-
.../directory/fortress/core/cfg/Config.java | 2 +-
.../fortress/core/cli/CmdLineParser.java | 11 +
.../core/cli/CommandLineInterpreter.java | 1049 +++++++++---------
.../directory/fortress/core/cli/Options.java | 3 +
.../core/ldap/ApacheDsDataProvider.java | 92 +-
.../core/ldap/LdapClientTrustStoreManager.java | 11 +
.../directory/fortress/core/rbac/AuthZ.java | 179 ++-
.../directory/fortress/core/rbac/Bind.java | 133 ++-
.../fortress/core/rbac/DSDChecker.java | 11 +-
.../fortress/core/rbac/GlobalPwMsgIds.java | 77 +-
.../directory/fortress/core/rbac/Mod.java | 66 +-
.../fortress/core/rbac/OrgUnitAnt.java | 20 +-
.../directory/fortress/core/rbac/PermP.java | 25 +-
.../fortress/core/rbac/Permission.java | 15 +-
.../directory/fortress/core/rbac/PolicyP.java | 51 +-
.../directory/fortress/core/rbac/Props.java | 38 +-
.../directory/fortress/core/rbac/PsoUtil.java | 19 +-
.../directory/fortress/core/rbac/SDSet.java | 89 +-
.../fortress/core/rbac/UserAdminRole.java | 2 +
.../directory/fortress/core/rbac/UserAudit.java | 71 +-
.../directory/fortress/core/rest/RestUtils.java | 2 +-
.../fortress/core/util/attr/VUtil.java | 4 +-
.../core/util/cache/CacheException.java | 15 +-
.../fortress/core/util/time/CUtil.java | 6 +-
.../fortress/core/rbac/FortressJUnitTest.java | 1 -
44 files changed, 1464 insertions(+), 1053 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/AuthorizationException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AuthorizationException.java b/src/main/java/org/apache/directory/fortress/core/AuthorizationException.java
index 7641bc5..c3fd515 100755
--- a/src/main/java/org/apache/directory/fortress/core/AuthorizationException.java
+++ b/src/main/java/org/apache/directory/fortress/core/AuthorizationException.java
@@ -28,15 +28,18 @@ package org.apache.directory.fortress.core;
*/
public class AuthorizationException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public AuthorizationException(int errorId, String msg)
+ public AuthorizationException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/BaseException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/BaseException.java b/src/main/java/org/apache/directory/fortress/core/BaseException.java
index 69d99af..4a4d5d2 100755
--- a/src/main/java/org/apache/directory/fortress/core/BaseException.java
+++ b/src/main/java/org/apache/directory/fortress/core/BaseException.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.fortress.core;
+
/**
* Base exception class for checked exceptions thrown. This class wraps {@code java.lang.Exception}. The BaseException
* class adds int attribute which stores the necessary error code as required by all checked exceptions in this system.
@@ -29,7 +30,11 @@ package org.apache.directory.fortress.core;
*/
public abstract class BaseException extends Exception implements StandardException
{
- private final int errorId;
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private final int errorId;
+
/**
* Create exception containing error code and message.
@@ -37,11 +42,12 @@ public abstract class BaseException extends Exception implements StandardExcepti
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- BaseException(int errorId, String msg)
- {
- super(msg);
- this.errorId = errorId;
- }
+ BaseException( int errorId, String msg )
+ {
+ super( msg );
+ this.errorId = errorId;
+ }
+
/**
* Create exception containing error code, message and previous exception.
@@ -50,19 +56,20 @@ public abstract class BaseException extends Exception implements StandardExcepti
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- BaseException(int errorId, String msg, Throwable previousException)
- {
- super(msg, previousException);
- this.errorId = errorId;
- }
+ BaseException( int errorId, String msg, Throwable previousException )
+ {
+ super( msg, previousException );
+ this.errorId = errorId;
+ }
+
/**
* Return the error id that is defined by this class {@link GlobalErrIds}.
*
* @return error id which is defined here {@link GlobalErrIds}. Valid values for Fortress error codes fall between 0 and 100_000.
*/
- public int getErrorId()
- {
- return errorId;
- }
+ public int getErrorId()
+ {
+ return errorId;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/BaseRuntimeException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/BaseRuntimeException.java b/src/main/java/org/apache/directory/fortress/core/BaseRuntimeException.java
index 106f7c7..951fb91 100755
--- a/src/main/java/org/apache/directory/fortress/core/BaseRuntimeException.java
+++ b/src/main/java/org/apache/directory/fortress/core/BaseRuntimeException.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.fortress.core;
+
/**
* Base runtime exception class for Fortress runtime exceptions.
* See the {@link GlobalErrIds} javadoc for list of error ids.
@@ -27,9 +28,12 @@ package org.apache.directory.fortress.core;
*/
public abstract class BaseRuntimeException extends RuntimeException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private final int errorId;
+ private final String[] msgParams;
- private final int errorId;
- private final String[] msgParams;
/**
*
@@ -37,47 +41,50 @@ public abstract class BaseRuntimeException extends RuntimeException
* @param msgParam contains message pertaining to exception.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- protected BaseRuntimeException(int errorId, String msgParam, Throwable previousException)
- {
- super(msgParam + ", errCode=" + errorId, previousException);
- this.errorId = errorId;
- this.msgParams = new String[1];
- this.msgParams[0] = msgParam;
- }
+ protected BaseRuntimeException( int errorId, String msgParam, Throwable previousException )
+ {
+ super( msgParam + ", errCode=" + errorId, previousException );
+ this.errorId = errorId;
+ this.msgParams = new String[1];
+ this.msgParams[0] = msgParam;
+ }
+
/**
*
* @param errorId int contains the error id which is defined here {@link GlobalErrIds}.
* @param msgParam contains message pertaining to exception.
*/
- protected BaseRuntimeException(int errorId, String msgParam)
- {
- super(msgParam + ", errCode=" + errorId);
- this.errorId = errorId;
- this.msgParams = new String[1];
- this.msgParams[0] = msgParam;
- }
+ protected BaseRuntimeException( int errorId, String msgParam )
+ {
+ super( msgParam + ", errCode=" + errorId );
+ this.errorId = errorId;
+ this.msgParams = new String[1];
+ this.msgParams[0] = msgParam;
+ }
+
/**
* Return the message for current exception.
*
* @return string contains the error message.
*/
- public String getMsg()
- {
+ public String getMsg()
+ {
String msg = null;
- if (this.msgParams != null)
+ if ( this.msgParams != null )
msg = this.msgParams[0];
- return msg;
- }
+ return msg;
+ }
+
/**
* Return the error id that is defined by this class {@link GlobalErrIds}.
*
* @return error id which is defined here {@link GlobalErrIds}.
*/
- public int getErrorId()
- {
- return errorId;
- }
+ public int getErrorId()
+ {
+ return errorId;
+ }
}
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/CfgException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/CfgException.java b/src/main/java/org/apache/directory/fortress/core/CfgException.java
index 3f45dc3..5aa8d0f 100755
--- a/src/main/java/org/apache/directory/fortress/core/CfgException.java
+++ b/src/main/java/org/apache/directory/fortress/core/CfgException.java
@@ -28,26 +28,29 @@ package org.apache.directory.fortress.core;
*/
public class CfgException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public CfgException(int errorId, String msg)
+ public CfgException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public CfgException(int errorId, String msg, Exception previousException)
+ public CfgException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/CfgRuntimeException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/CfgRuntimeException.java b/src/main/java/org/apache/directory/fortress/core/CfgRuntimeException.java
index 117d413..78739cf 100755
--- a/src/main/java/org/apache/directory/fortress/core/CfgRuntimeException.java
+++ b/src/main/java/org/apache/directory/fortress/core/CfgRuntimeException.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.fortress.core;
+
/**
* This exception extends {@link BaseRuntimeException} and is thrown when Fortress config startup failed.
* This is critical runtime exception and means system is inoperable due to a cfg error.
@@ -28,32 +29,38 @@ package org.apache.directory.fortress.core;
*/
public class CfgRuntimeException extends BaseRuntimeException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
private int subsystem;
private Exception exception;
private Object moreInfo;
+
/**
* Create exception with error id, message and related exception.
* @param errorId contains error code that is contained within {@link GlobalErrIds}
* @param newMsgText contains text related to the exception.
* @param newException contains related exception.
*/
- public CfgRuntimeException(int errorId, String newMsgText, Exception newException)
+ public CfgRuntimeException( int errorId, String newMsgText, Exception newException )
{
- super(errorId, newMsgText, newException);
+ super( errorId, newMsgText, newException );
this.exception = newException;
}
+
/**
* Create exception with error id and message.
* @param errorId contains error code that is contained within {@link GlobalErrIds}
* @param newMsgText contains text related to the exception.
*/
- public CfgRuntimeException(int errorId, String newMsgText)
+ public CfgRuntimeException( int errorId, String newMsgText )
{
- super(errorId, newMsgText);
+ super( errorId, newMsgText );
}
+
/**
* Get the exception object.
*
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/CreateException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/CreateException.java b/src/main/java/org/apache/directory/fortress/core/CreateException.java
index 3a8cadf..8127016 100755
--- a/src/main/java/org/apache/directory/fortress/core/CreateException.java
+++ b/src/main/java/org/apache/directory/fortress/core/CreateException.java
@@ -28,25 +28,29 @@ package org.apache.directory.fortress.core;
*/
public class CreateException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public CreateException(int errorId, String msg)
+ public CreateException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public CreateException(int errorId, String msg, Exception previousException)
+ public CreateException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/FinderException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/FinderException.java b/src/main/java/org/apache/directory/fortress/core/FinderException.java
index bafeba5..fa1f992 100755
--- a/src/main/java/org/apache/directory/fortress/core/FinderException.java
+++ b/src/main/java/org/apache/directory/fortress/core/FinderException.java
@@ -28,26 +28,30 @@ package org.apache.directory.fortress.core;
*/
public class FinderException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public FinderException(int errorId, String msg)
+ public FinderException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public FinderException(int errorId, String msg, Exception previousException)
+ public FinderException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/GlobalErrIds.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/GlobalErrIds.java b/src/main/java/org/apache/directory/fortress/core/GlobalErrIds.java
index bbafa03..552c315 100755
--- a/src/main/java/org/apache/directory/fortress/core/GlobalErrIds.java
+++ b/src/main/java/org/apache/directory/fortress/core/GlobalErrIds.java
@@ -40,6 +40,9 @@ package org.apache.directory.fortress.core;
*/
public class GlobalErrIds
{
+ /** Default value when we have no error */
+ public static final int NO_ERROR = 0;
+
/**
* Group 1 - Configuration Errors:
*/
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/PasswordException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/PasswordException.java b/src/main/java/org/apache/directory/fortress/core/PasswordException.java
index 4f7c44f..1d60fa8 100755
--- a/src/main/java/org/apache/directory/fortress/core/PasswordException.java
+++ b/src/main/java/org/apache/directory/fortress/core/PasswordException.java
@@ -28,15 +28,18 @@ package org.apache.directory.fortress.core;
*/
public class PasswordException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public PasswordException(int errorId, String msg)
+ public PasswordException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/RemoveException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/RemoveException.java b/src/main/java/org/apache/directory/fortress/core/RemoveException.java
index c16ca4f..e53f84c 100755
--- a/src/main/java/org/apache/directory/fortress/core/RemoveException.java
+++ b/src/main/java/org/apache/directory/fortress/core/RemoveException.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.fortress.core;
+
/**
* This exception extends {@link SecurityException} and is thrown when DAO cannot delete entity.
* See the {@link GlobalErrIds} javadoc for list of error ids.
@@ -27,26 +28,30 @@ package org.apache.directory.fortress.core;
*/
public class RemoveException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public RemoveException(int errorId, String msg)
+ public RemoveException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public RemoveException(int errorId, String msg, Exception previousException)
+ public RemoveException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/RestException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/RestException.java b/src/main/java/org/apache/directory/fortress/core/RestException.java
index e6b3a69..1274ed5 100644
--- a/src/main/java/org/apache/directory/fortress/core/RestException.java
+++ b/src/main/java/org/apache/directory/fortress/core/RestException.java
@@ -28,25 +28,29 @@ package org.apache.directory.fortress.core;
*/
public class RestException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public RestException(int errorId, String msg)
+ public RestException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public RestException(int errorId, String msg, Exception previousException)
+ public RestException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/SecurityException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/SecurityException.java b/src/main/java/org/apache/directory/fortress/core/SecurityException.java
index 4fb79d7..1b49922 100755
--- a/src/main/java/org/apache/directory/fortress/core/SecurityException.java
+++ b/src/main/java/org/apache/directory/fortress/core/SecurityException.java
@@ -19,6 +19,7 @@
*/
package org.apache.directory.fortress.core;
+
/**
* This exception is declared to be thrown by all APIs within Fortress Manager interfaces: ({@link AdminMgr}, {@link AccessMgr},
* {@link ReviewMgr},{@link PwPolicyMgr},{@link AuditMgr},{@link DelAdminMgr},
@@ -450,14 +451,18 @@ package org.apache.directory.fortress.core;
*/
public class SecurityException extends BaseException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create exception with error id and message.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public SecurityException(int errorId, String msg)
+ public SecurityException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
@@ -467,8 +472,8 @@ public class SecurityException extends BaseException
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public SecurityException(int errorId, String msg, Exception previousException)
+ public SecurityException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/UpdateException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/UpdateException.java b/src/main/java/org/apache/directory/fortress/core/UpdateException.java
index ffdfbb5..0db612f 100755
--- a/src/main/java/org/apache/directory/fortress/core/UpdateException.java
+++ b/src/main/java/org/apache/directory/fortress/core/UpdateException.java
@@ -19,7 +19,6 @@
*/
package org.apache.directory.fortress.core;
-import java.lang.*;
/**
* This exception extends {@link SecurityException} and is thrown when DAO cannot update entity.
@@ -29,26 +28,30 @@ import java.lang.*;
*/
public class UpdateException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public UpdateException(int errorId, String msg)
+ public UpdateException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
+
/**
* Create exception with error id, message and related exception.
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
* @param previousException contains reference to related exception which usually is system related, i.e. ldap.
*/
- public UpdateException(int errorId, String msg, Exception previousException)
+ public UpdateException( int errorId, String msg, Exception previousException )
{
- super(errorId, msg, previousException);
+ super( errorId, msg, previousException );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ValidationException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ValidationException.java b/src/main/java/org/apache/directory/fortress/core/ValidationException.java
index 6028ff6..a0e9ecf 100755
--- a/src/main/java/org/apache/directory/fortress/core/ValidationException.java
+++ b/src/main/java/org/apache/directory/fortress/core/ValidationException.java
@@ -20,8 +20,6 @@
package org.apache.directory.fortress.core;
-import java.lang.*;
-
/**
* This exception extends {@link SecurityException} and is thrown when Fortress cannot validate entity.
* See the {@link GlobalErrIds} javadoc for list of error ids.
@@ -30,15 +28,18 @@ import java.lang.*;
*/
public class ValidationException extends SecurityException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+
/**
* Create an exception with an error code that maps to {@link GlobalErrIds} and message text.
*
* @param errorId see {@link GlobalErrIds} for list of valid error codes that can be set. Valid values between 0 & 100_000.
* @param msg contains textual information including method of origin and description of the root cause.
*/
- public ValidationException(int errorId, String msg)
+ public ValidationException( int errorId, String msg )
{
- super(errorId, msg);
+ super( errorId, msg );
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ant/AdminRoleAnt.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/AdminRoleAnt.java b/src/main/java/org/apache/directory/fortress/core/ant/AdminRoleAnt.java
index ac2438d..17779f8 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/AdminRoleAnt.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/AdminRoleAnt.java
@@ -24,6 +24,7 @@ import org.apache.directory.fortress.core.rbac.AdminRole;
import java.util.StringTokenizer;
+
/**
* Entity is used by custom Apache Ant task for special handling of collections. This is necessary because the
* Ant parser cannot deal with complex data attribute types.
@@ -32,9 +33,12 @@ import java.util.StringTokenizer;
*/
public class AdminRoleAnt extends AdminRole
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private String osPs;
private String osUs;
+
/**
* Default constructor required for all Ant entities.
*
@@ -45,35 +49,38 @@ public class AdminRoleAnt extends AdminRole
return osPs;
}
+
/**
* Set the list of Perm OUs as a comma delimited string. This method will convert from that format to
* the AdminRole native format which is collection of Strings.
*
* @param osPs
*/
- public void setOSPs(String osPs)
+ public void setOSPs( String osPs )
{
this.osPs = osPs;
- if (osPs != null)
+ if ( osPs != null )
{
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(osPs, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( osPs, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String osP = tkn.nextToken();
- setOsP(osP); /**
- * Set the list of Perm OUs as a comma delimited string. This method will convert from that format to
- * the AdminRole native format which is collection of Strings.
- * @param osPs
- */
+ setOsP( osP );
+ /**
+ * Set the list of Perm OUs as a comma delimited string. This method will convert from that format to
+ * the AdminRole native format which is collection of Strings.
+ * @param osPs
+ */
}
}
}
}
+
/**
* Return the comma delimited OU string.
*
@@ -84,27 +91,27 @@ public class AdminRoleAnt extends AdminRole
return osUs;
}
+
/**
* Load an OU into the collection of OUs stored by collection.
*
* @param osUs contains OU name.
*/
- public void setOSUs(String osUs)
+ public void setOSUs( String osUs )
{
this.osUs = osUs;
- if (osUs != null)
+ if ( osUs != null )
{
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(osUs, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( osUs, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String osU = tkn.nextToken();
- setOsU(osU);
+ setOsU( osU );
}
}
}
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java b/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
index cadc175..fcf19bd 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/FortressAntTask.java
@@ -704,6 +704,7 @@ public class FortressAntTask extends Task implements InputHandler
this.deluseradminroles.add( deluserrole );
}
+
/**
* Load the entity with data.
*
@@ -774,9 +775,9 @@ public class FortressAntTask extends Task implements InputHandler
* @param list
* @return boolean
*/
- private boolean isListNotNull( List list )
+ private boolean isListNotNull( List<?> list )
{
- return ( list != null && list.size() > 0 );
+ return ( ( list != null ) && ( list.size() > 0 ) );
}
@@ -1009,7 +1010,7 @@ public class FortressAntTask extends Task implements InputHandler
try
{
String testClassName = Config.getProperty( getTaskName() );
- if(!VUtil.isNotNullOrEmpty( testClassName ))
+ if ( !VUtil.isNotNullOrEmpty( testClassName ) )
{
testClassName = "org.apache.directory.fortress.core.rbac.FortressAntLoadTest";
}
@@ -1038,7 +1039,7 @@ public class FortressAntTask extends Task implements InputHandler
for ( UserAnt user : users )
{
- LOG.info( "addUsers userid={} description={} orgUnit={}",
+ LOG.info( "addUsers userid={} description={} orgUnit={}",
user.getUserId(), user.getDescription(), user.getOu() );
try
{
@@ -1090,7 +1091,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "addUsers userId [{}] caught SecurityException={}", user.getUserId(), se );
+ LOG.warn( "addUsers userId [{}] caught SecurityException={}", user.getUserId(), se );
}
}
}
@@ -1121,6 +1122,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1133,7 +1135,7 @@ public class FortressAntTask extends Task implements InputHandler
for ( Group group : groups )
{
- LOG.info( "addGroups name={} description={}", group.getName(), group.getDescription());
+ LOG.info( "addGroups name={} description={}", group.getName(), group.getDescription() );
try
{
groupMgr.add( group );
@@ -1146,6 +1148,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1170,6 +1173,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1183,9 +1187,9 @@ public class FortressAntTask extends Task implements InputHandler
for ( Group group : groups )
{
List<String> members = group.getMembers();
- if(VUtil.isNotNullOrEmpty( members ))
+ if ( VUtil.isNotNullOrEmpty( members ) )
{
- for( String member : members )
+ for ( String member : members )
{
LOG.info( "addGroupMembers name={}, member={}", group.getName(), member );
try
@@ -1194,7 +1198,8 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "addGroupMembers name [{}], member [{}] caught SecurityException={}", group.getName(), member, se );
+ LOG.warn( "addGroupMembers name [{}], member [{}] caught SecurityException={}",
+ group.getName(), member, se );
}
}
}
@@ -1206,6 +1211,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1217,9 +1223,9 @@ public class FortressAntTask extends Task implements InputHandler
List<Group> groups = delgroupmember.getGroups();
for ( Group group : groups )
{
- if(VUtil.isNotNullOrEmpty( group.getMembers() ))
+ if ( VUtil.isNotNullOrEmpty( group.getMembers() ) )
{
- for(String member : group.getMembers())
+ for ( String member : group.getMembers() )
{
LOG.info( "deleteGroupmembers name={}, member={}", group.getName(), member );
try
@@ -1228,7 +1234,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "deleteGroupmembers name [{}], member [{}] caught SecurityException={}",
+ LOG.warn( "deleteGroupmembers name [{}], member [{}] caught SecurityException={}",
group.getName(), member, se );
}
}
@@ -1241,6 +1247,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1252,9 +1259,9 @@ public class FortressAntTask extends Task implements InputHandler
List<Group> groups = addgroupproperty.getGroups();
for ( Group group : groups )
{
- if(VUtil.isNotNullOrEmpty( group.getProperties() ))
+ if ( VUtil.isNotNullOrEmpty( group.getProperties() ) )
{
- for ( Enumeration e = group.getProperties().propertyNames(); e.hasMoreElements(); )
+ for ( Enumeration<?> e = group.getProperties().propertyNames(); e.hasMoreElements(); )
{
// This LDAP attr is stored as a name-value pair separated by a ':'.
String key = ( String ) e.nextElement();
@@ -1265,7 +1272,8 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "addGroupProperties name [{}], key [{}], value [{}] caught SecurityException={}", group.getName(), key, val, se );
+ LOG.warn( "addGroupProperties name [{}], key [{}], value [{}] caught SecurityException={}",
+ group.getName(), key, val, se );
}
}
}
@@ -1277,6 +1285,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1288,9 +1297,9 @@ public class FortressAntTask extends Task implements InputHandler
List<Group> groups = delgroupproperty.getGroups();
for ( Group group : groups )
{
- if(VUtil.isNotNullOrEmpty( group.getProperties() ))
+ if ( VUtil.isNotNullOrEmpty( group.getProperties() ) )
{
- for ( Enumeration e = group.getProperties().propertyNames(); e.hasMoreElements(); )
+ for ( Enumeration<?> e = group.getProperties().propertyNames(); e.hasMoreElements(); )
{
// This LDAP attr is stored as a name-value pair separated by a ':'.
String key = ( String ) e.nextElement();
@@ -1301,7 +1310,8 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "deleteGroupProperties name [{}], key [{}], value [{}] caught SecurityException={}",
+ LOG.warn(
+ "deleteGroupProperties name [{}], key [{}], value [{}] caught SecurityException={}",
group.getName(), key, val, se );
}
}
@@ -1314,6 +1324,7 @@ public class FortressAntTask extends Task implements InputHandler
}
}
+
/**
* @throws BuildException
*/
@@ -1450,11 +1461,11 @@ public class FortressAntTask extends Task implements InputHandler
try
{
adminMgr.addInheritance( new Role( relationship.getParent() ), new Role( relationship.getChild()
- ) );
+ ) );
}
catch ( SecurityException se )
{
- LOG.warn( "addRoleInheritances parent [{}] child [{}] caught SecurityException={}",
+ LOG.warn( "addRoleInheritances parent [{}] child [{}] caught SecurityException={}",
relationship.getParent(), relationship.getChild(), se );
}
}
@@ -1473,7 +1484,8 @@ public class FortressAntTask extends Task implements InputHandler
List<Relationship> roles = delroleinheritance.getRelationships();
for ( Relationship relationship : roles )
{
- LOG.info( "deleteRoleInheritances parent={} child={}", relationship.getParent(), relationship.getChild() );
+ LOG.info( "deleteRoleInheritances parent={} child={}", relationship.getParent(),
+ relationship.getChild() );
try
{
adminMgr.deleteInheritance( new Role( relationship.getParent() ),
@@ -1547,7 +1559,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "deleteSdsets name [{}] caught SecurityException={}", sd.getName(), se );
+ LOG.warn( "deleteSdsets name [{}] caught SecurityException={}", sd.getName(), se );
}
}
}
@@ -1565,7 +1577,7 @@ public class FortressAntTask extends Task implements InputHandler
List<PermObj> permObjs = addpermObj.getPermObjs();
for ( PermObj permObj : permObjs )
{
- LOG.info( "addPermObjs objName={} description={} orgUnit={} type={}",
+ LOG.info( "addPermObjs objName={} description={} orgUnit={} type={}",
permObj.getObjName(), permObj.getDescription(), permObj.getOu(), permObj.getType() );
try
{
@@ -1617,7 +1629,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "deletePermObjs name [{}] caught SecurityException={}", permObj.getObjName(), se );
+ LOG.warn( "deletePermObjs name [{}] caught SecurityException={}", permObj.getObjName(), se );
}
}
}
@@ -1635,7 +1647,7 @@ public class FortressAntTask extends Task implements InputHandler
List<PermAnt> permissions = addpermOp.getPermOps();
for ( PermAnt permission : permissions )
{
- LOG.info( "addPermOps name={} objName={}", permission.getOpName() , permission.getObjName() );
+ LOG.info( "addPermOps name={} objName={}", permission.getOpName(), permission.getObjName() );
try
{
try
@@ -1685,7 +1697,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "deletePermOps name [{}] objName[{}] caught SecurityException={}",
+ LOG.warn( "deletePermOps name [{}] objName[{}] caught SecurityException={}",
permission.getOpName(), permission.getObjName(), se );
}
}
@@ -1859,7 +1871,7 @@ public class FortressAntTask extends Task implements InputHandler
}
catch ( SecurityException se )
{
- LOG.warn( "addContainers name [{}] caught SecurityException={}", ou.getName(), se );
+ LOG.warn( "addContainers name [{}] caught SecurityException={}", ou.getName(), se );
}
}
}
@@ -2169,7 +2181,7 @@ public class FortressAntTask extends Task implements InputHandler
List<Relationship> roles = addadminroleinheritance.getRelationships();
for ( Relationship relationship : roles )
{
- LOG.info( "addAdminRoleInheritances parent={} child={}",
+ LOG.info( "addAdminRoleInheritances parent={} child={}",
relationship.getParent(), relationship.getChild() );
try
{
@@ -2382,46 +2394,55 @@ public class FortressAntTask extends Task implements InputHandler
return props;
}
+
public List<AddpermOp> getAddpermOps()
{
return addpermOps;
}
+
public List<AddpermObj> getAddpermObjs()
{
return addpermObjs;
}
+
public List<Adduser> getAddusers()
{
return addusers;
}
+
public List<Adduserrole> getAdduserroles()
{
return adduserroles;
}
+
public List<Addrole> getAddroles()
{
return addroles;
}
+
public List<Addsdset> getAddsdsets()
{
return addsdsets;
}
+
public List<Addroleinheritance> getAddroleinheritances()
{
return addroleinheritances;
}
+
public List<AddpermGrant> getAddpermGrants()
{
return addpermGrants;
}
+
public List<Addgroup> getAddgroups()
{
return addgroups;
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ant/PermAnt.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/PermAnt.java b/src/main/java/org/apache/directory/fortress/core/ant/PermAnt.java
index c865deb..1f17fa5 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/PermAnt.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/PermAnt.java
@@ -24,6 +24,7 @@ import org.apache.directory.fortress.core.rbac.Permission;
import java.util.StringTokenizer;
+
/**
* Entity is used by custom Apache Ant task for special handling of collections. This is necessary because the
* Ant parser cannot deal with complex data attribute types. The class extends a base entity.
@@ -32,8 +33,11 @@ import java.util.StringTokenizer;
*/
public class PermAnt extends Permission
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private String antRoles;
+
/**
* Return the roles as a String.
*
@@ -44,25 +48,25 @@ public class PermAnt extends Permission
return antRoles;
}
+
/**
* Accept a comma delimited String containing a list of Roles to be granted to a permission. This function
* will parse the String and call the setter on its parent.
*
* @param antRoles contains a comma delimited set of role names.
*/
- public void setAntRoles(String antRoles)
+ public void setAntRoles( String antRoles )
{
this.antRoles = antRoles;
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(antRoles, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( antRoles, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String rTkn = tkn.nextToken();
- setRole(rTkn);
+ setRole( rTkn );
}
}
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ant/SDSetAnt.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/SDSetAnt.java b/src/main/java/org/apache/directory/fortress/core/ant/SDSetAnt.java
index c9dbda9..0e30af3 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/SDSetAnt.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/SDSetAnt.java
@@ -24,6 +24,7 @@ import org.apache.directory.fortress.core.rbac.SDSet;
import java.util.StringTokenizer;
+
/**
* Entity is used by custom Apache Ant task for special handling of collections. This is necessary because the
* Ant parser cannot deal with complex data attribute types. The class extends a base entity.
@@ -32,9 +33,12 @@ import java.util.StringTokenizer;
*/
public class SDSetAnt extends SDSet
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private String type;
private String members;
+
/**
* Return the members as a String.
*
@@ -45,23 +49,24 @@ public class SDSetAnt extends SDSet
return members;
}
+
/**
* Accept a comma delimited list of members, iterate of each and call the setter on the parent class.
*
* @param members contains comma delimited set of members.
*/
- public void setSetMembers(String members)
+ public void setSetMembers( String members )
{
this.members = members;
- if (members != null)
+ if ( members != null )
{
- StringTokenizer tkn = new StringTokenizer(members, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( members, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String member = tkn.nextToken();
- addMember(member);
+ addMember( member );
}
}
}
@@ -78,22 +83,22 @@ public class SDSetAnt extends SDSet
return type;
}
+
/**
* Method accepts a String variable that maps to its parent's set type.
*
* @param type String value represents static or dynamic set relations.
*/
- public void setSetType(String type)
+ public void setSetType( String type )
{
this.type = type;
- if (type != null && type.equals("DYNAMIC"))
+ if ( type != null && type.equals( "DYNAMIC" ) )
{
- setType(SDSet.SDType.DYNAMIC);
+ setType( SDSet.SDType.DYNAMIC );
}
else
{
- setType(SDSet.SDType.STATIC);
+ setType( SDSet.SDType.STATIC );
}
}
}
-
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java b/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
index b75775a..6c9aaa2 100755
--- a/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
+++ b/src/main/java/org/apache/directory/fortress/core/ant/UserAnt.java
@@ -33,6 +33,7 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.util.StringTokenizer;
+
/**
* Entity is used by custom Apache Ant task for special handling of collections. This is necessary because the
* Ant parser cannot deal with complex data attribute types. The class extends a base entity.
@@ -41,6 +42,8 @@ import java.util.StringTokenizer;
*/
public class UserAnt extends User
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private String userProps;
private String email;
private String phone;
@@ -57,115 +60,135 @@ public class UserAnt extends User
private static final String CLS_NM = UserAnt.class.getName();
private static final Logger LOG = LoggerFactory.getLogger( CLS_NM );
+
public String getAddresses()
{
return addresses;
}
- public void setAddresses(String addresses)
+
+ public void setAddresses( String addresses )
{
this.addresses = addresses;
- // allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(addresses, ",");
- if (tkn.countTokens() > 0)
- {
- while (tkn.hasMoreTokens())
- {
- String aTkn = tkn.nextToken();
- getAddress().setAddress(aTkn);
- }
- }
+ // allow the setter to process comma delimited strings:
+ StringTokenizer tkn = new StringTokenizer( addresses, "," );
+ if ( tkn.countTokens() > 0 )
+ {
+ while ( tkn.hasMoreTokens() )
+ {
+ String aTkn = tkn.nextToken();
+ getAddress().setAddress( aTkn );
+ }
+ }
}
+
public String getUserProps()
{
return userProps;
}
+
public void setUserProps( String userProps )
{
this.userProps = userProps;
- addProperties(AttrHelper.getProperties(userProps));
+ addProperties( AttrHelper.getProperties( userProps ) );
}
+
public String getPostalCode()
{
return postalCode;
}
- public void setPostalCode(String postalCode)
+
+ public void setPostalCode( String postalCode )
{
- getAddress().setPostalCode(postalCode);
+ getAddress().setPostalCode( postalCode );
}
+
public String getPostOfficeBox()
{
return postOfficeBox;
}
- public void setPostOfficeBox(String postOfficeBox)
+
+ public void setPostOfficeBox( String postOfficeBox )
{
- getAddress().setPostOfficeBox(postOfficeBox);
+ getAddress().setPostOfficeBox( postOfficeBox );
}
+
public String getBuilding()
{
return building;
}
- public void setBuilding(String building)
+
+ public void setBuilding( String building )
{
- getAddress().setBuilding(building);
+ getAddress().setBuilding( building );
}
+
public String getDepartmentNumber()
{
return departmentNumber;
}
- public void setDepartmentNumber(String departmentNumber)
+
+ public void setDepartmentNumber( String departmentNumber )
{
- getAddress().setDepartmentNumber(departmentNumber);
+ getAddress().setDepartmentNumber( departmentNumber );
}
+
public String getRoomNumber()
{
return roomNumber;
}
- public void setRoomNumber(String roomNumber)
+
+ public void setRoomNumber( String roomNumber )
{
- getAddress().setRoomNumber(roomNumber);
+ getAddress().setRoomNumber( roomNumber );
}
+
public String getCity()
{
return city;
}
- public void setCity(String city)
+
+ public void setCity( String city )
{
- getAddress().setCity(city);
+ getAddress().setCity( city );
}
+
public String getState()
{
return state;
}
- public void setState(String state)
+
+ public void setState( String state )
{
- getAddress().setState(state);
+ getAddress().setState( state );
}
+
public String getCountry()
{
return country;
}
- public void setCountry(String country)
+
+ public void setCountry( String country )
{
- getAddress().setCountry(country);
+ getAddress().setCountry( country );
}
private String country;
@@ -177,89 +200,98 @@ public class UserAnt extends User
*
* @param password String format will be converted to char[].
*/
- public void setPassword(String password)
+ public void setPassword( String password )
{
- super.setPassword(password.toCharArray());
+ super.setPassword( password.toCharArray() );
}
+
public String getPhone()
{
return phone;
}
- public void setPhone(String phone)
+
+ public void setPhone( String phone )
{
this.phone = phone;
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(phone, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( phone, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String pTkn = tkn.nextToken();
- getPhones().add(pTkn);
+ getPhones().add( pTkn );
}
}
}
+
public String getEmail()
{
return email;
}
- public void setEmail(String email)
+
+ public void setEmail( String email )
{
this.email = email;
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(email, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( email, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String eTkn = tkn.nextToken();
- getEmails().add(eTkn);
+ getEmails().add( eTkn );
}
}
}
+
public String getMobile()
{
return mobile;
}
- public void setMobile(String mobile)
+
+ public void setMobile( String mobile )
{
this.mobile = mobile;
// allow the setter to process comma delimited strings:
- StringTokenizer tkn = new StringTokenizer(mobile, ",");
- if (tkn.countTokens() > 0)
+ StringTokenizer tkn = new StringTokenizer( mobile, "," );
+ if ( tkn.countTokens() > 0 )
{
- while (tkn.hasMoreTokens())
+ while ( tkn.hasMoreTokens() )
{
String pTkn = tkn.nextToken();
- getMobiles().add(pTkn);
+ getMobiles().add( pTkn );
}
}
}
+
public String getPhoto()
{
return photo;
}
+
public void setPhoto( String photo )
{
this.photo = photo;
- if( VUtil.isNotNullOrEmpty( photo ))
+ if ( VUtil.isNotNullOrEmpty( photo ) )
{
byte[] jpeg = getJpegPhoto( photo );
- if( VUtil.isNotNullOrEmpty( jpeg ))
+ if ( VUtil.isNotNullOrEmpty( jpeg ) )
{
setJpegPhoto( jpeg );
}
}
}
+
private static byte[] getJpegPhoto( String fileName )
{
byte[] value = null;
@@ -275,6 +307,7 @@ public class UserAnt extends User
return value;
}
+
public static byte[] readJpegFile( String fileName )
{
URL fUrl = UserAnt.class.getClassLoader().getResource( fileName );
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/cfg/Config.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/cfg/Config.java b/src/main/java/org/apache/directory/fortress/core/cfg/Config.java
index 7b98223..e559b5d 100755
--- a/src/main/java/org/apache/directory/fortress/core/cfg/Config.java
+++ b/src/main/java/org/apache/directory/fortress/core/cfg/Config.java
@@ -92,7 +92,7 @@ public class Config
Properties props = getRemoteConfig( realmName );
if ( props != null )
{
- for ( Enumeration e = props.propertyNames(); e.hasMoreElements(); )
+ for ( Enumeration<?> e = props.propertyNames(); e.hasMoreElements(); )
{
String key = ( String ) e.nextElement();
String val = props.getProperty( key );
http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/083469b0/src/main/java/org/apache/directory/fortress/core/cli/CmdLineParser.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/cli/CmdLineParser.java b/src/main/java/org/apache/directory/fortress/core/cli/CmdLineParser.java
index 8be4a45..9bab2cd 100755
--- a/src/main/java/org/apache/directory/fortress/core/cli/CmdLineParser.java
+++ b/src/main/java/org/apache/directory/fortress/core/cli/CmdLineParser.java
@@ -55,6 +55,8 @@ public class CmdLineParser
*/
public static abstract class OptionException extends Exception
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
OptionException( String msg )
{
super( msg );
@@ -69,6 +71,8 @@ public class CmdLineParser
*/
public static class UnknownOptionException extends OptionException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
UnknownOptionException( String optionName )
{
this( optionName, "Unknown option '" + optionName + "'" );
@@ -101,6 +105,8 @@ public class CmdLineParser
*/
public static class UnknownSuboptionException extends UnknownOptionException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private final char suboption;
UnknownSuboptionException( String option, char suboption )
@@ -125,6 +131,8 @@ public class CmdLineParser
*/
public static class NotFlagException extends UnknownOptionException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
private final char notflag;
NotFlagException( String option, char unflaggish )
@@ -151,6 +159,9 @@ public class CmdLineParser
*/
public static class IllegalOptionValueException extends OptionException
{
+ /** Default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
public IllegalOptionValueException( Option opt, String value )
{
super( "Illegal value '" + value + "' for option " +