Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anthony ROZEN
ASAProject
Commits
1a751dc7
Commit
1a751dc7
authored
Nov 30, 2021
by
Alexandre GICQUEL
Browse files
add m0
parent
cdeaeb35
Changes
28
Hide whitespace changes
Inline
Side-by-side
ASAProject/bin/.gitignore
View file @
1a751dc7
/M1/
/M2/
/M2Bis/
/M1sousCouche/
/Component/
/M0.class
ASAProject/src/M0.java
0 → 100644
View file @
1a751dc7
import
M1.Client
;
import
M1.Server
;
import
M1.SimpleCs
;
public
class
M0
{
public
static
void
main
(
String
[]
args
)
{
Server
myServer
=
new
Server
(
"myServer"
);
SimpleCs
mySystem
=
new
SimpleCs
(
"mySystel"
,
myServer
,
1
);
Client
myClient
=
(
Client
)
mySystem
.
getListComponent
().
get
(
1
);
System
.
out
.
println
(
myClient
.
getNomComponent
());
//String r = myClient.serviceSend("1+1");
//System.out.println(r);
}
}
ASAProject/src/M1/Client.java
View file @
1a751dc7
package
M1
;
import
M2Bis.Component
;
import
M2Bis.Service
;
public
class
Client
extends
Component
{
public
Client
(
String
nomComponent
,
Service
serviceFournis
)
{
super
(
nomComponent
,
serviceFournis
);
this
.
getListPortCompRequis
().
add
(
"receiveRequest"
);
public
Client
(
String
nomComponent
)
{
super
(
nomComponent
);
this
.
getListPortCompRequis
().
add
(
"sendRequest"
);
}
public
String
serviceSend
(
String
x
)
{
this
.
getListPortCompRequis
().
set
(
0
,
x
);
while
(
this
.
getListPortCompRequis
().
get
(
0
)
==
"sendRequest"
||
this
.
getListPortCompRequis
().
get
(
0
)
==
x
)
{
}
x
=
this
.
getListPortCompRequis
().
get
(
0
);
this
.
getListPortCompRequis
().
set
(
0
,
"sendRequest"
);
return
x
;
}
}
ASAProject/src/M1/RPC.java
View file @
1a751dc7
...
...
@@ -6,6 +6,18 @@ public class RPC extends Connector {
public
RPC
(
String
nomConnector
)
{
super
(
nomConnector
,
"called"
,
"caller"
);
/*while(true) {
if(this.getRoleRequis()!="caller"
&& this.getRoleRequis()!="2") {
this.setRoleFournis(this.getRoleRequis());
this.setRoleRequis("caller");
}
if(this.getRoleFournis()!="called"
&& this.getRoleFournis()!="1+1") {
this.setRoleRequis(this.getRoleFournis());
this.setRoleFournis("called");
}
}*/
}
...
...
ASAProject/src/M1/ReceiveCalled.java
View file @
1a751dc7
...
...
@@ -6,6 +6,18 @@ public class ReceiveCalled extends AttachementReqFour {
public
ReceiveCalled
(
String
portCompRequis
,
String
roleFournis
)
{
super
(
portCompRequis
,
roleFournis
);
/*while(true) {
if(this.getRoleFournis()!="called"
&&this.getRoleFournis()!="2" ) {
this.setPortCompRequis(this.getRoleFournis());
this.setRoleFournis("called");
}
if(this.getPortCompRequis()!="receiveRequest"
&&this.getPortCompRequis()!="1+1") {
this.setRoleFournis(this.getPortCompRequis());
this.setPortCompRequis("receiveRequest");
}
}*/
}
}
ASAProject/src/M1/SendCaller.java
View file @
1a751dc7
...
...
@@ -7,6 +7,18 @@ public class SendCaller extends AttachementFourReq {
public
SendCaller
(
String
portCompFournis
,
String
roleRequis
)
{
super
(
portCompFournis
,
roleRequis
);
/*while(true) {
if(this.getPortCompFournis()!="sendRequest"
&& this.getPortCompFournis()!="2" ) {
this.setRoleRequis(this.getPortCompFournis());
this.setPortCompFournis("sendRequest");
}
if(this.getRoleRequis()!="caller"
&& this.getRoleRequis()!="1+1") {
this.setPortCompFournis(this.getRoleRequis());
this.setRoleRequis("caller");
}
}*/
}
}
ASAProject/src/M1/Server.java
View file @
1a751dc7
package
M1
;
import
M1sousCouche.ServerDetail
;
import
M2Bis.Component
;
import
M2Bis.Service
;
public
class
Server
extends
Component
{
public
Server
(
String
nomComponent
,
Service
serviceFournis
,
int
nbClient
)
{
super
(
nomComponent
,
serviceFournis
);
for
(
int
i
=
0
;
i
<
nbClient
;
i
++)
{
this
.
getListPortCompFournis
().
add
(
"sendRequest"
+
i
);
public
Server
(
String
nomComponent
)
{
super
(
nomComponent
);
this
.
getListPortCompFournis
().
add
(
"receiveRequest"
);
ServerDetail
sDetail
=
new
ServerDetail
(
"serveurDetail"
,
this
.
getListPortCompFournis
().
get
(
0
));
this
.
setConfiguration
(
sDetail
);
/*while(true) {
if(this.getListPortCompFournis().get(0)!="receiveRequest"
&&this.getListPortCompFournis().get(0)!="2") {
this.serviceServer(getListPortCompFournis().get(0));
}
}*/
}
public
void
serviceServer
(
String
x
)
{
if
(
x
==
"1+1"
)
{
this
.
getListPortCompRequis
().
set
(
0
,
"2"
);
}
// ServerDetail sDetail = new ServerDetail();
// this.setConfiguration(sDetail);
}
}
ASAProject/src/M1/ServerDetail.java
deleted
100644 → 0
View file @
cdeaeb35
package
M1
;
import
M2Bis.Component
;
import
M2Bis.Configuration
;
public
class
ServerDetail
extends
Configuration
{
connectionManager
securityManager
dataBase
connector
:
-
CMToSM
-
SMToDB
-
BMToSM
attachement
:
-
securityCheckToCallerCM
-
CheckQueryToCallerDB
-
QueryInterrogationToCallerCM
-
SecurityAuthentificationToCalledCM
-
SecurityManagementToCalledSM
-
DBQueryToCalledDB
Binding
:
ReceiverRequestExternalSocket
public
ServerDetail
(
String
nomConfiguration
,
Component
component
)
{
super
(
nomConfiguration
,
component
);
// TODO Auto-generated constructor stub
}
}
ASAProject/src/M1/SimpleCs.java
View file @
1a751dc7
package
M1
;
import
java.util.ArrayList
;
import
M2Bis.Component
;
import
M2Bis.Configuration
;
import
M2Bis.Service
;
public
class
SimpleCs
extends
Configuration
{
public
SimpleCs
(
String
nomConfiguration
,
Server
server
,
int
nbClient
)
{
super
(
nomConfiguration
,
server
);
for
(
int
i
=
1
;
i
<=
nbClient
;
i
++)
{
Service
serviceClient
=
new
Service
(
"ServiceClient"
+
i
);
// crer classe service pour changer la methode execution
Client
client
=
new
Client
(
"Client"
+
i
,
serviceClient
);
this
.
listComponent
.
add
(
client
);
for
(
int
i
=
0
;
i
<
nbClient
;
i
++)
{
Client
client
=
new
Client
(
"Client"
+
i
);
this
.
getListComponent
().
add
(
client
);
RPC
link
=
new
RPC
(
"RPC"
+
i
);
this
.
l
istConnector
.
add
(
link
);
this
.
getL
istConnector
()
.
add
(
link
);
ReceiveCalled
rCalled
=
new
ReceiveCalled
(
client
.
getListPortCompRequis
().
get
(
0
),
link
.
getRoleFournis
());
this
.
l
istAttachement
.
add
(
rCalled
);
SendCaller
sCaller
=
new
SendCaller
(
server
.
getListPortCompFournis
().
get
(
i
),
this
.
getL
istAttachement
()
.
add
(
rCalled
);
SendCaller
sCaller
=
new
SendCaller
(
server
.
getListPortCompFournis
().
get
(
0
),
link
.
getRoleRequis
());
this
.
l
istAttachement
.
add
(
sCaller
);
this
.
getL
istAttachement
()
.
add
(
sCaller
);
}
}
...
...
ASAProject/src/M1sousCouche/CMtoSM.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.Connector
;
public
class
CMtoSM
extends
Connector
{
public
CMtoSM
(
String
nomConnector
)
{
super
(
nomConnector
,
"calledCM"
,
"callerSM"
);
}
}
ASAProject/src/M1sousCouche/CheckQueryToCallerDB.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.AttachementFourReq
;
public
class
CheckQueryToCallerDB
extends
AttachementFourReq
{
public
CheckQueryToCallerDB
(
String
portCompFournis
,
String
roleRequis
)
{
super
(
portCompFournis
,
roleRequis
);
}
}
ASAProject/src/M1sousCouche/ConnectionManager.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.Component
;
public
class
ConnectionManager
extends
Component
{
public
ConnectionManager
(
String
nom
)
{
super
(
nom
);
this
.
getListPortCompFournis
().
add
(
"SecurityCheck"
);
this
.
getListPortCompRequis
().
add
(
"ExternalSocket"
);
this
.
getListPortCompRequis
().
add
(
"DBQuery"
);
}
}
ASAProject/src/M1sousCouche/DBQueryToCalledDB.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.AttachementReqFour
;
public
class
DBQueryToCalledDB
extends
AttachementReqFour
{
public
DBQueryToCalledDB
(
String
portCompRequis
,
String
roleFournis
)
{
super
(
portCompRequis
,
roleFournis
);
}
}
ASAProject/src/M1sousCouche/DBtoCM.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.Connector
;
public
class
DBtoCM
extends
Connector
{
public
DBtoCM
(
String
nomConnector
)
{
super
(
nomConnector
,
"calledDB"
,
"callerCM"
);
}
}
ASAProject/src/M1sousCouche/DataBase.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.Component
;
public
class
DataBase
extends
Component
{
public
DataBase
(
String
nom
)
{
super
(
nom
);
this
.
getListPortCompFournis
().
add
(
"QueryInterrogation"
);
this
.
getListPortCompRequis
().
add
(
"SecurityManagement"
);
}
}
\ No newline at end of file
ASAProject/src/M1sousCouche/QueryInterrogationToCallerCM.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.AttachementFourReq
;
public
class
QueryInterrogationToCallerCM
extends
AttachementFourReq
{
public
QueryInterrogationToCallerCM
(
String
portCompFournis
,
String
roleRequis
)
{
super
(
portCompFournis
,
roleRequis
);
// TODO Auto-generated constructor stub
}
}
ASAProject/src/M1sousCouche/ReceiverRequestExternalSocket.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.BindingRequis
;
public
class
ReceiverRequestExternalSocket
extends
BindingRequis
{
public
ReceiverRequestExternalSocket
(
String
portConfRequis
,
String
portCompRequis
)
{
super
(
portConfRequis
,
portCompRequis
);
}
}
ASAProject/src/M1sousCouche/SMtoDB.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.Connector
;
public
class
SMtoDB
extends
Connector
{
public
SMtoDB
(
String
nomConnector
)
{
super
(
nomConnector
,
"calledSM"
,
"callerDB"
);
}
}
ASAProject/src/M1sousCouche/SecurityAuthentificationToCalledCM.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.AttachementReqFour
;
public
class
SecurityAuthentificationToCalledCM
extends
AttachementReqFour
{
public
SecurityAuthentificationToCalledCM
(
String
portCompRequis
,
String
roleFournis
)
{
super
(
portCompRequis
,
roleFournis
);
// TODO Auto-generated constructor stub
}
}
ASAProject/src/M1sousCouche/SecurityCheckToCallerSM.java
0 → 100644
View file @
1a751dc7
package
M1sousCouche
;
import
M2Bis.AttachementFourReq
;
public
class
SecurityCheckToCallerSM
extends
AttachementFourReq
{
public
SecurityCheckToCallerSM
(
String
portCompFournis
,
String
roleRequis
)
{
super
(
portCompFournis
,
roleRequis
);
// TODO Auto-generated constructor stub
}
}
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment