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
partition
stringclasses
1 value
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/QueryResult.java
QueryResult.iterator
public Iterator<Row> iterator() { if (this.rows != null) { return Arrays.asList(this.rows).iterator(); } else { return ConvertibleIteratorUtils.iterateAsRow(this.pbRows.iterator(), this.pbColumnDescriptions); } }
java
public Iterator<Row> iterator() { if (this.rows != null) { return Arrays.asList(this.rows).iterator(); } else { return ConvertibleIteratorUtils.iterateAsRow(this.pbRows.iterator(), this.pbColumnDescriptions); } }
[ "public", "Iterator", "<", "Row", ">", "iterator", "(", ")", "{", "if", "(", "this", ".", "rows", "!=", "null", ")", "{", "return", "Arrays", ".", "asList", "(", "this", ".", "rows", ")", ".", "iterator", "(", ")", ";", "}", "else", "{", "return"...
An iterator of the Rows in this QueryResult. @return an iterator.
[ "An", "iterator", "of", "the", "Rows", "in", "this", "QueryResult", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/QueryResult.java#L76-L86
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/QueryResult.java
QueryResult.getRowsCopy
public List<Row> getRowsCopy() { final List<Row> rows = new ArrayList<>(this.getRowsCount()); for (Row cells : this) { rows.add(cells); } return rows; }
java
public List<Row> getRowsCopy() { final List<Row> rows = new ArrayList<>(this.getRowsCount()); for (Row cells : this) { rows.add(cells); } return rows; }
[ "public", "List", "<", "Row", ">", "getRowsCopy", "(", ")", "{", "final", "List", "<", "Row", ">", "rows", "=", "new", "ArrayList", "<>", "(", "this", ".", "getRowsCount", "(", ")", ")", ";", "for", "(", "Row", "cells", ":", "this", ")", "{", "ro...
Get a shallow copy of the rows in this query result. @return a List&lt;Row&gt; shallow copy of the rows in this query result.
[ "Get", "a", "shallow", "copy", "of", "the", "rows", "in", "this", "query", "result", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/QueryResult.java#L101-L111
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/indexes/RiakIndexes.java
RiakIndexes.hasIndex
public <T extends RiakIndex<?>> boolean hasIndex(RiakIndex.Name<T> name) { return indexes.containsKey(name.getFullname()); }
java
public <T extends RiakIndex<?>> boolean hasIndex(RiakIndex.Name<T> name) { return indexes.containsKey(name.getFullname()); }
[ "public", "<", "T", "extends", "RiakIndex", "<", "?", ">", ">", "boolean", "hasIndex", "(", "RiakIndex", ".", "Name", "<", "T", ">", "name", ")", "{", "return", "indexes", ".", "containsKey", "(", "name", ".", "getFullname", "(", ")", ")", ";", "}" ]
Returns whether a specific RiakIndex is present @param name the {@link RiakIndex.Name} representing the index to check for @return {@code true} if the index is present, {@code false} otherwise
[ "Returns", "whether", "a", "specific", "RiakIndex", "is", "present" ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/indexes/RiakIndexes.java#L129-L132
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/indexes/RiakIndexes.java
RiakIndexes.removeIndex
public <V,T extends RiakIndex<V>> T removeIndex(RiakIndex.Name<T> name) { RiakIndex<?> removed = indexes.remove(name.getFullname()); if (removed != null) { T index = name.wrap(removed).createIndex(); return index; } else { return nu...
java
public <V,T extends RiakIndex<V>> T removeIndex(RiakIndex.Name<T> name) { RiakIndex<?> removed = indexes.remove(name.getFullname()); if (removed != null) { T index = name.wrap(removed).createIndex(); return index; } else { return nu...
[ "public", "<", "V", ",", "T", "extends", "RiakIndex", "<", "V", ">", ">", "T", "removeIndex", "(", "RiakIndex", ".", "Name", "<", "T", ">", "name", ")", "{", "RiakIndex", "<", "?", ">", "removed", "=", "indexes", ".", "remove", "(", "name", ".", ...
Remove the named RiakIndex @param name the {@code RiakIndex.Name} representing the index to remove @return the removed {@code RiakIndex} (typed accordingly) if the index was present, {@code null} otherwise
[ "Remove", "the", "named", "RiakIndex" ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/indexes/RiakIndexes.java#L178-L190
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.setMaxConnections
public RiakNode setMaxConnections(int maxConnections) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); if (maxConnections >= getMinConnections()) { permits.setMaxPermits(maxConnections); } else { throw new IllegalArgumentExcep...
java
public RiakNode setMaxConnections(int maxConnections) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); if (maxConnections >= getMinConnections()) { permits.setMaxPermits(maxConnections); } else { throw new IllegalArgumentExcep...
[ "public", "RiakNode", "setMaxConnections", "(", "int", "maxConnections", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "if", "(", "maxConnections", ">=", "getMinConnections", ...
Sets the maximum number of connections allowed. @param maxConnections the maxConnections to set. @return a reference to this RiakNode. @see Builder#withMaxConnections(int)
[ "Sets", "the", "maximum", "number", "of", "connections", "allowed", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L399-L412
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.getMaxConnections
public int getMaxConnections() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return permits.getMaxPermits(); }
java
public int getMaxConnections() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return permits.getMaxPermits(); }
[ "public", "int", "getMaxConnections", "(", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "return", "permits", ".", "getMaxPermits", "(", ")", ";", "}" ]
Returns the maximum number of connections allowed. @return the maxConnections @see Builder#withMaxConnections(int)
[ "Returns", "the", "maximum", "number", "of", "connections", "allowed", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L420-L424
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.setMinConnections
public RiakNode setMinConnections(int minConnections) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); if (minConnections <= getMaxConnections()) { this.minConnections = minConnections; } else { throw new IllegalArgumentExcept...
java
public RiakNode setMinConnections(int minConnections) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); if (minConnections <= getMaxConnections()) { this.minConnections = minConnections; } else { throw new IllegalArgumentExcept...
[ "public", "RiakNode", "setMinConnections", "(", "int", "minConnections", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "if", "(", "minConnections", "<=", "getMaxConnections", ...
Sets the minimum number of active connections to be maintained. @param minConnections the minConnections to set @return a reference to this RiakNode @see Builder#withMinConnections(int)
[ "Sets", "the", "minimum", "number", "of", "active", "connections", "to", "be", "maintained", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L433-L446
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.setIdleTimeout
public RiakNode setIdleTimeout(int idleTimeoutInMillis) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); this.idleTimeoutInNanos = TimeUnit.NANOSECONDS.convert(idleTimeoutInMillis, TimeUnit.MILLISECONDS); return this; }
java
public RiakNode setIdleTimeout(int idleTimeoutInMillis) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); this.idleTimeoutInNanos = TimeUnit.NANOSECONDS.convert(idleTimeoutInMillis, TimeUnit.MILLISECONDS); return this; }
[ "public", "RiakNode", "setIdleTimeout", "(", "int", "idleTimeoutInMillis", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "this", ".", "idleTimeoutInNanos", "=", "TimeUnit", "...
Sets the connection idle timeout for connections. @param idleTimeoutInMillis the idleTimeout to set @return a reference to this RiakNode @see Builder#withIdleTimeout(int)
[ "Sets", "the", "connection", "idle", "timeout", "for", "connections", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L487-L492
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.getIdleTimeout
public int getIdleTimeout() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return (int) TimeUnit.MILLISECONDS.convert(idleTimeoutInNanos, TimeUnit.NANOSECONDS); }
java
public int getIdleTimeout() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return (int) TimeUnit.MILLISECONDS.convert(idleTimeoutInNanos, TimeUnit.NANOSECONDS); }
[ "public", "int", "getIdleTimeout", "(", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "return", "(", "int", ")", "TimeUnit", ".", "MILLISECONDS", ".", "convert", "(", "...
Returns the connection idle timeout for connections in milliseconds. @return the idleTimeout in milliseconds @see Builder#withIdleTimeout(int)
[ "Returns", "the", "connection", "idle", "timeout", "for", "connections", "in", "milliseconds", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L500-L504
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.setConnectionTimeout
public RiakNode setConnectionTimeout(int connectionTimeoutInMillis) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); this.connectionTimeout = connectionTimeoutInMillis; bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectionTimeout); return this; }
java
public RiakNode setConnectionTimeout(int connectionTimeoutInMillis) { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); this.connectionTimeout = connectionTimeoutInMillis; bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectionTimeout); return this; }
[ "public", "RiakNode", "setConnectionTimeout", "(", "int", "connectionTimeoutInMillis", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "this", ".", "connectionTimeout", "=", "con...
Sets the connection timeout for new connections. @param connectionTimeoutInMillis the connectionTimeout to set @return a reference to this RiakNode @see Builder#withConnectionTimeout(int)
[ "Sets", "the", "connection", "timeout", "for", "new", "connections", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L513-L519
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.availablePermits
public int availablePermits() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return permits.availablePermits(); }
java
public int availablePermits() { stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING); return permits.availablePermits(); }
[ "public", "int", "availablePermits", "(", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "return", "permits", ".", "availablePermits", "(", ")", ";", "}" ]
Returns the number of permits currently available. The number of available permits indicates how many additional connections can be made without blocking. @return the number of available permits. @see Builder#withMaxConnections(int)
[ "Returns", "the", "number", "of", "permits", "currently", "available", ".", "The", "number", "of", "available", "permits", "indicates", "how", "many", "additional", "connections", "can", "be", "made", "without", "blocking", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L541-L545
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.execute
public boolean execute(FutureOperation operation) { stateCheck(State.RUNNING, State.HEALTH_CHECKING); operation.setLastNode(this); Channel channel = getConnection(); if (channel != null) { inProgressMap.put(channel, operation); ChannelFuture writeFutu...
java
public boolean execute(FutureOperation operation) { stateCheck(State.RUNNING, State.HEALTH_CHECKING); operation.setLastNode(this); Channel channel = getConnection(); if (channel != null) { inProgressMap.put(channel, operation); ChannelFuture writeFutu...
[ "public", "boolean", "execute", "(", "FutureOperation", "operation", ")", "{", "stateCheck", "(", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "operation", ".", "setLastNode", "(", "this", ")", ";", "Channel", "channel", "=", "get...
Submits the operation to be executed on this node. @param operation The operation to perform @return {@code true} if this operation was accepted, {@code false} if there were no available connections. @throws IllegalStateException if this node is not in the {@code RUNNING} or {@code HEALTH_CHECKING} state @throws Il...
[ "Submits", "the", "operation", "to", "be", "executed", "on", "this", "node", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L577-L598
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.returnConnection
private void returnConnection(Channel c) { switch (state) { case SHUTTING_DOWN: case SHUTDOWN: closeConnection(c); break; case RUNNING: case HEALTH_CHECKING: default: if (inProgressMap.contain...
java
private void returnConnection(Channel c) { switch (state) { case SHUTTING_DOWN: case SHUTDOWN: closeConnection(c); break; case RUNNING: case HEALTH_CHECKING: default: if (inProgressMap.contain...
[ "private", "void", "returnConnection", "(", "Channel", "c", ")", "{", "switch", "(", "state", ")", "{", "case", "SHUTTING_DOWN", ":", "case", "SHUTDOWN", ":", "closeConnection", "(", "c", ")", ";", "break", ";", "case", "RUNNING", ":", "case", "HEALTH_CHEC...
Return a Netty channel. @param c The Netty channel to return to the pool
[ "Return", "a", "Netty", "channel", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L811-L844
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.onSuccess
@Override public void onSuccess(Channel channel, final RiakMessage response) { logger.debug("Operation onSuccess() channel: id:{} {}:{}", channel.hashCode(), remoteAddress, port); consecutiveFailedOperations.set(0); final FutureOperation inProgress = inProgressMap.get(channel); ...
java
@Override public void onSuccess(Channel channel, final RiakMessage response) { logger.debug("Operation onSuccess() channel: id:{} {}:{}", channel.hashCode(), remoteAddress, port); consecutiveFailedOperations.set(0); final FutureOperation inProgress = inProgressMap.get(channel); ...
[ "@", "Override", "public", "void", "onSuccess", "(", "Channel", "channel", ",", "final", "RiakMessage", "response", ")", "{", "logger", ".", "debug", "(", "\"Operation onSuccess() channel: id:{} {}:{}\"", ",", "channel", ".", "hashCode", "(", ")", ",", "remoteAddr...
End ConnectionPool stuff
[ "End", "ConnectionPool", "stuff" ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L857-L883
train
basho/riak-java-client
src/main/java/com/basho/riak/client/api/cap/DefaultResolver.java
DefaultResolver.resolve
@Override public T resolve(List<T> siblings) throws UnresolvedConflictException { if (siblings.size() > 1) { throw new UnresolvedConflictException("Siblings found", siblings); } else if (siblings.size() == 1) { return siblings.get(0); } ...
java
@Override public T resolve(List<T> siblings) throws UnresolvedConflictException { if (siblings.size() > 1) { throw new UnresolvedConflictException("Siblings found", siblings); } else if (siblings.size() == 1) { return siblings.get(0); } ...
[ "@", "Override", "public", "T", "resolve", "(", "List", "<", "T", ">", "siblings", ")", "throws", "UnresolvedConflictException", "{", "if", "(", "siblings", ".", "size", "(", ")", ">", "1", ")", "{", "throw", "new", "UnresolvedConflictException", "(", "\"S...
Detects conflict but does not resolve it. @param siblings the list of siblings returned from Riak @return null or the single value in the collection @throws UnresolvedConflictException if {@code siblings} has > 1 entry.
[ "Detects", "conflict", "but", "does", "not", "resolve", "it", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/cap/DefaultResolver.java#L43-L58
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java
TableDefinition.getPartitionKeyColumnDescriptions
public Collection<FullColumnDescription> getPartitionKeyColumnDescriptions() { if (partitionKeys == null) { partitionKeys = new LinkedList<>(); for (FullColumnDescription col : fullColumnDescriptions.values()) { if (col.isPartitionKeyMember()) ...
java
public Collection<FullColumnDescription> getPartitionKeyColumnDescriptions() { if (partitionKeys == null) { partitionKeys = new LinkedList<>(); for (FullColumnDescription col : fullColumnDescriptions.values()) { if (col.isPartitionKeyMember()) ...
[ "public", "Collection", "<", "FullColumnDescription", ">", "getPartitionKeyColumnDescriptions", "(", ")", "{", "if", "(", "partitionKeys", "==", "null", ")", "{", "partitionKeys", "=", "new", "LinkedList", "<>", "(", ")", ";", "for", "(", "FullColumnDescription", ...
Get the collection of Partition Key FullColumnDescriptions, in order. @return an iterable collection.
[ "Get", "the", "collection", "of", "Partition", "Key", "FullColumnDescriptions", "in", "order", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java#L68-L86
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java
TableDefinition.getQuantumDescription
public FullColumnDescription getQuantumDescription() { if (quantumField == null) { for (FullColumnDescription fd: getPartitionKeyColumnDescriptions()) { if (fd.hasQuantum()) { if (quantumField != null) { ...
java
public FullColumnDescription getQuantumDescription() { if (quantumField == null) { for (FullColumnDescription fd: getPartitionKeyColumnDescriptions()) { if (fd.hasQuantum()) { if (quantumField != null) { ...
[ "public", "FullColumnDescription", "getQuantumDescription", "(", ")", "{", "if", "(", "quantumField", "==", "null", ")", "{", "for", "(", "FullColumnDescription", "fd", ":", "getPartitionKeyColumnDescriptions", "(", ")", ")", "{", "if", "(", "fd", ".", "hasQuant...
Get the FullColumnDescription for a quantum field, if any. @return null if there is no quantum information
[ "Get", "the", "FullColumnDescription", "for", "a", "quantum", "field", "if", "any", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java#L92-L113
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java
TableDefinition.getLocalKeyColumnDescriptions
public Collection<FullColumnDescription> getLocalKeyColumnDescriptions() { if (localKeys == null) { localKeys = new LinkedList<>(); for (FullColumnDescription col : fullColumnDescriptions.values()) { if (col.isLocalKeyMember()) { ...
java
public Collection<FullColumnDescription> getLocalKeyColumnDescriptions() { if (localKeys == null) { localKeys = new LinkedList<>(); for (FullColumnDescription col : fullColumnDescriptions.values()) { if (col.isLocalKeyMember()) { ...
[ "public", "Collection", "<", "FullColumnDescription", ">", "getLocalKeyColumnDescriptions", "(", ")", "{", "if", "(", "localKeys", "==", "null", ")", "{", "localKeys", "=", "new", "LinkedList", "<>", "(", ")", ";", "for", "(", "FullColumnDescription", "col", "...
Get the collection of Local Key FullColumnDescriptions, in order. @return an iterable collection.
[ "Get", "the", "collection", "of", "Local", "Key", "FullColumnDescriptions", "in", "order", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/TableDefinition.java#L119-L137
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/FutureOperation.java
FutureOperation.setResponse
public synchronized final void setResponse(RiakMessage rawResponse) { stateCheck(State.CREATED, State.WRITTEN, State.RETRY); U decodedMessage = decode(rawResponse); processMessage(decodedMessage); exception = null; if (done(decodedMessage)) { logger.debu...
java
public synchronized final void setResponse(RiakMessage rawResponse) { stateCheck(State.CREATED, State.WRITTEN, State.RETRY); U decodedMessage = decode(rawResponse); processMessage(decodedMessage); exception = null; if (done(decodedMessage)) { logger.debu...
[ "public", "synchronized", "final", "void", "setResponse", "(", "RiakMessage", "rawResponse", ")", "{", "stateCheck", "(", "State", ".", "CREATED", ",", "State", ".", "WRITTEN", ",", "State", ".", "RETRY", ")", ";", "U", "decodedMessage", "=", "decode", "(", ...
Exposed for testing.
[ "Exposed", "for", "testing", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/FutureOperation.java#L193-L211
train
basho/riak-java-client
src/main/java/com/basho/riak/client/api/convert/Converter.java
Converter.toDomain
public T toDomain(RiakObject obj, Location location) { T domainObject; if (obj.isDeleted()) { domainObject = newDomainInstance(); } else { domainObject = toDomain(obj.getValue(), obj.getContentType()); AnnotationUtil.populateIndexe...
java
public T toDomain(RiakObject obj, Location location) { T domainObject; if (obj.isDeleted()) { domainObject = newDomainInstance(); } else { domainObject = toDomain(obj.getValue(), obj.getContentType()); AnnotationUtil.populateIndexe...
[ "public", "T", "toDomain", "(", "RiakObject", "obj", ",", "Location", "location", ")", "{", "T", "domainObject", ";", "if", "(", "obj", ".", "isDeleted", "(", ")", ")", "{", "domainObject", "=", "newDomainInstance", "(", ")", ";", "}", "else", "{", "do...
Converts from a RiakObject to a domain object. @param obj the RiakObject to be converted @param location The location of this RiakObject in Riak @return an instance of the domain type T
[ "Converts", "from", "a", "RiakObject", "to", "a", "domain", "object", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/Converter.java#L74-L101
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/util/BinaryValue.java
BinaryValue.create
public static BinaryValue create(String data, Charset charset) { byte[] bytes = null; if (data != null) { bytes = data.getBytes(charset); } return new BinaryValue(bytes); }
java
public static BinaryValue create(String data, Charset charset) { byte[] bytes = null; if (data != null) { bytes = data.getBytes(charset); } return new BinaryValue(bytes); }
[ "public", "static", "BinaryValue", "create", "(", "String", "data", ",", "Charset", "charset", ")", "{", "byte", "[", "]", "bytes", "=", "null", ";", "if", "(", "data", "!=", "null", ")", "{", "bytes", "=", "data", ".", "getBytes", "(", "charset", ")...
Create a BinaryValue containing a copy of the supplied string encoded using the supplied Charset. @param data the data to copy @param charset the charset to use for encoding @return a new {@code BinaryValue}
[ "Create", "a", "BinaryValue", "containing", "a", "copy", "of", "the", "supplied", "string", "encoded", "using", "the", "supplied", "Charset", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/BinaryValue.java#L106-L114
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/indexes/RiakIndex.java
RiakIndex.add
public final RiakIndex<T> add(Collection<T> values) { for (T value : values) { add(value); } return this; }
java
public final RiakIndex<T> add(Collection<T> values) { for (T value : values) { add(value); } return this; }
[ "public", "final", "RiakIndex", "<", "T", ">", "add", "(", "Collection", "<", "T", ">", "values", ")", "{", "for", "(", "T", "value", ":", "values", ")", "{", "add", "(", "value", ")", ";", "}", "return", "this", ";", "}" ]
Add a asSet of values to this secondary index. @param values a collection of values to add @return a reference to this object
[ "Add", "a", "asSet", "of", "values", "to", "this", "secondary", "index", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/indexes/RiakIndex.java#L96-L104
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/indexes/RiakIndex.java
RiakIndex.remove
public final RiakIndex<T> remove(Collection<T> values) { for (T value : values) { remove(value); } return this; }
java
public final RiakIndex<T> remove(Collection<T> values) { for (T value : values) { remove(value); } return this; }
[ "public", "final", "RiakIndex", "<", "T", ">", "remove", "(", "Collection", "<", "T", ">", "values", ")", "{", "for", "(", "T", "value", ":", "values", ")", "{", "remove", "(", "value", ")", ";", "}", "return", "this", ";", "}" ]
Remove a asSet of values from this index @param values a collection of values to remove @return a reference to this object
[ "Remove", "a", "asSet", "of", "values", "from", "this", "index" ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/indexes/RiakIndex.java#L136-L143
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/util/CharsetUtils.java
CharsetUtils.addUtf8Charset
public static String addUtf8Charset(String contentType) { if (contentType == null) { return "text/plain;charset=utf-8"; } Matcher matcher = CHARSET_PATT.matcher(contentType); if (matcher.find()) { // replace what ever content-type with utf8 ...
java
public static String addUtf8Charset(String contentType) { if (contentType == null) { return "text/plain;charset=utf-8"; } Matcher matcher = CHARSET_PATT.matcher(contentType); if (matcher.find()) { // replace what ever content-type with utf8 ...
[ "public", "static", "String", "addUtf8Charset", "(", "String", "contentType", ")", "{", "if", "(", "contentType", "==", "null", ")", "{", "return", "\"text/plain;charset=utf-8\"", ";", "}", "Matcher", "matcher", "=", "CHARSET_PATT", ".", "matcher", "(", "content...
Adds the utf-8 charset to a content type. @param contentType @return the {@code contentType} with {@literal ;charset=utf-8} appended.
[ "Adds", "the", "utf", "-", "8", "charset", "to", "a", "content", "type", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/CharsetUtils.java#L126-L141
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/util/CharsetUtils.java
CharsetUtils.addCharset
public static String addCharset(String charset, String contentType) { if (null == contentType) { return "text/plain;charset=" + charset; } else { Matcher matcher = CHARSET_PATT.matcher(contentType); if (matcher.find()) { ...
java
public static String addCharset(String charset, String contentType) { if (null == contentType) { return "text/plain;charset=" + charset; } else { Matcher matcher = CHARSET_PATT.matcher(contentType); if (matcher.find()) { ...
[ "public", "static", "String", "addCharset", "(", "String", "charset", ",", "String", "contentType", ")", "{", "if", "(", "null", "==", "contentType", ")", "{", "return", "\"text/plain;charset=\"", "+", "charset", ";", "}", "else", "{", "Matcher", "matcher", ...
Adds the charset to a content type. @param contentType @return the {@code contentType} with {@code charset.name()} appended.
[ "Adds", "the", "charset", "to", "a", "content", "type", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/CharsetUtils.java#L149-L169
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/util/CharsetUtils.java
CharsetUtils.hasCharset
public static boolean hasCharset(String ctype) { if (ctype == null) { return false; } Matcher matcher = CHARSET_PATT.matcher(ctype); if (matcher.find()) { return true; } else { return false; } }
java
public static boolean hasCharset(String ctype) { if (ctype == null) { return false; } Matcher matcher = CHARSET_PATT.matcher(ctype); if (matcher.find()) { return true; } else { return false; } }
[ "public", "static", "boolean", "hasCharset", "(", "String", "ctype", ")", "{", "if", "(", "ctype", "==", "null", ")", "{", "return", "false", ";", "}", "Matcher", "matcher", "=", "CHARSET_PATT", ".", "matcher", "(", "ctype", ")", ";", "if", "(", "match...
Check if a content-type string has a charset field appended. @param ctype the content-type string @return true if {@code ctype} has a charset, false otherwise
[ "Check", "if", "a", "content", "-", "type", "string", "has", "a", "charset", "field", "appended", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/CharsetUtils.java#L270-L285
train
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/timeseries/Cell.java
Cell.newTimestamp
public static Cell newTimestamp(long rawTimestampValue) { final Cell cell = new Cell(); cell.initTimestamp(rawTimestampValue); return cell; }
java
public static Cell newTimestamp(long rawTimestampValue) { final Cell cell = new Cell(); cell.initTimestamp(rawTimestampValue); return cell; }
[ "public", "static", "Cell", "newTimestamp", "(", "long", "rawTimestampValue", ")", "{", "final", "Cell", "cell", "=", "new", "Cell", "(", ")", ";", "cell", ".", "initTimestamp", "(", "rawTimestampValue", ")", ";", "return", "cell", ";", "}" ]
Creates a new "Timestamp" cell from the provided raw value. @param rawTimestampValue The epoch timestamp, including milliseconds. @return The new timestamp Cell.
[ "Creates", "a", "new", "Timestamp", "cell", "from", "the", "provided", "raw", "value", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/Cell.java#L212-L217
train
opentok/Opentok-Java-SDK
src/main/java/com/opentok/util/TokenGenerator.java
TokenGenerator.generateToken
public static String generateToken(final Integer apiKey, final String apiSecret) throws OpenTokException { //This is the default expire time we use for rest endpoints. final long defaultExpireTime = System.currentTimeMillis() / 1000L + TimeUnit.MINUTES.toSeconds(3); ...
java
public static String generateToken(final Integer apiKey, final String apiSecret) throws OpenTokException { //This is the default expire time we use for rest endpoints. final long defaultExpireTime = System.currentTimeMillis() / 1000L + TimeUnit.MINUTES.toSeconds(3); ...
[ "public", "static", "String", "generateToken", "(", "final", "Integer", "apiKey", ",", "final", "String", "apiSecret", ")", "throws", "OpenTokException", "{", "//This is the default expire time we use for rest endpoints.", "final", "long", "defaultExpireTime", "=", "System"...
Used by the REST Endpoints
[ "Used", "by", "the", "REST", "Endpoints" ]
d71b7999facc3131c415aebea874ea55776d477f
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/util/TokenGenerator.java#L30-L42
train
opentok/Opentok-Java-SDK
src/main/java/com/opentok/SignalProperties.java
SignalProperties.toMap
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != type) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(type); params.put("type", valueList); ...
java
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != type) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(type); params.put("type", valueList); ...
[ "public", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "toMap", "(", ")", "{", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "params", "=", "new", "HashMap", "<", "String", ",", "Collection", "<", "String", ">...
Returns the signal properties as a Map.
[ "Returns", "the", "signal", "properties", "as", "a", "Map", "." ]
d71b7999facc3131c415aebea874ea55776d477f
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/SignalProperties.java#L89-L103
train
opentok/Opentok-Java-SDK
src/main/java/com/opentok/ArchiveProperties.java
ArchiveProperties.toMap
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (name != null) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(name); params.put("name", valueList); ...
java
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (name != null) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(name); params.put("name", valueList); ...
[ "public", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "toMap", "(", ")", "{", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "params", "=", "new", "HashMap", "<", "String", ",", "Collection", "<", "String", ">...
Returns the archive properties as a Map.
[ "Returns", "the", "archive", "properties", "as", "a", "Map", "." ]
d71b7999facc3131c415aebea874ea55776d477f
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/ArchiveProperties.java#L185-L216
train
opentok/Opentok-Java-SDK
src/main/java/com/opentok/SessionProperties.java
SessionProperties.toMap
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != location) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(location); params.put("location", valueLis...
java
public Map<String, Collection<String>> toMap() { Map<String, Collection<String>> params = new HashMap<String, Collection<String>>(); if (null != location) { ArrayList<String> valueList = new ArrayList<String>(); valueList.add(location); params.put("location", valueLis...
[ "public", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "toMap", "(", ")", "{", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "params", "=", "new", "HashMap", "<", "String", ",", "Collection", "<", "String", ">...
Returns the session properties as a Map.
[ "Returns", "the", "session", "properties", "as", "a", "Map", "." ]
d71b7999facc3131c415aebea874ea55776d477f
https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/SessionProperties.java#L164-L181
train
davidmoten/rxjava-extras
src/main/java/com/github/davidmoten/rx/Functions.java
Functions.add
public static <T extends Number> Func2<T, T, T> add() { return new Func2<T, T, T>() { @SuppressWarnings("unchecked") @Override public T call(T a, T b) { if (a instanceof Integer) return (T) (Number) (a.intValue() + b.intValue()); ...
java
public static <T extends Number> Func2<T, T, T> add() { return new Func2<T, T, T>() { @SuppressWarnings("unchecked") @Override public T call(T a, T b) { if (a instanceof Integer) return (T) (Number) (a.intValue() + b.intValue()); ...
[ "public", "static", "<", "T", "extends", "Number", ">", "Func2", "<", "T", ",", "T", ",", "T", ">", "add", "(", ")", "{", "return", "new", "Func2", "<", "T", ",", "T", ",", "T", ">", "(", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ...
Returns a Func2 that adds numbers. Useful for Observable.reduce but not particularly performant as it does instanceOf checks. @param <T> generic type of Number being added @return Func2 that adds numbers
[ "Returns", "a", "Func2", "that", "adds", "numbers", ".", "Useful", "for", "Observable", ".", "reduce", "but", "not", "particularly", "performant", "as", "it", "does", "instanceOf", "checks", "." ]
a91d2ba7d454843250e0b0fce36084f9fb02a551
https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Functions.java#L89-L110
train
davidmoten/rxjava-extras
src/main/java/com/github/davidmoten/rx/Transformers.java
Transformers.bufferWhile
public static final <T> Transformer<T, List<T>> bufferWhile( Func1<? super T, Boolean> predicate) { return bufferWhile(predicate, 10); }
java
public static final <T> Transformer<T, List<T>> bufferWhile( Func1<? super T, Boolean> predicate) { return bufferWhile(predicate, 10); }
[ "public", "static", "final", "<", "T", ">", "Transformer", "<", "T", ",", "List", "<", "T", ">", ">", "bufferWhile", "(", "Func1", "<", "?", "super", "T", ",", "Boolean", ">", "predicate", ")", "{", "return", "bufferWhile", "(", "predicate", ",", "10...
Buffers the elements into continuous, non-overlapping Lists where the boundary is determined by a predicate receiving each item, before or after being buffered, and returns true to indicate a new buffer should start. <p> The operator won't return an empty first or last buffer. <dl> <dt><b>Backpressure Support:</b></d...
[ "Buffers", "the", "elements", "into", "continuous", "non", "-", "overlapping", "Lists", "where", "the", "boundary", "is", "determined", "by", "a", "predicate", "receiving", "each", "item", "before", "or", "after", "being", "buffered", "and", "returns", "true", ...
a91d2ba7d454843250e0b0fce36084f9fb02a551
https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L1180-L1183
train
davidmoten/rxjava-extras
src/main/java/com/github/davidmoten/rx/Transformers.java
Transformers.bufferWhile
public static final <T> Transformer<T, List<T>> bufferWhile(Func1<? super T, Boolean> predicate, int capacityHint) { return new OperatorBufferPredicateBoundary<T>(predicate, RxRingBuffer.SIZE, capacityHint, false); }
java
public static final <T> Transformer<T, List<T>> bufferWhile(Func1<? super T, Boolean> predicate, int capacityHint) { return new OperatorBufferPredicateBoundary<T>(predicate, RxRingBuffer.SIZE, capacityHint, false); }
[ "public", "static", "final", "<", "T", ">", "Transformer", "<", "T", ",", "List", "<", "T", ">", ">", "bufferWhile", "(", "Func1", "<", "?", "super", "T", ",", "Boolean", ">", "predicate", ",", "int", "capacityHint", ")", "{", "return", "new", "Opera...
Buffers the elements into continuous, non-overlapping Lists where the boundary is determined by a predicate receiving each item, before being buffered, and returns true to indicate a new buffer should start. <p> The operator won't return an empty first or last buffer. <dl> <dt><b>Backpressure Support:</b></dt> <dd>Th...
[ "Buffers", "the", "elements", "into", "continuous", "non", "-", "overlapping", "Lists", "where", "the", "boundary", "is", "determined", "by", "a", "predicate", "receiving", "each", "item", "before", "being", "buffered", "and", "returns", "true", "to", "indicate"...
a91d2ba7d454843250e0b0fce36084f9fb02a551
https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L1245-L1249
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setUUID
public void setUUID(UUID uuid) { if (uuid == null) { throw new IllegalArgumentException("'uuid' is null."); } mUUID = uuid; long msbits = uuid.getMostSignificantBits(); long lsbits = uuid.getLeastSignificantBits(); byte[] data = getData(); ...
java
public void setUUID(UUID uuid) { if (uuid == null) { throw new IllegalArgumentException("'uuid' is null."); } mUUID = uuid; long msbits = uuid.getMostSignificantBits(); long lsbits = uuid.getLeastSignificantBits(); byte[] data = getData(); ...
[ "public", "void", "setUUID", "(", "UUID", "uuid", ")", "{", "if", "(", "uuid", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'uuid' is null.\"", ")", ";", "}", "mUUID", "=", "uuid", ";", "long", "msbits", "=", "uuid", ".", ...
Set the proximity UUID. @param uuid The proximity UUID. The value must not be {@code null}. @throws IllegalArgumentException The given value is {@code null}.
[ "Set", "the", "proximity", "UUID", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L117-L146
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setMajor
public void setMajor(int major) { if (major < 0 || 0xFFFF < major) { throw new IllegalArgumentException("'major' is out of the valid range: " + major); } mMajor = major; byte[] data = getData(); data[MAJOR_INDEX ] = (byte)((major >> 8) & 0xFF); ...
java
public void setMajor(int major) { if (major < 0 || 0xFFFF < major) { throw new IllegalArgumentException("'major' is out of the valid range: " + major); } mMajor = major; byte[] data = getData(); data[MAJOR_INDEX ] = (byte)((major >> 8) & 0xFF); ...
[ "public", "void", "setMajor", "(", "int", "major", ")", "{", "if", "(", "major", "<", "0", "||", "0xFFFF", "<", "major", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'major' is out of the valid range: \"", "+", "major", ")", ";", "}", "mMajo...
Set the major number. @param major The major number. The value should be in the range from 0 to 65535. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "major", "number", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L170-L182
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setMinor
public void setMinor(int minor) { if (minor < 0 || 0xFFFF < minor) { throw new IllegalArgumentException("'minor' is out of the valid range: " + minor); } mMinor = minor; byte[] data = getData(); data[MINOR_INDEX ] = (byte)((minor >> 8) & 0xFF); ...
java
public void setMinor(int minor) { if (minor < 0 || 0xFFFF < minor) { throw new IllegalArgumentException("'minor' is out of the valid range: " + minor); } mMinor = minor; byte[] data = getData(); data[MINOR_INDEX ] = (byte)((minor >> 8) & 0xFF); ...
[ "public", "void", "setMinor", "(", "int", "minor", ")", "{", "if", "(", "minor", "<", "0", "||", "0xFFFF", "<", "minor", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'minor' is out of the valid range: \"", "+", "minor", ")", ";", "}", "mMino...
Set the minor number. @param minor The minor number. The value should be in the range from 0 to 65535. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "minor", "number", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L206-L218
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java
ADPayloadParser.registerBuilder
public void registerBuilder(int type, ADStructureBuilder builder) { if (type < 0 || 0xFF < type) { String message = String.format("'type' is out of the valid range: %d", type); throw new IllegalArgumentException(message); } if (builder == null) { ...
java
public void registerBuilder(int type, ADStructureBuilder builder) { if (type < 0 || 0xFF < type) { String message = String.format("'type' is out of the valid range: %d", type); throw new IllegalArgumentException(message); } if (builder == null) { ...
[ "public", "void", "registerBuilder", "(", "int", "type", ",", "ADStructureBuilder", "builder", ")", "{", "if", "(", "type", "<", "0", "||", "0xFF", "<", "type", ")", "{", "String", "message", "=", "String", ".", "format", "(", "\"'type' is out of the valid r...
Register an AD structure builder for the AD type. The given builder is added at the beginning of the list of the builders for the AD type. <p> Note that a builder for the type <i>Manufacturer Specific Data</i> (0xFF) should not be registered by this method. Instead, use {@link #registerManufacturerSpecificBuilder(int,...
[ "Register", "an", "AD", "structure", "builder", "for", "the", "AD", "type", ".", "The", "given", "builder", "is", "added", "at", "the", "beginning", "of", "the", "list", "of", "the", "builders", "for", "the", "AD", "type", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L152-L180
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java
ADPayloadParser.registerManufacturerSpecificBuilder
public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder) { if (companyId < 0 || 0xFFFF < companyId) { String message = String.format("'companyId' is out of the valid range: %d", companyId); throw new IllegalArgumentException(messag...
java
public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder) { if (companyId < 0 || 0xFFFF < companyId) { String message = String.format("'companyId' is out of the valid range: %d", companyId); throw new IllegalArgumentException(messag...
[ "public", "void", "registerManufacturerSpecificBuilder", "(", "int", "companyId", ",", "ADManufacturerSpecificBuilder", "builder", ")", "{", "if", "(", "companyId", "<", "0", "||", "0xFFFF", "<", "companyId", ")", "{", "String", "message", "=", "String", ".", "f...
Register a builder for the company ID. The given builder is added at the beginning of the list of the builders for the company ID. @param companyId Company ID. The value must be in the range from 0 to 0xFFFF. @param builder A builder.
[ "Register", "a", "builder", "for", "the", "company", "ID", ".", "The", "given", "builder", "is", "added", "at", "the", "beginning", "of", "the", "list", "of", "the", "builders", "for", "the", "company", "ID", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L193-L221
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java
Bytes.parseBE4BytesAsUnsigned
public static long parseBE4BytesAsUnsigned(byte[] data, int offset) { long value = ((long)(data[offset + 0] & 0xFF) << 24) | ((long)(data[offset + 1] & 0xFF) << 16) | ((long)(data[offset + 2] & 0xFF) << 8) | ((long)(data[offset + 3] & 0xFF) << 0); ...
java
public static long parseBE4BytesAsUnsigned(byte[] data, int offset) { long value = ((long)(data[offset + 0] & 0xFF) << 24) | ((long)(data[offset + 1] & 0xFF) << 16) | ((long)(data[offset + 2] & 0xFF) << 8) | ((long)(data[offset + 3] & 0xFF) << 0); ...
[ "public", "static", "long", "parseBE4BytesAsUnsigned", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "long", "value", "=", "(", "(", "long", ")", "(", "data", "[", "offset", "+", "0", "]", "&", "0xFF", ")", "<<", "24", ")", "|", ...
Parse 4 bytes in big endian byte order as an unsigned integer.
[ "Parse", "4", "bytes", "in", "big", "endian", "byte", "order", "as", "an", "unsigned", "integer", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L64-L72
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java
Bytes.copyOfRange
public static byte[] copyOfRange(byte[] source, int from, int to) { if (source == null || from < 0 || to < 0) { return null; } int length = to - from; if (length < 0) { return null; } if (source.length < from + length) ...
java
public static byte[] copyOfRange(byte[] source, int from, int to) { if (source == null || from < 0 || to < 0) { return null; } int length = to - from; if (length < 0) { return null; } if (source.length < from + length) ...
[ "public", "static", "byte", "[", "]", "copyOfRange", "(", "byte", "[", "]", "source", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "source", "==", "null", "||", "from", "<", "0", "||", "to", "<", "0", ")", "{", "return", "null", "...
Copy a range of a given byte array. @param source A source byte array. @param from The start index of the range in the source byte array (inclusive). @param to The end index of the range in the source byte array (exclusive). @return A copied byte array. {@code null} is returned if (1) {@code source} is {@code null}...
[ "Copy", "a", "range", "of", "a", "given", "byte", "array", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L142-L166
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from16
public static UUID from16(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 1) || Integer.MAX_VALUE == offset) { return null; } int v2, v3; if (littleEndian) { v2 = data[offset + 1] & ...
java
public static UUID from16(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 1) || Integer.MAX_VALUE == offset) { return null; } int v2, v3; if (littleEndian) { v2 = data[offset + 1] & ...
[ "public", "static", "UUID", "from16", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", "...
Create a UUID instance from 16-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 32-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0xAB, (byte)0xCD }; <span style="color: green;">// Create a ...
[ "Create", "a", "UUID", "instance", "from", "16", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L130-L151
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from32
public static UUID from32(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 3) || (Integer.MAX_VALUE - 3) < offset) { return null; } int v0, v1, v2, v3; if (littleEndian) { v0 = data[o...
java
public static UUID from32(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 3) || (Integer.MAX_VALUE - 3) < offset) { return null; } int v0, v1, v2, v3; if (littleEndian) { v0 = data[o...
[ "public", "static", "UUID", "from32", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", "...
Create a UUID instance from 32-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 32-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0x89, (byte)0xAB, (byte)0xCD, (byte)0xEF }; <span style="col...
[ "Create", "a", "UUID", "instance", "from", "32", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L237-L262
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from128
public static UUID from128(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 15) || (Integer.MAX_VALUE - 15) < offset) { return null; } String uuid; if (littleEndian) { uuid = String.f...
java
public static UUID from128(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 15) || (Integer.MAX_VALUE - 15) < offset) { return null; } String uuid; if (littleEndian) { uuid = String.f...
[ "public", "static", "UUID", "from128", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", ...
Create a UUID instance from 128-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 128-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0x10, (byte)0x32, (byte)0x54, (byte)0x76, (byte)0x98, (byte...
[ "Create", "a", "UUID", "instance", "from", "128", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L356-L391
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setVersion
public void setVersion(int version) { if (version < 0 || 255 < version) { throw new IllegalArgumentException("'version' is out of the valid range: " + version); } mVersion = version; getData()[VERSION_INDEX] = (byte)(version & 0xFF); }
java
public void setVersion(int version) { if (version < 0 || 255 < version) { throw new IllegalArgumentException("'version' is out of the valid range: " + version); } mVersion = version; getData()[VERSION_INDEX] = (byte)(version & 0xFF); }
[ "public", "void", "setVersion", "(", "int", "version", ")", "{", "if", "(", "version", "<", "0", "||", "255", "<", "version", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'version' is out of the valid range: \"", "+", "version", ")", ";", "}",...
Set the version of the packet format of Bluetooth LE ucode Marker. @param version The version number. The value should be in the range from 0 to 255. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "version", "of", "the", "packet", "format", "of", "Bluetooth", "LE", "ucode", "Marker", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L142-L152
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setUcode
public void setUcode(String ucode) { if (ucode == null) { throw new IllegalArgumentException("'ucode' is null."); } if (UCODE_PATTERN.matcher(ucode).matches() == false) { throw new IllegalArgumentException("The format of 'ucode' is wrong: " + ucode); ...
java
public void setUcode(String ucode) { if (ucode == null) { throw new IllegalArgumentException("'ucode' is null."); } if (UCODE_PATTERN.matcher(ucode).matches() == false) { throw new IllegalArgumentException("The format of 'ucode' is wrong: " + ucode); ...
[ "public", "void", "setUcode", "(", "String", "ucode", ")", "{", "if", "(", "ucode", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'ucode' is null.\"", ")", ";", "}", "if", "(", "UCODE_PATTERN", ".", "matcher", "(", "ucode", ")...
Set the ucode. @param ucode The string representation of the ucode. It must consist of 32 hex letters. @throws IllegalArgumentException {@code ucode} is {@code null} or it does not consist of 32 hex letters.
[ "Set", "the", "ucode", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L179-L205
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setPower
public void setPower(int power) { if (power < -128 || 127 < power) { throw new IllegalArgumentException("'power' is out of the valid range: " + power); } mPower = power; getData()[POWER_INDEX] = (byte)power; }
java
public void setPower(int power) { if (power < -128 || 127 < power) { throw new IllegalArgumentException("'power' is out of the valid range: " + power); } mPower = power; getData()[POWER_INDEX] = (byte)power; }
[ "public", "void", "setPower", "(", "int", "power", ")", "{", "if", "(", "power", "<", "-", "128", "||", "127", "<", "power", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'power' is out of the valid range: \"", "+", "power", ")", ";", "}", ...
Set the transmission power in dBm. @param power The transmission power in dBm. The valid range is from -128 to 127. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "transmission", "power", "in", "dBm", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L422-L432
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setCount
public void setCount(int count) { if (count < 0 || 0xFF < count) { throw new IllegalArgumentException("'count' is out of the valid range: " + count); } mCount = count; getData()[COUNT_INDEX] = (byte)count; }
java
public void setCount(int count) { if (count < 0 || 0xFF < count) { throw new IllegalArgumentException("'count' is out of the valid range: " + count); } mCount = count; getData()[COUNT_INDEX] = (byte)count; }
[ "public", "void", "setCount", "(", "int", "count", ")", "{", "if", "(", "count", "<", "0", "||", "0xFF", "<", "count", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'count' is out of the valid range: \"", "+", "count", ")", ";", "}", "mCount"...
Set the transmission count. @param count The transmission count. The value should be in the range from 0x00 to 0xFF. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "transmission", "count", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L462-L472
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getNamespaceIdAsString
public String getNamespaceIdAsString() { if (mNamespaceIdAsString == null) { mNamespaceIdAsString = Bytes.toHexString(getNamespaceId(), true); } return mNamespaceIdAsString; }
java
public String getNamespaceIdAsString() { if (mNamespaceIdAsString == null) { mNamespaceIdAsString = Bytes.toHexString(getNamespaceId(), true); } return mNamespaceIdAsString; }
[ "public", "String", "getNamespaceIdAsString", "(", ")", "{", "if", "(", "mNamespaceIdAsString", "==", "null", ")", "{", "mNamespaceIdAsString", "=", "Bytes", ".", "toHexString", "(", "getNamespaceId", "(", ")", ",", "true", ")", ";", "}", "return", "mNamespace...
Get the 10-byte namespace ID as an upper-case hex string. @return The namespace ID.
[ "Get", "the", "10", "-", "byte", "namespace", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L145-L153
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getInstanceIdAsString
public String getInstanceIdAsString() { if (mInstanceIdAsString == null) { mInstanceIdAsString = Bytes.toHexString(getInstanceId(), true); } return mInstanceIdAsString; }
java
public String getInstanceIdAsString() { if (mInstanceIdAsString == null) { mInstanceIdAsString = Bytes.toHexString(getInstanceId(), true); } return mInstanceIdAsString; }
[ "public", "String", "getInstanceIdAsString", "(", ")", "{", "if", "(", "mInstanceIdAsString", "==", "null", ")", "{", "mInstanceIdAsString", "=", "Bytes", ".", "toHexString", "(", "getInstanceId", "(", ")", ",", "true", ")", ";", "}", "return", "mInstanceIdAsS...
Get the 6-byte instance ID as an upper-case hex string. @return The instance ID.
[ "Get", "the", "6", "-", "byte", "instance", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L179-L187
train
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getBeaconIdAsString
public String getBeaconIdAsString() { if (mBeaconIdAsString == null) { mBeaconIdAsString = Bytes.toHexString(getBeaconId(), true); } return mBeaconIdAsString; }
java
public String getBeaconIdAsString() { if (mBeaconIdAsString == null) { mBeaconIdAsString = Bytes.toHexString(getBeaconId(), true); } return mBeaconIdAsString; }
[ "public", "String", "getBeaconIdAsString", "(", ")", "{", "if", "(", "mBeaconIdAsString", "==", "null", ")", "{", "mBeaconIdAsString", "=", "Bytes", ".", "toHexString", "(", "getBeaconId", "(", ")", ",", "true", ")", ";", "}", "return", "mBeaconIdAsString", ...
Get the 16-byte beacon ID as an upper-case hex string. @return The beacon ID.
[ "Get", "the", "16", "-", "byte", "beacon", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L217-L225
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jMDCAdapter.java
Slf4jMDCAdapter.getContext
private static PaxContext getContext(){ if( m_context==null && m_paxLogging!=null ){ m_context=(m_paxLogging.getPaxLoggingService()!=null)?m_paxLogging.getPaxLoggingService().getPaxContext():null; } return m_context!=null?m_context:m_defaultContext; }
java
private static PaxContext getContext(){ if( m_context==null && m_paxLogging!=null ){ m_context=(m_paxLogging.getPaxLoggingService()!=null)?m_paxLogging.getPaxLoggingService().getPaxContext():null; } return m_context!=null?m_context:m_defaultContext; }
[ "private", "static", "PaxContext", "getContext", "(", ")", "{", "if", "(", "m_context", "==", "null", "&&", "m_paxLogging", "!=", "null", ")", "{", "m_context", "=", "(", "m_paxLogging", ".", "getPaxLoggingService", "(", ")", "!=", "null", ")", "?", "m_pax...
For all the methods that operate against the context, return true if the MDC should use the PaxContext object from the PaxLoggingManager, or if the logging manager is not set, or does not have its context available yet, use a default context local to this MDC. @return m_context if the MDC should use the PaxContext obje...
[ "For", "all", "the", "methods", "that", "operate", "against", "the", "context", "return", "true", "if", "the", "MDC", "should", "use", "the", "PaxContext", "object", "from", "the", "PaxLoggingManager", "or", "if", "the", "logging", "manager", "is", "not", "s...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jMDCAdapter.java#L48-L53
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java
Receiver.setThreshold
public void setThreshold(final Level level) { Level oldValue = this.thresholdLevel; thresholdLevel = level; firePropertyChange("threshold", oldValue, this.thresholdLevel); }
java
public void setThreshold(final Level level) { Level oldValue = this.thresholdLevel; thresholdLevel = level; firePropertyChange("threshold", oldValue, this.thresholdLevel); }
[ "public", "void", "setThreshold", "(", "final", "Level", "level", ")", "{", "Level", "oldValue", "=", "this", ".", "thresholdLevel", ";", "thresholdLevel", "=", "level", ";", "firePropertyChange", "(", "\"threshold\"", ",", "oldValue", ",", "this", ".", "thres...
Sets the receiver theshold to the given level. @param level The threshold level events must equal or be greater than before further processing can be done.
[ "Sets", "the", "receiver", "theshold", "to", "the", "given", "level", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java#L78-L82
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java
Receiver.doPost
public void doPost(final LoggingEvent event) { // if event does not meet threshold, exit now if (!isAsSevereAsThreshold(event.getLevel())) { return; } // get the "local" logger for this event from the // configured repository. Logger localLogger = ...
java
public void doPost(final LoggingEvent event) { // if event does not meet threshold, exit now if (!isAsSevereAsThreshold(event.getLevel())) { return; } // get the "local" logger for this event from the // configured repository. Logger localLogger = ...
[ "public", "void", "doPost", "(", "final", "LoggingEvent", "event", ")", "{", "// if event does not meet threshold, exit now", "if", "(", "!", "isAsSevereAsThreshold", "(", "event", ".", "getLevel", "(", ")", ")", ")", "{", "return", ";", "}", "// get the \"local\"...
Posts the logging event to a logger in the configured logger repository. @param event the log event to post to the local log4j environment.
[ "Posts", "the", "logging", "event", "to", "a", "logger", "in", "the", "configured", "logger", "repository", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java#L112-L130
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java
JMSReceiver.activateOptions
public void activateOptions() { if (!isActive()) { try { remoteInfo = topicFactoryName + ":" + topicName; Context ctx = null; if (jndiPath == null || jndiPath.equals("")) { ctx = new InitialContext(); } else { FileInputStream is = new FileInputS...
java
public void activateOptions() { if (!isActive()) { try { remoteInfo = topicFactoryName + ":" + topicName; Context ctx = null; if (jndiPath == null || jndiPath.equals("")) { ctx = new InitialContext(); } else { FileInputStream is = new FileInputS...
[ "public", "void", "activateOptions", "(", ")", "{", "if", "(", "!", "isActive", "(", ")", ")", "{", "try", "{", "remoteInfo", "=", "topicFactoryName", "+", "\":\"", "+", "topicName", ";", "Context", "ctx", "=", "null", ";", "if", "(", "jndiPath", "==",...
Starts the JMSReceiver with the current options.
[ "Starts", "the", "JMSReceiver", "with", "the", "current", "options", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java#L186-L241
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java
JMSReceiver.shutdown
public synchronized void shutdown() { if (isActive()) { // mark this as no longer running setActive(false); if (topicConnection != null) { try { topicConnection.close(); } catch (Exception e) { // do nothing } topicConnection = null; }...
java
public synchronized void shutdown() { if (isActive()) { // mark this as no longer running setActive(false); if (topicConnection != null) { try { topicConnection.close(); } catch (Exception e) { // do nothing } topicConnection = null; }...
[ "public", "synchronized", "void", "shutdown", "(", ")", "{", "if", "(", "isActive", "(", ")", ")", "{", "// mark this as no longer running", "setActive", "(", "false", ")", ";", "if", "(", "topicConnection", "!=", "null", ")", "{", "try", "{", "topicConnecti...
Called when the receiver should be stopped.
[ "Called", "when", "the", "receiver", "should", "be", "stopped", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java#L245-L259
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/filter/ExpressionFilter.java
ExpressionFilter.decide
public int decide(final LoggingEvent event) { if (expressionRule.evaluate(event, null)) { if (acceptOnMatch) { return Filter.ACCEPT; } else { return Filter.DENY; } } return Filter.NEUTRAL; }
java
public int decide(final LoggingEvent event) { if (expressionRule.evaluate(event, null)) { if (acceptOnMatch) { return Filter.ACCEPT; } else { return Filter.DENY; } } return Filter.NEUTRAL; }
[ "public", "int", "decide", "(", "final", "LoggingEvent", "event", ")", "{", "if", "(", "expressionRule", ".", "evaluate", "(", "event", ",", "null", ")", ")", "{", "if", "(", "acceptOnMatch", ")", "{", "return", "Filter", ".", "ACCEPT", ";", "}", "else...
Determines if event matches the filter. @param event logging event; @return {@link Filter#NEUTRAL} is there is no string match.
[ "Determines", "if", "event", "matches", "the", "filter", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/filter/ExpressionFilter.java#L152-L161
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
AbstractLoggerAdapter.getLoggersInContext
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) { ConcurrentMap<String, L> loggers; lock.readLock ().lock (); try { loggers = registry.get (context); } finally { lock.readLock ().unlock (); } if (loggers != null) {...
java
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) { ConcurrentMap<String, L> loggers; lock.readLock ().lock (); try { loggers = registry.get (context); } finally { lock.readLock ().unlock (); } if (loggers != null) {...
[ "public", "ConcurrentMap", "<", "String", ",", "L", ">", "getLoggersInContext", "(", "final", "LoggerContext", "context", ")", "{", "ConcurrentMap", "<", "String", ",", "L", ">", "loggers", ";", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", "...
Gets or creates the ConcurrentMap of named loggers for a given LoggerContext. @param context the LoggerContext to get loggers for @return the map of loggers for the given LoggerContext
[ "Gets", "or", "creates", "the", "ConcurrentMap", "of", "named", "loggers", "for", "a", "given", "LoggerContext", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java#L62-L86
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.shutdown
public synchronized void shutdown() { // mark this as no longer running active = false; // close the socket try { if (socketNode != null) { socketNode.close(); socketNode = null; } } catch (Exception e) { getLogger().info("Excpetion closing socket", e); // ig...
java
public synchronized void shutdown() { // mark this as no longer running active = false; // close the socket try { if (socketNode != null) { socketNode.close(); socketNode = null; } } catch (Exception e) { getLogger().info("Excpetion closing socket", e); // ig...
[ "public", "synchronized", "void", "shutdown", "(", ")", "{", "// mark this as no longer running", "active", "=", "false", ";", "// close the socket", "try", "{", "if", "(", "socketNode", "!=", "null", ")", "{", "socketNode", ".", "close", "(", ")", ";", "socke...
Called when the receiver should be stopped. Closes the socket
[ "Called", "when", "the", "receiver", "should", "be", "stopped", ".", "Closes", "the", "socket" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L259-L282
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.fireConnector
private synchronized void fireConnector(final boolean isReconnect) { if (active && connector == null) { getLogger().debug("Starting a new connector thread."); connector = new Connector(isReconnect); connector.setDaemon(true); connector.setPriority(Thread.MIN_PRIORITY); connector.start(...
java
private synchronized void fireConnector(final boolean isReconnect) { if (active && connector == null) { getLogger().debug("Starting a new connector thread."); connector = new Connector(isReconnect); connector.setDaemon(true); connector.setPriority(Thread.MIN_PRIORITY); connector.start(...
[ "private", "synchronized", "void", "fireConnector", "(", "final", "boolean", "isReconnect", ")", "{", "if", "(", "active", "&&", "connector", "==", "null", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"Starting a new connector thread.\"", ")", ";", "c...
Fire connectors. @param isReconnect true if reconnect.
[ "Fire", "connectors", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L304-L312
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.setSocket
private synchronized void setSocket(final Socket newSocket) { connector = null; socketNode = new SocketNode13(newSocket, this); socketNode.addSocketNodeEventListener(this); synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { SocketNodeEvent...
java
private synchronized void setSocket(final Socket newSocket) { connector = null; socketNode = new SocketNode13(newSocket, this); socketNode.addSocketNodeEventListener(this); synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { SocketNodeEvent...
[ "private", "synchronized", "void", "setSocket", "(", "final", "Socket", "newSocket", ")", "{", "connector", "=", "null", ";", "socketNode", "=", "new", "SocketNode13", "(", "newSocket", ",", "this", ")", ";", "socketNode", ".", "addSocketNodeEventListener", "(",...
Set socket. @param newSocket new value for socket.
[ "Set", "socket", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L318-L331
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/extras/SoundAppender.java
SoundAppender.activateOptions
public void activateOptions() { /* * AudioSystem.getAudioInputStream requires jdk 1.3, * so we use applet.newaudioclip instead * */ try { clip = Applet.newAudioClip(new URL(audioURL)); } catch (MalformedURLException mue) { LogLog.error("unable to initialize SoundAppender", mue);} if (...
java
public void activateOptions() { /* * AudioSystem.getAudioInputStream requires jdk 1.3, * so we use applet.newaudioclip instead * */ try { clip = Applet.newAudioClip(new URL(audioURL)); } catch (MalformedURLException mue) { LogLog.error("unable to initialize SoundAppender", mue);} if (...
[ "public", "void", "activateOptions", "(", ")", "{", "/*\n\t\t * AudioSystem.getAudioInputStream requires jdk 1.3,\n\t\t * so we use applet.newaudioclip instead\n\t\t *\n\t\t */", "try", "{", "clip", "=", "Applet", ".", "newAudioClip", "(", "new", "URL", "(", "audioURL", ")", ...
Attempt to initialize the appender by creating a reference to an AudioClip. Will log a message if format is not supported, file not found, etc.
[ "Attempt", "to", "initialize", "the", "appender", "by", "creating", "a", "reference", "to", "an", "AudioClip", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/extras/SoundAppender.java#L61-L74
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java
RuleFactory.isRule
public boolean isRule(final String symbol) { return ((symbol != null) && (RULES.contains(symbol.toLowerCase(Locale.ENGLISH)))); }
java
public boolean isRule(final String symbol) { return ((symbol != null) && (RULES.contains(symbol.toLowerCase(Locale.ENGLISH)))); }
[ "public", "boolean", "isRule", "(", "final", "String", "symbol", ")", "{", "return", "(", "(", "symbol", "!=", "null", ")", "&&", "(", "RULES", ".", "contains", "(", "symbol", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", ")", ";"...
Determine if specified string is a known operator. @param symbol string @return true if string is a known operator
[ "Determine", "if", "specified", "string", "is", "a", "known", "operator", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java#L127-L129
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java
RuleFactory.getRule
public Rule getRule(final String symbol, final Stack stack) { if (AND_RULE.equals(symbol)) { return AndRule.getRule(stack); } if (OR_RULE.equals(symbol)) { return OrRule.getRule(stack); } if (NOT_RULE.equals(symbol)) { return NotRule.getRule(stack); } if (NOT_EQUALS_RULE...
java
public Rule getRule(final String symbol, final Stack stack) { if (AND_RULE.equals(symbol)) { return AndRule.getRule(stack); } if (OR_RULE.equals(symbol)) { return OrRule.getRule(stack); } if (NOT_RULE.equals(symbol)) { return NotRule.getRule(stack); } if (NOT_EQUALS_RULE...
[ "public", "Rule", "getRule", "(", "final", "String", "symbol", ",", "final", "Stack", "stack", ")", "{", "if", "(", "AND_RULE", ".", "equals", "(", "symbol", ")", ")", "{", "return", "AndRule", ".", "getRule", "(", "stack", ")", ";", "}", "if", "(", ...
Create rule from applying operator to stack. @param symbol symbol @param stack stack @return new instance
[ "Create", "rule", "from", "applying", "operator", "to", "stack", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java#L137-L186
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
RollingFileAppender.activateOptions
public void activateOptions() { if (rollingPolicy == null) { LogLog.warn( "Please set a rolling policy for the RollingFileAppender named '" + getName() + "'"); return; } // // if no explicit triggering policy and ...
java
public void activateOptions() { if (rollingPolicy == null) { LogLog.warn( "Please set a rolling policy for the RollingFileAppender named '" + getName() + "'"); return; } // // if no explicit triggering policy and ...
[ "public", "void", "activateOptions", "(", ")", "{", "if", "(", "rollingPolicy", "==", "null", ")", "{", "LogLog", ".", "warn", "(", "\"Please set a rolling policy for the RollingFileAppender named '\"", "+", "getName", "(", ")", "+", "\"'\"", ")", ";", "return", ...
Prepare instance of use.
[ "Prepare", "instance", "of", "use", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java#L122-L193
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
RollingFileAppender.createFileOutputStream
private FileOutputStream createFileOutputStream(String newFileName, boolean append) throws FileNotFoundException { try { // // attempt to create file // return new FileOutputStream(newFileName, append); } catch (FileNotFoundException ex) { ...
java
private FileOutputStream createFileOutputStream(String newFileName, boolean append) throws FileNotFoundException { try { // // attempt to create file // return new FileOutputStream(newFileName, append); } catch (FileNotFoundException ex) { ...
[ "private", "FileOutputStream", "createFileOutputStream", "(", "String", "newFileName", ",", "boolean", "append", ")", "throws", "FileNotFoundException", "{", "try", "{", "//", "// attempt to create file", "//", "return", "new", "FileOutputStream", "(", "newFileName", ...
Creates a new FileOutputStream of a new log file, possibly creating first all the needed parent directories @param newFileName Filename of new log file to be created @param append If file should be appended @return newly created FileOutputStream @throws FileNotFoundException if creating log file or parent directo...
[ "Creates", "a", "new", "FileOutputStream", "of", "a", "new", "log", "file", "possibly", "creating", "first", "all", "the", "needed", "parent", "directories" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java#L350-L375
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
StringBuilders.appendValue
public static void appendValue(final StringBuilder stringBuilder, final Object obj) { if (obj == null || obj instanceof String) { stringBuilder.append((String) obj); } else if (obj instanceof StringBuilderFormattable) { ((StringBuilderFormattable) obj).formatTo(stringBuilder); ...
java
public static void appendValue(final StringBuilder stringBuilder, final Object obj) { if (obj == null || obj instanceof String) { stringBuilder.append((String) obj); } else if (obj instanceof StringBuilderFormattable) { ((StringBuilderFormattable) obj).formatTo(stringBuilder); ...
[ "public", "static", "void", "appendValue", "(", "final", "StringBuilder", "stringBuilder", ",", "final", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", "||", "obj", "instanceof", "String", ")", "{", "stringBuilder", ".", "append", "(", "(", "St...
Appends a text representation of the specified object to the specified StringBuilder, if possible without allocating temporary objects. @param stringBuilder the StringBuilder to append the value to @param obj the object whose text representation to append to the StringBuilder
[ "Appends", "a", "text", "representation", "of", "the", "specified", "object", "to", "the", "specified", "StringBuilder", "if", "possible", "without", "allocating", "temporary", "objects", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L71-L95
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
StringBuilders.equalsIgnoreCase
public static boolean equalsIgnoreCase(final CharSequence left, final int leftOffset, final int leftLength, final CharSequence right, final int rightOffset, final int rightLength) { if (leftLength == rightLength) { for (int i = 0; i < rightLength; i++) {...
java
public static boolean equalsIgnoreCase(final CharSequence left, final int leftOffset, final int leftLength, final CharSequence right, final int rightOffset, final int rightLength) { if (leftLength == rightLength) { for (int i = 0; i < rightLength; i++) {...
[ "public", "static", "boolean", "equalsIgnoreCase", "(", "final", "CharSequence", "left", ",", "final", "int", "leftOffset", ",", "final", "int", "leftLength", ",", "final", "CharSequence", "right", ",", "final", "int", "rightOffset", ",", "final", "int", "rightL...
Returns true if the specified section of the left CharSequence equals, ignoring case, the specified section of the right CharSequence. @param left the left CharSequence @param leftOffset start index in the left CharSequence @param leftLength length of the section in the left CharSequence @param right the right CharSeq...
[ "Returns", "true", "if", "the", "specified", "section", "of", "the", "left", "CharSequence", "equals", "ignoring", "case", "the", "specified", "section", "of", "the", "right", "CharSequence", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L134-L145
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/log4j/MDC.java
MDC.setContext
private static boolean setContext() { if (m_context == null && m_paxLogging != null) { m_context = (m_paxLogging.getPaxLoggingService() != null) ? m_paxLogging.getPaxLoggingService().getPaxContext() : null; } return m_context != null; }
java
private static boolean setContext() { if (m_context == null && m_paxLogging != null) { m_context = (m_paxLogging.getPaxLoggingService() != null) ? m_paxLogging.getPaxLoggingService().getPaxContext() : null; } return m_context != null; }
[ "private", "static", "boolean", "setContext", "(", ")", "{", "if", "(", "m_context", "==", "null", "&&", "m_paxLogging", "!=", "null", ")", "{", "m_context", "=", "(", "m_paxLogging", ".", "getPaxLoggingService", "(", ")", "!=", "null", ")", "?", "m_paxLog...
For all the methods that operate against the context, return true if the MDC should use the PaxContext object ffrom the PaxLoggingManager, or if the logging manager is not set, or does not have its context available yet, use a default context local to this MDC. @return true if the MDC should use the PaxContext object f...
[ "For", "all", "the", "methods", "that", "operate", "against", "the", "context", "return", "true", "if", "the", "MDC", "should", "use", "the", "PaxContext", "object", "ffrom", "the", "PaxLoggingManager", "or", "if", "the", "logging", "manager", "is", "not", "...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/log4j/MDC.java#L46-L51
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.decode
public Vector decode(final URL url) throws IOException { LineNumberReader reader; boolean isZipFile = url.getPath().toLowerCase().endsWith(".zip"); InputStream inputStream; if (isZipFile) { inputStream = new ZipInputStream(url.openStream()); //move stream to next entry so we can read it ...
java
public Vector decode(final URL url) throws IOException { LineNumberReader reader; boolean isZipFile = url.getPath().toLowerCase().endsWith(".zip"); InputStream inputStream; if (isZipFile) { inputStream = new ZipInputStream(url.openStream()); //move stream to next entry so we can read it ...
[ "public", "Vector", "decode", "(", "final", "URL", "url", ")", "throws", "IOException", "{", "LineNumberReader", "reader", ";", "boolean", "isZipFile", "=", "url", ".", "getPath", "(", ")", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "\".zip\"", ")...
Decodes a File into a Vector of LoggingEvents. @param url the url of a file containing events to decode @return Vector of LoggingEvents @throws IOException if IO error during processing.
[ "Decodes", "a", "File", "into", "a", "Vector", "of", "LoggingEvents", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L180-L226
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.decode
public LoggingEvent decode(final String data) { Document document = parse(data); if (document == null) { return null; } Vector events = decodeEvents(document); if (events.size() > 0) { return (LoggingEvent) events.firstElement(); } return null; }
java
public LoggingEvent decode(final String data) { Document document = parse(data); if (document == null) { return null; } Vector events = decodeEvents(document); if (events.size() > 0) { return (LoggingEvent) events.firstElement(); } return null; }
[ "public", "LoggingEvent", "decode", "(", "final", "String", "data", ")", "{", "Document", "document", "=", "parse", "(", "data", ")", ";", "if", "(", "document", "==", "null", ")", "{", "return", "null", ";", "}", "Vector", "events", "=", "decodeEvents",...
Converts the string data into an XML Document, and then soaks out the relevant bits to form a new LoggingEvent instance which can be used by any Log4j element locally. @param data XML fragment @return a single LoggingEvent or null
[ "Converts", "the", "string", "data", "into", "an", "XML", "Document", "and", "then", "soaks", "out", "the", "relevant", "bits", "to", "form", "a", "new", "LoggingEvent", "instance", "which", "can", "be", "used", "by", "any", "Log4j", "element", "locally", ...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L282-L296
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.getCData
private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_S...
java
private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_S...
[ "private", "String", "getCData", "(", "final", "Node", "n", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "NodeList", "nl", "=", "n", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<"...
Get contents of CDATASection. @param n CDATASection @return text content of all text or CDATA children of node.
[ "Get", "contents", "of", "CDATASection", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L472-L487
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/UtilLoggingXMLDecoder.java
UtilLoggingXMLDecoder.decodeEvents
public Vector decodeEvents(final String document) { if (document != null) { if (document.trim().equals("")) { return null; } String newDoc; String newPartialEvent = null; //separate the string into the last portion ending with </record> ...
java
public Vector decodeEvents(final String document) { if (document != null) { if (document.trim().equals("")) { return null; } String newDoc; String newPartialEvent = null; //separate the string into the last portion ending with </record> ...
[ "public", "Vector", "decodeEvents", "(", "final", "String", "document", ")", "{", "if", "(", "document", "!=", "null", ")", "{", "if", "(", "document", ".", "trim", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "null", ";", "}", "S...
Decodes a String representing a number of events into a Vector of LoggingEvents. @param document to decode events from @return Vector of LoggingEvents
[ "Decodes", "a", "String", "representing", "a", "number", "of", "events", "into", "a", "Vector", "of", "LoggingEvents", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/UtilLoggingXMLDecoder.java#L228-L270
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
SimpleMessage.getFormattedMessage
@Override public String getFormattedMessage() { return message = message == null ? String.valueOf(charSequence) : message ; }
java
@Override public String getFormattedMessage() { return message = message == null ? String.valueOf(charSequence) : message ; }
[ "@", "Override", "public", "String", "getFormattedMessage", "(", ")", "{", "return", "message", "=", "message", "==", "null", "?", "String", ".", "valueOf", "(", "charSequence", ")", ":", "message", ";", "}" ]
Returns the message. @return the message.
[ "Returns", "the", "message", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java#L62-L65
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/Category.java
Category.removeAllAppenders
public void removeAllAppenders() { for (Appender appender : aai.getAppenders()) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
java
public void removeAllAppenders() { for (Appender appender : aai.getAppenders()) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
[ "public", "void", "removeAllAppenders", "(", ")", "{", "for", "(", "Appender", "appender", ":", "aai", ".", "getAppenders", "(", ")", ")", "{", "aai", ".", "removeAppender", "(", "appender", ")", ";", "fireRemoveAppenderEvent", "(", "appender", ")", ";", "...
Remove all previously added appenders from this Category instance. <p> This is useful when re-reading configuration information.
[ "Remove", "all", "previously", "added", "appenders", "from", "this", "Category", "instance", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/Category.java#L750-L755
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/Category.java
Category.removeAppender
public void removeAppender(Appender appender) { boolean wasAttached = aai.isAttached(appender); if (wasAttached) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
java
public void removeAppender(Appender appender) { boolean wasAttached = aai.isAttached(appender); if (wasAttached) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
[ "public", "void", "removeAppender", "(", "Appender", "appender", ")", "{", "boolean", "wasAttached", "=", "aai", ".", "isAttached", "(", "appender", ")", ";", "if", "(", "wasAttached", ")", "{", "aai", ".", "removeAppender", "(", "appender", ")", ";", "fir...
Remove the appender passed as parameter form the list of appenders. @since 0.8.2
[ "Remove", "the", "appender", "passed", "as", "parameter", "form", "the", "list", "of", "appenders", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/Category.java#L762-L768
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/spi/ComponentBase.java
ComponentBase.setLoggerRepository
public void setLoggerRepository(final LoggerRepository repository) { if (this.repository == null) { this.repository = repository; } else if (this.repository != repository) { throw new IllegalStateException("Repository has been already set"); } }
java
public void setLoggerRepository(final LoggerRepository repository) { if (this.repository == null) { this.repository = repository; } else if (this.repository != repository) { throw new IllegalStateException("Repository has been already set"); } }
[ "public", "void", "setLoggerRepository", "(", "final", "LoggerRepository", "repository", ")", "{", "if", "(", "this", ".", "repository", "==", "null", ")", "{", "this", ".", "repository", "=", "repository", ";", "}", "else", "if", "(", "this", ".", "reposi...
Set the owning repository. The owning repository cannot be set more than once. @param repository repository
[ "Set", "the", "owning", "repository", ".", "The", "owning", "repository", "cannot", "be", "set", "more", "than", "once", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/spi/ComponentBase.java#L71-L77
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
SortedArrayStringMap.inflateTable
private void inflateTable(final int toSize) { threshold = toSize; keys = new String[toSize]; values = new Object[toSize]; }
java
private void inflateTable(final int toSize) { threshold = toSize; keys = new String[toSize]; values = new Object[toSize]; }
[ "private", "void", "inflateTable", "(", "final", "int", "toSize", ")", "{", "threshold", "=", "toSize", ";", "keys", "=", "new", "String", "[", "toSize", "]", ";", "values", "=", "new", "Object", "[", "toSize", "]", ";", "}" ]
Inflates the table.
[ "Inflates", "the", "table", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java#L333-L337
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.getLogger
public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
java
public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
[ "public", "T", "getLogger", "(", "final", "String", "name", ",", "final", "MessageFactory", "messageFactory", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryKey", "(", "messageFactory", ")", ")", ".", "get", "(", "name", ")", ";", "}" ]
Returns an ExtendedLogger. @param name The name of the Logger to return. @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched. @return The logger with the specified name.
[ "Returns", "an", "ExtendedLogger", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L124-L126
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.hasLogger
public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }
java
public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }
[ "public", "boolean", "hasLogger", "(", "final", "String", "name", ",", "final", "MessageFactory", "messageFactory", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryKey", "(", "messageFactory", ")", ")", ".", "containsKey", "(", "name", ")", ";", "}" ]
Detects if a Logger with the specified name and MessageFactory exists. @param name The Logger name to search for. @param messageFactory The message factory to search for. @return true if the Logger exists, false otherwise. @since 2.5
[ "Detects", "if", "a", "Logger", "with", "the", "specified", "name", "and", "MessageFactory", "exists", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L164-L166
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.hasLogger
public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
java
public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
[ "public", "boolean", "hasLogger", "(", "final", "String", "name", ",", "final", "Class", "<", "?", "extends", "MessageFactory", ">", "messageFactoryClass", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryClassKey", "(", "messageFactoryClass", ")", ")", "."...
Detects if a Logger with the specified name and MessageFactory type exists. @param name The Logger name to search for. @param messageFactoryClass The message factory class to search for. @return true if the Logger exists, false otherwise. @since 2.5
[ "Detects", "if", "a", "Logger", "with", "the", "specified", "name", "and", "MessageFactory", "type", "exists", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L175-L177
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/log4j/Logger.java
Logger.getLogger
public static Logger getLogger( String name ) { PaxLogger paxLogger; if( m_paxLogging == null ) { paxLogger = FallbackLogFactory.createFallbackLog( null, name ); } else { paxLogger = m_paxLogging.getLogger( name, LOG4J_FQCN ); } ...
java
public static Logger getLogger( String name ) { PaxLogger paxLogger; if( m_paxLogging == null ) { paxLogger = FallbackLogFactory.createFallbackLog( null, name ); } else { paxLogger = m_paxLogging.getLogger( name, LOG4J_FQCN ); } ...
[ "public", "static", "Logger", "getLogger", "(", "String", "name", ")", "{", "PaxLogger", "paxLogger", ";", "if", "(", "m_paxLogging", "==", "null", ")", "{", "paxLogger", "=", "FallbackLogFactory", ".", "createFallbackLog", "(", "null", ",", "name", ")", ";"...
Retrieve a logger by name. If the named logger already exists, then the existing instance will be reutrned. Otherwise, a new instance is created. <p>By default, loggers do not have a set level but inherit it from their ancestors. This is one of the central features of log4j. </p> @param name The name of the logger to...
[ "Retrieve", "a", "logger", "by", "name", ".", "If", "the", "named", "logger", "already", "exists", "then", "the", "existing", "instance", "will", "be", "reutrned", ".", "Otherwise", "a", "new", "instance", "is", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/log4j/Logger.java#L121-L135
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/UDPAppender.java
UDPAppender.cleanUp
public void cleanUp() { if (outSocket != null) { try { outSocket.close(); } catch (Exception e) { LogLog.error("Could not close outSocket.", e); } outSocket = null; } }
java
public void cleanUp() { if (outSocket != null) { try { outSocket.close(); } catch (Exception e) { LogLog.error("Could not close outSocket.", e); } outSocket = null; } }
[ "public", "void", "cleanUp", "(", ")", "{", "if", "(", "outSocket", "!=", "null", ")", "{", "try", "{", "outSocket", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LogLog", ".", "error", "(", "\"Could not close outSocket.\...
Close the UDP Socket and release the underlying connector thread if it has been created
[ "Close", "the", "UDP", "Socket", "and", "release", "the", "underlying", "connector", "thread", "if", "it", "has", "been", "created" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/UDPAppender.java#L176-L186
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java
XMLSocketReceiver.doShutdown
private synchronized void doShutdown() { active = false; getLogger().debug("{} doShutdown called", getName()); // close the server socket closeServerSocket(); // close all of the accepted sockets closeAllAcceptedSockets(); if (advertiseViaMulticastDNS) { zeroConf....
java
private synchronized void doShutdown() { active = false; getLogger().debug("{} doShutdown called", getName()); // close the server socket closeServerSocket(); // close all of the accepted sockets closeAllAcceptedSockets(); if (advertiseViaMulticastDNS) { zeroConf....
[ "private", "synchronized", "void", "doShutdown", "(", ")", "{", "active", "=", "false", ";", "getLogger", "(", ")", ".", "debug", "(", "\"{} doShutdown called\"", ",", "getName", "(", ")", ")", ";", "// close the server socket", "closeServerSocket", "(", ")", ...
Does the actual shutting down by closing the server socket and any connected sockets that have been created.
[ "Does", "the", "actual", "shutting", "down", "by", "closing", "the", "server", "socket", "and", "any", "connected", "sockets", "that", "have", "been", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java#L196-L210
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java
XMLSocketReceiver.closeServerSocket
private void closeServerSocket() { getLogger().debug("{} closing server socket", getName()); try { if (serverSocket != null) { serverSocket.close(); } } catch (Exception e) { // ignore for now } serverSocket = null; }
java
private void closeServerSocket() { getLogger().debug("{} closing server socket", getName()); try { if (serverSocket != null) { serverSocket.close(); } } catch (Exception e) { // ignore for now } serverSocket = null; }
[ "private", "void", "closeServerSocket", "(", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"{} closing server socket\"", ",", "getName", "(", ")", ")", ";", "try", "{", "if", "(", "serverSocket", "!=", "null", ")", "{", "serverSocket", ".", "close"...
Closes the server socket, if created.
[ "Closes", "the", "server", "socket", "if", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java#L215-L227
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.findIndex
int findIndex(final Job job) { int size = jobList.size(); boolean found = false; int i = 0; for (; i < size; i++) { ScheduledJobEntry se = (ScheduledJobEntry) jobList.get(i); if (se.job == job) { found = true; break; } ...
java
int findIndex(final Job job) { int size = jobList.size(); boolean found = false; int i = 0; for (; i < size; i++) { ScheduledJobEntry se = (ScheduledJobEntry) jobList.get(i); if (se.job == job) { found = true; break; } ...
[ "int", "findIndex", "(", "final", "Job", "job", ")", "{", "int", "size", "=", "jobList", ".", "size", "(", ")", ";", "boolean", "found", "=", "false", ";", "int", "i", "=", "0", ";", "for", "(", ";", "i", "<", "size", ";", "i", "++", ")", "{"...
Find the index of a given job. @param job job @return -1 if the job could not be found.
[ "Find", "the", "index", "of", "a", "given", "job", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L57-L74
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.delete
public synchronized boolean delete(final Job job) { // if already shutdown in the process of shutdown, there is no // need to remove Jobs as they will never be executed. if (shutdown) { return false; } int i = findIndex(job); if (i != -1) { Schedul...
java
public synchronized boolean delete(final Job job) { // if already shutdown in the process of shutdown, there is no // need to remove Jobs as they will never be executed. if (shutdown) { return false; } int i = findIndex(job); if (i != -1) { Schedul...
[ "public", "synchronized", "boolean", "delete", "(", "final", "Job", "job", ")", "{", "// if already shutdown in the process of shutdown, there is no", "// need to remove Jobs as they will never be executed.", "if", "(", "shutdown", ")", "{", "return", "false", ";", "}", "in...
Delete the given job. @param job job. @return true if the job could be deleted, and false if the job could not be found or if the Scheduler is about to shutdown in which case deletions are not permitted.
[ "Delete", "the", "given", "job", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L83-L104
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.run
public synchronized void run() { while (!shutdown) { if (jobList.isEmpty()) { linger(); } else { ScheduledJobEntry sje = (ScheduledJobEntry) jobList.get(0); long now = System.currentTimeMillis(); if (now >= sje.desiredExecut...
java
public synchronized void run() { while (!shutdown) { if (jobList.isEmpty()) { linger(); } else { ScheduledJobEntry sje = (ScheduledJobEntry) jobList.get(0); long now = System.currentTimeMillis(); if (now >= sje.desiredExecut...
[ "public", "synchronized", "void", "run", "(", ")", "{", "while", "(", "!", "shutdown", ")", "{", "if", "(", "jobList", ".", "isEmpty", "(", ")", ")", "{", "linger", "(", ")", ";", "}", "else", "{", "ScheduledJobEntry", "sje", "=", "(", "ScheduledJobE...
Run scheduler.
[ "Run", "scheduler", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L200-L223
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.executeInABox
void executeInABox(final Job job) { try { job.execute(); } catch (Exception e) { System.err.println("The execution of the job threw an exception"); e.printStackTrace(System.err); } }
java
void executeInABox(final Job job) { try { job.execute(); } catch (Exception e) { System.err.println("The execution of the job threw an exception"); e.printStackTrace(System.err); } }
[ "void", "executeInABox", "(", "final", "Job", "job", ")", "{", "try", "{", "job", ".", "execute", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"The execution of the job threw an exception\"", ")...
We do not want a single failure to affect the whole scheduler. @param job job to execute.
[ "We", "do", "not", "want", "a", "single", "failure", "to", "affect", "the", "whole", "scheduler", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L229-L236
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.process
protected void process(BufferedReader bufferedReader) throws IOException { Matcher eventMatcher; Matcher exceptionMatcher; String line; while ((line = bufferedReader.readLine()) != null) { //skip empty line entries eventMatcher = regexpPattern.matcher(line); ...
java
protected void process(BufferedReader bufferedReader) throws IOException { Matcher eventMatcher; Matcher exceptionMatcher; String line; while ((line = bufferedReader.readLine()) != null) { //skip empty line entries eventMatcher = regexpPattern.matcher(line); ...
[ "protected", "void", "process", "(", "BufferedReader", "bufferedReader", ")", "throws", "IOException", "{", "Matcher", "eventMatcher", ";", "Matcher", "exceptionMatcher", ";", "String", "line", ";", "while", "(", "(", "line", "=", "bufferedReader", ".", "readLine"...
Read, parse and optionally tail the log file, converting entries into logging events. A runtimeException is thrown if the logFormat pattern is malformed. @param bufferedReader @throws IOException
[ "Read", "parse", "and", "optionally", "tail", "the", "log", "file", "converting", "entries", "into", "logging", "events", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L479-L534
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.passesExpression
private boolean passesExpression(LoggingEvent event) { if (event != null) { if (expressionRule != null) { return (expressionRule.evaluate(event, null)); } } return true; }
java
private boolean passesExpression(LoggingEvent event) { if (event != null) { if (expressionRule != null) { return (expressionRule.evaluate(event, null)); } } return true; }
[ "private", "boolean", "passesExpression", "(", "LoggingEvent", "event", ")", "{", "if", "(", "event", "!=", "null", ")", "{", "if", "(", "expressionRule", "!=", "null", ")", "{", "return", "(", "expressionRule", ".", "evaluate", "(", "event", ",", "null", ...
Helper method that supports the evaluation of the expression @param event @return true if expression isn't set, or the result of the evaluation otherwise
[ "Helper", "method", "that", "supports", "the", "evaluation", "of", "the", "expression" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L546-L553
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.convertTimestamp
private String convertTimestamp() { //some locales (for example, French) generate timestamp text with characters not included in \w - // now using \S (all non-whitespace characters) instead of /w String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+"); //make sure dots...
java
private String convertTimestamp() { //some locales (for example, French) generate timestamp text with characters not included in \w - // now using \S (all non-whitespace characters) instead of /w String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+"); //make sure dots...
[ "private", "String", "convertTimestamp", "(", ")", "{", "//some locales (for example, French) generate timestamp text with characters not included in \\w -", "// now using \\S (all non-whitespace characters) instead of /w ", "String", "result", "=", "timestampFormat", ".", "replaceAll", ...
Helper method that will convert timestamp format to a pattern @return string
[ "Helper", "method", "that", "will", "convert", "timestamp", "format", "to", "a", "pattern" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L582-L589
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.replaceMetaChars
private String replaceMetaChars(String input) { //escape backslash first since that character is used to escape the remaining meta chars input = input.replaceAll("\\\\", "\\\\\\"); //don't escape star - it's used as the wildcard input = input.replaceAll(Pattern.quote("]"), "\\\\]"); input = input.r...
java
private String replaceMetaChars(String input) { //escape backslash first since that character is used to escape the remaining meta chars input = input.replaceAll("\\\\", "\\\\\\"); //don't escape star - it's used as the wildcard input = input.replaceAll(Pattern.quote("]"), "\\\\]"); input = input.r...
[ "private", "String", "replaceMetaChars", "(", "String", "input", ")", "{", "//escape backslash first since that character is used to escape the remaining meta chars", "input", "=", "input", ".", "replaceAll", "(", "\"\\\\\\\\\"", ",", "\"\\\\\\\\\\\\\"", ")", ";", "//don't es...
Some perl5 characters may occur in the log file format. Escape these characters to prevent parsing errors. @param input @return string
[ "Some", "perl5", "characters", "may", "occur", "in", "the", "log", "file", "format", ".", "Escape", "these", "characters", "to", "prevent", "parsing", "errors", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L811-L831
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.shutdown
public void shutdown() { getLogger().info(getPath() + " shutdown"); active = false; try { if (reader != null) { reader.close(); reader = null; } } catch (IOException ioe) { ioe.printStackTrace(); } }
java
public void shutdown() { getLogger().info(getPath() + " shutdown"); active = false; try { if (reader != null) { reader.close(); reader = null; } } catch (IOException ioe) { ioe.printStackTrace(); } }
[ "public", "void", "shutdown", "(", ")", "{", "getLogger", "(", ")", ".", "info", "(", "getPath", "(", ")", "+", "\" shutdown\"", ")", ";", "active", "=", "false", ";", "try", "{", "if", "(", "reader", "!=", "null", ")", "{", "reader", ".", "close",...
Close the reader.
[ "Close", "the", "reader", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L966-L977
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.activateOptions
public void activateOptions() { getLogger().info("activateOptions"); active = true; Runnable runnable = new Runnable() { public void run() { initialize(); while (reader == null) { getLogger().info("attempting to load file: " + getFileURL()); try { ...
java
public void activateOptions() { getLogger().info("activateOptions"); active = true; Runnable runnable = new Runnable() { public void run() { initialize(); while (reader == null) { getLogger().info("attempting to load file: " + getFileURL()); try { ...
[ "public", "void", "activateOptions", "(", ")", "{", "getLogger", "(", ")", ".", "info", "(", "\"activateOptions\"", ")", ";", "active", "=", "true", ";", "Runnable", "runnable", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", ...
Read and process the log file.
[ "Read", "and", "process", "the", "log", "file", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L982-L1032
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/AbstractRule.java
AbstractRule.firePropertyChange
protected void firePropertyChange( final String propertyName, final Object oldVal, final Object newVal) { propertySupport.firePropertyChange(propertyName, oldVal, newVal); }
java
protected void firePropertyChange( final String propertyName, final Object oldVal, final Object newVal) { propertySupport.firePropertyChange(propertyName, oldVal, newVal); }
[ "protected", "void", "firePropertyChange", "(", "final", "String", "propertyName", ",", "final", "Object", "oldVal", ",", "final", "Object", "newVal", ")", "{", "propertySupport", ".", "firePropertyChange", "(", "propertyName", ",", "oldVal", ",", "newVal", ")", ...
Send property change notification to attached listeners. @param propertyName property name. @param oldVal old value. @param newVal new value.
[ "Send", "property", "change", "notification", "to", "attached", "listeners", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/AbstractRule.java#L66-L71
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
TimeBasedRollingPolicy.activateOptions
public void activateOptions() { super.activateOptions(); PatternConverter dtc = getDatePatternConverter(); if (dtc == null) { throw new IllegalStateException( "FileNamePattern [" + getFileNamePattern() + "] does not contain a valid date format specifier"); } long n = System....
java
public void activateOptions() { super.activateOptions(); PatternConverter dtc = getDatePatternConverter(); if (dtc == null) { throw new IllegalStateException( "FileNamePattern [" + getFileNamePattern() + "] does not contain a valid date format specifier"); } long n = System....
[ "public", "void", "activateOptions", "(", ")", "{", "super", ".", "activateOptions", "(", ")", ";", "PatternConverter", "dtc", "=", "getDatePatternConverter", "(", ")", ";", "if", "(", "dtc", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "...
Prepares instance of use.
[ "Prepares", "instance", "of", "use", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java#L166-L189
train
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java
StatusConsoleListener.log
@Override public void log(final StatusData data) { if (!filtered(data)) { stream.println(data.getFormattedStatus()); } }
java
@Override public void log(final StatusData data) { if (!filtered(data)) { stream.println(data.getFormattedStatus()); } }
[ "@", "Override", "public", "void", "log", "(", "final", "StatusData", "data", ")", "{", "if", "(", "!", "filtered", "(", "data", ")", ")", "{", "stream", ".", "println", "(", "data", ".", "getFormattedStatus", "(", ")", ")", ";", "}", "}" ]
Writes status messages to the console. @param data The StatusData.
[ "Writes", "status", "messages", "to", "the", "console", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java#L78-L83
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java
FileRenameAction.execute
public static boolean execute( final File source, final File destination, boolean renameEmptyFiles) { if (renameEmptyFiles || (source.length() > 0)) { return source.renameTo(destination); } return source.delete(); }
java
public static boolean execute( final File source, final File destination, boolean renameEmptyFiles) { if (renameEmptyFiles || (source.length() > 0)) { return source.renameTo(destination); } return source.delete(); }
[ "public", "static", "boolean", "execute", "(", "final", "File", "source", ",", "final", "File", "destination", ",", "boolean", "renameEmptyFiles", ")", "{", "if", "(", "renameEmptyFiles", "||", "(", "source", ".", "length", "(", ")", ">", "0", ")", ")", ...
Rename file. @param source current file name. @param destination new file name. @param renameEmptyFiles if true, rename file even if empty, otherwise delete empty files. @return true if successfully renamed.
[ "Rename", "file", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java#L74-L81
train
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/ExistsRule.java
ExistsRule.getRule
public static Rule getRule(final Stack stack) { if (stack.size() < 1) { throw new IllegalArgumentException( "Invalid EXISTS rule - expected one parameter but received " + stack.size()); } return new ExistsRule(stack.pop().toString()); }
java
public static Rule getRule(final Stack stack) { if (stack.size() < 1) { throw new IllegalArgumentException( "Invalid EXISTS rule - expected one parameter but received " + stack.size()); } return new ExistsRule(stack.pop().toString()); }
[ "public", "static", "Rule", "getRule", "(", "final", "Stack", "stack", ")", "{", "if", "(", "stack", ".", "size", "(", ")", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid EXISTS rule - expected one parameter but received \"", "+", ...
Create an instance of ExistsRule using the top name on the stack. @param stack stack @return instance of ExistsRule.
[ "Create", "an", "instance", "of", "ExistsRule", "using", "the", "top", "name", "on", "the", "stack", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/ExistsRule.java#L78-L86
train