[jboss-cvs] JBossAS SVN: r110573 - projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Feb 9 13:52:54 EST 2011
Author: jesper.pedersen
Date: 2011-02-09 13:52:53 -0500 (Wed, 09 Feb 2011)
New Revision: 110573
Added:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/GetAuth.java
Modified:
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Commands.java
projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Interaction.java
Log:
[JBJCA-94] Reauthentication test eis server - Add GETAUTH command
Modified: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Commands.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Commands.java 2011-02-09 18:42:22 UTC (rev 110572)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Commands.java 2011-02-09 18:52:53 UTC (rev 110573)
@@ -42,4 +42,7 @@
/** UNAUTH */
public static final byte UNAUTH = 4;
+
+ /** GETAUTH */
+ public static final byte GETAUTH = 5;
}
Added: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/GetAuth.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/GetAuth.java (rev 0)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/GetAuth.java 2011-02-09 18:52:53 UTC (rev 110573)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.jca.core.security.reauth.eis;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a getauth command
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class GetAuth implements Invoker
+{
+ /** The logger */
+ private Logger log = Logger.getLogger(GetAuth.class);
+
+ /** The interaction */
+ private Interaction interaction;
+
+ /**
+ * Constructor
+ * @param interaction The interaction
+ */
+ public GetAuth(Interaction interaction)
+ {
+ this.interaction = interaction;
+ }
+
+ /**
+ * Invoke
+ * @param args The arguments
+ * @return The return value
+ */
+ public Serializable invoke(Serializable[] args)
+ {
+ if (args != null)
+ return new IllegalArgumentException("Unsupported argument list: " + Arrays.toString(args));
+
+ String result = interaction.getUserName() != null ? interaction.getUserName() : "Anonymous";
+
+ log.infof("GetAuth: %s", result);
+
+ return result;
+ }
+}
Modified: projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Interaction.java
===================================================================
--- projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Interaction.java 2011-02-09 18:42:22 UTC (rev 110572)
+++ projects/jboss-jca/trunk/core/src/test/java/org/jboss/jca/core/security/reauth/eis/Interaction.java 2011-02-09 18:52:53 UTC (rev 110573)
@@ -126,6 +126,10 @@
{
invoker = new Unauth(this);
}
+ else if (granted && command == Commands.GETAUTH)
+ {
+ invoker = new GetAuth(this);
+ }
else
{
log.warnf("Unknown command: %d for %s", command, socket);
More information about the jboss-cvs-commits
mailing list