Author: anil.saldhana(a)jboss.com
Date: 2009-05-23 00:50:19 -0400 (Sat, 23 May 2009)
New Revision: 517
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyConfigurationException.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyProcessingException.java
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/util/JNDIUtilUnitTestCase.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/exceptions/ProcessingException.java
Log:
JBID-111: generic exception throwing cleaned up
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyConfigurationException.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyConfigurationException.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyConfigurationException.java 2009-05-23
04:50:19 UTC (rev 517)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.bindings.interfaces;
+
+import org.jboss.identity.federation.core.exceptions.ConfigurationException;
+
+/**
+ * ConfigurationException in the TrustKeyManager
+ * @author Anil.Saldhana(a)redhat.com
+ * @since May 22, 2009
+ */
+public class TrustKeyConfigurationException extends ConfigurationException
+{
+ private static final long serialVersionUID = 1L;
+
+ public TrustKeyConfigurationException()
+ {
+ super();
+ }
+
+ public TrustKeyConfigurationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public TrustKeyConfigurationException(String message)
+ {
+ super(message);
+ }
+
+ public TrustKeyConfigurationException(Throwable cause)
+ {
+ super(cause);
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyProcessingException.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyProcessingException.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyProcessingException.java 2009-05-23
04:50:19 UTC (rev 517)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.bindings.interfaces;
+
+import org.jboss.identity.federation.core.exceptions.ProcessingException;
+
+/**
+ * Processing Exception in the trust key manager
+ * @author Anil.Saldhana(a)redhat.com
+ * @since May 22, 2009
+ */
+public class TrustKeyProcessingException extends ProcessingException
+{
+ private static final long serialVersionUID = 1L;
+
+ public TrustKeyProcessingException()
+ {
+ super();
+ }
+
+ public TrustKeyProcessingException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public TrustKeyProcessingException(String message)
+ {
+ super(message);
+ }
+
+ public TrustKeyProcessingException(Throwable cause)
+ {
+ super(cause);
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/util/JNDIUtilUnitTestCase.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/util/JNDIUtilUnitTestCase.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/util/JNDIUtilUnitTestCase.java 2009-05-23
04:50:19 UTC (rev 517)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.identity.federation.bindings.util;
+
+import junit.framework.TestCase;
+
+
+/**
+ * JNDI Util test case
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 27, 2009
+ */
+public class JNDIUtilUnitTestCase extends TestCase
+{
+ @SuppressWarnings("unchecked")
+ public void testJNDIConnection() throws Exception
+ {
+ /*Hashtable env = new Hashtable();
+
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, "ldap://localhost:389");
+ env.put(Context.SECURITY_AUTHENTICATION,"simple");
+ env.put(Context.SECURITY_PRINCIPAL,"cn=Manager,dc=jboss,dc=org");
+ env.put(Context.SECURITY_CREDENTIALS,"test");
+ DirContext ctx = new InitialDirContext(env);
+
+ //Read stuff
+ Object obj = ctx.lookup("ou=identity,dc=jboss,dc=org");
+ assertNotNull("Obj is not null", obj);
+ assertTrue(obj instanceof LdapContext);
+
+ obj = ctx.lookup("ou=idp,ou=identity,dc=jboss,dc=org");
+ assertNotNull("Obj is not null", obj);
+ assertTrue(obj instanceof LdapContext);
+
+ SearchControls sc = new SearchControls();
+ sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ NamingEnumeration<SearchResult> ne =
ctx.search("ou=idp,ou=identity,dc=jboss,dc=org",
+ "(ou=providers)", sc);
+
+ while(ne.hasMore())
+ {
+ SearchResult sr = ne.next();
+ System.out.println(sr.toString());
+ }*/
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/exceptions/ProcessingException.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/exceptions/ProcessingException.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/exceptions/ProcessingException.java 2009-05-23
04:50:19 UTC (rev 517)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.exceptions;
+
+/**
+ * Exception to indicate a server processing error
+ * @author Anil.Saldhana(a)redhat.com
+ * @since May 22, 2009
+ */
+public class ProcessingException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ public ProcessingException()
+ {
+ super();
+ }
+
+ public ProcessingException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ProcessingException(String message)
+ {
+ super(message);
+ }
+
+ public ProcessingException(Throwable cause)
+ {
+ super(cause);
+ }
+}
\ No newline at end of file