Skip to content

Commit

Permalink
[PROXIES] Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioal0 committed Jun 7, 2020
1 parent 67b5055 commit 29100a1
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 111 deletions.
29 changes: 17 additions & 12 deletions src/proxies/ArrivalLoungeProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.ArrivalLounge;

public class ArrivalLoungeProxy implements SharedRegionProxy {

/**
* Arrival Lounge (represents the service to be provided).
*
* @serialField arrivalLounge.
*/
private final ArrivalLounge arrivalLounge;

/**
* The simulation has finished
* @serialField simFinished
* ArrivalLoungeProxy Constructor.
* It initiates the Arrival Lounge.
*
* @param arrivalLounge Arrival Lounge.
*/
private boolean simFinished;

public ArrivalLoungeProxy(ArrivalLounge arrivalLounge) {
this.arrivalLounge = arrivalLounge;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -86,12 +97,6 @@ public Message processAndReply(Message msg) {
serviceProviderProxy.shutdown(msg.getIntValue1(),0);
break;
}

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
28 changes: 17 additions & 11 deletions src/proxies/ArrivalQuayProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.ArrivalQuay;

public class ArrivalQuayProxy implements SharedRegionProxy {

/**
* Arrival Quay (represents the service to be provided).
*
* @serialField arrivalQuay.
*/
private final ArrivalQuay arrivalQuay;

/**
* The simulation has finished
* @serialField simFinished
* ArrivalQuayProxy Constructor.
* It initiates the Arrival Quay.
*
* @param arrivalQuay Arrival Quay.
*/
private boolean simFinished;

public ArrivalQuayProxy(ArrivalQuay arrivalQuay) {
this.arrivalQuay = arrivalQuay;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -62,9 +73,4 @@ public Message processAndReply(Message msg) {

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
30 changes: 17 additions & 13 deletions src/proxies/ArrivalTerminalExitProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.ArrivalTerminalExit;

public class ArrivalTerminalExitProxy implements SharedRegionProxy {

/**
* Arrival Terminal Exit (represents the service to be provided).
*
* @serialField arrivalTerminalExit.
*/
private final ArrivalTerminalExit arrivalTerminalExit;

/**
* The simulation has finished
* @serialField simFinished
* ArrivalQuayProxy Constructor.
* It initiates the Arrival Terminal Exit.
*
* @param arrivalTerminalExit Arrival Terminal Exit.
*/
private boolean simFinished;

public ArrivalTerminalExitProxy(ArrivalTerminalExit arrivalTerminalExit) {
this.arrivalTerminalExit = arrivalTerminalExit;
this.simFinished = false;
}

// check how to do setDTE
/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -49,12 +59,6 @@ public Message processAndReply(Message msg) {
serviceProviderProxy.shutdown(msg.getIntValue1(),2);
break;
}

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
29 changes: 17 additions & 12 deletions src/proxies/BagColPointProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.BagColPoint;

public class BagColPointProxy implements SharedRegionProxy {

/**
* Baggage Collection Point (represents the service to be provided).
*
* @serialField bagColPoint.
*/
private final BagColPoint bagColPoint;

/**
* The simulation has finished
* @serialField simFinished
* ArrivalQuayProxy Constructor.
* It initiates the Baggage Collection Point.
*
* @param bagColPoint Baggage Collection Point.
*/
private boolean simFinished;

public BagColPointProxy(BagColPoint bagColPoint) {
this.bagColPoint = bagColPoint;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -51,12 +62,6 @@ public Message processAndReply(Message msg) {
serviceProviderProxy.shutdown(msg.getIntValue1(),3);
break;
}

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
28 changes: 17 additions & 11 deletions src/proxies/BagRecOfficeProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.BagRecOffice;

public class BagRecOfficeProxy implements SharedRegionProxy {

/**
* Baggage Reclaim Office (represents the service to be provided).
*
* @serialField bagRecOffice.
*/
private final BagRecOffice bagRecOffice;

/**
* The simulation has finished
* @serialField simFinished
* BagRecOfficeProxy Constructor.
* It initiates the Baggage Reclaim Office.
*
* @param bagRecOffice Baggage Reclaim Office.
*/
private boolean simFinished;

public BagRecOfficeProxy( BagRecOffice bagRecOffice) {
this.bagRecOffice = bagRecOffice;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand All @@ -41,9 +52,4 @@ public Message processAndReply(Message msg) {

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
28 changes: 17 additions & 11 deletions src/proxies/DepartureQuayProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.DepartureQuay;

public class DepartureQuayProxy implements SharedRegionProxy {

/**
* Departure Quay (represents the service to be provided).
*
* @serialField departureQuay.
*/
private final DepartureQuay departureQuay;

/**
* The simulation has finished
* @serialField simFinished
* DepartureQuayProxy Constructor.
* It initiates the Departure Quay.
*
* @param departureQuay Departure Quay.
*/
private boolean simFinished;

public DepartureQuayProxy(DepartureQuay departureQuay) {
this.departureQuay = departureQuay;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -49,9 +60,4 @@ public Message processAndReply(Message msg) {

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
29 changes: 17 additions & 12 deletions src/proxies/DepartureTerminalEntranceProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@

import common.Message;
import common.MessageType;
import common.ServerCom;
import sharedRegions.DepartureTerminalEntrance;

public class DepartureTerminalEntranceProxy implements SharedRegionProxy {

/**
* Departure Terminal Entrance (represents the service to be provided).
*
* @serialField departureTerminalEntrance.
*/
private final DepartureTerminalEntrance departureTerminalEntrance;

/**
* The simulation has finished
* @serialField simFinished
* DepartureTerminalEntranceProxy Constructor.
* It initiates the Departure Terminal Entrance.
*
* @param departureTerminalEntrance Departure Terminal Entrance.
*/
private boolean simFinished;

public DepartureTerminalEntranceProxy(DepartureTerminalEntrance departureTerminalEntrance) {
this.departureTerminalEntrance = departureTerminalEntrance;
this.simFinished = false;
}

/**
* Process messages by executing corresponding task.
* Generate answer message.
*
* @param msg message in the request.
*
* @return answer message.
*/
@Override
public Message processAndReply(Message msg) {
Message nm = new Message();
Expand Down Expand Up @@ -48,12 +59,6 @@ public Message processAndReply(Message msg) {
serviceProviderProxy.shutdown(msg.getIntValue1(),6);
break;
}

return nm;
}

@Override
public boolean getSimStatus() {
return false;
}
}
Loading

0 comments on commit 29100a1

Please sign in to comment.