public HBaseLookupBolt(String tableName, HBaseMapper mapper, HBaseValueMapper rowToTupleMapper) { super(tableName, mapper); Validate.notNull(rowToTupleMapper, "rowToTupleMapper can not be null"); this.rowToTupleMapper = rowToTupleMapper; }
/** * MongoInsertBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data * @param mapper MongoMapper converting tuple to an MongoDB document */ public MongoInsertBolt(String url, String collectionName, MongoMapper mapper) { super(url, collectionName); Validate.notNull(mapper, "MongoMapper can not be null"); this.mapper = mapper; }
public JdbcInsertBolt(ConnectionProvider connectionProvider, JdbcMapper jdbcMapper) { super(connectionProvider); Validate.notNull(jdbcMapper); this.jdbcMapper = jdbcMapper; }
/** * Constructor. * <p/> * @param connectionProviderParam database connection provider */ public AbstractJdbcBolt(final ConnectionProvider connectionProviderParam) { Validate.notNull(connectionProviderParam); this.connectionProvider = connectionProviderParam; }
/** * <p>Validate that the specified argument is not <code>null</code>; * otherwise throwing an exception. * * <pre>Validate.notNull(myObject);</pre> * * <p>The message of the exception is "The validated object is * null".</p> * * @param object the object to check * @throws IllegalArgumentException if the object is <code>null</code> */ public static void notNull(Object object) { notNull(object, "The validated object is null"); }
/** * MongoUpdateBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data * @param queryCreator QueryFilterCreator * @param mapper MongoMapper converting tuple to an MongoDB document */ public MongoUpdateBolt(String url, String collectionName, QueryFilterCreator queryCreator, MongoUpdateMapper mapper) { super(url, collectionName); Validate.notNull(queryCreator, "QueryFilterCreator can not be null"); Validate.notNull(mapper, "MongoUpdateMapper can not be null"); this.queryCreator = queryCreator; this.mapper = mapper; }
/** * MongoLookupBolt Constructor. * @param url The MongoDB server url * @param collectionName The collection where reading/writing data * @param queryCreator QueryFilterCreator * @param mapper MongoMapper converting tuple to an MongoDB document */ public MongoLookupBolt(String url, String collectionName, QueryFilterCreator queryCreator, MongoLookupMapper mapper) { super(url, collectionName); Validate.notNull(queryCreator, "QueryFilterCreator can not be null"); Validate.notNull(mapper, "MongoLookupMapper can not be null"); this.queryCreator = queryCreator; this.mapper = mapper; }
/** * Sets the player that this message will display as, or command will be * executed as * * @param player New player which this event will execute as */ public void setPlayer(final Player player) { Validate.notNull(player, "Player cannot be null"); this.player = player; }
public AbstractHBaseBolt(String tableName, HBaseMapper mapper) { Validate.notEmpty(tableName, "Table name can not be blank or null"); Validate.notNull(mapper, "mapper can not be null"); this.tableName = tableName; this.mapper = mapper; }
public void addDefaults(Map<String, Object> defaults) { Validate.notNull(defaults, "Defaults may not be null"); for (Map.Entry<String, Object> entry : defaults.entrySet()) { addDefault(entry.getKey(), entry.getValue()); } }
/** * Sets the ItemStack being moved; if this is different from the original * ItemStack, the original item will not be removed from the source * inventory. * * @param itemStack The ItemStack */ public void setItem(ItemStack itemStack) { Validate.notNull(itemStack, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred."); this.itemStack = itemStack.clone(); }
protected MongoMapState(Map<String, Object> map, Options options) { this.options = options; this.map = map; this.serializer = options.serializer; Validate.notEmpty(options.url, "url can not be blank or null"); Validate.notEmpty(options.collectionName, "collectionName can not be blank or null"); Validate.notNull(options.queryCreator, "queryCreator can not be null"); Validate.notNull(options.mapper, "mapper can not be null"); this.mongoClient = new MongoDbClient(options.url, options.collectionName); }
protected void prepare() { Validate.notEmpty(options.properties, "Producer properties can not be empty"); Validate.notNull(options.selector, "TopicSelector can not be null"); Validate.notNull(options.mapper, "TupleToMessageMapper can not be null"); producer = new DefaultMQProducer(); producer.setInstanceName(UUID.randomUUID().toString()); RocketMqConfig.buildProducerConfigs(options.properties, producer); try { producer.start(); } catch (MQClientException e) { throw new RuntimeException(e); } }
public PlayerEditBookEvent(Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning) { super(who); Validate.isTrue(slot >= 0 && slot <=8, "Slot must be in range 0-8 inclusive"); Validate.notNull(previousBookMeta, "Previous book meta must not be null"); Validate.notNull(newBookMeta, "New book meta must not be null"); Bukkit.getItemFactory().equals(previousBookMeta, newBookMeta); this.previousBookMeta = previousBookMeta; this.newBookMeta = newBookMeta; this.slot = slot; this.isSigning = isSigning; this.cancel = false; }
@Override public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) { Validate.notEmpty(properties, "Producer properties can not be empty"); Validate.notNull(selector, "TopicSelector can not be null"); Validate.notNull(mapper, "TupleToMessageMapper can not be null"); producer = new DefaultMQProducer(); producer.setInstanceName(String.valueOf(context.getThisTaskId())); RocketMqConfig.buildProducerConfigs(properties, producer); try { producer.start(); } catch (MQClientException e) { throw new RuntimeException(e); } this.collector = collector; this.batchHelper = new BatchHelper(batchSize, collector); this.messages = new LinkedList<>(); }
/** * @param keyStorePassword * the keyStorePassword to set */ public void setKeyStorePassword( String keyStorePassword ) { Validate.notNull( keyStorePassword, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE_PASSWORD, NULL ) ); Validate.notEmpty( keyStorePassword, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE_PASSWORD, EMPTY ) ); this.keyStorePassword = keyStorePassword; }
/** * @param keyStorePath * the keyStorePath to set */ public void setKeyStore( String keyStore ) { Validate.notNull( keyStore, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE, NULL ) ); Validate.notEmpty( keyStore, BaseMessages.getString( PKG, "WebServer.Error.IllegalSslParameter", XML_TAG_KEY_STORE, EMPTY ) ); this.keyStore = keyStore; }
public SimpleJdbcMapper(String tableName, ConnectionProvider connectionProvider) { Validate.notEmpty(tableName); Validate.notNull(connectionProvider); int queryTimeoutSecs = 30; connectionProvider.prepare(); JdbcClient client = new JdbcClient(connectionProvider, queryTimeoutSecs); this.schemaColumns = client.getColumnSchema(tableName); }
public static RepositorySystemSession newRepositorySystemSession( RepositorySystem system, String localRepoPath) { Validate.notNull(localRepoPath, "localRepoPath should have a value"); MavenRepositorySystemSession session = new MavenRepositorySystemSession(); LocalRepository localRepo = new LocalRepository(resolveLocalRepoPath(localRepoPath)); session.setLocalRepositoryManager(system.newLocalRepositoryManager(localRepo)); if (logger.isDebugEnabled()) { session.setTransferListener(new TransferListener()); session.setRepositoryListener(new RepositoryListener()); } // uncomment to generate dirty trees // session.setDependencyGraphTransformer( null ); return session; }