@Test public void convertSecurityServerObject() { SecurityServerId securityServerId = SecurityServerId.create( "XRD2", "GOV", "M4", "server1"); SecurityServer converted = securityServerConverter.convert(securityServerId); assertEquals("XRD2:GOV:M4:server1", converted.getId()); assertEquals("XRD2", converted.getInstanceId()); assertEquals("GOV", converted.getMemberClass()); assertEquals("M4", converted.getMemberCode()); assertEquals("server1", converted.getServerCode()); assertEquals(SERVER_ADDRESS, converted.getServerAddress()); }
public SecurityServer convert(SecurityServerId securityServerId) { SecurityServer securityServer = new SecurityServer(); securityServer.setId(convertId(securityServerId)); securityServer.setInstanceId(securityServerId.getXRoadInstance()); securityServer.setMemberClass(securityServerId.getMemberClass()); securityServer.setMemberCode(securityServerId.getMemberCode()); securityServer.setServerCode(securityServerId.getServerCode()); String securityServerAddress = globalConfFacade.getSecurityServerAddress(securityServerId); securityServer.setServerAddress(securityServerAddress); return securityServer; }
SecurityServerConverter { public SecurityServer convert(SecurityServerId securityServerId) { SecurityServer securityServer = new SecurityServer(); securityServer.setId(convertId(securityServerId)); securityServer.setInstanceId(securityServerId.getXRoadInstance()); securityServer.setMemberClass(securityServerId.getMemberClass()); securityServer.setMemberCode(securityServerId.getMemberCode()); securityServer.setServerCode(securityServerId.getServerCode()); String securityServerAddress = globalConfFacade.getSecurityServerAddress(securityServerId); securityServer.setServerAddress(securityServerAddress); return securityServer; } }
SecurityServerConverter { public SecurityServer convert(SecurityServerId securityServerId) { SecurityServer securityServer = new SecurityServer(); securityServer.setId(convertId(securityServerId)); securityServer.setInstanceId(securityServerId.getXRoadInstance()); securityServer.setMemberClass(securityServerId.getMemberClass()); securityServer.setMemberCode(securityServerId.getMemberCode()); securityServer.setServerCode(securityServerId.getServerCode()); String securityServerAddress = globalConfFacade.getSecurityServerAddress(securityServerId); securityServer.setServerAddress(securityServerAddress); return securityServer; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); }
SecurityServerConverter { public SecurityServer convert(SecurityServerId securityServerId) { SecurityServer securityServer = new SecurityServer(); securityServer.setId(convertId(securityServerId)); securityServer.setInstanceId(securityServerId.getXRoadInstance()); securityServer.setMemberClass(securityServerId.getMemberClass()); securityServer.setMemberCode(securityServerId.getMemberCode()); securityServer.setServerCode(securityServerId.getServerCode()); String securityServerAddress = globalConfFacade.getSecurityServerAddress(securityServerId); securityServer.setServerAddress(securityServerAddress); return securityServer; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); SecurityServerId convertId(String encodedId); String convertId(SecurityServerId securityServerId); SecurityServer convert(SecurityServerId securityServerId); List<SecurityServer> convert(Iterable<SecurityServerId> securityServerIds); }
SecurityServerConverter { public SecurityServer convert(SecurityServerId securityServerId) { SecurityServer securityServer = new SecurityServer(); securityServer.setId(convertId(securityServerId)); securityServer.setInstanceId(securityServerId.getXRoadInstance()); securityServer.setMemberClass(securityServerId.getMemberClass()); securityServer.setMemberCode(securityServerId.getMemberCode()); securityServer.setServerCode(securityServerId.getServerCode()); String securityServerAddress = globalConfFacade.getSecurityServerAddress(securityServerId); securityServer.setServerAddress(securityServerAddress); return securityServer; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); SecurityServerId convertId(String encodedId); String convertId(SecurityServerId securityServerId); SecurityServer convert(SecurityServerId securityServerId); List<SecurityServer> convert(Iterable<SecurityServerId> securityServerIds); static final int SECURITY_SERVER_CODE_INDEX; }