Commit 459726a32705c5c793caf074d7273ad1b405059a

Authored by Cleverson Sacramento
1 parent 2814060b
Exists in master

Removendo classes desnecessárias

impl/extension/jaas/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/LoginContextFactory.java
... ... @@ -1,135 +0,0 @@
1   -///*
2   -// * Demoiselle Framework
3   -// * Copyright (C) 2010 SERPRO
4   -// * ----------------------------------------------------------------------------
5   -// * This file is part of Demoiselle Framework.
6   -// *
7   -// * Demoiselle Framework is free software; you can redistribute it and/or
8   -// * modify it under the terms of the GNU Lesser General Public License version 3
9   -// * as published by the Free Software Foundation.
10   -// *
11   -// * This program is distributed in the hope that it will be useful,
12   -// * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   -// * GNU General Public License for more details.
15   -// *
16   -// * You should have received a copy of the GNU Lesser General Public License version 3
17   -// * along with this program; if not, see <http://www.gnu.org/licenses/>
18   -// * or write to the Free Software Foundation, Inc., 51 Franklin Street,
19   -// * Fifth Floor, Boston, MA 02110-1301, USA.
20   -// * ----------------------------------------------------------------------------
21   -// * Este arquivo é parte do Framework Demoiselle.
22   -// *
23   -// * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
24   -// * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
25   -// * do Software Livre (FSF).
26   -// *
27   -// * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
28   -// * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
29   -// * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
30   -// * para maiores detalhes.
31   -// *
32   -// * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
33   -// * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
34   -// * ou escreva para a Fundação do Software Livre (FSF) Inc.,
35   -// * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
36   -// */
37   -//package br.gov.frameworkdemoiselle.internal.implementation;
38   -//
39   -//import java.io.Serializable;
40   -//
41   -//import javax.enterprise.context.ContextNotActiveException;
42   -//import javax.enterprise.context.SessionScoped;
43   -//import javax.security.auth.Subject;
44   -//import javax.security.auth.callback.CallbackHandler;
45   -//import javax.security.auth.login.LoginContext;
46   -//import javax.security.auth.login.LoginException;
47   -//
48   -//import br.gov.frameworkdemoiselle.internal.configuration.JAASConfig;
49   -//import br.gov.frameworkdemoiselle.security.SecurityException;
50   -//import br.gov.frameworkdemoiselle.util.Beans;
51   -//
52   -//@SessionScoped
53   -//public class LoginContextFactory implements Serializable {
54   -//
55   -// private static final long serialVersionUID = 1L;
56   -//
57   -// private transient LoginContext loginContext;
58   -//
59   -// private String name;
60   -//
61   -// private CallbackHandler callbackHandler;
62   -//
63   -// private LoginContext getLoginContext() throws LoginException {
64   -// if (this.loginContext == null) {
65   -// this.loginContext = new LoginContext(getName(), new Subject(), getCallbackHandler());
66   -// }
67   -//
68   -// getName();
69   -//
70   -// return this.loginContext;
71   -// }
72   -//
73   -// public static LoginContext createLoginContext() {
74   -// LoginContext loginContext;
75   -//
76   -// try {
77   -// loginContext = Beans.getReference(LoginContextFactory.class).getLoginContext();
78   -//
79   -// } catch (ContextNotActiveException cause) {
80   -// loginContext = null;
81   -//
82   -// } catch (LoginException cause) {
83   -// throw new SecurityException(cause);
84   -// }
85   -//
86   -// if (loginContext == null) {
87   -// try {
88   -// loginContext = new LoginContextFactory().getLoginContext();
89   -//
90   -// } catch (LoginException cause) {
91   -// throw new SecurityException(cause);
92   -// }
93   -// }
94   -//
95   -// return loginContext;
96   -// }
97   -//
98   -// public static void destroyLoginContext() {
99   -// try {
100   -// LoginContextFactory factory = Beans.getReference(LoginContextFactory.class);
101   -// factory.clean();
102   -//
103   -// } catch (ContextNotActiveException cause) {
104   -// }
105   -// }
106   -//
107   -// private void clean() {
108   -// if (this.loginContext != null) {
109   -//
110   -// try {
111   -// this.loginContext.logout();
112   -//
113   -// } catch (LoginException cause) {
114   -// }
115   -//
116   -// this.loginContext = null;
117   -// }
118   -// }
119   -//
120   -// private String getName() {
121   -// if (this.name == null) {
122   -// this.name = Beans.getReference(JAASConfig.class).getLoginModuleName();
123   -// }
124   -//
125   -// return this.name;
126   -// }
127   -//
128   -// private CallbackHandler getCallbackHandler() {
129   -// if (this.callbackHandler == null) {
130   -// this.callbackHandler = Beans.getReference(CallbackHandler.class);
131   -// }
132   -//
133   -// return this.callbackHandler;
134   -// }
135   -//}
impl/extension/jaas/src/main/java/br/gov/frameworkdemoiselle/internal/producer/CallbackHandlerProducer.java
... ... @@ -1,60 +0,0 @@
1   -///*
2   -// * Demoiselle Framework
3   -// * Copyright (C) 2010 SERPRO
4   -// * ----------------------------------------------------------------------------
5   -// * This file is part of Demoiselle Framework.
6   -// *
7   -// * Demoiselle Framework is free software; you can redistribute it and/or
8   -// * modify it under the terms of the GNU Lesser General Public License version 3
9   -// * as published by the Free Software Foundation.
10   -// *
11   -// * This program is distributed in the hope that it will be useful,
12   -// * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   -// * GNU General Public License for more details.
15   -// *
16   -// * You should have received a copy of the GNU Lesser General Public License version 3
17   -// * along with this program; if not, see <http://www.gnu.org/licenses/>
18   -// * or write to the Free Software Foundation, Inc., 51 Franklin Street,
19   -// * Fifth Floor, Boston, MA 02110-1301, USA.
20   -// * ----------------------------------------------------------------------------
21   -// * Este arquivo é parte do Framework Demoiselle.
22   -// *
23   -// * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
24   -// * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
25   -// * do Software Livre (FSF).
26   -// *
27   -// * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
28   -// * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
29   -// * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
30   -// * para maiores detalhes.
31   -// *
32   -// * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
33   -// * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
34   -// * ou escreva para a Fundação do Software Livre (FSF) Inc.,
35   -// * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
36   -// */
37   -//package br.gov.frameworkdemoiselle.internal.producer;
38   -//
39   -//import java.io.Serializable;
40   -//
41   -//import javax.enterprise.context.RequestScoped;
42   -//import javax.enterprise.inject.Produces;
43   -//import javax.security.auth.callback.CallbackHandler;
44   -//
45   -//import br.gov.frameworkdemoiselle.internal.proxy.CallbackHandlerProxy;
46   -//import br.gov.frameworkdemoiselle.security.Credentials;
47   -//import br.gov.frameworkdemoiselle.util.Beans;
48   -//
49   -//public class CallbackHandlerProducer implements Serializable {
50   -//
51   -// private static final long serialVersionUID = 1L;
52   -//
53   -// @Produces
54   -// @RequestScoped
55   -// public CallbackHandler create() {
56   -// Credentials credentials = Beans.getReference(Credentials.class);
57   -//
58   -// return new CallbackHandlerProxy(credentials);
59   -// }
60   -//}
impl/extension/jaas/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/CallbackHandlerProxy.java
... ... @@ -1,92 +0,0 @@
1   -///*
2   -// * Demoiselle Framework
3   -// * Copyright (C) 2010 SERPRO
4   -// * ----------------------------------------------------------------------------
5   -// * This file is part of Demoiselle Framework.
6   -// *
7   -// * Demoiselle Framework is free software; you can redistribute it and/or
8   -// * modify it under the terms of the GNU Lesser General Public License version 3
9   -// * as published by the Free Software Foundation.
10   -// *
11   -// * This program is distributed in the hope that it will be useful,
12   -// * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   -// * GNU General Public License for more details.
15   -// *
16   -// * You should have received a copy of the GNU Lesser General Public License version 3
17   -// * along with this program; if not, see <http://www.gnu.org/licenses/>
18   -// * or write to the Free Software Foundation, Inc., 51 Franklin Street,
19   -// * Fifth Floor, Boston, MA 02110-1301, USA.
20   -// * ----------------------------------------------------------------------------
21   -// * Este arquivo é parte do Framework Demoiselle.
22   -// *
23   -// * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
24   -// * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
25   -// * do Software Livre (FSF).
26   -// *
27   -// * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
28   -// * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
29   -// * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
30   -// * para maiores detalhes.
31   -// *
32   -// * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
33   -// * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
34   -// * ou escreva para a Fundação do Software Livre (FSF) Inc.,
35   -// * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
36   -// */
37   -//package br.gov.frameworkdemoiselle.internal.proxy;
38   -//
39   -//import java.io.IOException;
40   -//import java.io.Serializable;
41   -//
42   -//import javax.security.auth.callback.Callback;
43   -//import javax.security.auth.callback.CallbackHandler;
44   -//import javax.security.auth.callback.NameCallback;
45   -//import javax.security.auth.callback.PasswordCallback;
46   -//import javax.security.auth.callback.UnsupportedCallbackException;
47   -//
48   -//import br.gov.frameworkdemoiselle.security.Credentials;
49   -//
50   -//public class CallbackHandlerProxy implements CallbackHandler, Serializable {
51   -//
52   -// private static final long serialVersionUID = 1L;
53   -//
54   -// private transient CallbackHandler delegate;
55   -//
56   -// private final Credentials credentials;
57   -//
58   -// public CallbackHandlerProxy(Credentials credentials) {
59   -// this.credentials = credentials;
60   -// }
61   -//
62   -// private CallbackHandler getDelegate() {
63   -// if (this.delegate == null) {
64   -// this.delegate = create();
65   -// }
66   -//
67   -// return this.delegate;
68   -// }
69   -//
70   -// private CallbackHandler create() {
71   -// return new CallbackHandler() {
72   -//
73   -// public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
74   -// for (int i = 0; i < callbacks.length; i++) {
75   -// if (callbacks[i] instanceof NameCallback) {
76   -// ((NameCallback) callbacks[i]).setName(credentials.getUsername());
77   -//
78   -// } else if (callbacks[i] instanceof PasswordCallback) {
79   -// ((PasswordCallback) callbacks[i]).setPassword(credentials.getPassword().toCharArray());
80   -//
81   -// } else {
82   -// System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXX Unsupported callback " + callbacks[i]);
83   -// }
84   -// }
85   -// }
86   -// };
87   -// }
88   -//
89   -// public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
90   -// getDelegate().handle(callbacks);
91   -// }
92   -//}
impl/extension/jaas/src/main/java/br/gov/frameworkdemoiselle/internal/proxy/LoginContextProxy.java
... ... @@ -1,120 +0,0 @@
1   -///*
2   -// * Demoiselle Framework
3   -// * Copyright (C) 2010 SERPRO
4   -// * ----------------------------------------------------------------------------
5   -// * This file is part of Demoiselle Framework.
6   -// *
7   -// * Demoiselle Framework is free software; you can redistribute it and/or
8   -// * modify it under the terms of the GNU Lesser General Public License version 3
9   -// * as published by the Free Software Foundation.
10   -// *
11   -// * This program is distributed in the hope that it will be useful,
12   -// * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   -// * GNU General Public License for more details.
15   -// *
16   -// * You should have received a copy of the GNU Lesser General Public License version 3
17   -// * along with this program; if not, see <http://www.gnu.org/licenses/>
18   -// * or write to the Free Software Foundation, Inc., 51 Franklin Street,
19   -// * Fifth Floor, Boston, MA 02110-1301, USA.
20   -// * ----------------------------------------------------------------------------
21   -// * Este arquivo é parte do Framework Demoiselle.
22   -// *
23   -// * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
24   -// * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
25   -// * do Software Livre (FSF).
26   -// *
27   -// * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
28   -// * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
29   -// * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
30   -// * para maiores detalhes.
31   -// *
32   -// * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
33   -// * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
34   -// * ou escreva para a Fundação do Software Livre (FSF) Inc.,
35   -// * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
36   -// */
37   -//package br.gov.frameworkdemoiselle.internal.proxy;
38   -//
39   -//import java.io.Serializable;
40   -//
41   -//import javax.enterprise.context.Dependent;
42   -//import javax.security.auth.Subject;
43   -//import javax.security.auth.callback.CallbackHandler;
44   -//import javax.security.auth.login.LoginContext;
45   -//import javax.security.auth.login.LoginException;
46   -//
47   -//import br.gov.frameworkdemoiselle.internal.configuration.JAASConfig;
48   -//import br.gov.frameworkdemoiselle.security.SecurityException;
49   -//import br.gov.frameworkdemoiselle.util.Beans;
50   -//
51   -////@Alternative
52   -////@SessionScoped
53   -//@Dependent
54   -//public class LoginContextProxy extends LoginContext implements Serializable {
55   -//
56   -// private static final long serialVersionUID = 1L;
57   -//
58   -// private transient LoginContext delegate;
59   -//
60   -// private transient CallbackHandler callbackHandler;
61   -//
62   -// private String name;
63   -//
64   -// // public LoginContextProxy() {
65   -// // super(name)
66   -// // }
67   -//
68   -// public LoginContextProxy() {
69   -// super("");
70   -// }
71   -//
72   -// private String getName() {
73   -// if (this.name == null) {
74   -// this.name = Beans.getReference(JAASConfig.class).getLoginModuleName();
75   -// }
76   -//
77   -// return this.name;
78   -// }
79   -//
80   -// private LoginContext getDelegate() {
81   -// if (this.delegate == null) {
82   -// try {
83   -// this.delegate = new LoginContext(getName(), getCallbackHandler());
84   -//
85   -// } catch (LoginException cause) {
86   -// throw new SecurityException(cause);
87   -// }
88   -// }
89   -//
90   -// return this.delegate;
91   -// }
92   -//
93   -// private CallbackHandler getCallbackHandler() {
94   -// if (this.callbackHandler == null) {
95   -// this.callbackHandler = Beans.getReference(CallbackHandler.class);
96   -// }
97   -//
98   -// return this.callbackHandler;
99   -// }
100   -//
101   -// public boolean equals(Object object) {
102   -// return getDelegate().equals(object);
103   -// }
104   -//
105   -// public Subject getSubject() {
106   -// return getDelegate().getSubject();
107   -// }
108   -//
109   -// public int hashCode() {
110   -// return getDelegate().hashCode();
111   -// }
112   -//
113   -// public void login() throws LoginException {
114   -// getDelegate().login();
115   -// }
116   -//
117   -// public void logout() throws LoginException {
118   -// getDelegate().logout();
119   -// }
120   -//}