Package com.inesm.KeyManager.services
Class CommunicationService
java.lang.Object
com.inesm.KeyManager.services.CommunicationService
Provides methods that used to coordinate communication between stations
at more of a network level.
-
Constructor Summary
ConstructorsConstructorDescriptionCommunicationService(KeyManager keyManager, CryptographyService crypto, KeySupplier keySuplier, MessageManager msgService) Constructor for CommunicationService. -
Method Summary
Modifier and TypeMethodDescriptionGets all waiting network resources.voidprocess(ObjectInputStream objIn) Process a network resource from an input stream.
-
Constructor Details
-
CommunicationService
@Autowired public CommunicationService(KeyManager keyManager, CryptographyService crypto, KeySupplier keySuplier, MessageManager msgService) Constructor for CommunicationService.- Parameters:
keyManager- the key manager usedcrypto- the service providing cryptographic algorithmskeySuplier- the service providing the keysmsgService- the message manager used
-
-
Method Details
-
getResourcesForStations
Gets all waiting network resources. Checks for all waiting network resources to be sent. If none are found, it will block and wait for the creation of network resources.Groups the network resources by destination and saves them in a list.
- Returns:
- an object containing the list of network resources for a given station and the station's corresponding IP Address.
- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting
-
process
public void process(ObjectInputStream objIn) throws ClassNotFoundException, IOException, ObjectNotMappedException, ObjectNotFoundException, InvalidParametersException, InvalidSignatureException Process a network resource from an input stream.- Parameters:
objIn- the input stream to be processed- Throws:
ClassNotFoundException- if the class of the serialized object can't be foundIOException- if a problem occurred reading the input streamObjectNotMappedException- if the network resource received is not expected by the methodObjectNotFoundException- if the network resource is a receipt, and the message referenced is not foundInvalidParametersException- if the network resource contains invalid parametersInvalidSignatureException- if the network resource contains an invalid signature
-