Tabnine Logo
Configurator
Code IndexAdd Tabnine to your IDE (free)

How to use
Configurator
in
com.elasticinbox.config

Best Java code snippets using com.elasticinbox.config.Configurator (Showing top 12 results out of 315)

origin: elasticinbox/elasticinbox

/**
 * Get quota (maximum) bytes for the given mailbox
 *  
 * @param mailbox
 * @return
 */
public Long getQuotaBytes(final Mailbox mailbox) {
  // TODO: add account quota attribute check
  return Configurator.getDefaultQuotaBytes();
}

origin: elasticinbox/elasticinbox

/**
 * Get quota (maximum) messages for the given mailbox
 * 
 * @param mailbox
 * @return
 */
public Long getQuotaCount(final Mailbox mailbox) {
  // TODO: add account quota attribute check
  return Configurator.getDefaultQuotaCount();
}
origin: elasticinbox/elasticinbox

public void start(BundleContext context) throws Exception
{
  plugin = this;
  bundleContext = context;
  // Setup performance logger for POP3
  if(Configurator.isPerformanceCountersEnabled()) {
    PeriodicalLog pLog = new PeriodicalLog();
    pLog.setName(SPEED4J_LOG_NAME);
    pLog.setMode(PeriodicalLog.Mode.JMX_ONLY);
    pLog.setMaxQueueSize(250000);
    pLog.setPeriod(Configurator.getPerformanceCountersInterval());
    pLog.setJmx("AUTH.success,AUTH.fail");
    pLog.setSlf4jLogname("com.elasticinbox.speed4j.pop3.PeriodicalLogger");
    stopWatchFactory = StopWatchFactory.getInstance(pLog);
  } else {
    Slf4jLog pLog = new Slf4jLog();
    pLog.setName(SPEED4J_LOG_NAME);
    pLog.setSlf4jLogname("com.elasticinbox.speed4j.pop3.PeriodicalLogger");
    stopWatchFactory = StopWatchFactory.getInstance(pLog);
  }
  backend = new MailboxHandlerFactory();
  logger.debug("Starting POP3 daemon...");
  server = new POP3ProxyServer(backend);
  server.start();
  logger.info("POP3 daemon started.");
}
origin: elasticinbox/elasticinbox

long requiredCount = mailboxCounters.getTotalMessages() + 1;
if ((requiredBytes > Configurator.getDefaultQuotaBytes()) ||
  (requiredCount > Configurator.getDefaultQuotaCount()))
          Configurator.getDefaultQuotaBytes(), requiredCount,
          Configurator.getDefaultQuotaCount() });
        Configurator.getBlobStoreWriteProfileName(), in, message.getSize())
        .buildURI();
origin: elasticinbox/elasticinbox

public Speed4jOpTimer()
{
  // Instantiate a new Periodical logger
  PeriodicalLog pLog = new PeriodicalLog();
  pLog.setName("ElasticInbox-Hector");
  pLog.setPeriod(Configurator.getPerformanceCountersInterval());
  pLog.setMode(PeriodicalLog.Mode.JMX_ONLY);
  pLog.setMaxQueueSize(250000);
  pLog.setJmx("READ.success,WRITE.success,READ.fail,WRITE.fail,META_READ.success,META_READ.fail");
  pLog.setSlf4jLogname("com.elasticinbox.speed4j.cassandra.HectorPeriodicalLogger");
  stopWatchFactory = StopWatchFactory.getInstance(pLog);
}
origin: elasticinbox/elasticinbox

if (updatedSize <= Configurator.getDatabaseBlobMaxSize())
      updatedSize, Configurator.getDatabaseBlobMaxSize());
  blobUri = dbBlobStorage.write(messageId, mailbox, null, in1, updatedSize);
} else {
  logger.debug(
      "Storing Blob in the cloud because size ({}KB) was greater than database threshold {}KB",
      updatedSize, Configurator.getDatabaseBlobMaxSize());
  blobUri = cloudBlobStorage.write(messageId, mailbox, Configurator.getBlobStoreWriteProfileName(), in1, updatedSize);
origin: elasticinbox/elasticinbox

@Override
public BlobURI write(final UUID messageId, final Mailbox mailbox, final String profileName, final InputStream in, final Long size)
    throws IOException, GeneralSecurityException
{
  // get blob name
  String blobName = new BlobNameBuilder().setMailbox(mailbox)
      .setMessageId(messageId).setMessageSize(size).build();
  InputStream in1;
  Long updatedSize = size;
  // prepare URI
  BlobURI blobUri = new BlobURI()
      .setProfile(profileName)
      .setName(blobName);
  // encrypt stream
  if (encryptionHandler != null)
  {
    byte[] iv = getCipherIVFromBlobName(blobName);
    
    InputStream encryptedInputStream = this.encryptionHandler.encrypt(in, Configurator.getBlobStoreDefaultEncryptionKey(), iv);
    FileBackedOutputStream fbout = new FileBackedOutputStream(MAX_MEMORY_FILE_SIZE, true);
    
    updatedSize = ByteStreams.copy(encryptedInputStream, fbout);
    in1 = fbout.getSupplier().getInput();
    blobUri.setEncryptionKey(Configurator.getBlobStoreDefaultEncryptionKeyAlias());
  } else {
    in1 = in;
  }
  CloudStoreProxy.write(blobName, profileName, in1, updatedSize);
  return blobUri;
}
origin: elasticinbox/elasticinbox

BlobStoreProfile profile = Configurator.getBlobStoreProfile(profileName);
String path = BlobUtils.relativize(uri.getPath());
origin: elasticinbox/elasticinbox

public void start(BundleContext context) throws Exception
{
  plugin = this;
  bundleContext = context;
  // Setup performance logger for LMTP
  if(Configurator.isPerformanceCountersEnabled()) {
    LoggingPeriodicalLog pLog = new LoggingPeriodicalLog();
    pLog.setName(SPEED4J_LOG_NAME);
    pLog.setMode(PeriodicalLog.Mode.JMX_ONLY);
    pLog.setMaxQueueSize(250000);
    pLog.setPeriod(Configurator.getPerformanceCountersInterval());
    pLog.setJmx("DELIVERY.success,DELIVERY.discard,DELIVERY.defer,DELIVERY.defer_failure,DELIVERY.reject_overQuota,DELIVERY.reject_nonExistent");
    pLog.setSlf4jLogname("com.elasticinbox.speed4j.lmtp.PeriodicalLogger");
    stopWatchFactory = StopWatchFactory.getInstance(pLog);
  } else {
    Slf4jLog pLog = new Slf4jLog();
    pLog.setName(SPEED4J_LOG_NAME);
    pLog.setSlf4jLogname("com.elasticinbox.speed4j.lmtp.PeriodicalLogger");
    stopWatchFactory = StopWatchFactory.getInstance(pLog);
  }
  DeliveryAgentFactory mdf = new DeliveryAgentFactory();
  backend = new MulticastDeliveryAgent(mdf.getDeliveryAgent());
  logger.debug("Starting LMTP daemon...");
  server = new LMTPProxyServer(backend);
  server.start();
  logger.info("LMTP daemon started.");
}
origin: elasticinbox/elasticinbox

/**
 * Read Blob contents
 * 
 * @param uri
 * @return
 */
public static InputStream read(URI uri)
{
  // check if blob was stored for the message
  Assert.notNull(uri, "URI cannot be null");
  logger.debug("Reading blob {}", uri);
  String profileName = uri.getHost();
  String container = Configurator.getBlobStoreProfile(profileName).getContainer();
  BlobStoreContext context = getBlobStoreContext(profileName);
  String path = BlobUtils.relativize(uri.getPath());
  InputStream in = context.getBlobStore()
      .getBlob(container, path)
      .getPayload().getInput();
  return in;
}
origin: elasticinbox/elasticinbox

BlobStoreProfile profile = Configurator.getBlobStoreProfile(profileName);
ContextBuilder contextBuilder = ContextBuilder.newBuilder(profile.getProvider());
origin: elasticinbox/elasticinbox

/**
 * Store Blob
 * 
 * @param blobName
 *            Blob filename including relative path
 * @param profileName
 *            Blob store profile name
 * @param in
 *            Payload
 * @param size
 *            Payload size in bytes
 * @return
 * @throws IOException 
 */
public static void write(final String blobName, final String profileName, InputStream in, final Long size)
    throws IOException, GeneralSecurityException
{
  Assert.notNull(in, "No data to store");
  Assert.notNull(size, "Blob size must be specified");
  final String container = Configurator.getBlobStoreProfile(profileName).getContainer();
  BlobStoreContext context = getBlobStoreContext(profileName);
  logger.debug("Storing blob {} on {}", blobName, profileName);
  BlobStore blobStore = context.getBlobStore();
  BlobBuilder blobBuilder = blobStore.blobBuilder(blobName).payload(in).contentLength(size);
  // store blob
  blobStore.putBlob(container, blobBuilder.build());
}
com.elasticinbox.configConfigurator

Javadoc

Main configuration class which loads options from YAML and provides to the rest of the application. Path to the YAML config file should be provided in the elasticinbox.config system property.

Most used methods

  • getPerformanceCountersInterval
  • isPerformanceCountersEnabled
  • getBlobStoreDefaultEncryptionKey
  • getBlobStoreDefaultEncryptionKeyAlias
  • getBlobStoreProfile
    Get BlobStoreProfile based on profile name
  • getBlobStoreWriteProfileName
    Get blobstore profile name for storing data
  • getDatabaseBlobMaxSize
  • getDefaultQuotaBytes
  • getDefaultQuotaCount
  • getEncryptionKey
  • getLmtpMaxConnections
  • getLmtpPort
  • getLmtpMaxConnections,
  • getLmtpPort,
  • getPop3MaxConnections,
  • getPop3Port,
  • isBlobStoreCompressionEnabled,
  • isBlobStoreEncryptionEnabled,
  • isLmtpPop3Enabled,
  • isStoreHtmlWithMetadata,
  • isStorePlainWithMetadata

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now