DatabaseClientFactory.Bean clientFactoryBean = makeClientBeanFactory(); clientFactoryBean.getHandleRegistry().register( JAXBHandle.newFactory(Product.class) ); DatabaseClient client = clientFactoryBean.newClient();
: clientFactoryBean.getHandleRegistry(); : clientFactoryBean.newClient();
/** * Creates a client for bean applications based on the properties. * Other applications can use the static newClient() factory methods * of DatabaseClientFactory. * The client accesses the database by means of a REST server. * @return a new client for making database requests */ public DatabaseClient newClient() { DatabaseClientImpl client = (DatabaseClientImpl) DatabaseClientFactory.newClient( host, port, database, (securityContext!=null? securityContext:makeSecurityContext(user, password, authentication, context, verifier)), connectionType); client.setHandleRegistry(getHandleRegistry().copy()); return client; } }
/** * Creates a client for bean applications based on the properties. * Other applications can use the static newClient() factory methods * of DatabaseClientFactory. * The client accesses the database by means of a REST server. * @return a new client for making database requests */ public DatabaseClient newClient() { DatabaseClientImpl client = newClientImpl(host, port, user, password, authentication, context, verifier); client.setHandleRegistry(getHandleRegistry().copy()); return client; } }
/** * Initializes a handle registry with the default associations * between the content handles provided by the API and the supported * IO representation classes. Use this method only after clearing * or overwriting associations in the handle registry. */ public void registerDefaultHandles() { HandleFactoryRegistryImpl.registerDefaults(getHandleRegistry()); }
/** * Initializes a handle registry with the default associations * between the content handles provided by the API and the supported * IO representation classes. Use this method only after clearing * or overwriting associations in the handle registry. */ public void registerDefaultHandles() { HandleFactoryRegistryImpl.registerDefaults(getHandleRegistry()); }
private DatabaseClientFactory.Bean makeClientFactory() { DatabaseClientFactory.Bean clientFactoryBean = new DatabaseClientFactory.Bean(); clientFactoryBean.setHost(Common.HOST); clientFactoryBean.setPort(Common.PORT); clientFactoryBean.setUser(Common.USER); clientFactoryBean.setPassword(Common.PASS); clientFactoryBean.setAuthentication(Authentication.DIGEST); return clientFactoryBean; }
private DatabaseClientFactory.Bean makeClientBeanFactory() { DatabaseClientFactory.Bean clientFactoryBean = new DatabaseClientFactory.Bean(); DatabaseClientFactory.DigestAuthContext clientFactoryContext = new DatabaseClientFactory.DigestAuthContext(Common.USER, Common.PASS); clientFactoryBean.setHost(Common.HOST); clientFactoryBean.setPort(Common.PORT); clientFactoryBean.setSecurityContext(clientFactoryContext); return clientFactoryBean; }