id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
6,500
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer.getPartitionInfo
public List<PartitionInfo> getPartitionInfo(String topicName) { Map<String, List<PartitionInfo>> topicInfo = getTopicInfo(); List<PartitionInfo> partitionInfo = topicInfo != null ? topicInfo.get(topicName) : null; return partitionInfo != null ? Collections.unmodifiableList(partitionInfo) : null; }
java
public List<PartitionInfo> getPartitionInfo(String topicName) { Map<String, List<PartitionInfo>> topicInfo = getTopicInfo(); List<PartitionInfo> partitionInfo = topicInfo != null ? topicInfo.get(topicName) : null; return partitionInfo != null ? Collections.unmodifiableList(partitionInfo) : null; }
[ "public", "List", "<", "PartitionInfo", ">", "getPartitionInfo", "(", "String", "topicName", ")", "{", "Map", "<", "String", ",", "List", "<", "PartitionInfo", ">", ">", "topicInfo", "=", "getTopicInfo", "(", ")", ";", "List", "<", "PartitionInfo", ">", "partitionInfo", "=", "topicInfo", "!=", "null", "?", "topicInfo", ".", "get", "(", "topicName", ")", ":", "null", ";", "return", "partitionInfo", "!=", "null", "?", "Collections", ".", "unmodifiableList", "(", "partitionInfo", ")", ":", "null", ";", "}" ]
Gets partition information of a topic. @param topicName @return list of {@link PartitionInfo} or {@code null} if topic does not exist. @since 1.3.0
[ "Gets", "partition", "information", "of", "a", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L330-L334
6,501
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer.getTopics
@SuppressWarnings("unchecked") public Set<String> getTopics() { Map<String, List<PartitionInfo>> topicInfo = getTopicInfo(); Set<String> topics = topicInfo != null ? topicInfo.keySet() : null; return topics != null ? Collections.unmodifiableSet(topics) : Collections.EMPTY_SET; }
java
@SuppressWarnings("unchecked") public Set<String> getTopics() { Map<String, List<PartitionInfo>> topicInfo = getTopicInfo(); Set<String> topics = topicInfo != null ? topicInfo.keySet() : null; return topics != null ? Collections.unmodifiableSet(topics) : Collections.EMPTY_SET; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Set", "<", "String", ">", "getTopics", "(", ")", "{", "Map", "<", "String", ",", "List", "<", "PartitionInfo", ">", ">", "topicInfo", "=", "getTopicInfo", "(", ")", ";", "Set", "<", "String", ">", "topics", "=", "topicInfo", "!=", "null", "?", "topicInfo", ".", "keySet", "(", ")", ":", "null", ";", "return", "topics", "!=", "null", "?", "Collections", ".", "unmodifiableSet", "(", "topics", ")", ":", "Collections", ".", "EMPTY_SET", ";", "}" ]
Gets all available topics. @return @since 1.3.0
[ "Gets", "all", "available", "topics", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L342-L347
6,502
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer._getConsumer
private KafkaConsumer<String, byte[]> _getConsumer(String topic, boolean autoCommitOffsets) { KafkaConsumer<String, byte[]> consumer = topicConsumers.get(topic); if (consumer == null) { consumer = KafkaHelper.createKafkaConsumer(bootstrapServers, consumerGroupId, consumeFromBeginning, autoCommitOffsets, consumerProperties); KafkaConsumer<String, byte[]> existingConsumer = topicConsumers.putIfAbsent(topic, consumer); if (existingConsumer != null) { consumer.close(); consumer = existingConsumer; } else { _checkAndSubscribe(consumer, topic); } } return consumer; }
java
private KafkaConsumer<String, byte[]> _getConsumer(String topic, boolean autoCommitOffsets) { KafkaConsumer<String, byte[]> consumer = topicConsumers.get(topic); if (consumer == null) { consumer = KafkaHelper.createKafkaConsumer(bootstrapServers, consumerGroupId, consumeFromBeginning, autoCommitOffsets, consumerProperties); KafkaConsumer<String, byte[]> existingConsumer = topicConsumers.putIfAbsent(topic, consumer); if (existingConsumer != null) { consumer.close(); consumer = existingConsumer; } else { _checkAndSubscribe(consumer, topic); } } return consumer; }
[ "private", "KafkaConsumer", "<", "String", ",", "byte", "[", "]", ">", "_getConsumer", "(", "String", "topic", ",", "boolean", "autoCommitOffsets", ")", "{", "KafkaConsumer", "<", "String", ",", "byte", "[", "]", ">", "consumer", "=", "topicConsumers", ".", "get", "(", "topic", ")", ";", "if", "(", "consumer", "==", "null", ")", "{", "consumer", "=", "KafkaHelper", ".", "createKafkaConsumer", "(", "bootstrapServers", ",", "consumerGroupId", ",", "consumeFromBeginning", ",", "autoCommitOffsets", ",", "consumerProperties", ")", ";", "KafkaConsumer", "<", "String", ",", "byte", "[", "]", ">", "existingConsumer", "=", "topicConsumers", ".", "putIfAbsent", "(", "topic", ",", "consumer", ")", ";", "if", "(", "existingConsumer", "!=", "null", ")", "{", "consumer", ".", "close", "(", ")", ";", "consumer", "=", "existingConsumer", ";", "}", "else", "{", "_checkAndSubscribe", "(", "consumer", ",", "topic", ")", ";", "}", "}", "return", "consumer", ";", "}" ]
Prepares a consumer to consume messages from a Kafka topic. @param topic @param autoCommitOffsets @since 1.2.0
[ "Prepares", "a", "consumer", "to", "consume", "messages", "from", "a", "Kafka", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L438-L453
6,503
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer._getBuffer
private BlockingQueue<ConsumerRecord<String, byte[]>> _getBuffer(String topic) { BlockingQueue<ConsumerRecord<String, byte[]>> buffer = topicBuffers.get(topic); if (buffer == null) { buffer = new LinkedBlockingQueue<ConsumerRecord<String, byte[]>>(); BlockingQueue<ConsumerRecord<String, byte[]>> existingBuffer = topicBuffers .putIfAbsent(topic, buffer); if (existingBuffer != null) { buffer = existingBuffer; } } return buffer; }
java
private BlockingQueue<ConsumerRecord<String, byte[]>> _getBuffer(String topic) { BlockingQueue<ConsumerRecord<String, byte[]>> buffer = topicBuffers.get(topic); if (buffer == null) { buffer = new LinkedBlockingQueue<ConsumerRecord<String, byte[]>>(); BlockingQueue<ConsumerRecord<String, byte[]>> existingBuffer = topicBuffers .putIfAbsent(topic, buffer); if (existingBuffer != null) { buffer = existingBuffer; } } return buffer; }
[ "private", "BlockingQueue", "<", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", ">", "_getBuffer", "(", "String", "topic", ")", "{", "BlockingQueue", "<", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", ">", "buffer", "=", "topicBuffers", ".", "get", "(", "topic", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "buffer", "=", "new", "LinkedBlockingQueue", "<", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", ">", "(", ")", ";", "BlockingQueue", "<", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", ">", "existingBuffer", "=", "topicBuffers", ".", "putIfAbsent", "(", "topic", ",", "buffer", ")", ";", "if", "(", "existingBuffer", "!=", "null", ")", "{", "buffer", "=", "existingBuffer", ";", "}", "}", "return", "buffer", ";", "}" ]
Gets a buffer to store consumed messages from a Kafka topic. @param topic @return @since 1.2.0
[ "Gets", "a", "buffer", "to", "store", "consumed", "messages", "from", "a", "Kafka", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L462-L473
6,504
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer._getWorker
private KafkaMsgConsumerWorker _getWorker(String topic, boolean autoCommitOffsets) { KafkaMsgConsumerWorker worker = topicWorkers.get(topic); if (worker == null) { Collection<IKafkaMessageListener> msgListeners = topicMsgListeners.get(topic); worker = new KafkaMsgConsumerWorker(this, topic, msgListeners, executorService); KafkaMsgConsumerWorker existingWorker = topicWorkers.putIfAbsent(topic, worker); if (existingWorker != null) { worker = existingWorker; } else { worker.start(); } } return worker; }
java
private KafkaMsgConsumerWorker _getWorker(String topic, boolean autoCommitOffsets) { KafkaMsgConsumerWorker worker = topicWorkers.get(topic); if (worker == null) { Collection<IKafkaMessageListener> msgListeners = topicMsgListeners.get(topic); worker = new KafkaMsgConsumerWorker(this, topic, msgListeners, executorService); KafkaMsgConsumerWorker existingWorker = topicWorkers.putIfAbsent(topic, worker); if (existingWorker != null) { worker = existingWorker; } else { worker.start(); } } return worker; }
[ "private", "KafkaMsgConsumerWorker", "_getWorker", "(", "String", "topic", ",", "boolean", "autoCommitOffsets", ")", "{", "KafkaMsgConsumerWorker", "worker", "=", "topicWorkers", ".", "get", "(", "topic", ")", ";", "if", "(", "worker", "==", "null", ")", "{", "Collection", "<", "IKafkaMessageListener", ">", "msgListeners", "=", "topicMsgListeners", ".", "get", "(", "topic", ")", ";", "worker", "=", "new", "KafkaMsgConsumerWorker", "(", "this", ",", "topic", ",", "msgListeners", ",", "executorService", ")", ";", "KafkaMsgConsumerWorker", "existingWorker", "=", "topicWorkers", ".", "putIfAbsent", "(", "topic", ",", "worker", ")", ";", "if", "(", "existingWorker", "!=", "null", ")", "{", "worker", "=", "existingWorker", ";", "}", "else", "{", "worker", ".", "start", "(", ")", ";", "}", "}", "return", "worker", ";", "}" ]
Prepares a worker to consume messages from a Kafka topic. @param topic @param autoCommitOffsets @return
[ "Prepares", "a", "worker", "to", "consume", "messages", "from", "a", "Kafka", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L482-L495
6,505
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer.addMessageListener
public boolean addMessageListener(String topic, IKafkaMessageListener messageListener, boolean autoCommitOffsets) { synchronized (topicMsgListeners) { if (topicMsgListeners.put(topic, messageListener)) { _getWorker(topic, autoCommitOffsets); return true; } } return false; }
java
public boolean addMessageListener(String topic, IKafkaMessageListener messageListener, boolean autoCommitOffsets) { synchronized (topicMsgListeners) { if (topicMsgListeners.put(topic, messageListener)) { _getWorker(topic, autoCommitOffsets); return true; } } return false; }
[ "public", "boolean", "addMessageListener", "(", "String", "topic", ",", "IKafkaMessageListener", "messageListener", ",", "boolean", "autoCommitOffsets", ")", "{", "synchronized", "(", "topicMsgListeners", ")", "{", "if", "(", "topicMsgListeners", ".", "put", "(", "topic", ",", "messageListener", ")", ")", "{", "_getWorker", "(", "topic", ",", "autoCommitOffsets", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Adds a message listener to a topic. @param topic @param messageListener @param autoCommitOffsets @return {@code true} if successful, {@code false} otherwise (the listener may have been added already)
[ "Adds", "a", "message", "listener", "to", "a", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L518-L527
6,506
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java
KafkaMsgConsumer._fetch
private void _fetch(BlockingQueue<ConsumerRecord<String, byte[]>> buffer, String topic, long waitTime, TimeUnit waitTimeUnit) { KafkaConsumer<String, byte[]> consumer = _getConsumer(topic); synchronized (consumer) { _checkAndSubscribe(consumer, topic); Set<String> subscription = consumer.subscription(); ConsumerRecords<String, byte[]> crList = subscription != null && subscription.contains(topic) ? consumer.poll(waitTimeUnit.toMillis(waitTime)) : null; if (crList != null) { for (ConsumerRecord<String, byte[]> cr : crList) { buffer.offer(cr); } } } }
java
private void _fetch(BlockingQueue<ConsumerRecord<String, byte[]>> buffer, String topic, long waitTime, TimeUnit waitTimeUnit) { KafkaConsumer<String, byte[]> consumer = _getConsumer(topic); synchronized (consumer) { _checkAndSubscribe(consumer, topic); Set<String> subscription = consumer.subscription(); ConsumerRecords<String, byte[]> crList = subscription != null && subscription.contains(topic) ? consumer.poll(waitTimeUnit.toMillis(waitTime)) : null; if (crList != null) { for (ConsumerRecord<String, byte[]> cr : crList) { buffer.offer(cr); } } } }
[ "private", "void", "_fetch", "(", "BlockingQueue", "<", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", ">", "buffer", ",", "String", "topic", ",", "long", "waitTime", ",", "TimeUnit", "waitTimeUnit", ")", "{", "KafkaConsumer", "<", "String", ",", "byte", "[", "]", ">", "consumer", "=", "_getConsumer", "(", "topic", ")", ";", "synchronized", "(", "consumer", ")", "{", "_checkAndSubscribe", "(", "consumer", ",", "topic", ")", ";", "Set", "<", "String", ">", "subscription", "=", "consumer", ".", "subscription", "(", ")", ";", "ConsumerRecords", "<", "String", ",", "byte", "[", "]", ">", "crList", "=", "subscription", "!=", "null", "&&", "subscription", ".", "contains", "(", "topic", ")", "?", "consumer", ".", "poll", "(", "waitTimeUnit", ".", "toMillis", "(", "waitTime", ")", ")", ":", "null", ";", "if", "(", "crList", "!=", "null", ")", "{", "for", "(", "ConsumerRecord", "<", "String", ",", "byte", "[", "]", ">", "cr", ":", "crList", ")", "{", "buffer", ".", "offer", "(", "cr", ")", ";", "}", "}", "}", "}" ]
Fetches messages from Kafka and puts into buffer. @param buffer @param topic @param waitTime @param waitTimeUnit
[ "Fetches", "messages", "from", "Kafka", "and", "puts", "into", "buffer", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L571-L586
6,507
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java
KafkaHelper.seekToBeginning
public static boolean seekToBeginning(KafkaConsumer<?, ?> consumer, String topic) { boolean result = false; synchronized (consumer) { Set<TopicPartition> topicParts = consumer.assignment(); if (topicParts != null) { for (TopicPartition tp : topicParts) { if (StringUtils.equals(topic, tp.topic())) { consumer.seekToBeginning(Arrays.asList(tp)); // we want to seek as soon as possible // since seekToEnd evaluates lazily, invoke position() // so // that seeking will be committed. consumer.position(tp); result = true; } } if (result) { consumer.commitSync(); } } } return result; }
java
public static boolean seekToBeginning(KafkaConsumer<?, ?> consumer, String topic) { boolean result = false; synchronized (consumer) { Set<TopicPartition> topicParts = consumer.assignment(); if (topicParts != null) { for (TopicPartition tp : topicParts) { if (StringUtils.equals(topic, tp.topic())) { consumer.seekToBeginning(Arrays.asList(tp)); // we want to seek as soon as possible // since seekToEnd evaluates lazily, invoke position() // so // that seeking will be committed. consumer.position(tp); result = true; } } if (result) { consumer.commitSync(); } } } return result; }
[ "public", "static", "boolean", "seekToBeginning", "(", "KafkaConsumer", "<", "?", ",", "?", ">", "consumer", ",", "String", "topic", ")", "{", "boolean", "result", "=", "false", ";", "synchronized", "(", "consumer", ")", "{", "Set", "<", "TopicPartition", ">", "topicParts", "=", "consumer", ".", "assignment", "(", ")", ";", "if", "(", "topicParts", "!=", "null", ")", "{", "for", "(", "TopicPartition", "tp", ":", "topicParts", ")", "{", "if", "(", "StringUtils", ".", "equals", "(", "topic", ",", "tp", ".", "topic", "(", ")", ")", ")", "{", "consumer", ".", "seekToBeginning", "(", "Arrays", ".", "asList", "(", "tp", ")", ")", ";", "// we want to seek as soon as possible", "// since seekToEnd evaluates lazily, invoke position()", "// so", "// that seeking will be committed.", "consumer", ".", "position", "(", "tp", ")", ";", "result", "=", "true", ";", "}", "}", "if", "(", "result", ")", "{", "consumer", ".", "commitSync", "(", ")", ";", "}", "}", "}", "return", "result", ";", "}" ]
Seeks the consumer's cursor to the beginning of a topic. <p> This method only set cursors of topic's partitions that are assigned to the consumer! </p> @param consumer @param topic @return {@code true} if the consumer has subscribed to the specified topic, {@code false} otherwise.
[ "Seeks", "the", "consumer", "s", "cursor", "to", "the", "beginning", "of", "a", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java#L72-L94
6,508
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java
KafkaHelper.buildKafkaProducerProps
public static Properties buildKafkaProducerProps(ProducerType type, String bootstrapServers) { return buildKafkaProducerProps(type, bootstrapServers, null); }
java
public static Properties buildKafkaProducerProps(ProducerType type, String bootstrapServers) { return buildKafkaProducerProps(type, bootstrapServers, null); }
[ "public", "static", "Properties", "buildKafkaProducerProps", "(", "ProducerType", "type", ",", "String", "bootstrapServers", ")", "{", "return", "buildKafkaProducerProps", "(", "type", ",", "bootstrapServers", ",", "null", ")", ";", "}" ]
Builds default producer's properties. @param type @param bootstrapServers @return @since 1.3.2
[ "Builds", "default", "producer", "s", "properties", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java#L176-L178
6,509
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java
KafkaHelper.buildKafkaConsumerProps
public static Properties buildKafkaConsumerProps(String bootstrapServers, String consumerGroupId, boolean consumeFromBeginning, boolean autoCommitOffsets) { return buildKafkaConsumerProps(bootstrapServers, consumerGroupId, consumeFromBeginning, autoCommitOffsets, null); }
java
public static Properties buildKafkaConsumerProps(String bootstrapServers, String consumerGroupId, boolean consumeFromBeginning, boolean autoCommitOffsets) { return buildKafkaConsumerProps(bootstrapServers, consumerGroupId, consumeFromBeginning, autoCommitOffsets, null); }
[ "public", "static", "Properties", "buildKafkaConsumerProps", "(", "String", "bootstrapServers", ",", "String", "consumerGroupId", ",", "boolean", "consumeFromBeginning", ",", "boolean", "autoCommitOffsets", ")", "{", "return", "buildKafkaConsumerProps", "(", "bootstrapServers", ",", "consumerGroupId", ",", "consumeFromBeginning", ",", "autoCommitOffsets", ",", "null", ")", ";", "}" ]
Builds default consumer's properties. @param bootstrapServers @param consumerGroupId @param consumeFromBeginning @param autoCommitOffsets @return
[ "Builds", "default", "consumer", "s", "properties", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java#L309-L313
6,510
walkmod/walkmod-core
src/main/java/org/walkmod/conf/providers/XMLConfigurationProvider.java
XMLConfigurationProvider.loadDocument
private Document loadDocument(String file) { Document doc = null; URL url = null; File f = new File(file); if (f.exists()) { try { url = f.toURI().toURL(); } catch (MalformedURLException e) { throw new ConfigurationException("Unable to load " + file, e); } } if (url == null) { url = ClassLoader.getSystemResource(file); } InputStream is = null; if (url == null) { if (errorIfMissing) { throw new ConfigurationException("Could not open files of the name " + file); } else { LOG.info("Unable to locate configuration files of the name " + file + ", skipping"); return doc; } } try { is = url.openStream(); InputSource in = new InputSource(is); in.setSystemId(url.toString()); doc = DomHelper.parse(in, dtdMappings); } catch (Exception e) { throw new ConfigurationException("Unable to load " + file, e); } finally { try { is.close(); } catch (IOException e) { LOG.error("Unable to close input stream", e); } } if (doc != null) { LOG.debug("Wallmod configuration parsed"); } return doc; }
java
private Document loadDocument(String file) { Document doc = null; URL url = null; File f = new File(file); if (f.exists()) { try { url = f.toURI().toURL(); } catch (MalformedURLException e) { throw new ConfigurationException("Unable to load " + file, e); } } if (url == null) { url = ClassLoader.getSystemResource(file); } InputStream is = null; if (url == null) { if (errorIfMissing) { throw new ConfigurationException("Could not open files of the name " + file); } else { LOG.info("Unable to locate configuration files of the name " + file + ", skipping"); return doc; } } try { is = url.openStream(); InputSource in = new InputSource(is); in.setSystemId(url.toString()); doc = DomHelper.parse(in, dtdMappings); } catch (Exception e) { throw new ConfigurationException("Unable to load " + file, e); } finally { try { is.close(); } catch (IOException e) { LOG.error("Unable to close input stream", e); } } if (doc != null) { LOG.debug("Wallmod configuration parsed"); } return doc; }
[ "private", "Document", "loadDocument", "(", "String", "file", ")", "{", "Document", "doc", "=", "null", ";", "URL", "url", "=", "null", ";", "File", "f", "=", "new", "File", "(", "file", ")", ";", "if", "(", "f", ".", "exists", "(", ")", ")", "{", "try", "{", "url", "=", "f", ".", "toURI", "(", ")", ".", "toURL", "(", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "throw", "new", "ConfigurationException", "(", "\"Unable to load \"", "+", "file", ",", "e", ")", ";", "}", "}", "if", "(", "url", "==", "null", ")", "{", "url", "=", "ClassLoader", ".", "getSystemResource", "(", "file", ")", ";", "}", "InputStream", "is", "=", "null", ";", "if", "(", "url", "==", "null", ")", "{", "if", "(", "errorIfMissing", ")", "{", "throw", "new", "ConfigurationException", "(", "\"Could not open files of the name \"", "+", "file", ")", ";", "}", "else", "{", "LOG", ".", "info", "(", "\"Unable to locate configuration files of the name \"", "+", "file", "+", "\", skipping\"", ")", ";", "return", "doc", ";", "}", "}", "try", "{", "is", "=", "url", ".", "openStream", "(", ")", ";", "InputSource", "in", "=", "new", "InputSource", "(", "is", ")", ";", "in", ".", "setSystemId", "(", "url", ".", "toString", "(", ")", ")", ";", "doc", "=", "DomHelper", ".", "parse", "(", "in", ",", "dtdMappings", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "ConfigurationException", "(", "\"Unable to load \"", "+", "file", ",", "e", ")", ";", "}", "finally", "{", "try", "{", "is", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "LOG", ".", "error", "(", "\"Unable to close input stream\"", ",", "e", ")", ";", "}", "}", "if", "(", "doc", "!=", "null", ")", "{", "LOG", ".", "debug", "(", "\"Wallmod configuration parsed\"", ")", ";", "}", "return", "doc", ";", "}" ]
Load the XML configuration on memory as a DOM structure with SAX. Additional information about elements location is added. Non valid DTDs or XML structures are detected. @param file XML configuration @return XML tree
[ "Load", "the", "XML", "configuration", "on", "memory", "as", "a", "DOM", "structure", "with", "SAX", ".", "Additional", "information", "about", "elements", "location", "is", "added", ".", "Non", "valid", "DTDs", "or", "XML", "structures", "are", "detected", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/conf/providers/XMLConfigurationProvider.java#L185-L226
6,511
walkmod/walkmod-core
src/main/java/org/walkmod/conf/providers/IvyConfigurationProvider.java
IvyConfigurationProvider.initIvy
public void initIvy() throws ParseException, IOException, ConfigurationException { if (ivy == null) { // creates clear ivy settings IvySettings ivySettings = new IvySettings(); File settingsFile = new File(IVY_SETTINGS_FILE); if (settingsFile.exists()) { ivySettings.load(settingsFile); } else { URL settingsURL = ClassLoader.getSystemResource(IVY_SETTINGS_FILE); if (settingsURL == null) { // file not found in System classloader, we try the current one settingsURL = this.getClass().getClassLoader().getResource(IVY_SETTINGS_FILE); // extra validation to avoid uncontrolled NullPointerException // when invoking toURI() if (settingsURL == null) throw new ConfigurationException("Ivy settings file (" + IVY_SETTINGS_FILE + ") could not be found in classpath"); } ivySettings.load(settingsURL); } // creates an Ivy instance with settings ivy = Ivy.newInstance(ivySettings); } ivyfile = File.createTempFile("ivy", ".xml"); ivyfile.deleteOnExit(); applyVerbose(); String[] confs = new String[] { "default" }; resolveOptions = new ResolveOptions().setConfs(confs); if (isOffLine) { resolveOptions = resolveOptions.setUseCacheOnly(true); } else { Map<String, Object> params = configuration.getParameters(); if (params != null) { Object value = params.get("offline"); if (value != null) { String offlineOpt = value.toString(); if (offlineOpt != null) { boolean offline = Boolean.parseBoolean(offlineOpt); if (offline) { resolveOptions = resolveOptions.setUseCacheOnly(true); } } } } } }
java
public void initIvy() throws ParseException, IOException, ConfigurationException { if (ivy == null) { // creates clear ivy settings IvySettings ivySettings = new IvySettings(); File settingsFile = new File(IVY_SETTINGS_FILE); if (settingsFile.exists()) { ivySettings.load(settingsFile); } else { URL settingsURL = ClassLoader.getSystemResource(IVY_SETTINGS_FILE); if (settingsURL == null) { // file not found in System classloader, we try the current one settingsURL = this.getClass().getClassLoader().getResource(IVY_SETTINGS_FILE); // extra validation to avoid uncontrolled NullPointerException // when invoking toURI() if (settingsURL == null) throw new ConfigurationException("Ivy settings file (" + IVY_SETTINGS_FILE + ") could not be found in classpath"); } ivySettings.load(settingsURL); } // creates an Ivy instance with settings ivy = Ivy.newInstance(ivySettings); } ivyfile = File.createTempFile("ivy", ".xml"); ivyfile.deleteOnExit(); applyVerbose(); String[] confs = new String[] { "default" }; resolveOptions = new ResolveOptions().setConfs(confs); if (isOffLine) { resolveOptions = resolveOptions.setUseCacheOnly(true); } else { Map<String, Object> params = configuration.getParameters(); if (params != null) { Object value = params.get("offline"); if (value != null) { String offlineOpt = value.toString(); if (offlineOpt != null) { boolean offline = Boolean.parseBoolean(offlineOpt); if (offline) { resolveOptions = resolveOptions.setUseCacheOnly(true); } } } } } }
[ "public", "void", "initIvy", "(", ")", "throws", "ParseException", ",", "IOException", ",", "ConfigurationException", "{", "if", "(", "ivy", "==", "null", ")", "{", "// creates clear ivy settings\r", "IvySettings", "ivySettings", "=", "new", "IvySettings", "(", ")", ";", "File", "settingsFile", "=", "new", "File", "(", "IVY_SETTINGS_FILE", ")", ";", "if", "(", "settingsFile", ".", "exists", "(", ")", ")", "{", "ivySettings", ".", "load", "(", "settingsFile", ")", ";", "}", "else", "{", "URL", "settingsURL", "=", "ClassLoader", ".", "getSystemResource", "(", "IVY_SETTINGS_FILE", ")", ";", "if", "(", "settingsURL", "==", "null", ")", "{", "// file not found in System classloader, we try the current one\r", "settingsURL", "=", "this", ".", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ".", "getResource", "(", "IVY_SETTINGS_FILE", ")", ";", "// extra validation to avoid uncontrolled NullPointerException\r", "// when invoking toURI()\r", "if", "(", "settingsURL", "==", "null", ")", "throw", "new", "ConfigurationException", "(", "\"Ivy settings file (\"", "+", "IVY_SETTINGS_FILE", "+", "\") could not be found in classpath\"", ")", ";", "}", "ivySettings", ".", "load", "(", "settingsURL", ")", ";", "}", "// creates an Ivy instance with settings\r", "ivy", "=", "Ivy", ".", "newInstance", "(", "ivySettings", ")", ";", "}", "ivyfile", "=", "File", ".", "createTempFile", "(", "\"ivy\"", ",", "\".xml\"", ")", ";", "ivyfile", ".", "deleteOnExit", "(", ")", ";", "applyVerbose", "(", ")", ";", "String", "[", "]", "confs", "=", "new", "String", "[", "]", "{", "\"default\"", "}", ";", "resolveOptions", "=", "new", "ResolveOptions", "(", ")", ".", "setConfs", "(", "confs", ")", ";", "if", "(", "isOffLine", ")", "{", "resolveOptions", "=", "resolveOptions", ".", "setUseCacheOnly", "(", "true", ")", ";", "}", "else", "{", "Map", "<", "String", ",", "Object", ">", "params", "=", "configuration", ".", "getParameters", "(", ")", ";", "if", "(", "params", "!=", "null", ")", "{", "Object", "value", "=", "params", ".", "get", "(", "\"offline\"", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "String", "offlineOpt", "=", "value", ".", "toString", "(", ")", ";", "if", "(", "offlineOpt", "!=", "null", ")", "{", "boolean", "offline", "=", "Boolean", ".", "parseBoolean", "(", "offlineOpt", ")", ";", "if", "(", "offline", ")", "{", "resolveOptions", "=", "resolveOptions", ".", "setUseCacheOnly", "(", "true", ")", ";", "}", "}", "}", "}", "}", "}" ]
Ivy configuration initialization @throws ParseException If an error occurs when loading ivy settings file (ivysettings.xml) @throws IOException If an error occurs when reading ivy settings file (ivysettings.xml) @throws ConfigurationException If ivy settings file (ivysettings.xml) is not found in classpath
[ "Ivy", "configuration", "initialization" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/conf/providers/IvyConfigurationProvider.java#L119-L168
6,512
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.locateConfigurationProvider
private ConfigurationProvider locateConfigurationProvider() { if (configurationProvider == null) return new IvyConfigurationProvider(options.isOffline(), options.isVerbose()); else return configurationProvider; }
java
private ConfigurationProvider locateConfigurationProvider() { if (configurationProvider == null) return new IvyConfigurationProvider(options.isOffline(), options.isVerbose()); else return configurationProvider; }
[ "private", "ConfigurationProvider", "locateConfigurationProvider", "(", ")", "{", "if", "(", "configurationProvider", "==", "null", ")", "return", "new", "IvyConfigurationProvider", "(", "options", ".", "isOffline", "(", ")", ",", "options", ".", "isVerbose", "(", ")", ")", ";", "else", "return", "configurationProvider", ";", "}" ]
Takes care of chosing the proper configuration provider NOTE: this is a first pass, handling a default provider should be improved
[ "Takes", "care", "of", "chosing", "the", "proper", "configuration", "provider" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L148-L153
6,513
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.patch
public List<File> patch(String... chains) throws InvalidConfigurationException { final List<File> result = new LinkedList<File>(); run(result, new WalkmodCommand() { @Override public void execute(Options options, File executionDir, String... chains) throws Exception { WalkModFacade facade = new WalkModFacade(OptionsBuilder.options(options).executionDirectory(executionDir).build()); result.addAll(facade.patch(chains)); } }, ExecutionModeEnum.PATCH, chains); return result; }
java
public List<File> patch(String... chains) throws InvalidConfigurationException { final List<File> result = new LinkedList<File>(); run(result, new WalkmodCommand() { @Override public void execute(Options options, File executionDir, String... chains) throws Exception { WalkModFacade facade = new WalkModFacade(OptionsBuilder.options(options).executionDirectory(executionDir).build()); result.addAll(facade.patch(chains)); } }, ExecutionModeEnum.PATCH, chains); return result; }
[ "public", "List", "<", "File", ">", "patch", "(", "String", "...", "chains", ")", "throws", "InvalidConfigurationException", "{", "final", "List", "<", "File", ">", "result", "=", "new", "LinkedList", "<", "File", ">", "(", ")", ";", "run", "(", "result", ",", "new", "WalkmodCommand", "(", ")", "{", "@", "Override", "public", "void", "execute", "(", "Options", "options", ",", "File", "executionDir", ",", "String", "...", "chains", ")", "throws", "Exception", "{", "WalkModFacade", "facade", "=", "new", "WalkModFacade", "(", "OptionsBuilder", ".", "options", "(", "options", ")", ".", "executionDirectory", "(", "executionDir", ")", ".", "build", "(", ")", ")", ";", "result", ".", "addAll", "(", "facade", ".", "patch", "(", "chains", ")", ")", ";", "}", "}", ",", "ExecutionModeEnum", ".", "PATCH", ",", "chains", ")", ";", "return", "result", ";", "}" ]
Generates a list of patches according the transformation chains @param chains the list of applied transformation chains. @throws InvalidConfigurationException if the walkmod configuration is invalid and it is working in no verbose mode. @return The list of affected files.
[ "Generates", "a", "list", "of", "patches", "according", "the", "transformation", "chains" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L250-L264
6,514
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.init
public void init() throws Exception { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); if (!cfg.exists()) { ConfigurationManager manager = new ConfigurationManager(cfg, false, locateConfigurationProvider()); try { manager.runProjectConfigurationInitializers(); if (options.isVerbose()) { log.info("CONFIGURATION FILE [" + cfg.getAbsolutePath() + "] CREATION COMPLETE"); } } catch (IOException aux) { if (options.isVerbose()) { log.error("The system can't create the file [ " + cfg.getAbsolutePath() + "]"); } if (options.isThrowException()) { System.setProperty("user.dir", userDir); throw aux; } } } else { if (options.isVerbose()) { log.error("The configuration file [" + cfg.getAbsolutePath() + "] already exists"); } } System.setProperty("user.dir", userDir); }
java
public void init() throws Exception { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); if (!cfg.exists()) { ConfigurationManager manager = new ConfigurationManager(cfg, false, locateConfigurationProvider()); try { manager.runProjectConfigurationInitializers(); if (options.isVerbose()) { log.info("CONFIGURATION FILE [" + cfg.getAbsolutePath() + "] CREATION COMPLETE"); } } catch (IOException aux) { if (options.isVerbose()) { log.error("The system can't create the file [ " + cfg.getAbsolutePath() + "]"); } if (options.isThrowException()) { System.setProperty("user.dir", userDir); throw aux; } } } else { if (options.isVerbose()) { log.error("The configuration file [" + cfg.getAbsolutePath() + "] already exists"); } } System.setProperty("user.dir", userDir); }
[ "public", "void", "init", "(", ")", "throws", "Exception", "{", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ",", "locateConfigurationProvider", "(", ")", ")", ";", "try", "{", "manager", ".", "runProjectConfigurationInitializers", "(", ")", ";", "if", "(", "options", ".", "isVerbose", "(", ")", ")", "{", "log", ".", "info", "(", "\"CONFIGURATION FILE [\"", "+", "cfg", ".", "getAbsolutePath", "(", ")", "+", "\"] CREATION COMPLETE\"", ")", ";", "}", "}", "catch", "(", "IOException", "aux", ")", "{", "if", "(", "options", ".", "isVerbose", "(", ")", ")", "{", "log", ".", "error", "(", "\"The system can't create the file [ \"", "+", "cfg", ".", "getAbsolutePath", "(", ")", "+", "\"]\"", ")", ";", "}", "if", "(", "options", ".", "isThrowException", "(", ")", ")", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "throw", "aux", ";", "}", "}", "}", "else", "{", "if", "(", "options", ".", "isVerbose", "(", ")", ")", "{", "log", ".", "error", "(", "\"The configuration file [\"", "+", "cfg", ".", "getAbsolutePath", "(", ")", "+", "\"] already exists\"", ")", ";", "}", "}", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "}" ]
Initializes an empty walkmod configuration file @throws Exception in case that the walkmod configuration file can't be created.
[ "Initializes", "an", "empty", "walkmod", "configuration", "file" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L343-L375
6,515
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.addChainConfig
public void addChainConfig(ChainConfig chainCfg, boolean recursive, String before) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.addChainConfig(chainCfg, recursive, before); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
java
public void addChainConfig(ChainConfig chainCfg, boolean recursive, String before) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.addChainConfig(chainCfg, recursive, before); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
[ "public", "void", "addChainConfig", "(", "ChainConfig", "chainCfg", ",", "boolean", "recursive", ",", "String", "before", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "init", "(", ")", ";", "}", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "ProjectConfigurationProvider", "cfgProvider", "=", "manager", ".", "getProjectConfigurationProvider", "(", ")", ";", "cfgProvider", ".", "addChainConfig", "(", "chainCfg", ",", "recursive", ",", "before", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}" ]
Adds a new chain configuration into the configuration file @param chainCfg chain configuration to add @param recursive Adds the new chain into all the submodules @param before Decides which is the next chain to execute. @throws Exception in case that the walkmod configuration file can't be read.
[ "Adds", "a", "new", "chain", "configuration", "into", "the", "configuration", "file" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L389-L409
6,516
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.addTransformationConfig
public void addTransformationConfig(String chain, String path, boolean recursive, TransformationConfig transformationCfg, Integer order, String before) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.addTransformationConfig(chain, path, transformationCfg, recursive, order, before); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
java
public void addTransformationConfig(String chain, String path, boolean recursive, TransformationConfig transformationCfg, Integer order, String before) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.addTransformationConfig(chain, path, transformationCfg, recursive, order, before); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
[ "public", "void", "addTransformationConfig", "(", "String", "chain", ",", "String", "path", ",", "boolean", "recursive", ",", "TransformationConfig", "transformationCfg", ",", "Integer", "order", ",", "String", "before", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "init", "(", ")", ";", "}", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "ProjectConfigurationProvider", "cfgProvider", "=", "manager", ".", "getProjectConfigurationProvider", "(", ")", ";", "cfgProvider", ".", "addTransformationConfig", "(", "chain", ",", "path", ",", "transformationCfg", ",", "recursive", ",", "order", ",", "before", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}" ]
Adds a new transformation configuration into the configuration file @param chain chain identifier where the transformation will be appended. It can be null. @param path the path where the transformation config will be applied if the chain does not exists or is null. @param recursive if the transformation config is added recursively to all the submodules. @param transformationCfg transformation configuration to add @param order priority order @param before defines which is the next chain to execute @throws Exception in case that the walkmod configuration file can't be read.
[ "Adds", "a", "new", "transformation", "configuration", "into", "the", "configuration", "file" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L430-L451
6,517
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.setReader
public void setReader(String chain, String type, String path, boolean recursive, Map<String, String> params) throws Exception { if ((type != null && !"".equals(type.trim())) || (path != null && !"".equals(path.trim()))) { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.setReader(chain, type, path, recursive, params); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
java
public void setReader(String chain, String type, String path, boolean recursive, Map<String, String> params) throws Exception { if ((type != null && !"".equals(type.trim())) || (path != null && !"".equals(path.trim()))) { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.setReader(chain, type, path, recursive, params); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
[ "public", "void", "setReader", "(", "String", "chain", ",", "String", "type", ",", "String", "path", ",", "boolean", "recursive", ",", "Map", "<", "String", ",", "String", ">", "params", ")", "throws", "Exception", "{", "if", "(", "(", "type", "!=", "null", "&&", "!", "\"\"", ".", "equals", "(", "type", ".", "trim", "(", ")", ")", ")", "||", "(", "path", "!=", "null", "&&", "!", "\"\"", ".", "equals", "(", "path", ".", "trim", "(", ")", ")", ")", ")", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "init", "(", ")", ";", "}", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "ProjectConfigurationProvider", "cfgProvider", "=", "manager", ".", "getProjectConfigurationProvider", "(", ")", ";", "cfgProvider", ".", "setReader", "(", "chain", ",", "type", ",", "path", ",", "recursive", ",", "params", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}", "}" ]
Sets an specific reader for an specific chain. @param chain Chain to apply the writer @param type Reader type to set @param path Reader path to set @param recursive If to set the reader to all the submodules. @param params Reader parameters @throws Exception if the walkmod configuration file can't be read.
[ "Sets", "an", "specific", "reader", "for", "an", "specific", "chain", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L806-L829
6,518
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.removePluginConfig
public void removePluginConfig(PluginConfig pluginConfig, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.removePluginConfig(pluginConfig, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
java
public void removePluginConfig(PluginConfig pluginConfig, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.removePluginConfig(pluginConfig, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
[ "public", "void", "removePluginConfig", "(", "PluginConfig", "pluginConfig", ",", "boolean", "recursive", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "init", "(", ")", ";", "}", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "ProjectConfigurationProvider", "cfgProvider", "=", "manager", ".", "getProjectConfigurationProvider", "(", ")", ";", "cfgProvider", ".", "removePluginConfig", "(", "pluginConfig", ",", "recursive", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}" ]
Removes a plugin from the configuration file. @param pluginConfig Plugin configuration to remove. @param recursive If it necessary to remove the plugin from all the submodules. @throws Exception if the walkmod configuration file can't be read.
[ "Removes", "a", "plugin", "from", "the", "configuration", "file", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L841-L860
6,519
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.removeModules
public void removeModules(List<String> modules) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.removeModules(modules); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
java
public void removeModules(List<String> modules) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (!cfg.exists()) { init(); } userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider(); cfgProvider.removeModules(modules); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } }
[ "public", "void", "removeModules", "(", "List", "<", "String", ">", "modules", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "!", "cfg", ".", "exists", "(", ")", ")", "{", "init", "(", ")", ";", "}", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "ProjectConfigurationProvider", "cfgProvider", "=", "manager", ".", "getProjectConfigurationProvider", "(", ")", ";", "cfgProvider", ".", "removeModules", "(", "modules", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}" ]
Removes the module list from the configuration file @param modules Module names to remove @throws Exception if the walkmod configuration file can't be read.
[ "Removes", "the", "module", "list", "from", "the", "configuration", "file" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L870-L889
6,520
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.getConfiguration
public Configuration getConfiguration() throws Exception { Configuration result = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.executeConfigurationProviders(); result = manager.getConfiguration(); } finally { System.setProperty("user.dir", userDir); } } return result; }
java
public Configuration getConfiguration() throws Exception { Configuration result = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.executeConfigurationProviders(); result = manager.getConfiguration(); } finally { System.setProperty("user.dir", userDir); } } return result; }
[ "public", "Configuration", "getConfiguration", "(", ")", "throws", "Exception", "{", "Configuration", "result", "=", "null", ";", "if", "(", "cfg", ".", "exists", "(", ")", ")", "{", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "manager", ".", "executeConfigurationProviders", "(", ")", ";", "result", "=", "manager", ".", "getConfiguration", "(", ")", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "}", "}", "return", "result", ";", "}" ]
Returns the equivalent configuration representation of the Walkmod config file. @return Configuration object representation of the config file. @throws Exception If the walkmod configuration file can't be read.
[ "Returns", "the", "equivalent", "configuration", "representation", "of", "the", "Walkmod", "config", "file", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L929-L944
6,521
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.removeChains
public void removeChains(List<String> chains, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().removeChains(chains, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
java
public void removeChains(List<String> chains, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().removeChains(chains, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
[ "public", "void", "removeChains", "(", "List", "<", "String", ">", "chains", ",", "boolean", "recursive", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "cfg", ".", "exists", "(", ")", ")", "{", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "manager", ".", "getProjectConfigurationProvider", "(", ")", ".", "removeChains", "(", "chains", ",", "recursive", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}", "}" ]
Removes the chains from the Walkmod config file. @param chains Chain names to remove @param recursive If it necessary to remove the chains from all the submodules. @throws Exception If the walkmod configuration file can't be read.
[ "Removes", "the", "chains", "from", "the", "Walkmod", "config", "file", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L956-L974
6,522
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.inspectPlugin
public List<BeanDefinition> inspectPlugin(PluginConfig plugin) { Configuration conf = new ConfigurationImpl(); Collection<PluginConfig> plugins = new LinkedList<PluginConfig>(); plugins.add(plugin); conf.setPlugins(plugins); ConfigurationManager manager = new ConfigurationManager(conf, false, locateConfigurationProvider()); manager.executeConfigurationProviders(); return conf.getAvailableBeans(plugin); }
java
public List<BeanDefinition> inspectPlugin(PluginConfig plugin) { Configuration conf = new ConfigurationImpl(); Collection<PluginConfig> plugins = new LinkedList<PluginConfig>(); plugins.add(plugin); conf.setPlugins(plugins); ConfigurationManager manager = new ConfigurationManager(conf, false, locateConfigurationProvider()); manager.executeConfigurationProviders(); return conf.getAvailableBeans(plugin); }
[ "public", "List", "<", "BeanDefinition", ">", "inspectPlugin", "(", "PluginConfig", "plugin", ")", "{", "Configuration", "conf", "=", "new", "ConfigurationImpl", "(", ")", ";", "Collection", "<", "PluginConfig", ">", "plugins", "=", "new", "LinkedList", "<", "PluginConfig", ">", "(", ")", ";", "plugins", ".", "add", "(", "plugin", ")", ";", "conf", ".", "setPlugins", "(", "plugins", ")", ";", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "conf", ",", "false", ",", "locateConfigurationProvider", "(", ")", ")", ";", "manager", ".", "executeConfigurationProviders", "(", ")", ";", "return", "conf", ".", "getAvailableBeans", "(", "plugin", ")", ";", "}" ]
Retrieves the bean definitions that contains an specific plugin. @param plugin Plugin container of bean definitions. @return List of bean definitions.
[ "Retrieves", "the", "bean", "definitions", "that", "contains", "an", "specific", "plugin", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L983-L991
6,523
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.addConfigurationParameter
public void addConfigurationParameter(String param, String value, String type, String category, String name, String chain, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().addConfigurationParameter(param, value, type, category, name, chain, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
java
public void addConfigurationParameter(String param, String value, String type, String category, String name, String chain, boolean recursive) throws Exception { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().addConfigurationParameter(param, value, type, category, name, chain, recursive); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
[ "public", "void", "addConfigurationParameter", "(", "String", "param", ",", "String", "value", ",", "String", "type", ",", "String", "category", ",", "String", "name", ",", "String", "chain", ",", "boolean", "recursive", ")", "throws", "Exception", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "cfg", ".", "exists", "(", ")", ")", "{", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "manager", ".", "getProjectConfigurationProvider", "(", ")", ".", "addConfigurationParameter", "(", "param", ",", "value", ",", "type", ",", "category", ",", "name", ",", "chain", ",", "recursive", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}", "}" ]
Sets an specific parameter value into a bean. @param param Parameter name @param value Parameter value @param type Bean type to set the parameter @param category Bean category to set the parameter (walker, reader, transformation, writer) @param name Bean name/alias to set the parameter @param chain Bean chain to filter the beans to take into account @param recursive If it necessary to set the parameter to all the submodules. @throws Exception If the walkmod configuration file can't be read.
[ "Sets", "an", "specific", "parameter", "value", "into", "a", "bean", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L1013-L1033
6,524
walkmod/walkmod-core
src/main/java/org/walkmod/WalkModFacade.java
WalkModFacade.addIncludesToChain
public void addIncludesToChain(String chain, List<String> includes, boolean recursive, boolean setToReader, boolean setToWriter) { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().addIncludesToChain(chain, includes, recursive, setToReader, setToWriter); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
java
public void addIncludesToChain(String chain, List<String> includes, boolean recursive, boolean setToReader, boolean setToWriter) { long startTime = System.currentTimeMillis(); Exception exception = null; if (cfg.exists()) { userDir = new File(System.getProperty("user.dir")).getAbsolutePath(); System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath()); try { ConfigurationManager manager = new ConfigurationManager(cfg, false); manager.getProjectConfigurationProvider().addIncludesToChain(chain, includes, recursive, setToReader, setToWriter); } catch (Exception e) { exception = e; } finally { System.setProperty("user.dir", userDir); updateMsg(startTime, exception); } } }
[ "public", "void", "addIncludesToChain", "(", "String", "chain", ",", "List", "<", "String", ">", "includes", ",", "boolean", "recursive", ",", "boolean", "setToReader", ",", "boolean", "setToWriter", ")", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Exception", "exception", "=", "null", ";", "if", "(", "cfg", ".", "exists", "(", ")", ")", "{", "userDir", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "options", ".", "getExecutionDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "try", "{", "ConfigurationManager", "manager", "=", "new", "ConfigurationManager", "(", "cfg", ",", "false", ")", ";", "manager", ".", "getProjectConfigurationProvider", "(", ")", ".", "addIncludesToChain", "(", "chain", ",", "includes", ",", "recursive", ",", "setToReader", ",", "setToWriter", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "exception", "=", "e", ";", "}", "finally", "{", "System", ".", "setProperty", "(", "\"user.dir\"", ",", "userDir", ")", ";", "updateMsg", "(", "startTime", ",", "exception", ")", ";", "}", "}", "}" ]
Adds a list of includes rules into a chain @param chain Chain to apply the includes list @param includes List of includes @param recursive If it necessary to set the parameter to all the submodules. @param setToReader If it is added into the reader includes list @param setToWriter If it is added into the writer includes list
[ "Adds", "a", "list", "of", "includes", "rules", "into", "a", "chain" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L1049-L1068
6,525
walkmod/walkmod-core
src/main/java/org/walkmod/util/ClassLoaderUtil.java
ClassLoaderUtil.getResource
public static URL getResource(String resourceName, Class<?> callingClass) { URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName); if (url == null) { url = ClassLoaderUtil.class.getClassLoader().getResource(resourceName); } if (url == null) { ClassLoader cl = callingClass.getClassLoader(); if (cl != null) { url = cl.getResource(resourceName); } } if ((url == null) && (resourceName != null) && ((resourceName.length() == 0) || (resourceName.charAt(0) != '/'))) { return getResource('/' + resourceName, callingClass); } return url; }
java
public static URL getResource(String resourceName, Class<?> callingClass) { URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName); if (url == null) { url = ClassLoaderUtil.class.getClassLoader().getResource(resourceName); } if (url == null) { ClassLoader cl = callingClass.getClassLoader(); if (cl != null) { url = cl.getResource(resourceName); } } if ((url == null) && (resourceName != null) && ((resourceName.length() == 0) || (resourceName.charAt(0) != '/'))) { return getResource('/' + resourceName, callingClass); } return url; }
[ "public", "static", "URL", "getResource", "(", "String", "resourceName", ",", "Class", "<", "?", ">", "callingClass", ")", "{", "URL", "url", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResource", "(", "resourceName", ")", ";", "if", "(", "url", "==", "null", ")", "{", "url", "=", "ClassLoaderUtil", ".", "class", ".", "getClassLoader", "(", ")", ".", "getResource", "(", "resourceName", ")", ";", "}", "if", "(", "url", "==", "null", ")", "{", "ClassLoader", "cl", "=", "callingClass", ".", "getClassLoader", "(", ")", ";", "if", "(", "cl", "!=", "null", ")", "{", "url", "=", "cl", ".", "getResource", "(", "resourceName", ")", ";", "}", "}", "if", "(", "(", "url", "==", "null", ")", "&&", "(", "resourceName", "!=", "null", ")", "&&", "(", "(", "resourceName", ".", "length", "(", ")", "==", "0", ")", "||", "(", "resourceName", ".", "charAt", "(", "0", ")", "!=", "'", "'", ")", ")", ")", "{", "return", "getResource", "(", "'", "'", "+", "resourceName", ",", "callingClass", ")", ";", "}", "return", "url", ";", "}" ]
Load a given resource. This method will try to load the resource using the following methods (in order): <ul> <li>From Thread.currentThread().getContextClassLoader() <li>From ClassLoaderUtil.class.getClassLoader() <li>callingClass.getClassLoader() </ul> @param resourceName The name IllegalStateException("Unable to call ")of the resource to load @param callingClass The Class object of the calling object @return Matching resouce or null if not found
[ "Load", "a", "given", "resource", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/ClassLoaderUtil.java#L350-L366
6,526
walkmod/walkmod-core
src/main/java/org/walkmod/util/location/LocationAttributes.java
LocationAttributes.addLocationAttributes
public static Attributes addLocationAttributes(Locator locator, Attributes attrs) { if (locator == null || attrs.getIndex(URI, SRC_ATTR) != -1) { return attrs; } AttributesImpl newAttrs = attrs instanceof AttributesImpl ? (AttributesImpl) attrs : new AttributesImpl(attrs); return newAttrs; }
java
public static Attributes addLocationAttributes(Locator locator, Attributes attrs) { if (locator == null || attrs.getIndex(URI, SRC_ATTR) != -1) { return attrs; } AttributesImpl newAttrs = attrs instanceof AttributesImpl ? (AttributesImpl) attrs : new AttributesImpl(attrs); return newAttrs; }
[ "public", "static", "Attributes", "addLocationAttributes", "(", "Locator", "locator", ",", "Attributes", "attrs", ")", "{", "if", "(", "locator", "==", "null", "||", "attrs", ".", "getIndex", "(", "URI", ",", "SRC_ATTR", ")", "!=", "-", "1", ")", "{", "return", "attrs", ";", "}", "AttributesImpl", "newAttrs", "=", "attrs", "instanceof", "AttributesImpl", "?", "(", "AttributesImpl", ")", "attrs", ":", "new", "AttributesImpl", "(", "attrs", ")", ";", "return", "newAttrs", ";", "}" ]
Add location attributes to a set of SAX attributes. @param locator the <code>Locator</code> (can be null) @param attrs the <code>Attributes</code> where locator information should be added @return Location enabled Attributes.
[ "Add", "location", "attributes", "to", "a", "set", "of", "SAX", "attributes", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/location/LocationAttributes.java#L67-L74
6,527
walkmod/walkmod-core
src/main/java/org/walkmod/util/location/LocationAttributes.java
LocationAttributes.remove
public static void remove(Element elem, boolean recurse) { elem.removeAttributeNS(URI, SRC_ATTR); elem.removeAttributeNS(URI, LINE_ATTR); elem.removeAttributeNS(URI, COL_ATTR); if (recurse) { NodeList children = elem.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { remove((Element) child, recurse); } } } }
java
public static void remove(Element elem, boolean recurse) { elem.removeAttributeNS(URI, SRC_ATTR); elem.removeAttributeNS(URI, LINE_ATTR); elem.removeAttributeNS(URI, COL_ATTR); if (recurse) { NodeList children = elem.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { remove((Element) child, recurse); } } } }
[ "public", "static", "void", "remove", "(", "Element", "elem", ",", "boolean", "recurse", ")", "{", "elem", ".", "removeAttributeNS", "(", "URI", ",", "SRC_ATTR", ")", ";", "elem", ".", "removeAttributeNS", "(", "URI", ",", "LINE_ATTR", ")", ";", "elem", ".", "removeAttributeNS", "(", "URI", ",", "COL_ATTR", ")", ";", "if", "(", "recurse", ")", "{", "NodeList", "children", "=", "elem", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "getLength", "(", ")", ";", "i", "++", ")", "{", "Node", "child", "=", "children", ".", "item", "(", "i", ")", ";", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "remove", "(", "(", "Element", ")", "child", ",", "recurse", ")", ";", "}", "}", "}", "}" ]
Remove the location attributes from a DOM element. @param elem the element to remove the location attributes from. @param recurse if <code>true</code>, also remove location attributes on descendant elements.
[ "Remove", "the", "location", "attributes", "from", "a", "DOM", "element", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/util/location/LocationAttributes.java#L247-L260
6,528
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/KafkaClient.java
KafkaClient.setProducerProperties
public KafkaClient setProducerProperties(Properties props) { if (props == null) { producerProperties = null; } else { producerProperties = new Properties(); producerProperties.putAll(props); } return this; }
java
public KafkaClient setProducerProperties(Properties props) { if (props == null) { producerProperties = null; } else { producerProperties = new Properties(); producerProperties.putAll(props); } return this; }
[ "public", "KafkaClient", "setProducerProperties", "(", "Properties", "props", ")", "{", "if", "(", "props", "==", "null", ")", "{", "producerProperties", "=", "null", ";", "}", "else", "{", "producerProperties", "=", "new", "Properties", "(", ")", ";", "producerProperties", ".", "putAll", "(", "props", ")", ";", "}", "return", "this", ";", "}" ]
Sets custom producer configuration properties. @param props @return @since 1.2.1
[ "Sets", "custom", "producer", "configuration", "properties", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L179-L187
6,529
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/KafkaClient.java
KafkaClient.addMessageListener
public boolean addMessageListener(String consumerGroupId, boolean consumeFromBeginning, String topic, IKafkaMessageListener messageListener) { KafkaMsgConsumer kafkaConsumer = getKafkaConsumer(consumerGroupId, consumeFromBeginning); return kafkaConsumer.addMessageListener(topic, messageListener); }
java
public boolean addMessageListener(String consumerGroupId, boolean consumeFromBeginning, String topic, IKafkaMessageListener messageListener) { KafkaMsgConsumer kafkaConsumer = getKafkaConsumer(consumerGroupId, consumeFromBeginning); return kafkaConsumer.addMessageListener(topic, messageListener); }
[ "public", "boolean", "addMessageListener", "(", "String", "consumerGroupId", ",", "boolean", "consumeFromBeginning", ",", "String", "topic", ",", "IKafkaMessageListener", "messageListener", ")", "{", "KafkaMsgConsumer", "kafkaConsumer", "=", "getKafkaConsumer", "(", "consumerGroupId", ",", "consumeFromBeginning", ")", ";", "return", "kafkaConsumer", ".", "addMessageListener", "(", "topic", ",", "messageListener", ")", ";", "}" ]
Adds a message listener for a topic. <p> Note: {@code consumeFromBeginning} is ignored if there is an existing consumer for the {@link consumerGroupId}. </p> @param consumerGroupId @param consumeFromBeginning @param topic @param messageListener @return {@code true} if successful, {@code false} otherwise (the listener may have been added already)
[ "Adds", "a", "message", "listener", "for", "a", "topic", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L535-L539
6,530
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/KafkaClient.java
KafkaClient.flush
public void flush() { for (ProducerType type : ProducerType.ALL_TYPES) { KafkaProducer<String, byte[]> producer = getJavaProducer(type); if (producer != null) { producer.flush(); } } }
java
public void flush() { for (ProducerType type : ProducerType.ALL_TYPES) { KafkaProducer<String, byte[]> producer = getJavaProducer(type); if (producer != null) { producer.flush(); } } }
[ "public", "void", "flush", "(", ")", "{", "for", "(", "ProducerType", "type", ":", "ProducerType", ".", "ALL_TYPES", ")", "{", "KafkaProducer", "<", "String", ",", "byte", "[", "]", ">", "producer", "=", "getJavaProducer", "(", "type", ")", ";", "if", "(", "producer", "!=", "null", ")", "{", "producer", ".", "flush", "(", ")", ";", "}", "}", "}" ]
Flushes any messages in producer queue. @since 1.3.1
[ "Flushes", "any", "messages", "in", "producer", "queue", "." ]
aaeb8536e28a109ac0b69022f0ea4bbf5696b76f
https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L699-L706
6,531
walkmod/walkmod-core
src/main/java/org/walkmod/OptionsBuilder.java
OptionsBuilder.path
public OptionsBuilder path(String path) { options.put(Options.CHAIN_PATH, path != null ? path : DEFAULT_PATH); return this; }
java
public OptionsBuilder path(String path) { options.put(Options.CHAIN_PATH, path != null ? path : DEFAULT_PATH); return this; }
[ "public", "OptionsBuilder", "path", "(", "String", "path", ")", "{", "options", ".", "put", "(", "Options", ".", "CHAIN_PATH", ",", "path", "!=", "null", "?", "path", ":", "DEFAULT_PATH", ")", ";", "return", "this", ";", "}" ]
Sets the path option. Null value resets to default value. @param path directory to read and write from @return updated OptionBuilder instance @see Options#VERBOSE
[ "Sets", "the", "path", "option", ".", "Null", "value", "resets", "to", "default", "value", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/OptionsBuilder.java#L162-L165
6,532
walkmod/walkmod-core
src/main/java/org/walkmod/OptionsBuilder.java
OptionsBuilder.dynamicArgs
public OptionsBuilder dynamicArgs(Map<String, ?> dynamicArgs){ final Map<String, Object> m = dynamicArgs != null ? Collections.unmodifiableMap(new HashMap<String, Object>(dynamicArgs)) : Collections.<String, Object>emptyMap(); options.put(Options.DYNAMIC_ARGS, m); return this; }
java
public OptionsBuilder dynamicArgs(Map<String, ?> dynamicArgs){ final Map<String, Object> m = dynamicArgs != null ? Collections.unmodifiableMap(new HashMap<String, Object>(dynamicArgs)) : Collections.<String, Object>emptyMap(); options.put(Options.DYNAMIC_ARGS, m); return this; }
[ "public", "OptionsBuilder", "dynamicArgs", "(", "Map", "<", "String", ",", "?", ">", "dynamicArgs", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "m", "=", "dynamicArgs", "!=", "null", "?", "Collections", ".", "unmodifiableMap", "(", "new", "HashMap", "<", "String", ",", "Object", ">", "(", "dynamicArgs", ")", ")", ":", "Collections", ".", "<", "String", ",", "Object", ">", "emptyMap", "(", ")", ";", "options", ".", "put", "(", "Options", ".", "DYNAMIC_ARGS", ",", "m", ")", ";", "return", "this", ";", "}" ]
Seths the dynamic arguments @param dynamicArgs Map of dynamic arguments @return Options#DYNAMIC_ARGS
[ "Seths", "the", "dynamic", "arguments" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/OptionsBuilder.java#L273-L279
6,533
walkmod/walkmod-core
src/main/java/org/walkmod/OptionsBuilder.java
OptionsBuilder.executionDirectory
public OptionsBuilder executionDirectory(File executionDirectory) { options.put(Options.EXECUTION_DIRECTORY, executionDirectory != null ? executionDirectory : defaultExecutionDirectory()); return this; }
java
public OptionsBuilder executionDirectory(File executionDirectory) { options.put(Options.EXECUTION_DIRECTORY, executionDirectory != null ? executionDirectory : defaultExecutionDirectory()); return this; }
[ "public", "OptionsBuilder", "executionDirectory", "(", "File", "executionDirectory", ")", "{", "options", ".", "put", "(", "Options", ".", "EXECUTION_DIRECTORY", ",", "executionDirectory", "!=", "null", "?", "executionDirectory", ":", "defaultExecutionDirectory", "(", ")", ")", ";", "return", "this", ";", "}" ]
Sets the execution directory @param executionDirectory execution directory @return updated OptionBuilder instance @see Options#EXECUTION_DIRECTORY
[ "Sets", "the", "execution", "directory" ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/OptionsBuilder.java#L290-L293
6,534
walkmod/walkmod-core
src/main/java/org/walkmod/OptionsBuilder.java
OptionsBuilder.configurationFile
public OptionsBuilder configurationFile(String configFile) { if (configFile != null) { options.put(Options.CONFIGURATION_FILE, new File(configFile)); } else { options.remove(Options.CONFIGURATION_FILE); } return this; }
java
public OptionsBuilder configurationFile(String configFile) { if (configFile != null) { options.put(Options.CONFIGURATION_FILE, new File(configFile)); } else { options.remove(Options.CONFIGURATION_FILE); } return this; }
[ "public", "OptionsBuilder", "configurationFile", "(", "String", "configFile", ")", "{", "if", "(", "configFile", "!=", "null", ")", "{", "options", ".", "put", "(", "Options", ".", "CONFIGURATION_FILE", ",", "new", "File", "(", "configFile", ")", ")", ";", "}", "else", "{", "options", ".", "remove", "(", "Options", ".", "CONFIGURATION_FILE", ")", ";", "}", "return", "this", ";", "}" ]
Sets the walkmod configuration file. @return updated OptionBuilder instance @see Options#CONFIGURATION_FILE
[ "Sets", "the", "walkmod", "configuration", "file", "." ]
fa79b836894fa00ca4b3e2bd26326a44b778f46f
https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/OptionsBuilder.java#L325-L332
6,535
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/ServletCallBackAdapter.java
ServletCallBackAdapter.injectServletCallback
private void injectServletCallback(String method) { Label tryStart = new Label(); Label tryEnd = new Label(); Label catchStart = new Label(); Label catchEnd = new Label(); visitTryCatchBlock(tryStart, tryEnd, catchStart, "java/lang/NoClassDefFoundError"); mark(tryStart); // try { loadArgs(); invokeStatic(Type.getType(SERVLET_CALLBACK_TYPE), Method.getMethod(method)); mark(tryEnd); // } visitJumpInsn(GOTO, catchEnd); mark(catchStart); // catch() { pop(); mark(catchEnd); // } }
java
private void injectServletCallback(String method) { Label tryStart = new Label(); Label tryEnd = new Label(); Label catchStart = new Label(); Label catchEnd = new Label(); visitTryCatchBlock(tryStart, tryEnd, catchStart, "java/lang/NoClassDefFoundError"); mark(tryStart); // try { loadArgs(); invokeStatic(Type.getType(SERVLET_CALLBACK_TYPE), Method.getMethod(method)); mark(tryEnd); // } visitJumpInsn(GOTO, catchEnd); mark(catchStart); // catch() { pop(); mark(catchEnd); // } }
[ "private", "void", "injectServletCallback", "(", "String", "method", ")", "{", "Label", "tryStart", "=", "new", "Label", "(", ")", ";", "Label", "tryEnd", "=", "new", "Label", "(", ")", ";", "Label", "catchStart", "=", "new", "Label", "(", ")", ";", "Label", "catchEnd", "=", "new", "Label", "(", ")", ";", "visitTryCatchBlock", "(", "tryStart", ",", "tryEnd", ",", "catchStart", ",", "\"java/lang/NoClassDefFoundError\"", ")", ";", "mark", "(", "tryStart", ")", ";", "// try {", "loadArgs", "(", ")", ";", "invokeStatic", "(", "Type", ".", "getType", "(", "SERVLET_CALLBACK_TYPE", ")", ",", "Method", ".", "getMethod", "(", "method", ")", ")", ";", "mark", "(", "tryEnd", ")", ";", "// }", "visitJumpInsn", "(", "GOTO", ",", "catchEnd", ")", ";", "mark", "(", "catchStart", ")", ";", "// catch() {", "pop", "(", ")", ";", "mark", "(", "catchEnd", ")", ";", "// }", "}" ]
Inject a callback to our servlet handler. @param method
[ "Inject", "a", "callback", "to", "our", "servlet", "handler", "." ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/ServletCallBackAdapter.java#L65-L80
6,536
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/dataproviders/GCDataProvider.java
GCDataProvider.getTotalGCPercentage
public static double getTotalGCPercentage() { long totalCollectionTime = getTotalCollectionTime(); if(totalCollectionTime == -1) { return -1.0; } long uptime = ManagementFactory.getRuntimeMXBean().getUptime(); return ((double) totalCollectionTime / (double) uptime); }
java
public static double getTotalGCPercentage() { long totalCollectionTime = getTotalCollectionTime(); if(totalCollectionTime == -1) { return -1.0; } long uptime = ManagementFactory.getRuntimeMXBean().getUptime(); return ((double) totalCollectionTime / (double) uptime); }
[ "public", "static", "double", "getTotalGCPercentage", "(", ")", "{", "long", "totalCollectionTime", "=", "getTotalCollectionTime", "(", ")", ";", "if", "(", "totalCollectionTime", "==", "-", "1", ")", "{", "return", "-", "1.0", ";", "}", "long", "uptime", "=", "ManagementFactory", ".", "getRuntimeMXBean", "(", ")", ".", "getUptime", "(", ")", ";", "return", "(", "(", "double", ")", "totalCollectionTime", "/", "(", "double", ")", "uptime", ")", ";", "}" ]
Returns the time spent in GC as a proportion of the time elapsed since the JVM was started. If no data is available returns -1. @return the percentage of uptime spent in gc or -1.0
[ "Returns", "the", "time", "spent", "in", "GC", "as", "a", "proportion", "of", "the", "time", "elapsed", "since", "the", "JVM", "was", "started", ".", "If", "no", "data", "is", "available", "returns", "-", "1", "." ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/dataproviders/GCDataProvider.java#L69-L76
6,537
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/Agent.java
Agent.premain
public static void premain(String agentArgs, Instrumentation inst) { /* * To work in OSGI environment we need to expose our packages to the * boot ClassLoader */ try { String bootDelegation = System.getProperty(OSGI_BOOTDELEGATION_PROPERTY, ""); if (!bootDelegation.equals("")) { bootDelegation += ","; } bootDelegation += BOOTDELEGATION_PACKAGES; System.setProperty(OSGI_BOOTDELEGATION_PROPERTY, bootDelegation); } catch (Exception e) { } /* * We need to keep the ASM jars off the bootclasspath so we will load * our ClassTransformer with our own classloader so that subsequent load * of ASM classes are from our packaged jars */ try { /* * Determine the url to our jar lib folder */ String jarUrl = (Agent.class.getResource("Agent.class").toString()); int jarIndex = jarUrl.indexOf(JAR_URL); if (jarIndex == -1) { System.err .println("Javametrics: Unable to start javaagent: Agent class not loaded from jar: " + jarUrl); return; } /* * Determine root url and name of our jar */ String libUrl = jarUrl.substring(0, jarIndex); int jmIndex = libUrl.lastIndexOf(JAVAMETRICS); libUrl = jarUrl.substring(0, jmIndex); String jarName = jarUrl.substring(jmIndex, jarIndex + JAR_URL.length()); URL[] urls = { new URL(libUrl + jarName), new URL(libUrl + ASM_JAR_URL), new URL(libUrl + ASM_COMMONS_JAR_URL) }; URLClassLoader ucl = new URLClassLoader(urls) { /* * (non-Javadoc) * * @see java.lang.ClassLoader#loadClass(java.lang.String) * * Find class from our jars first before delegating to parent */ @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return findClass(name); } catch (ClassNotFoundException cnf) { } return super.loadClass(name); } }; Class<?> cl = ucl.loadClass(CLASSTRANSFORMER_CLASS); // Register our class transformer inst.addTransformer((ClassFileTransformer) cl.newInstance()); } catch (NoClassDefFoundError ncdfe) { System.err.println("Javametrics: Unable to start javaagent: " + ncdfe); ncdfe.printStackTrace(); } catch (Exception e) { System.err.println("Javametrics: Unable to start javaagent: " + e); e.printStackTrace(); } }
java
public static void premain(String agentArgs, Instrumentation inst) { /* * To work in OSGI environment we need to expose our packages to the * boot ClassLoader */ try { String bootDelegation = System.getProperty(OSGI_BOOTDELEGATION_PROPERTY, ""); if (!bootDelegation.equals("")) { bootDelegation += ","; } bootDelegation += BOOTDELEGATION_PACKAGES; System.setProperty(OSGI_BOOTDELEGATION_PROPERTY, bootDelegation); } catch (Exception e) { } /* * We need to keep the ASM jars off the bootclasspath so we will load * our ClassTransformer with our own classloader so that subsequent load * of ASM classes are from our packaged jars */ try { /* * Determine the url to our jar lib folder */ String jarUrl = (Agent.class.getResource("Agent.class").toString()); int jarIndex = jarUrl.indexOf(JAR_URL); if (jarIndex == -1) { System.err .println("Javametrics: Unable to start javaagent: Agent class not loaded from jar: " + jarUrl); return; } /* * Determine root url and name of our jar */ String libUrl = jarUrl.substring(0, jarIndex); int jmIndex = libUrl.lastIndexOf(JAVAMETRICS); libUrl = jarUrl.substring(0, jmIndex); String jarName = jarUrl.substring(jmIndex, jarIndex + JAR_URL.length()); URL[] urls = { new URL(libUrl + jarName), new URL(libUrl + ASM_JAR_URL), new URL(libUrl + ASM_COMMONS_JAR_URL) }; URLClassLoader ucl = new URLClassLoader(urls) { /* * (non-Javadoc) * * @see java.lang.ClassLoader#loadClass(java.lang.String) * * Find class from our jars first before delegating to parent */ @Override public Class<?> loadClass(String name) throws ClassNotFoundException { try { return findClass(name); } catch (ClassNotFoundException cnf) { } return super.loadClass(name); } }; Class<?> cl = ucl.loadClass(CLASSTRANSFORMER_CLASS); // Register our class transformer inst.addTransformer((ClassFileTransformer) cl.newInstance()); } catch (NoClassDefFoundError ncdfe) { System.err.println("Javametrics: Unable to start javaagent: " + ncdfe); ncdfe.printStackTrace(); } catch (Exception e) { System.err.println("Javametrics: Unable to start javaagent: " + e); e.printStackTrace(); } }
[ "public", "static", "void", "premain", "(", "String", "agentArgs", ",", "Instrumentation", "inst", ")", "{", "/*\n * To work in OSGI environment we need to expose our packages to the\n * boot ClassLoader\n */", "try", "{", "String", "bootDelegation", "=", "System", ".", "getProperty", "(", "OSGI_BOOTDELEGATION_PROPERTY", ",", "\"\"", ")", ";", "if", "(", "!", "bootDelegation", ".", "equals", "(", "\"\"", ")", ")", "{", "bootDelegation", "+=", "\",\"", ";", "}", "bootDelegation", "+=", "BOOTDELEGATION_PACKAGES", ";", "System", ".", "setProperty", "(", "OSGI_BOOTDELEGATION_PROPERTY", ",", "bootDelegation", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "/*\n * We need to keep the ASM jars off the bootclasspath so we will load\n * our ClassTransformer with our own classloader so that subsequent load\n * of ASM classes are from our packaged jars\n */", "try", "{", "/*\n * Determine the url to our jar lib folder\n */", "String", "jarUrl", "=", "(", "Agent", ".", "class", ".", "getResource", "(", "\"Agent.class\"", ")", ".", "toString", "(", ")", ")", ";", "int", "jarIndex", "=", "jarUrl", ".", "indexOf", "(", "JAR_URL", ")", ";", "if", "(", "jarIndex", "==", "-", "1", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: Unable to start javaagent: Agent class not loaded from jar: \"", "+", "jarUrl", ")", ";", "return", ";", "}", "/*\n * Determine root url and name of our jar\n */", "String", "libUrl", "=", "jarUrl", ".", "substring", "(", "0", ",", "jarIndex", ")", ";", "int", "jmIndex", "=", "libUrl", ".", "lastIndexOf", "(", "JAVAMETRICS", ")", ";", "libUrl", "=", "jarUrl", ".", "substring", "(", "0", ",", "jmIndex", ")", ";", "String", "jarName", "=", "jarUrl", ".", "substring", "(", "jmIndex", ",", "jarIndex", "+", "JAR_URL", ".", "length", "(", ")", ")", ";", "URL", "[", "]", "urls", "=", "{", "new", "URL", "(", "libUrl", "+", "jarName", ")", ",", "new", "URL", "(", "libUrl", "+", "ASM_JAR_URL", ")", ",", "new", "URL", "(", "libUrl", "+", "ASM_COMMONS_JAR_URL", ")", "}", ";", "URLClassLoader", "ucl", "=", "new", "URLClassLoader", "(", "urls", ")", "{", "/*\n * (non-Javadoc)\n * \n * @see java.lang.ClassLoader#loadClass(java.lang.String)\n * \n * Find class from our jars first before delegating to parent\n */", "@", "Override", "public", "Class", "<", "?", ">", "loadClass", "(", "String", "name", ")", "throws", "ClassNotFoundException", "{", "try", "{", "return", "findClass", "(", "name", ")", ";", "}", "catch", "(", "ClassNotFoundException", "cnf", ")", "{", "}", "return", "super", ".", "loadClass", "(", "name", ")", ";", "}", "}", ";", "Class", "<", "?", ">", "cl", "=", "ucl", ".", "loadClass", "(", "CLASSTRANSFORMER_CLASS", ")", ";", "// Register our class transformer", "inst", ".", "addTransformer", "(", "(", "ClassFileTransformer", ")", "cl", ".", "newInstance", "(", ")", ")", ";", "}", "catch", "(", "NoClassDefFoundError", "ncdfe", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: Unable to start javaagent: \"", "+", "ncdfe", ")", ";", "ncdfe", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: Unable to start javaagent: \"", "+", "e", ")", ";", "e", ".", "printStackTrace", "(", ")", ";", "}", "}" ]
Entry point for the agent via -javaagent command line parameter @param agentArgs @param inst
[ "Entry", "point", "for", "the", "agent", "via", "-", "javaagent", "command", "line", "parameter" ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/Agent.java#L54-L126
6,538
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java
ClassAdapter.visitHttp
private void visitHttp(int version, int access, String name, String signature, String superName, String[] interfaces) { /* * Instrument implementers of javax/servlet/jsp/HttpJspPage */ if (interfaces != null) { for (String iface : interfaces) { if (HTTP_JSP_INTERFACE.equals(iface)) { jspImplementers.add(name); httpInstrumentJsp = true; if (Agent.debug) { System.err.println("Javametrics: " + name + " implements " + HTTP_JSP_INTERFACE); } } } } /* * Instrument classes that extend/override implementers of * javax/servlet/jsp/HttpJspPage */ if (jspImplementers.contains(superName)) { jspImplementers.add(name); httpInstrumentJsp = true; if (Agent.debug) { System.err.println( "Javametrics: " + name + " extends " + superName + " that implements " + HTTP_JSP_INTERFACE); } } /* * Instrument classes that extend javax/servlet/http/HttpServlet but not * if it is already instrumented as a JSP */ if (!httpInstrumentJsp && servletExtenders.contains(superName)) { servletExtenders.add(name); httpInstrumentServlet = true; if (Agent.debug) { System.err.println("Javametrics: " + name + " extends " + superName); } } }
java
private void visitHttp(int version, int access, String name, String signature, String superName, String[] interfaces) { /* * Instrument implementers of javax/servlet/jsp/HttpJspPage */ if (interfaces != null) { for (String iface : interfaces) { if (HTTP_JSP_INTERFACE.equals(iface)) { jspImplementers.add(name); httpInstrumentJsp = true; if (Agent.debug) { System.err.println("Javametrics: " + name + " implements " + HTTP_JSP_INTERFACE); } } } } /* * Instrument classes that extend/override implementers of * javax/servlet/jsp/HttpJspPage */ if (jspImplementers.contains(superName)) { jspImplementers.add(name); httpInstrumentJsp = true; if (Agent.debug) { System.err.println( "Javametrics: " + name + " extends " + superName + " that implements " + HTTP_JSP_INTERFACE); } } /* * Instrument classes that extend javax/servlet/http/HttpServlet but not * if it is already instrumented as a JSP */ if (!httpInstrumentJsp && servletExtenders.contains(superName)) { servletExtenders.add(name); httpInstrumentServlet = true; if (Agent.debug) { System.err.println("Javametrics: " + name + " extends " + superName); } } }
[ "private", "void", "visitHttp", "(", "int", "version", ",", "int", "access", ",", "String", "name", ",", "String", "signature", ",", "String", "superName", ",", "String", "[", "]", "interfaces", ")", "{", "/*\n * Instrument implementers of javax/servlet/jsp/HttpJspPage\n */", "if", "(", "interfaces", "!=", "null", ")", "{", "for", "(", "String", "iface", ":", "interfaces", ")", "{", "if", "(", "HTTP_JSP_INTERFACE", ".", "equals", "(", "iface", ")", ")", "{", "jspImplementers", ".", "add", "(", "name", ")", ";", "httpInstrumentJsp", "=", "true", ";", "if", "(", "Agent", ".", "debug", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: \"", "+", "name", "+", "\" implements \"", "+", "HTTP_JSP_INTERFACE", ")", ";", "}", "}", "}", "}", "/*\n * Instrument classes that extend/override implementers of\n * javax/servlet/jsp/HttpJspPage\n */", "if", "(", "jspImplementers", ".", "contains", "(", "superName", ")", ")", "{", "jspImplementers", ".", "add", "(", "name", ")", ";", "httpInstrumentJsp", "=", "true", ";", "if", "(", "Agent", ".", "debug", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: \"", "+", "name", "+", "\" extends \"", "+", "superName", "+", "\" that implements \"", "+", "HTTP_JSP_INTERFACE", ")", ";", "}", "}", "/*\n * Instrument classes that extend javax/servlet/http/HttpServlet but not\n * if it is already instrumented as a JSP\n */", "if", "(", "!", "httpInstrumentJsp", "&&", "servletExtenders", ".", "contains", "(", "superName", ")", ")", "{", "servletExtenders", ".", "add", "(", "name", ")", ";", "httpInstrumentServlet", "=", "true", ";", "if", "(", "Agent", ".", "debug", ")", "{", "System", ".", "err", ".", "println", "(", "\"Javametrics: \"", "+", "name", "+", "\" extends \"", "+", "superName", ")", ";", "}", "}", "}" ]
Check if HTTP request instrumentation is required Servlets: instrument any class that is a subclass of HttpServlet JSP pages: instrument any class that implements the HttpJspPage interface NOTE: This assumes the superclasses are visited first which appears to be the case @param version @param access @param name @param signature @param superName @param interfaces
[ "Check", "if", "HTTP", "request", "instrumentation", "is", "required" ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java#L114-L158
6,539
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java
ClassAdapter.visitHttpMethod
private MethodVisitor visitHttpMethod(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor httpMv = mv; /* * Instrument _jspService method for JSP. Instrument doGet, doPost and * service methods for servlets. */ if ((httpInstrumentJsp && name.equals("_jspService")) || (httpInstrumentServlet && (name.equals("doGet") || name.equals("doPost") || name.equals("service")))) { // Only instrument if method has the correct signature if (HTTP_REQUEST_METHOD_DESC.equals(desc)) { httpMv = new ServletCallBackAdapter(className, mv, access, name, desc); } } return httpMv; }
java
private MethodVisitor visitHttpMethod(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor httpMv = mv; /* * Instrument _jspService method for JSP. Instrument doGet, doPost and * service methods for servlets. */ if ((httpInstrumentJsp && name.equals("_jspService")) || (httpInstrumentServlet && (name.equals("doGet") || name.equals("doPost") || name.equals("service")))) { // Only instrument if method has the correct signature if (HTTP_REQUEST_METHOD_DESC.equals(desc)) { httpMv = new ServletCallBackAdapter(className, mv, access, name, desc); } } return httpMv; }
[ "private", "MethodVisitor", "visitHttpMethod", "(", "MethodVisitor", "mv", ",", "int", "access", ",", "String", "name", ",", "String", "desc", ",", "String", "signature", ",", "String", "[", "]", "exceptions", ")", "{", "MethodVisitor", "httpMv", "=", "mv", ";", "/*\n * Instrument _jspService method for JSP. Instrument doGet, doPost and\n * service methods for servlets.\n */", "if", "(", "(", "httpInstrumentJsp", "&&", "name", ".", "equals", "(", "\"_jspService\"", ")", ")", "||", "(", "httpInstrumentServlet", "&&", "(", "name", ".", "equals", "(", "\"doGet\"", ")", "||", "name", ".", "equals", "(", "\"doPost\"", ")", "||", "name", ".", "equals", "(", "\"service\"", ")", ")", ")", ")", "{", "// Only instrument if method has the correct signature", "if", "(", "HTTP_REQUEST_METHOD_DESC", ".", "equals", "(", "desc", ")", ")", "{", "httpMv", "=", "new", "ServletCallBackAdapter", "(", "className", ",", "mv", ",", "access", ",", "name", ",", "desc", ")", ";", "}", "}", "return", "httpMv", ";", "}" ]
Instrument HTTP request methods @param mv original MethodVisitor @param access @param name @param desc @param signature @param exceptions @return original MethodVisitor or new MethodVisitor chained to original
[ "Instrument", "HTTP", "request", "methods" ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/ClassAdapter.java#L172-L191
6,540
RuntimeTools/javametrics
javaagent/src/main/java/com/ibm/javametrics/instrument/BaseAdviceAdapter.java
BaseAdviceAdapter.injectMethodTimer
protected void injectMethodTimer() { methodEntertime = newLocal(Type.LONG_TYPE); invokeStatic(Type.getType(System.class), Method.getMethod(CURRENT_TIME_MILLIS_METHODNAME)); storeLocal(methodEntertime); /* * Inject debug information */ if (Agent.debug) { getStatic(Type.getType(System.class), "err", Type.getType(PrintStream.class)); push("Javametrics: Calling instrumented method: " + className + "." + methodName); invokeVirtual(Type.getType(PrintStream.class), Method.getMethod("void println(java.lang.String)")); } }
java
protected void injectMethodTimer() { methodEntertime = newLocal(Type.LONG_TYPE); invokeStatic(Type.getType(System.class), Method.getMethod(CURRENT_TIME_MILLIS_METHODNAME)); storeLocal(methodEntertime); /* * Inject debug information */ if (Agent.debug) { getStatic(Type.getType(System.class), "err", Type.getType(PrintStream.class)); push("Javametrics: Calling instrumented method: " + className + "." + methodName); invokeVirtual(Type.getType(PrintStream.class), Method.getMethod("void println(java.lang.String)")); } }
[ "protected", "void", "injectMethodTimer", "(", ")", "{", "methodEntertime", "=", "newLocal", "(", "Type", ".", "LONG_TYPE", ")", ";", "invokeStatic", "(", "Type", ".", "getType", "(", "System", ".", "class", ")", ",", "Method", ".", "getMethod", "(", "CURRENT_TIME_MILLIS_METHODNAME", ")", ")", ";", "storeLocal", "(", "methodEntertime", ")", ";", "/*\n * Inject debug information\n */", "if", "(", "Agent", ".", "debug", ")", "{", "getStatic", "(", "Type", ".", "getType", "(", "System", ".", "class", ")", ",", "\"err\"", ",", "Type", ".", "getType", "(", "PrintStream", ".", "class", ")", ")", ";", "push", "(", "\"Javametrics: Calling instrumented method: \"", "+", "className", "+", "\".\"", "+", "methodName", ")", ";", "invokeVirtual", "(", "Type", ".", "getType", "(", "PrintStream", ".", "class", ")", ",", "Method", ".", "getMethod", "(", "\"void println(java.lang.String)\"", ")", ")", ";", "}", "}" ]
Inject a local variable containing timestamp at method entry
[ "Inject", "a", "local", "variable", "containing", "timestamp", "at", "method", "entry" ]
e167a565d0878b535585329c42a29a86516dd741
https://github.com/RuntimeTools/javametrics/blob/e167a565d0878b535585329c42a29a86516dd741/javaagent/src/main/java/com/ibm/javametrics/instrument/BaseAdviceAdapter.java#L46-L59
6,541
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppResponse.java
HppResponse.setSupplementaryDataValue
@JsonAnySetter public void setSupplementaryDataValue(String name, String value) { supplementaryData.put(name, value); }
java
@JsonAnySetter public void setSupplementaryDataValue(String name, String value) { supplementaryData.put(name, value); }
[ "@", "JsonAnySetter", "public", "void", "setSupplementaryDataValue", "(", "String", "name", ",", "String", "value", ")", "{", "supplementaryData", ".", "put", "(", "name", ",", "value", ")", ";", "}" ]
Setter for supplementary data value. @param name @param value
[ "Setter", "for", "supplementary", "data", "value", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppResponse.java#L495-L498
6,542
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppResponse.java
HppResponse.isHashValid
public boolean isHashValid(String secret) { String generatedHash = generateHash(secret); return generatedHash.equals(this.hash); }
java
public boolean isHashValid(String secret) { String generatedHash = generateHash(secret); return generatedHash.equals(this.hash); }
[ "public", "boolean", "isHashValid", "(", "String", "secret", ")", "{", "String", "generatedHash", "=", "generateHash", "(", "secret", ")", ";", "return", "generatedHash", ".", "equals", "(", "this", ".", "hash", ")", ";", "}" ]
Helper method to determine if the HPP response security hash is valid. @param secret @return boolean
[ "Helper", "method", "to", "determine", "if", "the", "HPP", "response", "security", "hash", "is", "valid", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppResponse.java#L711-L714
6,543
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/utils/ValidationUtils.java
ValidationUtils.validate
public static void validate(HppRequest hppRequest) { Set<ConstraintViolation<HppRequest>> constraintViolations = validator.validate(hppRequest); if (constraintViolations.size() > 0) { List<String> validationMessages = new ArrayList<String>(); Iterator<ConstraintViolation<HppRequest>> i = constraintViolations.iterator(); while (i.hasNext()) { ConstraintViolation<HppRequest> constraitViolation = i.next(); validationMessages.add(constraitViolation.getMessage()); } LOGGER.info("HppRequest failed validation with the following errors {}", validationMessages); throw new RealexValidationException("HppRequest failed validation", validationMessages); } }
java
public static void validate(HppRequest hppRequest) { Set<ConstraintViolation<HppRequest>> constraintViolations = validator.validate(hppRequest); if (constraintViolations.size() > 0) { List<String> validationMessages = new ArrayList<String>(); Iterator<ConstraintViolation<HppRequest>> i = constraintViolations.iterator(); while (i.hasNext()) { ConstraintViolation<HppRequest> constraitViolation = i.next(); validationMessages.add(constraitViolation.getMessage()); } LOGGER.info("HppRequest failed validation with the following errors {}", validationMessages); throw new RealexValidationException("HppRequest failed validation", validationMessages); } }
[ "public", "static", "void", "validate", "(", "HppRequest", "hppRequest", ")", "{", "Set", "<", "ConstraintViolation", "<", "HppRequest", ">>", "constraintViolations", "=", "validator", ".", "validate", "(", "hppRequest", ")", ";", "if", "(", "constraintViolations", ".", "size", "(", ")", ">", "0", ")", "{", "List", "<", "String", ">", "validationMessages", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "Iterator", "<", "ConstraintViolation", "<", "HppRequest", ">", ">", "i", "=", "constraintViolations", ".", "iterator", "(", ")", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "ConstraintViolation", "<", "HppRequest", ">", "constraitViolation", "=", "i", ".", "next", "(", ")", ";", "validationMessages", ".", "add", "(", "constraitViolation", ".", "getMessage", "(", ")", ")", ";", "}", "LOGGER", ".", "info", "(", "\"HppRequest failed validation with the following errors {}\"", ",", "validationMessages", ")", ";", "throw", "new", "RealexValidationException", "(", "\"HppRequest failed validation\"", ",", "validationMessages", ")", ";", "}", "}" ]
Method validates HPP request object using JSR-303 bean validation. @param hppRequest
[ "Method", "validates", "HPP", "request", "object", "using", "JSR", "-", "303", "bean", "validation", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/utils/ValidationUtils.java#L50-L65
6,544
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/utils/ValidationUtils.java
ValidationUtils.validate
public static void validate(HppResponse hppResponse, String secret) { if (!hppResponse.isHashValid(secret)) { LOGGER.error("HppResponse contains an invalid security hash."); throw new RealexValidationException("HppResponse contains an invalid security hash"); } }
java
public static void validate(HppResponse hppResponse, String secret) { if (!hppResponse.isHashValid(secret)) { LOGGER.error("HppResponse contains an invalid security hash."); throw new RealexValidationException("HppResponse contains an invalid security hash"); } }
[ "public", "static", "void", "validate", "(", "HppResponse", "hppResponse", ",", "String", "secret", ")", "{", "if", "(", "!", "hppResponse", ".", "isHashValid", "(", "secret", ")", ")", "{", "LOGGER", ".", "error", "(", "\"HppResponse contains an invalid security hash.\"", ")", ";", "throw", "new", "RealexValidationException", "(", "\"HppResponse contains an invalid security hash\"", ")", ";", "}", "}" ]
Method validates HPP response hash. @param hppResponse @param secret
[ "Method", "validates", "HPP", "response", "hash", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/utils/ValidationUtils.java#L73-L78
6,545
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addAutoSettleFlag
public HppRequest addAutoSettleFlag(boolean autoSettleFlag) { this.autoSettleFlag = autoSettleFlag ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addAutoSettleFlag(boolean autoSettleFlag) { this.autoSettleFlag = autoSettleFlag ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addAutoSettleFlag", "(", "boolean", "autoSettleFlag", ")", "{", "this", ".", "autoSettleFlag", "=", "autoSettleFlag", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add autop settle flag. @param autoSettleFlag @return HppRequest
[ "Helper", "method", "to", "add", "autop", "settle", "flag", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L925-L928
6,546
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addReturnTss
public HppRequest addReturnTss(boolean returnTss) { this.returnTss = returnTss ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addReturnTss(boolean returnTss) { this.returnTss = returnTss ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addReturnTss", "(", "boolean", "returnTss", ")", "{", "this", ".", "returnTss", "=", "returnTss", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add return TSS. @param returnTss @return HppRequest
[ "Helper", "method", "to", "add", "return", "TSS", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L969-L972
6,547
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addCardStorageEnable
public HppRequest addCardStorageEnable(boolean cardStorageEnable) { this.cardStorageEnable = cardStorageEnable ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addCardStorageEnable(boolean cardStorageEnable) { this.cardStorageEnable = cardStorageEnable ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addCardStorageEnable", "(", "boolean", "cardStorageEnable", ")", "{", "this", ".", "cardStorageEnable", "=", "cardStorageEnable", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add card storage enable flag. @param cardStorageEnable @return HppRequest
[ "Helper", "method", "to", "add", "card", "storage", "enable", "flag", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1090-L1093
6,548
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addOfferSaveCard
public HppRequest addOfferSaveCard(boolean offerSaveCard) { this.offerSaveCard = offerSaveCard ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addOfferSaveCard(boolean offerSaveCard) { this.offerSaveCard = offerSaveCard ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addOfferSaveCard", "(", "boolean", "offerSaveCard", ")", "{", "this", ".", "offerSaveCard", "=", "offerSaveCard", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add offer to save card. @param offerSaveCard @return HppRequest
[ "Helper", "method", "to", "add", "offer", "to", "save", "card", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1112-L1115
6,549
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addPayerExists
public HppRequest addPayerExists(boolean payerExists) { this.payerExists = payerExists ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addPayerExists(boolean payerExists) { this.payerExists = payerExists ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addPayerExists", "(", "boolean", "payerExists", ")", "{", "this", ".", "payerExists", "=", "payerExists", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add payer exists flag. @param payerExists @return HppRequest
[ "Helper", "method", "to", "add", "payer", "exists", "flag", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1156-L1159
6,550
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addSupplementaryDataValue
@JsonAnySetter public HppRequest addSupplementaryDataValue(String name, String value) { supplementaryData.put(name, value); return this; }
java
@JsonAnySetter public HppRequest addSupplementaryDataValue(String name, String value) { supplementaryData.put(name, value); return this; }
[ "@", "JsonAnySetter", "public", "HppRequest", "addSupplementaryDataValue", "(", "String", "name", ",", "String", "value", ")", "{", "supplementaryData", ".", "put", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Helper method to add supplementary data. @param name @param value @return HppRequest
[ "Helper", "method", "to", "add", "supplementary", "data", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1198-L1202
6,551
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addValidateCardOnly
public HppRequest addValidateCardOnly(boolean validateCardOnly) { this.validateCardOnly = validateCardOnly ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addValidateCardOnly(boolean validateCardOnly) { this.validateCardOnly = validateCardOnly ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addValidateCardOnly", "(", "boolean", "validateCardOnly", ")", "{", "this", ".", "validateCardOnly", "=", "validateCardOnly", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add validate card only flag. @param validateCardOnly @return HppRequest
[ "Helper", "method", "to", "add", "validate", "card", "only", "flag", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1210-L1213
6,552
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.addDccEnable
public HppRequest addDccEnable(boolean dccEnable) { this.dccEnable = dccEnable ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
java
public HppRequest addDccEnable(boolean dccEnable) { this.dccEnable = dccEnable ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag(); return this; }
[ "public", "HppRequest", "addDccEnable", "(", "boolean", "dccEnable", ")", "{", "this", ".", "dccEnable", "=", "dccEnable", "?", "Flag", ".", "TRUE", ".", "getFlag", "(", ")", ":", "Flag", ".", "FALSE", ".", "getFlag", "(", ")", ";", "return", "this", ";", "}" ]
Helper method to add DCC enable flag. @param dccEnable @return HppRequest
[ "Helper", "method", "to", "add", "DCC", "enable", "flag", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1232-L1235
6,553
realexpayments/rxp-hpp-java
src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java
HppRequest.generateDefaults
public HppRequest generateDefaults(String secret) { //generate timestamp if not set if (null == this.timeStamp || "".equals(this.timeStamp)) { this.timeStamp = GenerationUtils.generateTimestamp(); } //generate order ID if not set if (null == this.orderId || "".equals(this.orderId)) { this.orderId = GenerationUtils.generateOrderId(); } //generate hash hash(secret); return this; }
java
public HppRequest generateDefaults(String secret) { //generate timestamp if not set if (null == this.timeStamp || "".equals(this.timeStamp)) { this.timeStamp = GenerationUtils.generateTimestamp(); } //generate order ID if not set if (null == this.orderId || "".equals(this.orderId)) { this.orderId = GenerationUtils.generateOrderId(); } //generate hash hash(secret); return this; }
[ "public", "HppRequest", "generateDefaults", "(", "String", "secret", ")", "{", "//generate timestamp if not set", "if", "(", "null", "==", "this", ".", "timeStamp", "||", "\"\"", ".", "equals", "(", "this", ".", "timeStamp", ")", ")", "{", "this", ".", "timeStamp", "=", "GenerationUtils", ".", "generateTimestamp", "(", ")", ";", "}", "//generate order ID if not set", "if", "(", "null", "==", "this", ".", "orderId", "||", "\"\"", ".", "equals", "(", "this", ".", "orderId", ")", ")", "{", "this", ".", "orderId", "=", "GenerationUtils", ".", "generateOrderId", "(", ")", ";", "}", "//generate hash", "hash", "(", "secret", ")", ";", "return", "this", ";", "}" ]
Generates default values for fields such as hash, timestamp and order ID. @param secret @return HppRequest
[ "Generates", "default", "values", "for", "fields", "such", "as", "hash", "timestamp", "and", "order", "ID", "." ]
29cc5df036af09a6d8ea16ccd7e02e856f72620f
https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1352-L1368
6,554
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java
ServerFilter.groups
public ServerFilter groups(Group... groups) { allItemsNotNull(groups, "Groups"); groupFilter = groupFilter.and(Filter.or( map(groups, Group::asFilter) )); return this; }
java
public ServerFilter groups(Group... groups) { allItemsNotNull(groups, "Groups"); groupFilter = groupFilter.and(Filter.or( map(groups, Group::asFilter) )); return this; }
[ "public", "ServerFilter", "groups", "(", "Group", "...", "groups", ")", "{", "allItemsNotNull", "(", "groups", ",", "\"Groups\"", ")", ";", "groupFilter", "=", "groupFilter", ".", "and", "(", "Filter", ".", "or", "(", "map", "(", "groups", ",", "Group", "::", "asFilter", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to restrict searched servers by groups @param groups is list of group references @return {@link ServerFilter}
[ "Method", "allow", "to", "restrict", "searched", "servers", "by", "groups" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java#L168-L176
6,555
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java
ServerFilter.where
public ServerFilter where(Predicate<ServerMetadata> filter) { checkNotNull(filter, "Filter must be not a null"); predicate = predicate.and(filter); return this; }
java
public ServerFilter where(Predicate<ServerMetadata> filter) { checkNotNull(filter, "Filter must be not a null"); predicate = predicate.and(filter); return this; }
[ "public", "ServerFilter", "where", "(", "Predicate", "<", "ServerMetadata", ">", "filter", ")", "{", "checkNotNull", "(", "filter", ",", "\"Filter must be not a null\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "filter", ")", ";", "return", "this", ";", "}" ]
Method allow to specify custom search servers predicate @param filter is not null custom filtering predicate @return {@link ServerFilter} @throws NullPointerException if {@code filter} is null
[ "Method", "allow", "to", "specify", "custom", "search", "servers", "predicate" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java#L185-L191
6,556
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java
ServerFilter.nameContains
public ServerFilter nameContains(String... subStrings) { allItemsNotNull(subStrings, "Name keywords"); predicate = predicate.and(combine( ServerMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
java
public ServerFilter nameContains(String... subStrings) { allItemsNotNull(subStrings, "Name keywords"); predicate = predicate.and(combine( ServerMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
[ "public", "ServerFilter", "nameContains", "(", "String", "...", "subStrings", ")", "{", "allItemsNotNull", "(", "subStrings", ",", "\"Name keywords\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "ServerMetadata", "::", "getName", ",", "in", "(", "asList", "(", "subStrings", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to restrict servers by keywords that contains in target server name. Matching is case insensitive. Comparison use search substring algorithms. @param subStrings is a list of server name keywords @return {@link ServerFilter}
[ "Method", "allow", "to", "restrict", "servers", "by", "keywords", "that", "contains", "in", "target", "server", "name", ".", "Matching", "is", "case", "insensitive", ".", "Comparison", "use", "search", "substring", "algorithms", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java#L229-L237
6,557
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java
ServerFilter.descriptionContains
public ServerFilter descriptionContains(String... subStrings) { allItemsNotNull(subStrings, "Description keywords"); predicate = predicate.and(combine( ServerMetadata::getDescription, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
java
public ServerFilter descriptionContains(String... subStrings) { allItemsNotNull(subStrings, "Description keywords"); predicate = predicate.and(combine( ServerMetadata::getDescription, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
[ "public", "ServerFilter", "descriptionContains", "(", "String", "...", "subStrings", ")", "{", "allItemsNotNull", "(", "subStrings", ",", "\"Description keywords\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "ServerMetadata", "::", "getDescription", ",", "in", "(", "asList", "(", "subStrings", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find server that description contains one of specified keywords. Matching is case insensitive. @param subStrings is list of not null keywords @return {@link ServerFilter}
[ "Method", "allow", "to", "find", "server", "that", "description", "contains", "one", "of", "specified", "keywords", ".", "Matching", "is", "case", "insensitive", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java#L246-L254
6,558
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java
ServerFilter.powerStates
public ServerFilter powerStates(PowerState... states) { allItemsNotNull(states, "Power states"); predicate = predicate.and(combine( s -> s.getDetails().getPowerState(), in(map(states, PowerState::getCode)) )); return this; }
java
public ServerFilter powerStates(PowerState... states) { allItemsNotNull(states, "Power states"); predicate = predicate.and(combine( s -> s.getDetails().getPowerState(), in(map(states, PowerState::getCode)) )); return this; }
[ "public", "ServerFilter", "powerStates", "(", "PowerState", "...", "states", ")", "{", "allItemsNotNull", "(", "states", ",", "\"Power states\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "s", "->", "s", ".", "getDetails", "(", ")", ".", "getPowerState", "(", ")", ",", "in", "(", "map", "(", "states", ",", "PowerState", "::", "getCode", ")", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find servers with specified power state of target servers @param states is a list target server power states @return {@link GroupFilter}
[ "Method", "allow", "to", "find", "servers", "with", "specified", "power", "state", "of", "target", "servers" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/server/filters/ServerFilter.java#L309-L317
6,559
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java
NetworkFilter.nameContains
public NetworkFilter nameContains(String... subStrings) { checkNotNull(subStrings, "Name match criteria must be not a null"); predicate = predicate.and(combine( NetworkMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
java
public NetworkFilter nameContains(String... subStrings) { checkNotNull(subStrings, "Name match criteria must be not a null"); predicate = predicate.and(combine( NetworkMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
[ "public", "NetworkFilter", "nameContains", "(", "String", "...", "subStrings", ")", "{", "checkNotNull", "(", "subStrings", ",", "\"Name match criteria must be not a null\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "NetworkMetadata", "::", "getName", ",", "in", "(", "asList", "(", "subStrings", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to filter networks by key phrase that contains in its name. Filtering will be case insensitive and will use substring matching. @param subStrings is not null list of target network names @return {@link NetworkFilter}
[ "Method", "allow", "to", "filter", "networks", "by", "key", "phrase", "that", "contains", "in", "its", "name", ".", "Filtering", "will", "be", "case", "insensitive", "and", "will", "use", "substring", "matching", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java#L131-L139
6,560
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java
NetworkFilter.names
public NetworkFilter names(String... names) { checkNotNull(names, "Name match criteria must be not a null"); predicate = predicate.and(combine( NetworkMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
java
public NetworkFilter names(String... names) { checkNotNull(names, "Name match criteria must be not a null"); predicate = predicate.and(combine( NetworkMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
[ "public", "NetworkFilter", "names", "(", "String", "...", "names", ")", "{", "checkNotNull", "(", "names", ",", "\"Name match criteria must be not a null\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "NetworkMetadata", "::", "getName", ",", "in", "(", "asList", "(", "names", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to filter networks by names. Filtering will be case insensitive and will use string equality comparison. @param names is not null list of network names @return {@link NetworkFilter}
[ "Method", "allow", "to", "filter", "networks", "by", "names", ".", "Filtering", "will", "be", "case", "insensitive", "and", "will", "use", "string", "equality", "comparison", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java#L148-L156
6,561
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java
NetworkFilter.where
public NetworkFilter where(Predicate<NetworkMetadata> filter) { checkNotNull(filter, "Filter predicate must be not a null"); this.predicate = this.predicate.and(filter); return this; }
java
public NetworkFilter where(Predicate<NetworkMetadata> filter) { checkNotNull(filter, "Filter predicate must be not a null"); this.predicate = this.predicate.and(filter); return this; }
[ "public", "NetworkFilter", "where", "(", "Predicate", "<", "NetworkMetadata", ">", "filter", ")", "{", "checkNotNull", "(", "filter", ",", "\"Filter predicate must be not a null\"", ")", ";", "this", ".", "predicate", "=", "this", ".", "predicate", ".", "and", "(", "filter", ")", ";", "return", "this", ";", "}" ]
Method allow to filter networks using predicate. @param filter is not null network filtering predicate @return {@link NetworkFilter}
[ "Method", "allow", "to", "filter", "networks", "using", "predicate", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/network/filters/NetworkFilter.java#L164-L170
6,562
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java
GroupFilter.dataCentersWhere
public GroupFilter dataCentersWhere(Predicate<DataCenterMetadata> predicate) { dataCenterFilter.where( dataCenterFilter.getPredicate().or(predicate) ); return this; }
java
public GroupFilter dataCentersWhere(Predicate<DataCenterMetadata> predicate) { dataCenterFilter.where( dataCenterFilter.getPredicate().or(predicate) ); return this; }
[ "public", "GroupFilter", "dataCentersWhere", "(", "Predicate", "<", "DataCenterMetadata", ">", "predicate", ")", "{", "dataCenterFilter", ".", "where", "(", "dataCenterFilter", ".", "getPredicate", "(", ")", ".", "or", "(", "predicate", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to provide filtering predicate that restrict group by data centers that contains its. @param predicate is not null filtering predicate @return {@link GroupFilter}
[ "Method", "allow", "to", "provide", "filtering", "predicate", "that", "restrict", "group", "by", "data", "centers", "that", "contains", "its", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java#L77-L83
6,563
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java
GroupFilter.nameContains
public GroupFilter nameContains(String... subStrings) { checkNotNull(subStrings, "Name match criteria must be not a null"); predicate = predicate.and(combine( GroupMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
java
public GroupFilter nameContains(String... subStrings) { checkNotNull(subStrings, "Name match criteria must be not a null"); predicate = predicate.and(combine( GroupMetadata::getName, in(asList(subStrings), Predicates::containsIgnoreCase) )); return this; }
[ "public", "GroupFilter", "nameContains", "(", "String", "...", "subStrings", ")", "{", "checkNotNull", "(", "subStrings", ",", "\"Name match criteria must be not a null\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "GroupMetadata", "::", "getName", ",", "in", "(", "asList", "(", "subStrings", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to filter groups by key phrase that contains in its name. Filtering will be case insensitive and will use substring matching. @param subStrings is not null list of target group names @return {@link GroupFilter}
[ "Method", "allow", "to", "filter", "groups", "by", "key", "phrase", "that", "contains", "in", "its", "name", ".", "Filtering", "will", "be", "case", "insensitive", "and", "will", "use", "substring", "matching", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java#L131-L139
6,564
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java
GroupFilter.names
public GroupFilter names(String... names) { checkNotNull(names, "Name match criteria must be not a null"); predicate = predicate.and(combine( GroupMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
java
public GroupFilter names(String... names) { checkNotNull(names, "Name match criteria must be not a null"); predicate = predicate.and(combine( GroupMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
[ "public", "GroupFilter", "names", "(", "String", "...", "names", ")", "{", "checkNotNull", "(", "names", ",", "\"Name match criteria must be not a null\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "GroupMetadata", "::", "getName", ",", "in", "(", "asList", "(", "names", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to filter groups by names. Filtering will be case insensitive and will use string equality comparison. @param names is not null list of group names @return {@link GroupFilter}
[ "Method", "allow", "to", "filter", "groups", "by", "names", ".", "Filtering", "will", "be", "case", "insensitive", "and", "will", "use", "string", "equality", "comparison", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java#L148-L156
6,565
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java
GroupFilter.where
public GroupFilter where(Predicate<GroupMetadata> filter) { checkNotNull(filter, "Filter predicate must be not a null"); this.predicate = this.predicate.and(filter); return this; }
java
public GroupFilter where(Predicate<GroupMetadata> filter) { checkNotNull(filter, "Filter predicate must be not a null"); this.predicate = this.predicate.and(filter); return this; }
[ "public", "GroupFilter", "where", "(", "Predicate", "<", "GroupMetadata", ">", "filter", ")", "{", "checkNotNull", "(", "filter", ",", "\"Filter predicate must be not a null\"", ")", ";", "this", ".", "predicate", "=", "this", ".", "predicate", ".", "and", "(", "filter", ")", ";", "return", "this", ";", "}" ]
Method allow to filter groups using predicate. @param filter is not null group filtering predicate @return {@link GroupFilter}
[ "Method", "allow", "to", "filter", "groups", "using", "predicate", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/group/filters/GroupFilter.java#L164-L170
6,566
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/domain/autoscale/filter/AutoscalePolicyFilter.java
AutoscalePolicyFilter.nameContains
public AutoscalePolicyFilter nameContains(String... names) { allItemsNotNull(names, "Autoscale policy names"); predicate = predicate.and(combine( AutoscalePolicyMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
java
public AutoscalePolicyFilter nameContains(String... names) { allItemsNotNull(names, "Autoscale policy names"); predicate = predicate.and(combine( AutoscalePolicyMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
[ "public", "AutoscalePolicyFilter", "nameContains", "(", "String", "...", "names", ")", "{", "allItemsNotNull", "(", "names", ",", "\"Autoscale policy names\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "AutoscalePolicyMetadata", "::", "getName", ",", "in", "(", "asList", "(", "names", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find autoscale policies that contains some substring in name. Filtering is case insensitive. @param names is not null list of name substrings @return {@link AutoscalePolicyFilter} @throws NullPointerException if {@code names} is null
[ "Method", "allow", "to", "find", "autoscale", "policies", "that", "contains", "some", "substring", "in", "name", ".", "Filtering", "is", "case", "insensitive", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/domain/autoscale/filter/AutoscalePolicyFilter.java#L129-L137
6,567
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/domain/autoscale/filter/AutoscalePolicyFilter.java
AutoscalePolicyFilter.names
public AutoscalePolicyFilter names(String... names) { allItemsNotNull(names, "Autoscale policies names"); predicate = predicate.and(combine( AutoscalePolicyMetadata::getName, in(names) )); return this; }
java
public AutoscalePolicyFilter names(String... names) { allItemsNotNull(names, "Autoscale policies names"); predicate = predicate.and(combine( AutoscalePolicyMetadata::getName, in(names) )); return this; }
[ "public", "AutoscalePolicyFilter", "names", "(", "String", "...", "names", ")", "{", "allItemsNotNull", "(", "names", ",", "\"Autoscale policies names\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "AutoscalePolicyMetadata", "::", "getName", ",", "in", "(", "names", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find autoscale policies by its names Filtering is case sensitive. @param names is a set of names @return {@link AutoscalePolicyFilter}
[ "Method", "allow", "to", "find", "autoscale", "policies", "by", "its", "names", "Filtering", "is", "case", "sensitive", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/domain/autoscale/filter/AutoscalePolicyFilter.java#L146-L154
6,568
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/ip/Subnet.java
Subnet.getCidr
public String getCidr() { if (cidr != null) { return cidr; } if (ipAddress != null) { if (mask != null) { return new SubnetUtils(ipAddress, mask).getCidrSignature(); } if (cidrMask != null) { return new SubnetUtils(ipAddress+cidrMask).getCidrSignature(); } } return null; }
java
public String getCidr() { if (cidr != null) { return cidr; } if (ipAddress != null) { if (mask != null) { return new SubnetUtils(ipAddress, mask).getCidrSignature(); } if (cidrMask != null) { return new SubnetUtils(ipAddress+cidrMask).getCidrSignature(); } } return null; }
[ "public", "String", "getCidr", "(", ")", "{", "if", "(", "cidr", "!=", "null", ")", "{", "return", "cidr", ";", "}", "if", "(", "ipAddress", "!=", "null", ")", "{", "if", "(", "mask", "!=", "null", ")", "{", "return", "new", "SubnetUtils", "(", "ipAddress", ",", "mask", ")", ".", "getCidrSignature", "(", ")", ";", "}", "if", "(", "cidrMask", "!=", "null", ")", "{", "return", "new", "SubnetUtils", "(", "ipAddress", "+", "cidrMask", ")", ".", "getCidrSignature", "(", ")", ";", "}", "}", "return", "null", ";", "}" ]
Returns IP address in CIDR format. If specified {@code cidr} - returns {@code cidr} value. If specified {@code ipAddress} and {@code mask} - returns calculated IP address. If specified {@code ipAddress} and {@code cidrMask} - returns calculated IP address. Otherwise returns {@code null} @return ip address string representation in CIDR format
[ "Returns", "IP", "address", "in", "CIDR", "format", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/server/services/dsl/domain/ip/Subnet.java#L72-L85
6,569
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getBillingStatisticsByAllDatacenters
@Test(groups = {SAMPLES}) public void getBillingStatisticsByAllDatacenters() { Statistics summarize = statisticsService .billingStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT, US_EAST_STERLING) ) .summarize(); assertNotNull(summarize); }
java
@Test(groups = {SAMPLES}) public void getBillingStatisticsByAllDatacenters() { Statistics summarize = statisticsService .billingStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT, US_EAST_STERLING) ) .summarize(); assertNotNull(summarize); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getBillingStatisticsByAllDatacenters", "(", ")", "{", "Statistics", "summarize", "=", "statisticsService", ".", "billingStats", "(", ")", ".", "forDataCenters", "(", "new", "DataCenterFilter", "(", ")", ".", "dataCenters", "(", "DE_FRANKFURT", ",", "US_EAST_STERLING", ")", ")", ".", "summarize", "(", ")", ";", "assertNotNull", "(", "summarize", ")", ";", "}" ]
Step 1. App query total billing statistics by all datacenters
[ "Step", "1", ".", "App", "query", "total", "billing", "statistics", "by", "all", "datacenters" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L148-L159
6,570
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getBillingStatisticsGroupedByDatacenters
@Test(groups = {SAMPLES}) public void getBillingStatisticsGroupedByDatacenters() { List<BillingStatsEntry> stats = statisticsService .billingStats() .forGroups( new GroupFilter().nameContains(nameCriteria) ) .groupByDataCenter(); assertNotNull(stats); }
java
@Test(groups = {SAMPLES}) public void getBillingStatisticsGroupedByDatacenters() { List<BillingStatsEntry> stats = statisticsService .billingStats() .forGroups( new GroupFilter().nameContains(nameCriteria) ) .groupByDataCenter(); assertNotNull(stats); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getBillingStatisticsGroupedByDatacenters", "(", ")", "{", "List", "<", "BillingStatsEntry", ">", "stats", "=", "statisticsService", ".", "billingStats", "(", ")", ".", "forGroups", "(", "new", "GroupFilter", "(", ")", ".", "nameContains", "(", "nameCriteria", ")", ")", ".", "groupByDataCenter", "(", ")", ";", "assertNotNull", "(", "stats", ")", ";", "}" ]
Step 2. App query billing statistics grouped by datacenters
[ "Step", "2", ".", "App", "query", "billing", "statistics", "grouped", "by", "datacenters" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L164-L174
6,571
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getDE1BillingStatsGroupedByServers
@Test(groups = {SAMPLES}) public void getDE1BillingStatsGroupedByServers() { List<BillingStatsEntry> stats = statisticsService .billingStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .groupByServer(); assertNotNull(stats); }
java
@Test(groups = {SAMPLES}) public void getDE1BillingStatsGroupedByServers() { List<BillingStatsEntry> stats = statisticsService .billingStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .groupByServer(); assertNotNull(stats); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getDE1BillingStatsGroupedByServers", "(", ")", "{", "List", "<", "BillingStatsEntry", ">", "stats", "=", "statisticsService", ".", "billingStats", "(", ")", ".", "forDataCenters", "(", "new", "DataCenterFilter", "(", ")", ".", "dataCenters", "(", "DE_FRANKFURT", ")", ")", ".", "groupByServer", "(", ")", ";", "assertNotNull", "(", "stats", ")", ";", "}" ]
Step 3. App query billing statistics grouped by servers within DE1 Datacenter
[ "Step", "3", ".", "App", "query", "billing", "statistics", "grouped", "by", "servers", "within", "DE1", "Datacenter" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L179-L190
6,572
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getMonitoringStatisticsByAllDatacenters
@Test(groups = {SAMPLES}) public void getMonitoringStatisticsByAllDatacenters() { List<MonitoringStatsEntry> summarize = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT, US_EAST_STERLING) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .summarize(); assertNotNull(summarize); }
java
@Test(groups = {SAMPLES}) public void getMonitoringStatisticsByAllDatacenters() { List<MonitoringStatsEntry> summarize = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT, US_EAST_STERLING) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .summarize(); assertNotNull(summarize); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getMonitoringStatisticsByAllDatacenters", "(", ")", "{", "List", "<", "MonitoringStatsEntry", ">", "summarize", "=", "statisticsService", ".", "monitoringStats", "(", ")", ".", "forDataCenters", "(", "new", "DataCenterFilter", "(", ")", ".", "dataCenters", "(", "DE_FRANKFURT", ",", "US_EAST_STERLING", ")", ")", ".", "forTime", "(", "new", "ServerMonitoringFilter", "(", ")", ".", "last", "(", "Duration", ".", "ofDays", "(", "2", ")", ")", ")", ".", "summarize", "(", ")", ";", "assertNotNull", "(", "summarize", ")", ";", "}" ]
Step 4. App query total monitoring statistics by all datacenters
[ "Step", "4", ".", "App", "query", "total", "monitoring", "statistics", "by", "all", "datacenters" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L195-L207
6,573
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getMonitoringStatisticsGroupedByDatacenters
@Test(groups = {SAMPLES}) public void getMonitoringStatisticsGroupedByDatacenters() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forGroups( new GroupFilter().nameContains(nameCriteria) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .groupByDataCenter(); assertNotNull(stats); }
java
@Test(groups = {SAMPLES}) public void getMonitoringStatisticsGroupedByDatacenters() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forGroups( new GroupFilter().nameContains(nameCriteria) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .groupByDataCenter(); assertNotNull(stats); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getMonitoringStatisticsGroupedByDatacenters", "(", ")", "{", "List", "<", "MonitoringStatsEntry", ">", "stats", "=", "statisticsService", ".", "monitoringStats", "(", ")", ".", "forGroups", "(", "new", "GroupFilter", "(", ")", ".", "nameContains", "(", "nameCriteria", ")", ")", ".", "forTime", "(", "new", "ServerMonitoringFilter", "(", ")", ".", "last", "(", "Duration", ".", "ofDays", "(", "2", ")", ")", ")", ".", "groupByDataCenter", "(", ")", ";", "assertNotNull", "(", "stats", ")", ";", "}" ]
Step 5. App query monitoring statistics grouped by datacenters
[ "Step", "5", ".", "App", "query", "monitoring", "statistics", "grouped", "by", "datacenters" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L212-L223
6,574
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getDE1MonitoringStatsGroupedByServers
@Test(groups = {SAMPLES}) public void getDE1MonitoringStatsGroupedByServers() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .groupByServer(); groupService.find( new GroupFilter() .dataCenters(DataCenter.DE_FRANKFURT) ); assertNotNull(stats); }
java
@Test(groups = {SAMPLES}) public void getDE1MonitoringStatsGroupedByServers() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .forTime(new ServerMonitoringFilter().last(Duration.ofDays(2))) .groupByServer(); groupService.find( new GroupFilter() .dataCenters(DataCenter.DE_FRANKFURT) ); assertNotNull(stats); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getDE1MonitoringStatsGroupedByServers", "(", ")", "{", "List", "<", "MonitoringStatsEntry", ">", "stats", "=", "statisticsService", ".", "monitoringStats", "(", ")", ".", "forDataCenters", "(", "new", "DataCenterFilter", "(", ")", ".", "dataCenters", "(", "DE_FRANKFURT", ")", ")", ".", "forTime", "(", "new", "ServerMonitoringFilter", "(", ")", ".", "last", "(", "Duration", ".", "ofDays", "(", "2", ")", ")", ")", ".", "groupByServer", "(", ")", ";", "groupService", ".", "find", "(", "new", "GroupFilter", "(", ")", ".", "dataCenters", "(", "DataCenter", ".", "DE_FRANKFURT", ")", ")", ";", "assertNotNull", "(", "stats", ")", ";", "}" ]
Step 6. App query monitoring statistics grouped by servers within DE1 Datacenter
[ "Step", "6", ".", "App", "query", "monitoring", "statistics", "grouped", "by", "servers", "within", "DE1", "Datacenter" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L228-L245
6,575
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getDE1MonitoringStatsForLastHourGroupedByServers
@Test(groups = {SAMPLES}) public void getDE1MonitoringStatsForLastHourGroupedByServers() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .forTime(new ServerMonitoringFilter() .last(Duration.ofHours(1)) .type(MonitoringType.REALTIME) .interval(Duration.ofMinutes(10))) .groupByDataCenter(); assertNotNull(stats); }
java
@Test(groups = {SAMPLES}) public void getDE1MonitoringStatsForLastHourGroupedByServers() { List<MonitoringStatsEntry> stats = statisticsService .monitoringStats() .forDataCenters( new DataCenterFilter() .dataCenters(DE_FRANKFURT) ) .forTime(new ServerMonitoringFilter() .last(Duration.ofHours(1)) .type(MonitoringType.REALTIME) .interval(Duration.ofMinutes(10))) .groupByDataCenter(); assertNotNull(stats); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getDE1MonitoringStatsForLastHourGroupedByServers", "(", ")", "{", "List", "<", "MonitoringStatsEntry", ">", "stats", "=", "statisticsService", ".", "monitoringStats", "(", ")", ".", "forDataCenters", "(", "new", "DataCenterFilter", "(", ")", ".", "dataCenters", "(", "DE_FRANKFURT", ")", ")", ".", "forTime", "(", "new", "ServerMonitoringFilter", "(", ")", ".", "last", "(", "Duration", ".", "ofHours", "(", "1", ")", ")", ".", "type", "(", "MonitoringType", ".", "REALTIME", ")", ".", "interval", "(", "Duration", ".", "ofMinutes", "(", "10", ")", ")", ")", ".", "groupByDataCenter", "(", ")", ";", "assertNotNull", "(", "stats", ")", ";", "}" ]
Step 7. App query monitoring statistics for last hour grouped by DataCenter
[ "Step", "7", ".", "App", "query", "monitoring", "statistics", "for", "last", "hour", "grouped", "by", "DataCenter" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L250-L265
6,576
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getInvoiceDataForPreviousMonth
@Test(groups = {SAMPLES}) public void getInvoiceDataForPreviousMonth() { InvoiceData invoice = invoiceService.getInvoice( LocalDate.now().minusMonths(1) ); assertNotNull(invoice); }
java
@Test(groups = {SAMPLES}) public void getInvoiceDataForPreviousMonth() { InvoiceData invoice = invoiceService.getInvoice( LocalDate.now().minusMonths(1) ); assertNotNull(invoice); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getInvoiceDataForPreviousMonth", "(", ")", "{", "InvoiceData", "invoice", "=", "invoiceService", ".", "getInvoice", "(", "LocalDate", ".", "now", "(", ")", ".", "minusMonths", "(", "1", ")", ")", ";", "assertNotNull", "(", "invoice", ")", ";", "}" ]
Step 8. App query invoice statistics for previous month
[ "Step", "8", ".", "App", "query", "invoice", "statistics", "for", "previous", "month" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L270-L277
6,577
CenturyLinkCloud/clc-java-sdk
sample/scripts/src/main/java/sample/StatisticsSampleApp.java
StatisticsSampleApp.getInvoiceDataForStartOf2015
@Test(groups = {SAMPLES}) public void getInvoiceDataForStartOf2015() { InvoiceData invoice = invoiceService.getInvoice(2015, 1); assertNotNull(invoice); }
java
@Test(groups = {SAMPLES}) public void getInvoiceDataForStartOf2015() { InvoiceData invoice = invoiceService.getInvoice(2015, 1); assertNotNull(invoice); }
[ "@", "Test", "(", "groups", "=", "{", "SAMPLES", "}", ")", "public", "void", "getInvoiceDataForStartOf2015", "(", ")", "{", "InvoiceData", "invoice", "=", "invoiceService", ".", "getInvoice", "(", "2015", ",", "1", ")", ";", "assertNotNull", "(", "invoice", ")", ";", "}" ]
Step 8. App query invoice statistics for Jan-15
[ "Step", "8", ".", "App", "query", "invoice", "statistics", "for", "Jan", "-", "15" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sample/scripts/src/main/java/sample/StatisticsSampleApp.java#L282-L287
6,578
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.create
public OperationFuture<LoadBalancer> create(LoadBalancerConfig config) { String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId(); LoadBalancerMetadata loadBalancer = loadBalancerClient.create( dataCenterId, new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); LoadBalancer loadBalancerRef = LoadBalancer.refById(loadBalancer.getId(), DataCenter.refById(dataCenterId)); return new OperationFuture<>( loadBalancerRef, new SequentialJobsFuture( () -> new CreateLoadBalancerJobFuture(this, loadBalancerRef), () -> addLoadBalancerPools(config, loadBalancerRef) ) ); }
java
public OperationFuture<LoadBalancer> create(LoadBalancerConfig config) { String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId(); LoadBalancerMetadata loadBalancer = loadBalancerClient.create( dataCenterId, new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); LoadBalancer loadBalancerRef = LoadBalancer.refById(loadBalancer.getId(), DataCenter.refById(dataCenterId)); return new OperationFuture<>( loadBalancerRef, new SequentialJobsFuture( () -> new CreateLoadBalancerJobFuture(this, loadBalancerRef), () -> addLoadBalancerPools(config, loadBalancerRef) ) ); }
[ "public", "OperationFuture", "<", "LoadBalancer", ">", "create", "(", "LoadBalancerConfig", "config", ")", "{", "String", "dataCenterId", "=", "dataCenterService", ".", "findByRef", "(", "config", ".", "getDataCenter", "(", ")", ")", ".", "getId", "(", ")", ";", "LoadBalancerMetadata", "loadBalancer", "=", "loadBalancerClient", ".", "create", "(", "dataCenterId", ",", "new", "LoadBalancerRequest", "(", ")", ".", "name", "(", "config", ".", "getName", "(", ")", ")", ".", "description", "(", "config", ".", "getDescription", "(", ")", ")", ".", "status", "(", "config", ".", "getStatus", "(", ")", ")", ")", ";", "LoadBalancer", "loadBalancerRef", "=", "LoadBalancer", ".", "refById", "(", "loadBalancer", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "dataCenterId", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "loadBalancerRef", ",", "new", "SequentialJobsFuture", "(", "(", ")", "->", "new", "CreateLoadBalancerJobFuture", "(", "this", ",", "loadBalancerRef", ")", ",", "(", ")", "->", "addLoadBalancerPools", "(", "config", ",", "loadBalancerRef", ")", ")", ")", ";", "}" ]
Create load balancer @param config load balancer config @return OperationFuture wrapper for load balancer
[ "Create", "load", "balancer" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L96-L116
6,579
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.update
public OperationFuture<LoadBalancer> update(LoadBalancer loadBalancer, LoadBalancerConfig config) { LoadBalancerMetadata loadBalancerMetadata = findByRef(loadBalancer); loadBalancerClient.update( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId(), new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); return new OperationFuture<>( loadBalancer, updateLoadBalancerPools( config, LoadBalancer.refById( loadBalancerMetadata.getId(), DataCenter.refById(loadBalancerMetadata.getDataCenterId()) ) ) ); }
java
public OperationFuture<LoadBalancer> update(LoadBalancer loadBalancer, LoadBalancerConfig config) { LoadBalancerMetadata loadBalancerMetadata = findByRef(loadBalancer); loadBalancerClient.update( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId(), new LoadBalancerRequest() .name(config.getName()) .description(config.getDescription()) .status(config.getStatus()) ); return new OperationFuture<>( loadBalancer, updateLoadBalancerPools( config, LoadBalancer.refById( loadBalancerMetadata.getId(), DataCenter.refById(loadBalancerMetadata.getDataCenterId()) ) ) ); }
[ "public", "OperationFuture", "<", "LoadBalancer", ">", "update", "(", "LoadBalancer", "loadBalancer", ",", "LoadBalancerConfig", "config", ")", "{", "LoadBalancerMetadata", "loadBalancerMetadata", "=", "findByRef", "(", "loadBalancer", ")", ";", "loadBalancerClient", ".", "update", "(", "loadBalancerMetadata", ".", "getDataCenterId", "(", ")", ",", "loadBalancerMetadata", ".", "getId", "(", ")", ",", "new", "LoadBalancerRequest", "(", ")", ".", "name", "(", "config", ".", "getName", "(", ")", ")", ".", "description", "(", "config", ".", "getDescription", "(", ")", ")", ".", "status", "(", "config", ".", "getStatus", "(", ")", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "loadBalancer", ",", "updateLoadBalancerPools", "(", "config", ",", "LoadBalancer", ".", "refById", "(", "loadBalancerMetadata", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "loadBalancerMetadata", ".", "getDataCenterId", "(", ")", ")", ")", ")", ")", ";", "}" ]
Update load balancer @param loadBalancer load balancer @param config load balancer config @return OperationFuture wrapper for load balancer
[ "Update", "load", "balancer" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L138-L160
6,580
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.update
public OperationFuture<List<LoadBalancer>> update( List<LoadBalancer> loadBalancerList, LoadBalancerConfig config ) { loadBalancerList.forEach(loadBalancer -> update(loadBalancer, config)); return new OperationFuture<>( loadBalancerList, new NoWaitingJobFuture() ); }
java
public OperationFuture<List<LoadBalancer>> update( List<LoadBalancer> loadBalancerList, LoadBalancerConfig config ) { loadBalancerList.forEach(loadBalancer -> update(loadBalancer, config)); return new OperationFuture<>( loadBalancerList, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "List", "<", "LoadBalancer", ">", ">", "update", "(", "List", "<", "LoadBalancer", ">", "loadBalancerList", ",", "LoadBalancerConfig", "config", ")", "{", "loadBalancerList", ".", "forEach", "(", "loadBalancer", "->", "update", "(", "loadBalancer", ",", "config", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "loadBalancerList", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Update load balancer list @param loadBalancerList load balancer list @param config load balancer config @return OperationFuture wrapper for load balancer list
[ "Update", "load", "balancer", "list" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L177-L187
6,581
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.update
public OperationFuture<List<LoadBalancer>> update( LoadBalancerFilter loadBalancerFilter, LoadBalancerConfig config ) { checkNotNull(loadBalancerFilter, "Load balancer filter must be not null"); List<LoadBalancer> loadBalancerList = findLazy(loadBalancerFilter) .map(metadata -> LoadBalancer.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(loadBalancerList, config); }
java
public OperationFuture<List<LoadBalancer>> update( LoadBalancerFilter loadBalancerFilter, LoadBalancerConfig config ) { checkNotNull(loadBalancerFilter, "Load balancer filter must be not null"); List<LoadBalancer> loadBalancerList = findLazy(loadBalancerFilter) .map(metadata -> LoadBalancer.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(loadBalancerList, config); }
[ "public", "OperationFuture", "<", "List", "<", "LoadBalancer", ">", ">", "update", "(", "LoadBalancerFilter", "loadBalancerFilter", ",", "LoadBalancerConfig", "config", ")", "{", "checkNotNull", "(", "loadBalancerFilter", ",", "\"Load balancer filter must be not null\"", ")", ";", "List", "<", "LoadBalancer", ">", "loadBalancerList", "=", "findLazy", "(", "loadBalancerFilter", ")", ".", "map", "(", "metadata", "->", "LoadBalancer", ".", "refById", "(", "metadata", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "metadata", ".", "getDataCenterId", "(", ")", ")", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ";", "return", "update", "(", "loadBalancerList", ",", "config", ")", ";", "}" ]
Update filtered load balancers @param loadBalancerFilter load balancer filter @param config load balancer config @return OperationFuture wrapper for load balancer list
[ "Update", "filtered", "load", "balancers" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L196-L210
6,582
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.delete
public OperationFuture<LoadBalancer> delete(LoadBalancer loadBalancer) { LoadBalancerMetadata loadBalancerMetadata = findByRef(loadBalancer); loadBalancerClient.delete( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId() ); return new OperationFuture<>( loadBalancer, new NoWaitingJobFuture() ); }
java
public OperationFuture<LoadBalancer> delete(LoadBalancer loadBalancer) { LoadBalancerMetadata loadBalancerMetadata = findByRef(loadBalancer); loadBalancerClient.delete( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId() ); return new OperationFuture<>( loadBalancer, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "LoadBalancer", ">", "delete", "(", "LoadBalancer", "loadBalancer", ")", "{", "LoadBalancerMetadata", "loadBalancerMetadata", "=", "findByRef", "(", "loadBalancer", ")", ";", "loadBalancerClient", ".", "delete", "(", "loadBalancerMetadata", ".", "getDataCenterId", "(", ")", ",", "loadBalancerMetadata", ".", "getId", "(", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "loadBalancer", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Delete load balancer @param loadBalancer load balancer @return OperationFuture wrapper for load balancer
[ "Delete", "load", "balancer" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L218-L230
6,583
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.delete
public OperationFuture<List<LoadBalancer>> delete(LoadBalancer... loadBalancer) { return delete(Arrays.asList(loadBalancer)); }
java
public OperationFuture<List<LoadBalancer>> delete(LoadBalancer... loadBalancer) { return delete(Arrays.asList(loadBalancer)); }
[ "public", "OperationFuture", "<", "List", "<", "LoadBalancer", ">", ">", "delete", "(", "LoadBalancer", "...", "loadBalancer", ")", "{", "return", "delete", "(", "Arrays", ".", "asList", "(", "loadBalancer", ")", ")", ";", "}" ]
Delete array of load balancers @param loadBalancer array of load balancer @return OperationFuture wrapper for load balancer list
[ "Delete", "array", "of", "load", "balancers" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L238-L240
6,584
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.delete
public OperationFuture<List<LoadBalancer>> delete(LoadBalancerFilter filter) { List<LoadBalancer> loadBalancerList = findLazy(filter) .map(metadata -> LoadBalancer.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId())) ) .collect(toList()); return delete(loadBalancerList); }
java
public OperationFuture<List<LoadBalancer>> delete(LoadBalancerFilter filter) { List<LoadBalancer> loadBalancerList = findLazy(filter) .map(metadata -> LoadBalancer.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId())) ) .collect(toList()); return delete(loadBalancerList); }
[ "public", "OperationFuture", "<", "List", "<", "LoadBalancer", ">", ">", "delete", "(", "LoadBalancerFilter", "filter", ")", "{", "List", "<", "LoadBalancer", ">", "loadBalancerList", "=", "findLazy", "(", "filter", ")", ".", "map", "(", "metadata", "->", "LoadBalancer", ".", "refById", "(", "metadata", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "metadata", ".", "getDataCenterId", "(", ")", ")", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ";", "return", "delete", "(", "loadBalancerList", ")", ";", "}" ]
Delete filtered load balancers @param filter load balancer filter @return OperationFuture wrapper for load balancer list
[ "Delete", "filtered", "load", "balancers" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L248-L257
6,585
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java
LoadBalancerService.delete
public OperationFuture<List<LoadBalancer>> delete(List<LoadBalancer> loadBalancerList) { List<JobFuture> jobs = loadBalancerList .stream() .map(reference -> delete(reference).jobFuture()) .collect(toList()); return new OperationFuture<>( loadBalancerList, new ParallelJobsFuture(jobs) ); }
java
public OperationFuture<List<LoadBalancer>> delete(List<LoadBalancer> loadBalancerList) { List<JobFuture> jobs = loadBalancerList .stream() .map(reference -> delete(reference).jobFuture()) .collect(toList()); return new OperationFuture<>( loadBalancerList, new ParallelJobsFuture(jobs) ); }
[ "public", "OperationFuture", "<", "List", "<", "LoadBalancer", ">", ">", "delete", "(", "List", "<", "LoadBalancer", ">", "loadBalancerList", ")", "{", "List", "<", "JobFuture", ">", "jobs", "=", "loadBalancerList", ".", "stream", "(", ")", ".", "map", "(", "reference", "->", "delete", "(", "reference", ")", ".", "jobFuture", "(", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "loadBalancerList", ",", "new", "ParallelJobsFuture", "(", "jobs", ")", ")", ";", "}" ]
Delete load balancer list @param loadBalancerList load balancer list @return OperationFuture wrapper for load balancer list
[ "Delete", "load", "balancer", "list" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerService.java#L265-L276
6,586
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.create
public OperationFuture<FirewallPolicy> create(FirewallPolicyConfig config) { String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId(); FirewallPolicyMetadata firewall = firewallPolicyClient.create( dataCenterId, composeFirewallPolicyRequest(config) ); return new OperationFuture<>( FirewallPolicy.refById( firewall.getId(), DataCenter.refById(dataCenterId) ), new NoWaitingJobFuture() ); }
java
public OperationFuture<FirewallPolicy> create(FirewallPolicyConfig config) { String dataCenterId = dataCenterService.findByRef(config.getDataCenter()).getId(); FirewallPolicyMetadata firewall = firewallPolicyClient.create( dataCenterId, composeFirewallPolicyRequest(config) ); return new OperationFuture<>( FirewallPolicy.refById( firewall.getId(), DataCenter.refById(dataCenterId) ), new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "FirewallPolicy", ">", "create", "(", "FirewallPolicyConfig", "config", ")", "{", "String", "dataCenterId", "=", "dataCenterService", ".", "findByRef", "(", "config", ".", "getDataCenter", "(", ")", ")", ".", "getId", "(", ")", ";", "FirewallPolicyMetadata", "firewall", "=", "firewallPolicyClient", ".", "create", "(", "dataCenterId", ",", "composeFirewallPolicyRequest", "(", "config", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "FirewallPolicy", ".", "refById", "(", "firewall", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "dataCenterId", ")", ")", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Create firewall policy @param config firewall policy config @return OperationFuture wrapper for firewall policy
[ "Create", "firewall", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L83-L98
6,587
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.update
public OperationFuture<FirewallPolicy> update(FirewallPolicy firewallPolicy, FirewallPolicyConfig config) { FirewallPolicyMetadata metadata = findByRef(firewallPolicy); firewallPolicyClient.update( metadata.getDataCenterId(), metadata.getId(), composeFirewallPolicyRequest(config) ); return new OperationFuture<>( firewallPolicy, new NoWaitingJobFuture() ); }
java
public OperationFuture<FirewallPolicy> update(FirewallPolicy firewallPolicy, FirewallPolicyConfig config) { FirewallPolicyMetadata metadata = findByRef(firewallPolicy); firewallPolicyClient.update( metadata.getDataCenterId(), metadata.getId(), composeFirewallPolicyRequest(config) ); return new OperationFuture<>( firewallPolicy, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "FirewallPolicy", ">", "update", "(", "FirewallPolicy", "firewallPolicy", ",", "FirewallPolicyConfig", "config", ")", "{", "FirewallPolicyMetadata", "metadata", "=", "findByRef", "(", "firewallPolicy", ")", ";", "firewallPolicyClient", ".", "update", "(", "metadata", ".", "getDataCenterId", "(", ")", ",", "metadata", ".", "getId", "(", ")", ",", "composeFirewallPolicyRequest", "(", "config", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "firewallPolicy", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Update firewall policy @param firewallPolicy firewall policy @param config firewall policy config @return OperationFuture wrapper for firewall policy
[ "Update", "firewall", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L107-L120
6,588
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.update
public OperationFuture<List<FirewallPolicy>> update( List<FirewallPolicy> firewallPolicyList, FirewallPolicyConfig config ) { firewallPolicyList.forEach(firewallPolicy -> update(firewallPolicy, config)); return new OperationFuture<>( firewallPolicyList, new NoWaitingJobFuture() ); }
java
public OperationFuture<List<FirewallPolicy>> update( List<FirewallPolicy> firewallPolicyList, FirewallPolicyConfig config ) { firewallPolicyList.forEach(firewallPolicy -> update(firewallPolicy, config)); return new OperationFuture<>( firewallPolicyList, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "List", "<", "FirewallPolicy", ">", ">", "update", "(", "List", "<", "FirewallPolicy", ">", "firewallPolicyList", ",", "FirewallPolicyConfig", "config", ")", "{", "firewallPolicyList", ".", "forEach", "(", "firewallPolicy", "->", "update", "(", "firewallPolicy", ",", "config", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "firewallPolicyList", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Update firewall policy list @param firewallPolicyList firewall policy list @param config firewall policy config @return OperationFuture wrapper for firewall policy list
[ "Update", "firewall", "policy", "list" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L129-L139
6,589
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.update
public OperationFuture<List<FirewallPolicy>> update( FirewallPolicyFilter firewallPolicyFilter, FirewallPolicyConfig config ) { checkNotNull(firewallPolicyFilter, "Firewall policy filter must be not null"); List<FirewallPolicy> firewallPolicyList = findLazy(firewallPolicyFilter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(firewallPolicyList, config); }
java
public OperationFuture<List<FirewallPolicy>> update( FirewallPolicyFilter firewallPolicyFilter, FirewallPolicyConfig config ) { checkNotNull(firewallPolicyFilter, "Firewall policy filter must be not null"); List<FirewallPolicy> firewallPolicyList = findLazy(firewallPolicyFilter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId()) )) .collect(toList()); return update(firewallPolicyList, config); }
[ "public", "OperationFuture", "<", "List", "<", "FirewallPolicy", ">", ">", "update", "(", "FirewallPolicyFilter", "firewallPolicyFilter", ",", "FirewallPolicyConfig", "config", ")", "{", "checkNotNull", "(", "firewallPolicyFilter", ",", "\"Firewall policy filter must be not null\"", ")", ";", "List", "<", "FirewallPolicy", ">", "firewallPolicyList", "=", "findLazy", "(", "firewallPolicyFilter", ")", ".", "map", "(", "metadata", "->", "FirewallPolicy", ".", "refById", "(", "metadata", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "metadata", ".", "getDataCenterId", "(", ")", ")", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ";", "return", "update", "(", "firewallPolicyList", ",", "config", ")", ";", "}" ]
Update filtered firewall policies @param firewallPolicyFilter firewall policy filter @param config firewall policy config @return OperationFuture wrapper for firewall policy list
[ "Update", "filtered", "firewall", "policies" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L148-L162
6,590
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.delete
public OperationFuture<FirewallPolicy> delete(FirewallPolicy firewallPolicy) { FirewallPolicyMetadata metadata = findByRef(firewallPolicy); firewallPolicyClient.delete( metadata.getDataCenterId(), metadata.getId() ); return new OperationFuture<>( firewallPolicy, new NoWaitingJobFuture() ); }
java
public OperationFuture<FirewallPolicy> delete(FirewallPolicy firewallPolicy) { FirewallPolicyMetadata metadata = findByRef(firewallPolicy); firewallPolicyClient.delete( metadata.getDataCenterId(), metadata.getId() ); return new OperationFuture<>( firewallPolicy, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "FirewallPolicy", ">", "delete", "(", "FirewallPolicy", "firewallPolicy", ")", "{", "FirewallPolicyMetadata", "metadata", "=", "findByRef", "(", "firewallPolicy", ")", ";", "firewallPolicyClient", ".", "delete", "(", "metadata", ".", "getDataCenterId", "(", ")", ",", "metadata", ".", "getId", "(", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "firewallPolicy", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Delete firewall policy @param firewallPolicy firewall policy @return OperationFuture wrapper for firewall policy
[ "Delete", "firewall", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L170-L182
6,591
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.delete
public OperationFuture<List<FirewallPolicy>> delete(FirewallPolicy... firewallPolicies) { return delete(Arrays.asList(firewallPolicies)); }
java
public OperationFuture<List<FirewallPolicy>> delete(FirewallPolicy... firewallPolicies) { return delete(Arrays.asList(firewallPolicies)); }
[ "public", "OperationFuture", "<", "List", "<", "FirewallPolicy", ">", ">", "delete", "(", "FirewallPolicy", "...", "firewallPolicies", ")", "{", "return", "delete", "(", "Arrays", ".", "asList", "(", "firewallPolicies", ")", ")", ";", "}" ]
Delete array of firewall policy @param firewallPolicies array of firewall policy @return OperationFuture wrapper for firewall policy list
[ "Delete", "array", "of", "firewall", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L190-L192
6,592
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.delete
public OperationFuture<List<FirewallPolicy>> delete(FirewallPolicyFilter filter) { return delete( findLazy(filter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId())) ) .collect(toList()) ); }
java
public OperationFuture<List<FirewallPolicy>> delete(FirewallPolicyFilter filter) { return delete( findLazy(filter) .map(metadata -> FirewallPolicy.refById( metadata.getId(), DataCenter.refById(metadata.getDataCenterId())) ) .collect(toList()) ); }
[ "public", "OperationFuture", "<", "List", "<", "FirewallPolicy", ">", ">", "delete", "(", "FirewallPolicyFilter", "filter", ")", "{", "return", "delete", "(", "findLazy", "(", "filter", ")", ".", "map", "(", "metadata", "->", "FirewallPolicy", ".", "refById", "(", "metadata", ".", "getId", "(", ")", ",", "DataCenter", ".", "refById", "(", "metadata", ".", "getDataCenterId", "(", ")", ")", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ")", ";", "}" ]
Delete filtered firewall policy @param filter firewall policy filter @return OperationFuture wrapper for firewall policy list
[ "Delete", "filtered", "firewall", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L200-L209
6,593
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java
FirewallPolicyService.delete
public OperationFuture<List<FirewallPolicy>> delete(List<FirewallPolicy> firewallPolicyList) { List<JobFuture> jobs = firewallPolicyList .stream() .map(reference -> delete(reference).jobFuture()) .collect(toList()); return new OperationFuture<>( firewallPolicyList, new ParallelJobsFuture(jobs) ); }
java
public OperationFuture<List<FirewallPolicy>> delete(List<FirewallPolicy> firewallPolicyList) { List<JobFuture> jobs = firewallPolicyList .stream() .map(reference -> delete(reference).jobFuture()) .collect(toList()); return new OperationFuture<>( firewallPolicyList, new ParallelJobsFuture(jobs) ); }
[ "public", "OperationFuture", "<", "List", "<", "FirewallPolicy", ">", ">", "delete", "(", "List", "<", "FirewallPolicy", ">", "firewallPolicyList", ")", "{", "List", "<", "JobFuture", ">", "jobs", "=", "firewallPolicyList", ".", "stream", "(", ")", ".", "map", "(", "reference", "->", "delete", "(", "reference", ")", ".", "jobFuture", "(", ")", ")", ".", "collect", "(", "toList", "(", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "firewallPolicyList", ",", "new", "ParallelJobsFuture", "(", "jobs", ")", ")", ";", "}" ]
Delete firewall policy list @param firewallPolicyList firewall policy list @return OperationFuture wrapper for firewall policy list
[ "Delete", "firewall", "policy", "list" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/FirewallPolicyService.java#L217-L227
6,594
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java
AlertService.create
public OperationFuture<AlertPolicy> create(AlertPolicyConfig createConfig) { AlertPolicyMetadata policy = client.createAlertPolicy(converter.buildCreateAlertPolicyRequest(createConfig)); return new OperationFuture<>( AlertPolicy.refById(policy.getId()), new NoWaitingJobFuture() ); }
java
public OperationFuture<AlertPolicy> create(AlertPolicyConfig createConfig) { AlertPolicyMetadata policy = client.createAlertPolicy(converter.buildCreateAlertPolicyRequest(createConfig)); return new OperationFuture<>( AlertPolicy.refById(policy.getId()), new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "AlertPolicy", ">", "create", "(", "AlertPolicyConfig", "createConfig", ")", "{", "AlertPolicyMetadata", "policy", "=", "client", ".", "createAlertPolicy", "(", "converter", ".", "buildCreateAlertPolicyRequest", "(", "createConfig", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "AlertPolicy", ".", "refById", "(", "policy", ".", "getId", "(", ")", ")", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Create Alert policy @param createConfig policy config @return OperationFuture wrapper for AlertPolicy
[ "Create", "Alert", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java#L65-L72
6,595
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java
AlertService.modify
public OperationFuture<AlertPolicy> modify(AlertPolicy policyRef, AlertPolicyConfig modifyConfig) { AlertPolicyMetadata policyToUpdate = findByRef(policyRef); client.modifyAlertPolicy( policyToUpdate.getId(), converter.buildModifyAlertPolicyRequest(modifyConfig, policyToUpdate) ); return new OperationFuture<>( policyRef, new NoWaitingJobFuture() ); }
java
public OperationFuture<AlertPolicy> modify(AlertPolicy policyRef, AlertPolicyConfig modifyConfig) { AlertPolicyMetadata policyToUpdate = findByRef(policyRef); client.modifyAlertPolicy( policyToUpdate.getId(), converter.buildModifyAlertPolicyRequest(modifyConfig, policyToUpdate) ); return new OperationFuture<>( policyRef, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "AlertPolicy", ">", "modify", "(", "AlertPolicy", "policyRef", ",", "AlertPolicyConfig", "modifyConfig", ")", "{", "AlertPolicyMetadata", "policyToUpdate", "=", "findByRef", "(", "policyRef", ")", ";", "client", ".", "modifyAlertPolicy", "(", "policyToUpdate", ".", "getId", "(", ")", ",", "converter", ".", "buildModifyAlertPolicyRequest", "(", "modifyConfig", ",", "policyToUpdate", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "policyRef", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Update Alert policy @param policyRef policy reference @param modifyConfig update policy config @return OperationFuture wrapper for AlertPolicy
[ "Update", "Alert", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java#L81-L96
6,596
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java
AlertService.delete
public OperationFuture<AlertPolicy> delete(AlertPolicy policyRef) { client.deleteAlertPolicy(findByRef(policyRef).getId()); return new OperationFuture<>( policyRef, new NoWaitingJobFuture() ); }
java
public OperationFuture<AlertPolicy> delete(AlertPolicy policyRef) { client.deleteAlertPolicy(findByRef(policyRef).getId()); return new OperationFuture<>( policyRef, new NoWaitingJobFuture() ); }
[ "public", "OperationFuture", "<", "AlertPolicy", ">", "delete", "(", "AlertPolicy", "policyRef", ")", "{", "client", ".", "deleteAlertPolicy", "(", "findByRef", "(", "policyRef", ")", ".", "getId", "(", ")", ")", ";", "return", "new", "OperationFuture", "<>", "(", "policyRef", ",", "new", "NoWaitingJobFuture", "(", ")", ")", ";", "}" ]
Remove Alert policy @param policyRef policy reference @return OperationFuture wrapper for AlertPolicy
[ "Remove", "Alert", "policy" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/policy/services/dsl/AlertService.java#L135-L142
6,597
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/domain/filter/LoadBalancerFilter.java
LoadBalancerFilter.nameContains
public LoadBalancerFilter nameContains(String... names) { allItemsNotNull(names, "Load balancer"); predicate = predicate.and(combine( LoadBalancerMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
java
public LoadBalancerFilter nameContains(String... names) { allItemsNotNull(names, "Load balancer"); predicate = predicate.and(combine( LoadBalancerMetadata::getName, in(asList(names), Predicates::containsIgnoreCase) )); return this; }
[ "public", "LoadBalancerFilter", "nameContains", "(", "String", "...", "names", ")", "{", "allItemsNotNull", "(", "names", ",", "\"Load balancer\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "LoadBalancerMetadata", "::", "getName", ",", "in", "(", "asList", "(", "names", ")", ",", "Predicates", "::", "containsIgnoreCase", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find load balancers that contains some substring in name. Filtering is case insensitive. @param names is not null list of name substrings @return {@link LoadBalancerFilter} @throws NullPointerException if {@code names} is null
[ "Method", "allow", "to", "find", "load", "balancers", "that", "contains", "some", "substring", "in", "name", ".", "Filtering", "is", "case", "insensitive", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/domain/filter/LoadBalancerFilter.java#L121-L129
6,598
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/domain/filter/LoadBalancerFilter.java
LoadBalancerFilter.names
public LoadBalancerFilter names(String... names) { allItemsNotNull(names, "Load balancer names"); predicate = predicate.and(combine( LoadBalancerMetadata::getName, in(names) )); return this; }
java
public LoadBalancerFilter names(String... names) { allItemsNotNull(names, "Load balancer names"); predicate = predicate.and(combine( LoadBalancerMetadata::getName, in(names) )); return this; }
[ "public", "LoadBalancerFilter", "names", "(", "String", "...", "names", ")", "{", "allItemsNotNull", "(", "names", ",", "\"Load balancer names\"", ")", ";", "predicate", "=", "predicate", ".", "and", "(", "combine", "(", "LoadBalancerMetadata", "::", "getName", ",", "in", "(", "names", ")", ")", ")", ";", "return", "this", ";", "}" ]
Method allow to find load balancers by its names Filtering is case sensitive. @param names is a set of names @return {@link LoadBalancerFilter}
[ "Method", "allow", "to", "find", "load", "balancers", "by", "its", "names", "Filtering", "is", "case", "sensitive", "." ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/domain/filter/LoadBalancerFilter.java#L138-L146
6,599
CenturyLinkCloud/clc-java-sdk
sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerPoolService.java
LoadBalancerPoolService.create
public OperationFuture<LoadBalancerPool> create(LoadBalancerPoolConfig config) { LoadBalancer loadBalancer = config.getLoadBalancer(); LoadBalancerMetadata loadBalancerMetadata = loadBalancerService.findByRef(loadBalancer); LoadBalancerPoolMetadata metadata = loadBalancerPoolClient.create( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId(), new LoadBalancerPoolRequest() .port(config.getPort()) .method(config.getMethod()) .persistence(config.getPersistence()) ); LoadBalancerPool pool = LoadBalancerPool.refById(metadata.getId(), loadBalancer); return new OperationFuture<>( pool, addLoadBalancerNodes(config, pool) ); }
java
public OperationFuture<LoadBalancerPool> create(LoadBalancerPoolConfig config) { LoadBalancer loadBalancer = config.getLoadBalancer(); LoadBalancerMetadata loadBalancerMetadata = loadBalancerService.findByRef(loadBalancer); LoadBalancerPoolMetadata metadata = loadBalancerPoolClient.create( loadBalancerMetadata.getDataCenterId(), loadBalancerMetadata.getId(), new LoadBalancerPoolRequest() .port(config.getPort()) .method(config.getMethod()) .persistence(config.getPersistence()) ); LoadBalancerPool pool = LoadBalancerPool.refById(metadata.getId(), loadBalancer); return new OperationFuture<>( pool, addLoadBalancerNodes(config, pool) ); }
[ "public", "OperationFuture", "<", "LoadBalancerPool", ">", "create", "(", "LoadBalancerPoolConfig", "config", ")", "{", "LoadBalancer", "loadBalancer", "=", "config", ".", "getLoadBalancer", "(", ")", ";", "LoadBalancerMetadata", "loadBalancerMetadata", "=", "loadBalancerService", ".", "findByRef", "(", "loadBalancer", ")", ";", "LoadBalancerPoolMetadata", "metadata", "=", "loadBalancerPoolClient", ".", "create", "(", "loadBalancerMetadata", ".", "getDataCenterId", "(", ")", ",", "loadBalancerMetadata", ".", "getId", "(", ")", ",", "new", "LoadBalancerPoolRequest", "(", ")", ".", "port", "(", "config", ".", "getPort", "(", ")", ")", ".", "method", "(", "config", ".", "getMethod", "(", ")", ")", ".", "persistence", "(", "config", ".", "getPersistence", "(", ")", ")", ")", ";", "LoadBalancerPool", "pool", "=", "LoadBalancerPool", ".", "refById", "(", "metadata", ".", "getId", "(", ")", ",", "loadBalancer", ")", ";", "return", "new", "OperationFuture", "<>", "(", "pool", ",", "addLoadBalancerNodes", "(", "config", ",", "pool", ")", ")", ";", "}" ]
Create load balancer pool @param config load balancer pool config @return OperationFuture wrapper for load balancer pool
[ "Create", "load", "balancer", "pool" ]
c026322f077dea71b1acf9f2d665253d79d9bf85
https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/loadbalancer/services/dsl/LoadBalancerPoolService.java#L99-L118