@Test public void testCreate() throws EtiqetException { String clientType = "testProtocol"; Client client = ClientFactory.create(clientType); assertNotNull(client); assertTrue(client instanceof TestClient); assertFalse(client.getConfig().isEmpty()); assertFalse(client.canFailover()); assertTrue(client.getDelegate() instanceof LoggerClientDelegate); }
public static Client create(String clientType) throws EtiqetException { ProtocolConfig protocol = GlobalConfig.getInstance().getProtocol(clientType); if (protocol == null) { throw new UnhandledProtocolException(String.format(PROTOCOL_ERROR, clientType)); } return create(clientType, protocol.getClient().getDefaultConfig()); }
ClientFactory { public static Client create(String clientType) throws EtiqetException { ProtocolConfig protocol = GlobalConfig.getInstance().getProtocol(clientType); if (protocol == null) { throw new UnhandledProtocolException(String.format(PROTOCOL_ERROR, clientType)); } return create(clientType, protocol.getClient().getDefaultConfig()); } }
ClientFactory { public static Client create(String clientType) throws EtiqetException { ProtocolConfig protocol = GlobalConfig.getInstance().getProtocol(clientType); if (protocol == null) { throw new UnhandledProtocolException(String.format(PROTOCOL_ERROR, clientType)); } return create(clientType, protocol.getClient().getDefaultConfig()); } private  ClientFactory(); }
ClientFactory { public static Client create(String clientType) throws EtiqetException { ProtocolConfig protocol = GlobalConfig.getInstance().getProtocol(clientType); if (protocol == null) { throw new UnhandledProtocolException(String.format(PROTOCOL_ERROR, clientType)); } return create(clientType, protocol.getClient().getDefaultConfig()); } private  ClientFactory(); static Client create(String clientType); static Client create(String clientType, String config); static Client create(String clientType, String primaryConfig, String secondaryConfig); static Client create(
        String clientType,
        String primaryConfig,
        String secondaryConfig,
        ProtocolConfig protocolConfig
    ); }
ClientFactory { public static Client create(String clientType) throws EtiqetException { ProtocolConfig protocol = GlobalConfig.getInstance().getProtocol(clientType); if (protocol == null) { throw new UnhandledProtocolException(String.format(PROTOCOL_ERROR, clientType)); } return create(clientType, protocol.getClient().getDefaultConfig()); } private  ClientFactory(); static Client create(String clientType); static Client create(String clientType, String config); static Client create(String clientType, String primaryConfig, String secondaryConfig); static Client create(
        String clientType,
        String primaryConfig,
        String secondaryConfig,
        ProtocolConfig protocolConfig
    );  }