Codota Logo
RestStoreConfigurationBuilder
Code IndexAdd Codota to your IDE (free)

How to use
RestStoreConfigurationBuilder
in
org.infinispan.persistence.rest.configuration

Best Java code snippets using org.infinispan.persistence.rest.configuration.RestStoreConfigurationBuilder (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public ConnectionPoolConfigurationBuilder connectionPool() {
 return builder.connectionPool();
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder host(String host) {
 return builder.host(host);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder path(String path) {
 return builder.path(path);
}
origin: org.infinispan.server/infinispan-server-infinispan

} else if (storeKey.equals(ModelKeys.REST_STORE)) {
    final RestStoreConfigurationBuilder builder = persistenceBuilder.addStore(RestStoreConfigurationBuilder.class);
    builder.host("localhost"); // To pass builder validation, the builder will be configured properly when the outbound socket is ready to be injected
    for (ModelNode server : store.require(ModelKeys.REMOTE_SERVERS).asList()) {
      String outboundSocketBinding = server.get(ModelKeys.OUTBOUND_SOCKET_BINDING).asString();
      dependencies.add(new Dependency<>(OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME.append(outboundSocketBinding), OutboundSocketBinding.class, injector));
    builder.appendCacheNameToPath(RestStoreConfigurationResource.APPEND_CACHE_NAME_TO_PATH.resolveModelAttribute(context, store).asBoolean());
    builder.path(RestStoreConfigurationResource.PATH.resolveModelAttribute(context, store).asString());
    builder.maxContentLength(RestStoreConfigurationResource.MAX_CONTENT_LENGTH.resolveModelAttribute(context, store).asInt());
    builder.rawValues(true);
      builder.connectionPool().bufferSize(RestStoreConfigurationResource.BUFFER_SIZE.resolveModelAttribute(context, pool).asInt());
      builder.connectionPool().connectionTimeout(RestStoreConfigurationResource.CONNECTION_TIMEOUT.resolveModelAttribute(context, pool).asInt());
      builder.connectionPool().maxConnectionsPerHost(RestStoreConfigurationResource.MAX_CONNECTIONS_PER_HOST.resolveModelAttribute(context, pool).asInt());
      builder.connectionPool().maxTotalConnections(RestStoreConfigurationResource.MAX_TOTAL_CONNECTIONS.resolveModelAttribute(context, pool).asInt());
      builder.connectionPool().socketTimeout(RestStoreConfigurationResource.SOCKET_TIMEOUT.resolveModelAttribute(context, pool).asInt());
      builder.connectionPool().tcpNoDelay(RestStoreConfigurationResource.TCP_NO_DELAY.resolveModelAttribute(context, pool).asBoolean());
origin: org.infinispan/infinispan-tools

switch (attribute) {
case APPEND_CACHE_NAME_TO_PATH: {
 builder.appendCacheNameToPath(Boolean.parseBoolean(value));
 break;
 builder.host(value);
 break;
 builder.path(value);
 break;
 builder.port(Integer.parseInt(value));
 break;
 builder.key2StringMapper(value);
 break;
origin: org.infinispan/infinispan-cachestore-rest

protected void configurePersistence(ConfigurationBuilder cb) {
 localCacheManager = TestCacheManagerFactory.createServerModeCacheManager();
 RestServerConfigurationBuilder restServerConfigurationBuilder = new RestServerConfigurationBuilder();
 restServer = new RestServer();
 restServer.start(restServerConfigurationBuilder.build(), localCacheManager);
 cb.persistence().addStore(RestStoreConfigurationBuilder.class)
    .host("localhost")
    .port(restServer.getPort())
    .path("/rest/"+ BasicCacheContainer.DEFAULT_CACHE_NAME)
    .preload(false);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
protected AdvancedLoadWriteStore createStore() throws Exception {
 ConfigurationBuilder localBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
 localBuilder.memory().evictionType(EvictionType.COUNT).size(WRITE_DELETE_BATCH_MAX_ENTRIES).expiration().wakeUpInterval(10L);
 localCacheManager = TestCacheManagerFactory.createServerModeCacheManager(localBuilder);
 localCacheManager.defineConfiguration(REMOTE_CACHE, localCacheManager.getDefaultCacheConfiguration());
 localCacheManager.getCache(REMOTE_CACHE);
 TestingUtil.replaceComponent(localCacheManager, TimeService.class, timeService, true);
 localCacheManager.getCache(REMOTE_CACHE).getAdvancedCache().getComponentRegistry().rewire();
 RestServerConfigurationBuilder restServerConfigurationBuilder = new RestServerConfigurationBuilder();
 restServerConfigurationBuilder.port(0);
 restServer = new RestServer();
 restServer.start(restServerConfigurationBuilder.build(), localCacheManager);
 ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
 RestStoreConfigurationBuilder storeConfigurationBuilder = builder.persistence()
    .addStore(RestStoreConfigurationBuilder.class);
 storeConfigurationBuilder.host(restServer.getHost()).port(restServer.getPort()).path("/rest/" + REMOTE_CACHE);
 storeConfigurationBuilder.connectionPool().maxTotalConnections(10).maxConnectionsPerHost(10);
 storeConfigurationBuilder.validate();
 RestStore restStore = new RestStore();
 restStore.init(createContext(builder.build()));
 return restStore;
}
origin: org.infinispan/infinispan-cachestore-rest

@BeforeClass
public void setup() {
 RestServerConfigurationBuilder restServerConfigurationBuilder = new RestServerConfigurationBuilder();
 restServerConfigurationBuilder.port(0);
 ConfigurationBuilder serverBuilder = getSourceServerBuilder();
 sourceContainer = TestCacheManagerFactory.createServerModeCacheManager(serverBuilder);
 sourceServerCache = sourceContainer.getCache();
 sourceServer = new RestServer();
 sourceServer.start(restServerConfigurationBuilder.build(), sourceContainer);
 ConfigurationBuilder targetConfigurationBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
 targetConfigurationBuilder.persistence().addStore(RestStoreConfigurationBuilder.class).host("localhost").port(sourceServer.getPort())
    .path("/rest/" + BasicCacheContainer.DEFAULT_CACHE_NAME).rawValues(true).locking().isolationLevel(IsolationLevel.NONE);
 targetConfigurationBuilder.encoding().key().mediaType(LEGACY_KEY_ENCODING);
 targetContainer = TestCacheManagerFactory.createServerModeCacheManager(targetConfigurationBuilder);
 targetServerCache = targetContainer.getCache();
 targetServer = new RestServer();
 targetServer.start(restServerConfigurationBuilder.build(), targetContainer);
 client = new HttpClient();
}
origin: org.infinispan/infinispan-cachestore-rest

switch (attribute) {
 case APPEND_CACHE_NAME_TO_PATH: {
   builder.appendCacheNameToPath(Boolean.parseBoolean(value));
   break;
   builder.path(value);
   break;
   builder.key2StringMapper(value);
   break;
   builder.rawValues(Boolean.parseBoolean(value));
   break;
   builder.maxContentLength(Integer.parseInt(value));
   break;
origin: org.infinispan.server/infinispan-server-infinispan

  @Override
  public void inject(OutboundSocketBinding value) {
    try {
      builder.host(value.getResolvedDestinationAddress().getHostAddress()).port(value.getDestinationPort()); // FIXME: add support for multiple hosts
    } catch (UnknownHostException e) {
      throw InfinispanMessages.MESSAGES.failedToInjectSocketBinding(e, value);
    }
  }
};
origin: org.infinispan/infinispan-tools

private void parseRestStore(final XMLExtendedStreamReader reader, PersistenceConfigurationBuilder loadersBuilder,
   ClassLoader classLoader) throws XMLStreamException {
 RestStoreConfigurationBuilder builder = new RestStoreConfigurationBuilder(loadersBuilder);
 parseRestStoreAttributes(reader, builder, classLoader);
 while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
   Element element = Element.forName(reader.getLocalName());
   switch (element) {
   case CONNECTION_POOL: {
    parseConnectionPool(reader, builder.connectionPool());
    break;
   }
   default: {
    Parser60.parseCommonStoreChildren(reader, builder);
    break;
   }
   }
 }
 loadersBuilder.addStore(builder);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder port(int port) {
 return builder.port(port);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder appendCacheNameToPath(boolean appendCacheNameToPath) {
 return builder.appendCacheNameToPath(appendCacheNameToPath);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder rawValues(boolean rawValues) {
 return builder.rawValues(rawValues);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder key2StringMapper(Class<? extends MarshallingTwoWayKey2StringMapper> klass) {
 return builder.key2StringMapper(klass);
}
origin: org.infinispan/infinispan-cachestore-rest

  @Override
  public RestStoreConfigurationBuilder maxContentLength(int maxContentLength) {
   return builder.maxContentLength(maxContentLength);
  }
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
protected PersistenceConfigurationBuilder createCacheStoreConfig(PersistenceConfigurationBuilder loaders, boolean preload) {
 localCacheManager = TestCacheManagerFactory.createServerModeCacheManager();
 RestServerConfigurationBuilder restServerConfigurationBuilder = new RestServerConfigurationBuilder();
 restServerConfigurationBuilder.port(0);
 restServer = new RestServer();
 restServer.start(restServerConfigurationBuilder.build(), cacheManager);
 loaders.addStore(RestStoreConfigurationBuilder.class)
    .host("localhost")
    .port(restServer.getPort())
    .path("/rest/"+BasicCacheContainer.DEFAULT_CACHE_NAME)
    .preload(preload);
 return loaders;
}
origin: org.infinispan/infinispan-cachestore-rest

private void parseServer(XMLExtendedStreamReader reader, RestStoreConfigurationBuilder builder)
   throws XMLStreamException {
 for (int i = 0; i < reader.getAttributeCount(); i++) {
   ParseUtils.requireNoNamespaceAttribute(reader, i);
   String value = replaceProperties(reader.getAttributeValue(i));
   Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
   switch (attribute) {
    case HOST:
      builder.host(value);
      break;
    case PORT:
      builder.port(Integer.parseInt(value));
      break;
    case OUTBOUND_SOCKET_BINDING:
      log.ignoreXmlAttribute(attribute);
      break;
    default:
      throw ParseUtils.unexpectedAttribute(reader, i);
   }
 }
 ParseUtils.requireNoContent(reader);
}
origin: org.infinispan/infinispan-cachestore-rest

private void parseRestStore(final XMLExtendedStreamReader reader, PersistenceConfigurationBuilder loadersBuilder) throws XMLStreamException {
 RestStoreConfigurationBuilder builder = new RestStoreConfigurationBuilder(loadersBuilder);
 parseRestStoreAttributes(reader, builder);
 while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
   Element element = Element.forName(reader.getLocalName());
   switch (element) {
    case CONNECTION_POOL: {
      parseConnectionPool(reader, builder.connectionPool());
      break;
    }
    case SERVER: {
      parseServer(reader, builder);
      break;
    }
    default: {
      Parser.parseStoreElement(reader, builder);
      break;
    }
   }
 }
 loadersBuilder.addStore(builder);
}
origin: org.infinispan/infinispan-cachestore-rest

@Override
public RestStoreConfigurationBuilder key2StringMapper(String key2StringMapper) {
 return builder.key2StringMapper(key2StringMapper);
}
org.infinispan.persistence.rest.configurationRestStoreConfigurationBuilder

Javadoc

RestStoreConfigurationBuilder. Configures a org.infinispan.persistence.rest.RestStore

Most used methods

  • connectionPool
  • host
  • path
  • port
  • appendCacheNameToPath
  • rawValues
  • <init>
  • key2StringMapper
  • maxContentLength
  • locking
  • metadataHelper
  • preload
  • metadataHelper,
  • preload,
  • validate

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now