Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benoît LE BADEZET
alma-gtd
Commits
46e8ec8d
Commit
46e8ec8d
authored
Apr 12, 2018
by
Glenn PLOUHINEC
Browse files
Fix
#6
- AJout d'une classe abstraite CommandeTag pour supprimer la redondance
parent
e0fdb378
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeCreerTag.java
View file @
46e8ec8d
...
...
@@ -3,87 +3,47 @@ package fr.alma.gtd.commande;
import
fr.alma.gtd.donneespartagees.ITag
;
import
fr.alma.gtd.donneesserveur.Utilisateur
;
import
fr.alma.gtd.interfacedistante.CallBack
;
import
fr.alma.gtd.isessions.ITagServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.Properties
;
import
javax.naming.Context
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
/**
* Commande de creation d'un tag.
*
* @author Stephane Begaudeau, Benjamin Gosset, Alex Lagarde, Christophe Renaudineau.
* @version 1.0.0
*/
public
final
class
CommandeCreerTag
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
private
final
String
identification
;
/**
* Le tag a creer.
*/
private
final
ITag
tag
;
/**
* Le callback.
*/
private
final
CallBack
<
ITag
>
callback
;
/**
* Le service de gestion de tags.
*/
private
ITagServiceRemote
tagServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
private
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a creer.
* @param c Le callback.
*/
public
CommandeCreerTag
(
final
String
i
,
final
ITag
t
,
final
CallBack
<
ITag
>
c
)
{
super
();
this
.
identification
=
i
;
this
.
tag
=
t
;
this
.
callback
=
c
;
final
Properties
env
=
new
Properties
();
env
.
setProperty
(
"java.naming.factory.initial"
,
"org.jnp.interfaces.NamingContextFactory"
);
env
.
setProperty
(
"java.naming.provider.url"
,
"localhost:1099"
);
env
.
setProperty
(
"java.naming.factory.url.pkgs"
,
"org.jboss.naming"
);
try
{
final
Context
context
=
new
InitialContext
(
env
);
this
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
public
final
class
CommandeCreerTag
extends
CommandeTag
{
/**
* Le callback.
*/
private
final
CallBack
<
ITag
>
callback
;
/**
* Le constructeur.
*
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a creer.
* @param c Le callback.
*/
CommandeCreerTag
(
final
String
i
,
final
ITag
t
,
final
CallBack
<
ITag
>
c
)
{
super
(
i
,
t
);
this
.
callback
=
c
;
}
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
if
((
ta
==
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
creerTag
(
this
.
tag
));
}
else
{
if
(
ta
!=
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag deja existant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
if
((
ta
==
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
creerTag
(
this
.
tag
));
}
else
{
if
(
ta
!=
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag deja existant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
}
GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeEnvoyerTag.java
View file @
46e8ec8d
...
...
@@ -4,106 +4,66 @@ import fr.alma.gtd.donneespartagees.ITag;
import
fr.alma.gtd.donneesserveur.Utilisateur
;
import
fr.alma.gtd.interfacedistante.CallBack
;
import
fr.alma.gtd.interfacedistante.ModeDeMiseAJour
;
import
fr.alma.gtd.isessions.ITagServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.Properties
;
import
javax.naming.Context
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
/**
* Commande d'envoi d'un tag.
*
* @author Stephane Begaudeau, Benjamin Gosset, Alex Lagarde, Christophe Renaudineau.
* @version 1.0.0
*/
public
final
class
CommandeEnvoyerTag
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
private
final
String
identification
;
/**
* Le tag a envoyer.
*/
private
final
ITag
tag
;
/**
* Le mode de mise a jour.
*/
private
final
ModeDeMiseAJour
mode
;
/**
* Le callback.
*/
private
final
CallBack
<
ITag
>
callback
;
/**
* Le service de gestion de tags.
*/
private
ITagServiceRemote
tagServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
private
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a envoyer.
* @param m Le mode de mise a jour.
* @param c Le callback.
*/
public
CommandeEnvoyerTag
(
final
String
i
,
final
ITag
t
,
final
ModeDeMiseAJour
m
,
final
CallBack
<
ITag
>
c
)
{
super
();
this
.
identification
=
i
;
this
.
tag
=
t
;
this
.
mode
=
m
;
this
.
callback
=
c
;
final
Properties
env
=
new
Properties
();
env
.
setProperty
(
"java.naming.factory.initial"
,
"org.jnp.interfaces.NamingContextFactory"
);
env
.
setProperty
(
"java.naming.provider.url"
,
"localhost:1099"
);
env
.
setProperty
(
"java.naming.factory.url.pkgs"
,
"org.jboss.naming"
);
try
{
final
Context
context
=
new
InitialContext
(
env
);
this
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
if
((
ta
!=
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
if
(
this
.
mode
==
ModeDeMiseAJour
.
FORCE
)
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
updateTag
(
this
.
tag
.
getIdentifiantServeur
(),
this
.
tag
));
}
else
if
(
this
.
mode
==
ModeDeMiseAJour
.
WARNING
)
{
if
(
this
.
tag
.
getDateDeDerniereModification
().
before
(
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
()).
getDateDeDerniereModification
()))
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag existant mais version plus recente en ligne"
));
}
else
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
updateTag
(
this
.
tag
.
getIdentifiantServeur
(),
this
.
tag
));
}
}
}
else
{
if
(
ta
==
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Contexte inexistant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
public
final
class
CommandeEnvoyerTag
extends
CommandeTag
{
/**
* Le mode de mise a jour.
*/
private
final
ModeDeMiseAJour
mode
;
/**
* Le callback.
*/
private
final
CallBack
<
ITag
>
callback
;
/**
* Le constructeur.
*
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a envoyer.
* @param m Le mode de mise a jour.
* @param c Le callback.
*/
CommandeEnvoyerTag
(
final
String
i
,
final
ITag
t
,
final
ModeDeMiseAJour
m
,
final
CallBack
<
ITag
>
c
)
{
super
(
i
,
t
);
this
.
mode
=
m
;
this
.
callback
=
c
;
}
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
if
((
ta
!=
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
if
(
this
.
mode
==
ModeDeMiseAJour
.
FORCE
)
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
updateTag
(
this
.
tag
.
getIdentifiantServeur
(),
this
.
tag
));
}
else
if
(
this
.
mode
==
ModeDeMiseAJour
.
WARNING
)
{
if
(
this
.
tag
.
getDateDeDerniereModification
().
before
(
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
()).
getDateDeDerniereModification
()))
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag existant mais version plus recente en ligne"
));
}
else
{
this
.
callback
.
onSucces
(
this
.
tagServiceRemote
.
updateTag
(
this
.
tag
.
getIdentifiantServeur
(),
this
.
tag
));
}
}
}
else
{
if
(
ta
==
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Contexte inexistant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
}
GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeSupprimerTag.java
View file @
46e8ec8d
...
...
@@ -3,89 +3,49 @@ package fr.alma.gtd.commande;
import
fr.alma.gtd.donneespartagees.ITag
;
import
fr.alma.gtd.donneesserveur.Utilisateur
;
import
fr.alma.gtd.interfacedistante.CallBack
;
import
fr.alma.gtd.isessions.ITagServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.Properties
;
import
javax.naming.Context
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
/**
* Commande de suppression d'un tag.
*
* @author Stephane Begaudeau, Benjamin Gosset, Alex Lagarde, Christophe Renaudineau.
* @version 1.0.0
*/
public
final
class
CommandeSupprimerTag
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
private
final
String
identification
;
/**
* Le tag a supprimer.
*/
private
final
ITag
tag
;
/**
* Le callback.
*/
private
final
CallBack
<
String
>
callback
;
/**
* Le service de gestion de tags.
*/
private
ITagServiceRemote
tagServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
private
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a supprimer.
* @param c Le callback.
*/
public
CommandeSupprimerTag
(
final
String
i
,
final
ITag
t
,
final
CallBack
<
String
>
c
)
{
super
();
this
.
identification
=
i
;
this
.
tag
=
t
;
this
.
callback
=
c
;
final
Properties
env
=
new
Properties
();
env
.
setProperty
(
"java.naming.factory.initial"
,
"org.jnp.interfaces.NamingContextFactory"
);
env
.
setProperty
(
"java.naming.provider.url"
,
"localhost:1099"
);
env
.
setProperty
(
"java.naming.factory.url.pkgs"
,
"org.jboss.naming"
);
try
{
final
Context
context
=
new
InitialContext
(
env
);
this
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
if
((
ta
!=
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
this
.
tagServiceRemote
.
removeTagById
(
ta
.
getIdentifiantServeur
());
this
.
callback
.
onSucces
(
"Tag supprime"
);
}
else
{
if
(
ta
==
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag inexistant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
public
final
class
CommandeSupprimerTag
extends
CommandeTag
{
/**
* Le callback.
*/
private
final
CallBack
<
String
>
callback
;
/**
* Le constructeur.
*
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a supprimer.
* @param c Le callback.
*/
CommandeSupprimerTag
(
final
String
i
,
final
ITag
t
,
final
CallBack
<
String
>
c
)
{
super
(
i
,
t
);
this
.
callback
=
c
;
}
@Override
public
void
execute
()
throws
RemoteException
{
final
ITag
ta
=
this
.
tagServiceRemote
.
getTagById
(
this
.
tag
.
getIdentifiantServeur
());
final
Utilisateur
uti
=
this
.
utilisateurServiceRemote
.
getUtilisateurById
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
());
if
((
ta
!=
null
)
&&
(
uti
!=
null
)
&&
(
this
.
identification
.
equalsIgnoreCase
(
this
.
tag
.
getCreateur
().
getIdentifiantServeur
())))
{
this
.
tagServiceRemote
.
removeTagById
(
ta
.
getIdentifiantServeur
());
this
.
callback
.
onSucces
(
"Tag supprime"
);
}
else
{
if
(
ta
==
null
)
{
this
.
callback
.
onFailure
(
new
Exception
(
"Tag inexistant"
));
}
else
{
this
.
callback
.
onFailure
(
new
Exception
(
"Identifiant utilisateur invalide"
));
}
}
}
}
GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeTag.java
0 → 100644
View file @
46e8ec8d
package
fr.alma.gtd.commande
;
import
fr.alma.gtd.donneespartagees.ITag
;
import
fr.alma.gtd.isessions.ITagServiceRemote
;
import
fr.alma.gtd.isessions.IUtilisateurServiceRemote
;
import
java.rmi.RemoteException
;
import
java.util.Properties
;
import
javax.naming.Context
;
import
javax.naming.InitialContext
;
import
javax.naming.NamingException
;
public
abstract
class
CommandeTag
implements
Commande
{
/**
* L'identifiant de l'utilisateur.
*/
protected
final
String
identification
;
/**
* Le tag.
*/
protected
final
ITag
tag
;
/**
* Le service de gestion de tags.
*/
ITagServiceRemote
tagServiceRemote
;
/**
* Le service de gestion d'utilisateurs.
*/
IUtilisateurServiceRemote
utilisateurServiceRemote
;
/**
* Le constructeur.
*
* @param i L'identifiant de l'utilisateur.
* @param t Le tag a creer.
*/
CommandeTag
(
final
String
i
,
final
ITag
t
)
{
this
.
identification
=
i
;
this
.
tag
=
t
;
final
Properties
env
=
new
Properties
();
env
.
setProperty
(
"java.naming.factory.initial"
,
"org.jnp.interfaces.NamingContextFactory"
);
env
.
setProperty
(
"java.naming.provider.url"
,
"localhost:1099"
);
env
.
setProperty
(
"java.naming.factory.url.pkgs"
,
"org.jboss.naming"
);
try
{
final
Context
context
=
new
InitialContext
(
env
);
this
.
tagServiceRemote
=
(
ITagServiceRemote
)
context
.
lookup
(
"TagService/local"
);
this
.
utilisateurServiceRemote
=
(
IUtilisateurServiceRemote
)
context
.
lookup
(
"UtilisateurService/local"
);
}
catch
(
NamingException
e
)
{
e
.
printStackTrace
();
}
}
public
abstract
void
execute
()
throws
RemoteException
;
}
GTDServer/JBoss/target/checkstyle-cachefile
View file @
46e8ec8d
#Thu Apr 12 15:
17:16
CEST 2018
#Thu Apr 12 15:
50:54
CEST 2018
>>>>>>>=a1dbf8c281633bc07dba6931845c1eb4990caf40
/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/reactor/ReactorCorba.java=1523456666000
<<<<<<<=HEAD
configuration*?=F894531AF957325040175B7EC7B8FAE5D3E12697
/comptes/E146247P/Documents/S6/CEL/projet/GTDServer/JBoss/src/main/java/fr/alma/gtd/reactor/ReactorCorba.java=1523456303000
=\=\=\=\=\=\=
/comptes/E146247P/Documents/S6/CEL/projet/GTDServer/JBoss/src/main/java/fr/alma/gtd/reactor/ReactorCorba.java=1523456303000
configuration*?=F894531AF957325040175B7EC7B8FAE5D3E12697
<<<<<<<=HEAD
GTDServer/JBoss/target/checkstyle-result.xml
View file @
46e8ec8d
This diff is collapsed.
Click to expand it.
GTDServer/JBoss/target/cpd.xml
View file @
46e8ec8d
...
...
@@ -28,34 +28,6 @@
if ((tac != null) && (uti != null) && (this.identification.equalsIgnoreCase(this.tache.getCreateur().getIdentifiantServeur()))) {]]>
</codefragment>
</duplication>
<duplication
lines=
"22"
tokens=
"174"
>
<file
line=
"66"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeEnvoyerTag.java"
/>
<file
line=
"58"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeSupprimerTag.java"
/>
<codefragment>
<![CDATA[ this.callback = c;
final Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:1099");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
final Context context = new InitialContext(env);
this.tagServiceRemote = (ITagServiceRemote) context.lookup("TagService/local");
this.utilisateurServiceRemote = (IUtilisateurServiceRemote) context.lookup("UtilisateurService/local");
} catch (NamingException e) {
e.printStackTrace();
}
}
@Override
public void execute() throws RemoteException {
final ITag ta = this.tagServiceRemote.getTagById(this.tag.getIdentifiantServeur());
final Utilisateur uti = this.utilisateurServiceRemote.getUtilisateurById(this.tag.getCreateur().getIdentifiantServeur());
if ((ta != null) && (uti != null) && (this.identification.equalsIgnoreCase(this.tag.getCreateur().getIdentifiantServeur()))) {]]>
</codefragment>
</duplication>
<duplication
lines=
"22"
tokens=
"168"
>
<file
line=
"66"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeEnvoyerIdee.java"
/>
...
...
@@ -116,38 +88,6 @@
if ((tac == null)
&&
(uti != null)
&&
(this.identification.equalsIgnoreCase(this.tache.getCreateur().getIdentifiantServeur()))) {]]>
</codefragment>
</duplication>
<duplication
lines=
"26"
tokens=
"159"
>
<file
line=
"54"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeCreerTag.java"
/>
<file
line=
"54"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeSupprimerTag.java"
/>
<codefragment>
<![CDATA[ public CommandeCreerTag(final String i, final ITag t, final CallBack<ITag>
c) {
super();
this.identification = i;
this.tag = t;
this.callback = c;
final Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:1099");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
final Context context = new InitialContext(env);
this.tagServiceRemote = (ITagServiceRemote) context.lookup("TagService/local");
this.utilisateurServiceRemote = (IUtilisateurServiceRemote) context.lookup("UtilisateurService/local");
} catch (NamingException e) {
e.printStackTrace();
}
}
@Override
public void execute() throws RemoteException {
final ITag ta = this.tagServiceRemote.getTagById(this.tag.getIdentifiantServeur());
final Utilisateur uti = this.utilisateurServiceRemote.getUtilisateurById(this.tag.getCreateur().getIdentifiantServeur());
if ((ta == null)
&&
(uti != null)
&&
(this.identification.equalsIgnoreCase(this.tag.getCreateur().getIdentifiantServeur()))) {]]>
</codefragment>
</duplication>
<duplication
lines=
"22"
tokens=
"142"
>
<file
line=
"58"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeCreerIdee.java"
/>
...
...
@@ -206,32 +146,4 @@
if ((tac == null) && (uti != null) && (this.identification.equalsIgnoreCase(this.tache.getCreateur().getIdentifiantServeur()))) {]]>
</codefragment>
</duplication>
<duplication
lines=
"22"
tokens=
"142"
>
<file
line=
"58"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeCreerTag.java"
/>
<file
line=
"66"
path=
"/comptes/E149741M/Documents/L3/S6/Construction_evolution_logiciel/projetv2/GTDServer/JBoss/src/main/java/fr/alma/gtd/commande/CommandeEnvoyerTag.java"
/>
<codefragment>
<![CDATA[ this.callback = c;
final Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.setProperty("java.naming.provider.url", "localhost:1099");
env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
try {
final Context context = new InitialContext(env);
this.tagServiceRemote = (ITagServiceRemote) context.lookup("TagService/local");
this.utilisateurServiceRemote = (IUtilisateurServiceRemote) context.lookup("UtilisateurService/local");
} catch (NamingException e) {
e.printStackTrace();
}
}