class Federation {

    public static FederationResponse resolve(String value) {
        String[] tokens = value.split("\\*");
        if (tokens.length == 1) {
            // accountId
            return new FederationResponse(null, value, null, null);
        } else if (tokens.length == 2) {
            String domain = tokens[1];
            FederationServer server = FederationServer.createForDomain(domain);
            return server.resolveAddress(value);
        } else {
            throw new MalformedAddressException();
        }
    }

    private  Federation();

}