Commit cdeaeb35 authored by Alexandre GICQUEL's avatar Alexandre GICQUEL
Browse files

add UML and upgrade m1

parent 07d0b530
......@@ -4,41 +4,9 @@ import M2Bis.Connector;
public class RPC extends Connector {
private String called;
private String caller;
public RPC(String nomConnector) {
super(nomConnector, "called", "caller");
public RPC(String nomConnector, String roleFournis, String roleRequis, String called, String caller) {
super(nomConnector, roleFournis, roleRequis);
this.called = called;
this.caller = caller;
}
/**
* @return the called
*/
public String getCalled() {
return called;
}
/**
* @param called the called to set
*/
public void setCalled(String called) {
this.called = called;
}
/**
* @return the caller
*/
public String getCaller() {
return caller;
}
/**
* @param caller the caller to set
*/
public void setCaller(String caller) {
this.caller = caller;
}
}
......@@ -3,42 +3,9 @@ package M1;
import M2Bis.AttachementReqFour;
public class ReceiveCalled extends AttachementReqFour {
private String called;
private String receiveRequest;
public ReceiveCalled(String portCompRequis, String roleFournis, String called, String receiveRequest) {
public ReceiveCalled(String portCompRequis, String roleFournis) {
super(portCompRequis, roleFournis);
this.called = called;
this.receiveRequest= receiveRequest;
}
/**
* @return the called
*/
public String getCalled() {
return called;
}
/**
* @param called the called to set
*/
public void setCalled(String called) {
this.called = called;
}
/**
* @return the receiveRequest
*/
public String getReceiveRequest() {
return receiveRequest;
}
/**
* @param receiveRequest the receiveRequest to set
*/
public void setReceiveRequest(String receiveRequest) {
this.receiveRequest = receiveRequest;
}
}
......@@ -4,41 +4,9 @@ import M2Bis.AttachementFourReq;
public class SendCaller extends AttachementFourReq {
private String sendRequest;
private String caller;
public SendCaller(String portCompFournis, String roleRequis, String sendRequest, String caller) {
public SendCaller(String portCompFournis, String roleRequis) {
super(portCompFournis, roleRequis);
this.caller = caller;
this.sendRequest = sendRequest;
}
/**
* @return the sendRequest
*/
public String getSendRequest() {
return sendRequest;
}
/**
* @param sendRequest the sendRequest to set
*/
public void setSendRequest(String sendRequest) {
this.sendRequest = sendRequest;
}
/**
* @return the caller
*/
public String getCaller() {
return caller;
}
/**
* @param caller the caller to set
*/
public void setCaller(String caller) {
this.caller = caller;
}
}
......@@ -5,8 +5,12 @@ import M2Bis.Service;
public class Server extends Component {
public Server(String nomComponent, Service serviceFournis) {
public Server(String nomComponent, Service serviceFournis, int nbClient) {
super(nomComponent, serviceFournis);
this.getListPortCompFournis().add("sendRequest");
for(int i = 0;i<nbClient;i++) {
this.getListPortCompFournis().add("sendRequest"+i);
}
// ServerDetail sDetail = new ServerDetail();
// this.setConfiguration(sDetail);
}
}
......@@ -4,93 +4,27 @@ import java.util.ArrayList;
import M2Bis.Component;
import M2Bis.Configuration;
import M2Bis.Service;
public class SimpleCs extends Configuration {
private RPC rpc;
private ReceiveCalled receiveCalled;
private SendCaller sendCaller;
private ArrayList<Client> listClient;
private Server server;
public SimpleCs(String nomConfiguration, Component component, RPC rpc, ReceiveCalled receiveCalled, SendCaller sendCaller, Client client, Server server) {
super(nomConfiguration, component);
this.rpc = rpc;
this.receiveCalled = receiveCalled;
this.sendCaller = sendCaller;
this.listClient = new ArrayList<Client>();
this.listClient.add(client);
this.server = server;
}
/**
* @return the rpc
*/
public RPC getRpc() {
return rpc;
}
/**
* @param rpc the rpc to set
*/
public void setRpc(RPC rpc) {
this.rpc = rpc;
}
/**
* @return the receiveCalled
*/
public ReceiveCalled getReceiveCalled() {
return receiveCalled;
}
/**
* @param receiveCalled the receiveCalled to set
*/
public void setReceiveCalled(ReceiveCalled receiveCalled) {
this.receiveCalled = receiveCalled;
}
/**
* @return the sendCaller
*/
public SendCaller getSendCaller() {
return sendCaller;
}
/**
* @param sendCaller the sendCaller to set
*/
public void setSendCaller(SendCaller sendCaller) {
this.sendCaller = sendCaller;
}
/**
* @return the listClient
*/
public ArrayList<Client> getListClient() {
return listClient;
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);
RPC link = new RPC("RPC"+i);
this.listConnector.add(link);
ReceiveCalled rCalled = new ReceiveCalled(client.getListPortCompRequis().get(0),
link.getRoleFournis());
this.listAttachement.add(rCalled);
SendCaller sCaller = new SendCaller(server.getListPortCompFournis().get(i),
link.getRoleRequis());
this.listAttachement.add(sCaller);
}
}
/**
* @param listClient the listClient to set
*/
public void setListClient(ArrayList<Client> listClient) {
this.listClient = listClient;
}
/**
* @return the server
*/
public Server getServer() {
return server;
}
/**
* @param server the server to set
*/
public void setServer(Server server) {
this.server = server;
}
}
......@@ -3,11 +3,11 @@ import java.util.ArrayList;
public class Configuration {
private String nomConfiguration;
private ArrayList<String> listPortConf;
private ArrayList<Binding> listBinding;
private ArrayList<Component> listComponent;
private ArrayList<Attachement> listAttachement;
private ArrayList<Connector> listConnector;
public ArrayList<String> listPortConf;
public ArrayList<Binding> listBinding;
public ArrayList<Component> listComponent;
public ArrayList<Attachement> listAttachement;
public ArrayList<Connector> listConnector;
/**
* @param nomConfiguration
......
@startuml
class Configuration{
String nomConfiguration
}
class Component{
String nomComponent
}
class Connector{
String nomConnector
RoleFournis : glue(RoleRequis from)
}
class Role{
String nomRole
}
class RoleFournis extends Role {
}
class RoleRequis extends Role {
}
class Port{
String nomPort
}
class PortConf extends Port{
}
class PortComp extends Port{
}
class PortConfRequis extends PortConf {
}
class PortConfFournis extends PortConf {
}
class PortCompRequis extends PortComp {
}
class PortCompFournis extends PortComp {
}
class Services {
String nomServices
}
class ServicesRequis extends Services {
}
class ServicesFournis extends Services {
}
class Attachement{
}
class AttachementReqFour extends Attachement {
}
class AttachementFourReq extends Attachement{
}
class Binding{
}
class BindingRequis extends Binding{
}
class BindingFournis extends Binding{
}
class Propertie{
string description
}
class Constraint{
string description
}
Configuration "1" *-- "1..*" Component
Configuration "1" *-- "0..*" Connector
Configuration "1" *-- "0..*" Attachement
Configuration "1" *-- "0..*" PortConf
Configuration "1" *-- "0..*" Binding
Component "1" *-- "0..*" PortCompRequis
Component "1" *-- "0..*" ServicesRequis
Component "1" *-- "0..*" PortCompFournis
Component "1" *-- "0..*" ServicesFournis
Component "1" *-- "0..1" Configuration
Component "1" *-- "0..*" Constraint
Component "1" *-- "0..*" Propertie
Connector "1" *-- "1" RoleRequis
Connector "1" *-- "1" RoleFournis
AttachementReqFour "0..*" --> "1" PortCompRequis
AttachementReqFour "0..*" --> "1" RoleFournis
AttachementFourReq "0..*" --> "1" PortCompFournis
AttachementFourReq "0..*" --> "1" RoleRequis
BindingRequis "0..*" --> "1" PortConfRequis
BindingRequis "0..*" --> "1" PortCompRequis
BindingFournis "0..*" --> "1" PortConfFournis
BindingFournis "0..*" --> "1" PortCompFournis
class SimpleCS extends Configuration{
}
class Client extends Component{
}
class Server extends Component{
}
class RPC extends Connector{
}
class Called extends RoleFournis{
}
class Caller extends RoleRequis {
}
class ReceiveRequest extends PortCompRequis{
}
class SendRequest extends PortCompFournis {
}
class ReceiveCalled extends AttachementReqFour{
}
class SendCaller extends AttachementFourReq{
}
SimpleCS "1" *-- "1" Client
SimpleCS "1" *-- "1" Server
SimpleCS "1" *-- "1" RPC
SimpleCS "1" *-- "1" SendCaller
SimpleCS "1" *-- "1" ReceiveCalled
Server "1" *-- "1" SendRequest
Client "1" *-- "1" ReceiveRequest
RPC "1" *-- "1" Caller
RPC "1" *-- "1" Called
SendCaller "1" --> "1" SendRequest
SendCaller "1*" --> "1" Caller
ReceiveCalled "1*" --> "1" Called
ReceiveCalled "1*" --> "1" ReceiveRequest
@enduml
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment