use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class InMemoryBounceProxyDirectory method addBounceProxy.
@Override
public void addBounceProxy(ControlledBounceProxyInformation bpInfo) {
if (directory.containsKey(bpInfo.getId()))
throw new IllegalArgumentException("Bounce proxy with ID '" + bpInfo.getId() + "' already added to the directory");
BounceProxyRecord record = new BounceProxyRecord(bpInfo);
record.setFreshness(timestampProvider.getCurrentTime());
directory.put(bpInfo.getId(), record);
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class InMemoryBounceProxyDirectory method updateChannelAssignment.
@Override
public void updateChannelAssignment(String ccid, BounceProxyInformation bpInfo) {
if (!directory.containsKey(bpInfo.getId()))
throw new IllegalArgumentException("No bounce proxy with ID '" + bpInfo.getId() + "' available in the directory");
BounceProxyRecord record = directory.get(bpInfo.getId());
record.addAssignedChannel(ccid);
record.setLastAssignedTimestamp(timestampProvider.getCurrentTime());
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class BounceProxyEntity method convertToBounceProxyRecord.
public BounceProxyRecord convertToBounceProxyRecord() {
BounceProxyRecord bpRecord = new BounceProxyRecord(bpInfo.convertToBounceProxyInformation());
for (ChannelEntity channelEntity : this.channels) {
bpRecord.addAssignedChannel(channelEntity.getChannelId());
}
bpRecord.setFreshness(this.freshness);
bpRecord.setLastAssignedTimestamp(this.lastAssignedTimestamp);
bpRecord.setStatus(BounceProxyStatus.valueOf(this.status));
return bpRecord;
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class MonitoringServiceImpl method updatePerformanceMeasures.
@Override
public void updatePerformanceMeasures(String bpId, PerformanceMeasures performanceMeasures) {
BounceProxyRecord bounceProxyRecord = bounceProxyDirectory.getBounceProxy(bpId);
bounceProxyRecord.setPerformanceMeasures(performanceMeasures);
bounceProxyRecord.setStatus(BounceProxyStatus.ACTIVE);
bounceProxyDirectory.updateBounceProxy(bounceProxyRecord);
}
use of io.joynr.messaging.bounceproxy.controller.directory.BounceProxyRecord in project joynr by bmwcarit.
the class RoundRobinAssignmentTest method testAssignmentWithSingleBounceProxy.
@Test
public void testAssignmentWithSingleBounceProxy() {
LinkedList<BounceProxyRecord> bpList = new LinkedList<BounceProxyRecord>();
bpList.add(createBounceProxyRecord("X.Y"));
Mockito.when(directoryMock.getAssignableBounceProxies()).thenReturn(bpList);
BounceProxyInformation bounceProxy = assignmentStrategy.calculateBounceProxy("channel-123");
Assert.assertEquals("X.Y", bounceProxy.getId());
Mockito.verify(directoryMock, Mockito.never()).updateChannelAssignment("channel-123", bounceProxy);
}
Aggregations