@Override
    public void register(Client client) throws RegistrationException, NotAuthorizedException {
        if (client.getApiKey() == null) {
            throw new RegistrationException("Cannot Register Client: Missing API Key"); //$NON-NLS-1$
        }

        final Set<Throwable> errorHolder = new HashSet<>();
        final CountDownLatch latch = new CountDownLatch(1);
        // Register client; latch until result returned and evaluated
        getEngine().getRegistry().registerClient(client, latchedResultHandler(latch, errorHolder));
        awaitOnLatch(latch, errorHolder);
    }
@see IClientResource#register(io.apiman.gateway.engine.beans.Client)
gateway/api/rest-impl/src/main/java/io/apiman/gateway/api/rest/impl/ClientResourceImpl.java