id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
36,200
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.initCf
public void initCf(UUID cfId, String cfName, boolean loadSSTables) { ColumnFamilyStore cfs = columnFamilyStores.get(cfId); if (cfs == null) { // CFS being created for the first time, either on server startup or new CF being added. // We don't worry about races here; ...
java
public void initCf(UUID cfId, String cfName, boolean loadSSTables) { ColumnFamilyStore cfs = columnFamilyStores.get(cfId); if (cfs == null) { // CFS being created for the first time, either on server startup or new CF being added. // We don't worry about races here; ...
[ "public", "void", "initCf", "(", "UUID", "cfId", ",", "String", "cfName", ",", "boolean", "loadSSTables", ")", "{", "ColumnFamilyStore", "cfs", "=", "columnFamilyStores", ".", "get", "(", "cfId", ")", ";", "if", "(", "cfs", "==", "null", ")", "{", "// CF...
adds a cf to internal structures, ends up creating disk files).
[ "adds", "a", "cf", "to", "internal", "structures", "ends", "up", "creating", "disk", "files", ")", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L315-L337
36,201
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.apply
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes) { try (OpOrder.Group opGroup = writeOrder.start()) { // write the mutation to the commitlog and memtables ReplayPosition replayPosition = null; if (writeCommitLog) { ...
java
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes) { try (OpOrder.Group opGroup = writeOrder.start()) { // write the mutation to the commitlog and memtables ReplayPosition replayPosition = null; if (writeCommitLog) { ...
[ "public", "void", "apply", "(", "Mutation", "mutation", ",", "boolean", "writeCommitLog", ",", "boolean", "updateIndexes", ")", "{", "try", "(", "OpOrder", ".", "Group", "opGroup", "=", "writeOrder", ".", "start", "(", ")", ")", "{", "// write the mutation to ...
This method appends a row to the global CommitLog, then updates memtables and indexes. @param mutation the row to write. Must not be modified after calling apply, since commitlog append may happen concurrently, depending on the CL Executor type. @param writeCommitLog false to disable commitlog append entirely @...
[ "This", "method", "appends", "a", "row", "to", "the", "global", "CommitLog", "then", "updates", "memtables", "and", "indexes", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L359-L388
36,202
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java
AbstractFunction.factory
public static Function.Factory factory(final Function fun) { return new Function.Factory() { public Function create(String ksName, String cfName) { return fun; } }; }
java
public static Function.Factory factory(final Function fun) { return new Function.Factory() { public Function create(String ksName, String cfName) { return fun; } }; }
[ "public", "static", "Function", ".", "Factory", "factory", "(", "final", "Function", "fun", ")", "{", "return", "new", "Function", ".", "Factory", "(", ")", "{", "public", "Function", "create", "(", "String", "ksName", ",", "String", "cfName", ")", "{", ...
Creates a trivial factory that always return the provided function.
[ "Creates", "a", "trivial", "factory", "that", "always", "return", "the", "provided", "function", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java#L62-L71
36,203
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.initSocket
private void initSocket() { socket = new Socket(); try { socket.setSoLinger(false, 0); socket.setTcpNoDelay(true); socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.error("Could not configure socket.", sx); } }
java
private void initSocket() { socket = new Socket(); try { socket.setSoLinger(false, 0); socket.setTcpNoDelay(true); socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.error("Could not configure socket.", sx); } }
[ "private", "void", "initSocket", "(", ")", "{", "socket", "=", "new", "Socket", "(", ")", ";", "try", "{", "socket", ".", "setSoLinger", "(", "false", ",", "0", ")", ";", "socket", ".", "setTcpNoDelay", "(", "true", ")", ";", "socket", ".", "setSoTim...
Initializes the socket object
[ "Initializes", "the", "socket", "object" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L118-L127
36,204
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.setTimeout
public void setTimeout(int timeout) { this.timeout = timeout; try { socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.warn("Could not set socket timeout.", sx); } }
java
public void setTimeout(int timeout) { this.timeout = timeout; try { socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.warn("Could not set socket timeout.", sx); } }
[ "public", "void", "setTimeout", "(", "int", "timeout", ")", "{", "this", ".", "timeout", "=", "timeout", ";", "try", "{", "socket", ".", "setSoTimeout", "(", "timeout", ")", ";", "}", "catch", "(", "SocketException", "sx", ")", "{", "LOGGER", ".", "war...
Sets the socket timeout @param timeout Milliseconds timeout
[ "Sets", "the", "socket", "timeout" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L134-L141
36,205
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.open
public void open() throws TTransportException { if (isOpen()) { throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected."); } if (host.length() == 0) { throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host."); } if (port <= ...
java
public void open() throws TTransportException { if (isOpen()) { throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected."); } if (host.length() == 0) { throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host."); } if (port <= ...
[ "public", "void", "open", "(", ")", "throws", "TTransportException", "{", "if", "(", "isOpen", "(", ")", ")", "{", "throw", "new", "TTransportException", "(", "TTransportException", ".", "ALREADY_OPEN", ",", "\"Socket already connected.\"", ")", ";", "}", "if", ...
Connects the socket, creating a new socket object if necessary.
[ "Connects", "the", "socket", "creating", "a", "new", "socket", "object", "if", "necessary", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L166-L190
36,206
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java
AbstractCompositeType.split
public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWit...
java
public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWit...
[ "public", "ByteBuffer", "[", "]", "split", "(", "ByteBuffer", "name", ")", "{", "List", "<", "ByteBuffer", ">", "l", "=", "new", "ArrayList", "<", "ByteBuffer", ">", "(", ")", ";", "ByteBuffer", "bb", "=", "name", ".", "duplicate", "(", ")", ";", "re...
Split a composite column names into it's components.
[ "Split", "a", "composite", "column", "names", "into", "it", "s", "components", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java#L90-L103
36,207
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cache/ConcurrentLinkedHashCache.java
ConcurrentLinkedHashCache.create
public static <K extends IMeasurableMemory, V extends IMeasurableMemory> ConcurrentLinkedHashCache<K, V> create(long weightedCapacity, EntryWeigher<K, V> entryWeiger) { ConcurrentLinkedHashMap<K, V> map = new ConcurrentLinkedHashMap.Builder<K, V>() .weigher(entryW...
java
public static <K extends IMeasurableMemory, V extends IMeasurableMemory> ConcurrentLinkedHashCache<K, V> create(long weightedCapacity, EntryWeigher<K, V> entryWeiger) { ConcurrentLinkedHashMap<K, V> map = new ConcurrentLinkedHashMap.Builder<K, V>() .weigher(entryW...
[ "public", "static", "<", "K", "extends", "IMeasurableMemory", ",", "V", "extends", "IMeasurableMemory", ">", "ConcurrentLinkedHashCache", "<", "K", ",", "V", ">", "create", "(", "long", "weightedCapacity", ",", "EntryWeigher", "<", "K", ",", "V", ">", "entryWe...
Initialize a cache with initial capacity with weightedCapacity
[ "Initialize", "a", "cache", "with", "initial", "capacity", "with", "weightedCapacity" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cache/ConcurrentLinkedHashCache.java#L40-L49
36,208
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/StreamingRepairTask.java
StreamingRepairTask.onSuccess
public void onSuccess(StreamState state) { logger.info(String.format("[repair #%s] streaming task succeed, returning response to %s", desc.sessionId, request.initiator)); MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, true).createMessage(), request.initiator)...
java
public void onSuccess(StreamState state) { logger.info(String.format("[repair #%s] streaming task succeed, returning response to %s", desc.sessionId, request.initiator)); MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, true).createMessage(), request.initiator)...
[ "public", "void", "onSuccess", "(", "StreamState", "state", ")", "{", "logger", ".", "info", "(", "String", ".", "format", "(", "\"[repair #%s] streaming task succeed, returning response to %s\"", ",", "desc", ".", "sessionId", ",", "request", ".", "initiator", ")",...
If we succeeded on both stream in and out, reply back to the initiator.
[ "If", "we", "succeeded", "on", "both", "stream", "in", "and", "out", "reply", "back", "to", "the", "initiator", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/StreamingRepairTask.java#L94-L98
36,209
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/StreamingRepairTask.java
StreamingRepairTask.onFailure
public void onFailure(Throwable t) { MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, false).createMessage(), request.initiator); }
java
public void onFailure(Throwable t) { MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, false).createMessage(), request.initiator); }
[ "public", "void", "onFailure", "(", "Throwable", "t", ")", "{", "MessagingService", ".", "instance", "(", ")", ".", "sendOneWay", "(", "new", "SyncComplete", "(", "desc", ",", "request", ".", "src", ",", "request", ".", "dst", ",", "false", ")", ".", "...
If we failed on either stream in or out, reply fail to the initiator.
[ "If", "we", "failed", "on", "either", "stream", "in", "or", "out", "reply", "fail", "to", "the", "initiator", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/StreamingRepairTask.java#L103-L106
36,210
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.createLocal
public ByteBuffer createLocal(long count) { ContextState state = ContextState.allocate(0, 1, 0); state.writeLocal(CounterId.getLocalId(), 1L, count); return state.context; }
java
public ByteBuffer createLocal(long count) { ContextState state = ContextState.allocate(0, 1, 0); state.writeLocal(CounterId.getLocalId(), 1L, count); return state.context; }
[ "public", "ByteBuffer", "createLocal", "(", "long", "count", ")", "{", "ContextState", "state", "=", "ContextState", ".", "allocate", "(", "0", ",", "1", ",", "0", ")", ";", "state", ".", "writeLocal", "(", "CounterId", ".", "getLocalId", "(", ")", ",", ...
Creates a counter context with a single local shard. For use by tests of compatibility with pre-2.1 counters only.
[ "Creates", "a", "counter", "context", "with", "a", "single", "local", "shard", ".", "For", "use", "by", "tests", "of", "compatibility", "with", "pre", "-", "2", ".", "1", "counters", "only", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L116-L121
36,211
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.createRemote
public ByteBuffer createRemote(CounterId id, long clock, long count) { ContextState state = ContextState.allocate(0, 0, 1); state.writeRemote(id, clock, count); return state.context; }
java
public ByteBuffer createRemote(CounterId id, long clock, long count) { ContextState state = ContextState.allocate(0, 0, 1); state.writeRemote(id, clock, count); return state.context; }
[ "public", "ByteBuffer", "createRemote", "(", "CounterId", "id", ",", "long", "clock", ",", "long", "count", ")", "{", "ContextState", "state", "=", "ContextState", ".", "allocate", "(", "0", ",", "0", ",", "1", ")", ";", "state", ".", "writeRemote", "(",...
Creates a counter context with a single remote shard. For use by tests of compatibility with pre-2.1 counters only.
[ "Creates", "a", "counter", "context", "with", "a", "single", "remote", "shard", ".", "For", "use", "by", "tests", "of", "compatibility", "with", "pre", "-", "2", ".", "1", "counters", "only", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L127-L132
36,212
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.diff
public Relationship diff(ByteBuffer left, ByteBuffer right) { Relationship relationship = Relationship.EQUAL; ContextState leftState = ContextState.wrap(left); ContextState rightState = ContextState.wrap(right); while (leftState.hasRemaining() && rightState.hasRemaining()) {...
java
public Relationship diff(ByteBuffer left, ByteBuffer right) { Relationship relationship = Relationship.EQUAL; ContextState leftState = ContextState.wrap(left); ContextState rightState = ContextState.wrap(right); while (leftState.hasRemaining() && rightState.hasRemaining()) {...
[ "public", "Relationship", "diff", "(", "ByteBuffer", "left", ",", "ByteBuffer", "right", ")", "{", "Relationship", "relationship", "=", "Relationship", ".", "EQUAL", ";", "ContextState", "leftState", "=", "ContextState", ".", "wrap", "(", "left", ")", ";", "Co...
Determine the count relationship between two contexts. EQUAL: Equal set of nodes and every count is equal. GREATER_THAN: Superset of nodes and every count is equal or greater than its corollary. LESS_THAN: Subset of nodes and every count is equal or less than its corollary. DISJOINT: Node sets are not eq...
[ "Determine", "the", "count", "relationship", "between", "two", "contexts", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L158-L249
36,213
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.total
public long total(ByteBuffer context) { long total = 0L; // we could use a ContextState but it is easy enough that we avoid the object creation for (int offset = context.position() + headerLength(context); offset < context.limit(); offset += STEP_LENGTH) total += context.getLong(...
java
public long total(ByteBuffer context) { long total = 0L; // we could use a ContextState but it is easy enough that we avoid the object creation for (int offset = context.position() + headerLength(context); offset < context.limit(); offset += STEP_LENGTH) total += context.getLong(...
[ "public", "long", "total", "(", "ByteBuffer", "context", ")", "{", "long", "total", "=", "0L", ";", "// we could use a ContextState but it is easy enough that we avoid the object creation", "for", "(", "int", "offset", "=", "context", ".", "position", "(", ")", "+", ...
Returns the aggregated count across all counter ids. @param context a counter context @return the aggregated count represented by {@code context}
[ "Returns", "the", "aggregated", "count", "across", "all", "counter", "ids", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L533-L540
36,214
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Resources.java
Resources.chain
public static List<? extends IResource> chain(IResource resource) { List<IResource> chain = new ArrayList<IResource>(); while (true) { chain.add(resource); if (!resource.hasParent()) break; resource = resource.getParent(); } ret...
java
public static List<? extends IResource> chain(IResource resource) { List<IResource> chain = new ArrayList<IResource>(); while (true) { chain.add(resource); if (!resource.hasParent()) break; resource = resource.getParent(); } ret...
[ "public", "static", "List", "<", "?", "extends", "IResource", ">", "chain", "(", "IResource", "resource", ")", "{", "List", "<", "IResource", ">", "chain", "=", "new", "ArrayList", "<", "IResource", ">", "(", ")", ";", "while", "(", "true", ")", "{", ...
Construct a chain of resource parents starting with the resource and ending with the root. @param resource The staring point. @return list of resource in the chain form start to the root.
[ "Construct", "a", "chain", "of", "resource", "parents", "starting", "with", "the", "resource", "and", "ending", "with", "the", "root", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Resources.java#L33-L44
36,215
Stratio/stratio-cassandra
src/java/org/apache/cassandra/gms/FailureDetector.java
FailureDetector.dumpInterArrivalTimes
public void dumpInterArrivalTimes() { File file = FileUtils.createTempFile("failuredetector-", ".dat"); OutputStream os = null; try { os = new BufferedOutputStream(new FileOutputStream(file, true)); os.write(toString().getBytes()); } catch (IO...
java
public void dumpInterArrivalTimes() { File file = FileUtils.createTempFile("failuredetector-", ".dat"); OutputStream os = null; try { os = new BufferedOutputStream(new FileOutputStream(file, true)); os.write(toString().getBytes()); } catch (IO...
[ "public", "void", "dumpInterArrivalTimes", "(", ")", "{", "File", "file", "=", "FileUtils", ".", "createTempFile", "(", "\"failuredetector-\"", ",", "\".dat\"", ")", ";", "OutputStream", "os", "=", "null", ";", "try", "{", "os", "=", "new", "BufferedOutputStre...
Dump the inter arrival times for examination if necessary.
[ "Dump", "the", "inter", "arrival", "times", "for", "examination", "if", "necessary", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/gms/FailureDetector.java#L160-L178
36,216
Stratio/stratio-cassandra
src/java/org/apache/cassandra/gms/FailureDetector.java
ArrivalWindow.phi
double phi(long tnow) { assert arrivalIntervals.size() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; return t / mean(); }
java
double phi(long tnow) { assert arrivalIntervals.size() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; return t / mean(); }
[ "double", "phi", "(", "long", "tnow", ")", "{", "assert", "arrivalIntervals", ".", "size", "(", ")", ">", "0", "&&", "tLast", ">", "0", ";", "// should not be called before any samples arrive", "long", "t", "=", "tnow", "-", "tLast", ";", "return", "t", "/...
see CASSANDRA-2597 for an explanation of the math at work here.
[ "see", "CASSANDRA", "-", "2597", "for", "an", "explanation", "of", "the", "math", "at", "work", "here", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/gms/FailureDetector.java#L356-L361
36,217
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/obs/BitUtil.java
BitUtil.pop
public static int pop(long x) { /* Hacker's Delight 32 bit pop function: * http://www.hackersdelight.org/HDcode/newCode/pop_arrayHS.cc * int pop(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0F0F0F0F; x = x + (x >> 8);...
java
public static int pop(long x) { /* Hacker's Delight 32 bit pop function: * http://www.hackersdelight.org/HDcode/newCode/pop_arrayHS.cc * int pop(unsigned x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0F0F0F0F; x = x + (x >> 8);...
[ "public", "static", "int", "pop", "(", "long", "x", ")", "{", "/* Hacker's Delight 32 bit pop function:\n * http://www.hackersdelight.org/HDcode/newCode/pop_arrayHS.cc\n *\n int pop(unsigned x) {\n x = x - ((x >> 1) & 0x55555555);\n x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n ...
Returns the number of bits set in the long
[ "Returns", "the", "number", "of", "bits", "set", "in", "the", "long" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/obs/BitUtil.java#L26-L48
36,218
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/obs/BitUtil.java
BitUtil.ntz
public static int ntz(long val) { // A full binary search to determine the low byte was slower than // a linear search for nextSetBit(). This is most likely because // the implementation of nextSetBit() shifts bits to the right, increasing // the probability that the first non-zero byte is in the rhs. ...
java
public static int ntz(long val) { // A full binary search to determine the low byte was slower than // a linear search for nextSetBit(). This is most likely because // the implementation of nextSetBit() shifts bits to the right, increasing // the probability that the first non-zero byte is in the rhs. ...
[ "public", "static", "int", "ntz", "(", "long", "val", ")", "{", "// A full binary search to determine the low byte was slower than", "// a linear search for nextSetBit(). This is most likely because", "// the implementation of nextSetBit() shifts bits to the right, increasing", "// the prob...
Returns number of trailing zeros in a 64 bit long value.
[ "Returns", "number", "of", "trailing", "zeros", "in", "a", "64", "bit", "long", "value", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/obs/BitUtil.java#L691-L728
36,219
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/obs/BitUtil.java
BitUtil.ntz
public static int ntz(int val) { // This implementation does a single binary search at the top level only. // In addition, the case of a non-zero first byte is checked for first // because it is the most common in dense bit arrays. int lowByte = val & 0xff; if (lowByte != 0) return ntzTable[lowByte...
java
public static int ntz(int val) { // This implementation does a single binary search at the top level only. // In addition, the case of a non-zero first byte is checked for first // because it is the most common in dense bit arrays. int lowByte = val & 0xff; if (lowByte != 0) return ntzTable[lowByte...
[ "public", "static", "int", "ntz", "(", "int", "val", ")", "{", "// This implementation does a single binary search at the top level only.", "// In addition, the case of a non-zero first byte is checked for first", "// because it is the most common in dense bit arrays.", "int", "lowByte", ...
Returns number of trailing zeros in a 32 bit int value.
[ "Returns", "number", "of", "trailing", "zeros", "in", "a", "32", "bit", "int", "value", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/obs/BitUtil.java#L731-L745
36,220
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/AbstractBounds.java
AbstractBounds.intersects
public boolean intersects(Iterable<Range<T>> ranges) { for (Range<T> range2 : ranges) { if (range2.intersects(this)) return true; } return false; }
java
public boolean intersects(Iterable<Range<T>> ranges) { for (Range<T> range2 : ranges) { if (range2.intersects(this)) return true; } return false; }
[ "public", "boolean", "intersects", "(", "Iterable", "<", "Range", "<", "T", ">", ">", "ranges", ")", "{", "for", "(", "Range", "<", "T", ">", "range2", ":", "ranges", ")", "{", "if", "(", "range2", ".", "intersects", "(", "this", ")", ")", "return"...
return true if @param range intersects any of the given @param ranges
[ "return", "true", "if" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/AbstractBounds.java#L81-L89
36,221
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/StressAction.java
StressAction.warmup
private void warmup(OpDistributionFactory operations) { // warmup - do 50k iterations; by default hotspot compiles methods after 10k invocations PrintStream warmupOutput = new PrintStream(new OutputStream() { @Override public void write(int b) throws IOException { } } ); int iterations = 500...
java
private void warmup(OpDistributionFactory operations) { // warmup - do 50k iterations; by default hotspot compiles methods after 10k invocations PrintStream warmupOutput = new PrintStream(new OutputStream() { @Override public void write(int b) throws IOException { } } ); int iterations = 500...
[ "private", "void", "warmup", "(", "OpDistributionFactory", "operations", ")", "{", "// warmup - do 50k iterations; by default hotspot compiles methods after 10k invocations", "PrintStream", "warmupOutput", "=", "new", "PrintStream", "(", "new", "OutputStream", "(", ")", "{", ...
type provided separately to support recursive call for mixed command with each command type it is performing
[ "type", "provided", "separately", "to", "support", "recursive", "call", "for", "mixed", "command", "with", "each", "command", "type", "it", "is", "performing" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/StressAction.java#L86-L105
36,222
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Auth.java
Auth.isSuperuser
public static boolean isSuperuser(String username) { UntypedResultSet result = selectUser(username); return !result.isEmpty() && result.one().getBoolean("super"); }
java
public static boolean isSuperuser(String username) { UntypedResultSet result = selectUser(username); return !result.isEmpty() && result.one().getBoolean("super"); }
[ "public", "static", "boolean", "isSuperuser", "(", "String", "username", ")", "{", "UntypedResultSet", "result", "=", "selectUser", "(", "username", ")", ";", "return", "!", "result", ".", "isEmpty", "(", ")", "&&", "result", ".", "one", "(", ")", ".", "...
Checks if the user is a known superuser. @param username Username to query. @return true is the user is a superuser, false if they aren't or don't exist at all.
[ "Checks", "if", "the", "user", "is", "a", "known", "superuser", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L95-L99
36,223
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Auth.java
Auth.deleteUser
public static void deleteUser(String username) throws RequestExecutionException { QueryProcessor.process(String.format("DELETE FROM %s.%s WHERE name = '%s'", AUTH_KS, USERS_CF, ...
java
public static void deleteUser(String username) throws RequestExecutionException { QueryProcessor.process(String.format("DELETE FROM %s.%s WHERE name = '%s'", AUTH_KS, USERS_CF, ...
[ "public", "static", "void", "deleteUser", "(", "String", "username", ")", "throws", "RequestExecutionException", "{", "QueryProcessor", ".", "process", "(", "String", ".", "format", "(", "\"DELETE FROM %s.%s WHERE name = '%s'\"", ",", "AUTH_KS", ",", "USERS_CF", ",", ...
Deletes the user from AUTH_KS.USERS_CF. @param username Username to delete. @throws RequestExecutionException
[ "Deletes", "the", "user", "from", "AUTH_KS", ".", "USERS_CF", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L124-L131
36,224
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Auth.java
Auth.setup
public static void setup() { if (DatabaseDescriptor.getAuthenticator() instanceof AllowAllAuthenticator) return; setupAuthKeyspace(); setupTable(USERS_CF, USERS_CF_SCHEMA); DatabaseDescriptor.getAuthenticator().setup(); DatabaseDescriptor.getAuthorizer().setup()...
java
public static void setup() { if (DatabaseDescriptor.getAuthenticator() instanceof AllowAllAuthenticator) return; setupAuthKeyspace(); setupTable(USERS_CF, USERS_CF_SCHEMA); DatabaseDescriptor.getAuthenticator().setup(); DatabaseDescriptor.getAuthorizer().setup()...
[ "public", "static", "void", "setup", "(", ")", "{", "if", "(", "DatabaseDescriptor", ".", "getAuthenticator", "(", ")", "instanceof", "AllowAllAuthenticator", ")", "return", ";", "setupAuthKeyspace", "(", ")", ";", "setupTable", "(", "USERS_CF", ",", "USERS_CF_S...
Sets up Authenticator and Authorizer.
[ "Sets", "up", "Authenticator", "and", "Authorizer", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L136-L170
36,225
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Auth.java
Auth.consistencyForUser
private static ConsistencyLevel consistencyForUser(String username) { if (username.equals(DEFAULT_SUPERUSER_NAME)) return ConsistencyLevel.QUORUM; else return ConsistencyLevel.LOCAL_ONE; }
java
private static ConsistencyLevel consistencyForUser(String username) { if (username.equals(DEFAULT_SUPERUSER_NAME)) return ConsistencyLevel.QUORUM; else return ConsistencyLevel.LOCAL_ONE; }
[ "private", "static", "ConsistencyLevel", "consistencyForUser", "(", "String", "username", ")", "{", "if", "(", "username", ".", "equals", "(", "DEFAULT_SUPERUSER_NAME", ")", ")", "return", "ConsistencyLevel", ".", "QUORUM", ";", "else", "return", "ConsistencyLevel",...
Only use QUORUM cl for the default superuser.
[ "Only", "use", "QUORUM", "cl", "for", "the", "default", "superuser", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L173-L179
36,226
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/Auth.java
Auth.setupTable
public static void setupTable(String name, String cql) { if (Schema.instance.getCFMetaData(AUTH_KS, name) == null) { try { CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql); parsed.prepareKeyspace(AUTH_KS); Cr...
java
public static void setupTable(String name, String cql) { if (Schema.instance.getCFMetaData(AUTH_KS, name) == null) { try { CFStatement parsed = (CFStatement)QueryProcessor.parseStatement(cql); parsed.prepareKeyspace(AUTH_KS); Cr...
[ "public", "static", "void", "setupTable", "(", "String", "name", ",", "String", "cql", ")", "{", "if", "(", "Schema", ".", "instance", ".", "getCFMetaData", "(", "AUTH_KS", ",", "name", ")", "==", "null", ")", "{", "try", "{", "CFStatement", "parsed", ...
Set up table from given CREATE TABLE statement under system_auth keyspace, if not already done so. @param name name of the table @param cql CREATE TABLE statement
[ "Set", "up", "table", "from", "given", "CREATE", "TABLE", "statement", "under", "system_auth", "keyspace", "if", "not", "already", "done", "so", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/Auth.java#L203-L221
36,227
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/RangeStreamer.java
RangeStreamer.getAllRangesWithSourcesFor
private Multimap<Range<Token>, InetAddress> getAllRangesWithSourcesFor(String keyspaceName, Collection<Range<Token>> desiredRanges) { AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy(); Multimap<Range<Token>, InetAddress> rangeAddresses = strat.getRangeAddresses...
java
private Multimap<Range<Token>, InetAddress> getAllRangesWithSourcesFor(String keyspaceName, Collection<Range<Token>> desiredRanges) { AbstractReplicationStrategy strat = Keyspace.open(keyspaceName).getReplicationStrategy(); Multimap<Range<Token>, InetAddress> rangeAddresses = strat.getRangeAddresses...
[ "private", "Multimap", "<", "Range", "<", "Token", ">", ",", "InetAddress", ">", "getAllRangesWithSourcesFor", "(", "String", "keyspaceName", ",", "Collection", "<", "Range", "<", "Token", ">", ">", "desiredRanges", ")", "{", "AbstractReplicationStrategy", "strat"...
Get a map of all ranges and their respective sources that are candidates for streaming the given ranges to us. For each range, the list of sources is sorted by proximity relative to the given destAddress.
[ "Get", "a", "map", "of", "all", "ranges", "and", "their", "respective", "sources", "that", "are", "candidates", "for", "streaming", "the", "given", "ranges", "to", "us", ".", "For", "each", "range", "the", "list", "of", "sources", "is", "sorted", "by", "...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/RangeStreamer.java#L165-L188
36,228
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/RangeStreamer.java
RangeStreamer.getAllRangesWithStrictSourcesFor
private Multimap<Range<Token>, InetAddress> getAllRangesWithStrictSourcesFor(String table, Collection<Range<Token>> desiredRanges) { assert tokens != null; AbstractReplicationStrategy strat = Keyspace.open(table).getReplicationStrategy(); //Active ranges TokenMetadata metadataClone...
java
private Multimap<Range<Token>, InetAddress> getAllRangesWithStrictSourcesFor(String table, Collection<Range<Token>> desiredRanges) { assert tokens != null; AbstractReplicationStrategy strat = Keyspace.open(table).getReplicationStrategy(); //Active ranges TokenMetadata metadataClone...
[ "private", "Multimap", "<", "Range", "<", "Token", ">", ",", "InetAddress", ">", "getAllRangesWithStrictSourcesFor", "(", "String", "table", ",", "Collection", "<", "Range", "<", "Token", ">", ">", "desiredRanges", ")", "{", "assert", "tokens", "!=", "null", ...
Get a map of all ranges and the source that will be cleaned up once this bootstrapped node is added for the given ranges. For each range, the list should only contain a single source. This allows us to consistently migrate data without violating consistency.
[ "Get", "a", "map", "of", "all", "ranges", "and", "the", "source", "that", "will", "be", "cleaned", "up", "once", "this", "bootstrapped", "node", "is", "added", "for", "the", "given", "ranges", ".", "For", "each", "range", "the", "list", "should", "only",...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/RangeStreamer.java#L195-L248
36,229
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/RangeStreamer.java
RangeStreamer.toFetch
Multimap<String, Map.Entry<InetAddress, Collection<Range<Token>>>> toFetch() { return toFetch; }
java
Multimap<String, Map.Entry<InetAddress, Collection<Range<Token>>>> toFetch() { return toFetch; }
[ "Multimap", "<", "String", ",", "Map", ".", "Entry", "<", "InetAddress", ",", "Collection", "<", "Range", "<", "Token", ">", ">", ">", ">", "toFetch", "(", ")", "{", "return", "toFetch", ";", "}" ]
For testing purposes
[ "For", "testing", "purposes" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/RangeStreamer.java#L298-L301
36,230
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
CreateColumnFamilyStatement.validate
private void validate(List<ByteBuffer> variables) throws InvalidRequestException { // Ensure that exactly one key has been specified. if (keyValidator.size() < 1) throw new InvalidRequestException("You must specify a PRIMARY KEY"); else if (keyValidator.size() > 1) th...
java
private void validate(List<ByteBuffer> variables) throws InvalidRequestException { // Ensure that exactly one key has been specified. if (keyValidator.size() < 1) throw new InvalidRequestException("You must specify a PRIMARY KEY"); else if (keyValidator.size() > 1) th...
[ "private", "void", "validate", "(", "List", "<", "ByteBuffer", ">", "variables", ")", "throws", "InvalidRequestException", "{", "// Ensure that exactly one key has been specified.", "if", "(", "keyValidator", ".", "size", "(", ")", "<", "1", ")", "throw", "new", "...
Perform validation of parsed params
[ "Perform", "validation", "of", "parsed", "params" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java#L55-L89
36,231
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.recover
public int recover() throws IOException { FilenameFilter unmanagedFilesFilter = new FilenameFilter() { public boolean accept(File dir, String name) { // we used to try to avoid instantiating commitlog (thus creating an empty segment ready for writes) ...
java
public int recover() throws IOException { FilenameFilter unmanagedFilesFilter = new FilenameFilter() { public boolean accept(File dir, String name) { // we used to try to avoid instantiating commitlog (thus creating an empty segment ready for writes) ...
[ "public", "int", "recover", "(", ")", "throws", "IOException", "{", "FilenameFilter", "unmanagedFilesFilter", "=", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "dir", ",", "String", "name", ")", "{", "// we used to try to a...
Perform recovery on commit logs located in the directory specified by the config file. @return the number of mutations replayed
[ "Perform", "recovery", "on", "commit", "logs", "located", "in", "the", "directory", "specified", "by", "the", "config", "file", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L95-L137
36,232
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.recover
public int recover(File... clogs) throws IOException { CommitLogReplayer recovery = new CommitLogReplayer(); recovery.recover(clogs); return recovery.blockForWrites(); }
java
public int recover(File... clogs) throws IOException { CommitLogReplayer recovery = new CommitLogReplayer(); recovery.recover(clogs); return recovery.blockForWrites(); }
[ "public", "int", "recover", "(", "File", "...", "clogs", ")", "throws", "IOException", "{", "CommitLogReplayer", "recovery", "=", "new", "CommitLogReplayer", "(", ")", ";", "recovery", ".", "recover", "(", "clogs", ")", ";", "return", "recovery", ".", "block...
Perform recovery on a list of commit log files. @param clogs the list of commit log files to replay @return the number of mutations replayed
[ "Perform", "recovery", "on", "a", "list", "of", "commit", "log", "files", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L145-L150
36,233
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.sync
public void sync(boolean syncAllSegments) { CommitLogSegment current = allocator.allocatingFrom(); for (CommitLogSegment segment : allocator.getActiveSegments()) { if (!syncAllSegments && segment.id > current.id) return; segment.sync(); } }
java
public void sync(boolean syncAllSegments) { CommitLogSegment current = allocator.allocatingFrom(); for (CommitLogSegment segment : allocator.getActiveSegments()) { if (!syncAllSegments && segment.id > current.id) return; segment.sync(); } }
[ "public", "void", "sync", "(", "boolean", "syncAllSegments", ")", "{", "CommitLogSegment", "current", "=", "allocator", ".", "allocatingFrom", "(", ")", ";", "for", "(", "CommitLogSegment", "segment", ":", "allocator", ".", "getActiveSegments", "(", ")", ")", ...
Forces a disk flush on the commit log files that need it. Blocking.
[ "Forces", "a", "disk", "flush", "on", "the", "commit", "log", "files", "that", "need", "it", ".", "Blocking", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L188-L197
36,234
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.add
public ReplayPosition add(Mutation mutation) { assert mutation != null; long size = Mutation.serializer.serializedSize(mutation, MessagingService.current_version); long totalSize = size + ENTRY_OVERHEAD_SIZE; if (totalSize > MAX_MUTATION_SIZE) { throw new Illega...
java
public ReplayPosition add(Mutation mutation) { assert mutation != null; long size = Mutation.serializer.serializedSize(mutation, MessagingService.current_version); long totalSize = size + ENTRY_OVERHEAD_SIZE; if (totalSize > MAX_MUTATION_SIZE) { throw new Illega...
[ "public", "ReplayPosition", "add", "(", "Mutation", "mutation", ")", "{", "assert", "mutation", "!=", "null", ";", "long", "size", "=", "Mutation", ".", "serializer", ".", "serializedSize", "(", "mutation", ",", "MessagingService", ".", "current_version", ")", ...
Add a Mutation to the commit log. @param mutation the Mutation to add to the log
[ "Add", "a", "Mutation", "to", "the", "commit", "log", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L212-L254
36,235
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.discardCompletedSegments
public void discardCompletedSegments(final UUID cfId, final ReplayPosition context) { logger.debug("discard completed log segments for {}, column family {}", context, cfId); // Go thru the active segment files, which are ordered oldest to newest, marking the // flushed CF as clean, until we...
java
public void discardCompletedSegments(final UUID cfId, final ReplayPosition context) { logger.debug("discard completed log segments for {}, column family {}", context, cfId); // Go thru the active segment files, which are ordered oldest to newest, marking the // flushed CF as clean, until we...
[ "public", "void", "discardCompletedSegments", "(", "final", "UUID", "cfId", ",", "final", "ReplayPosition", "context", ")", "{", "logger", ".", "debug", "(", "\"discard completed log segments for {}, column family {}\"", ",", "context", ",", "cfId", ")", ";", "// Go t...
Modifies the per-CF dirty cursors of any commit log segments for the column family according to the position given. Discards any commit log segments that are no longer used. @param cfId the column family ID that was flushed @param context the replay position of the flush
[ "Modifies", "the", "per", "-", "CF", "dirty", "cursors", "of", "any", "commit", "log", "segments", "for", "the", "column", "family", "according", "to", "the", "position", "given", ".", "Discards", "any", "commit", "log", "segments", "that", "are", "no", "l...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L263-L292
36,236
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLog.java
CommitLog.shutdownBlocking
public void shutdownBlocking() throws InterruptedException { executor.shutdown(); executor.awaitTermination(); allocator.shutdown(); allocator.awaitTermination(); }
java
public void shutdownBlocking() throws InterruptedException { executor.shutdown(); executor.awaitTermination(); allocator.shutdown(); allocator.awaitTermination(); }
[ "public", "void", "shutdownBlocking", "(", ")", "throws", "InterruptedException", "{", "executor", ".", "shutdown", "(", ")", ";", "executor", ".", "awaitTermination", "(", ")", ";", "allocator", ".", "shutdown", "(", ")", ";", "allocator", ".", "awaitTerminat...
Shuts down the threads used by the commit log, blocking until completion.
[ "Shuts", "down", "the", "threads", "used", "by", "the", "commit", "log", "blocking", "until", "completion", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L360-L366
36,237
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/Bounds.java
Bounds.makeRowBounds
public static Bounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new Bounds<RowPosition>(left.minKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner); }
java
public static Bounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner) { return new Bounds<RowPosition>(left.minKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner); }
[ "public", "static", "Bounds", "<", "RowPosition", ">", "makeRowBounds", "(", "Token", "left", ",", "Token", "right", ",", "IPartitioner", "partitioner", ")", "{", "return", "new", "Bounds", "<", "RowPosition", ">", "(", "left", ".", "minKeyBound", "(", "part...
Compute a bounds of keys corresponding to a given bounds of token.
[ "Compute", "a", "bounds", "of", "keys", "corresponding", "to", "a", "given", "bounds", "of", "token", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/Bounds.java#L114-L117
36,238
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/util/SampleOfLongs.java
SampleOfLongs.rankLatency
public double rankLatency(float rank) { if (sample.length == 0) return 0; int index = (int)(rank * sample.length); if (index >= sample.length) index = sample.length - 1; return sample[index] * 0.000001d; }
java
public double rankLatency(float rank) { if (sample.length == 0) return 0; int index = (int)(rank * sample.length); if (index >= sample.length) index = sample.length - 1; return sample[index] * 0.000001d; }
[ "public", "double", "rankLatency", "(", "float", "rank", ")", "{", "if", "(", "sample", ".", "length", "==", "0", ")", "return", "0", ";", "int", "index", "=", "(", "int", ")", "(", "rank", "*", "sample", ".", "length", ")", ";", "if", "(", "inde...
0 < rank < 1
[ "0", "<", "rank", "<", "1" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/SampleOfLongs.java#L100-L108
36,239
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
DynamicEndpointSnitch.maxScore
private double maxScore(List<InetAddress> endpoints) { double maxScore = -1.0; for (InetAddress endpoint : endpoints) { Double score = scores.get(endpoint); if (score == null) continue; if (score > maxScore) maxScore = scor...
java
private double maxScore(List<InetAddress> endpoints) { double maxScore = -1.0; for (InetAddress endpoint : endpoints) { Double score = scores.get(endpoint); if (score == null) continue; if (score > maxScore) maxScore = scor...
[ "private", "double", "maxScore", "(", "List", "<", "InetAddress", ">", "endpoints", ")", "{", "double", "maxScore", "=", "-", "1.0", ";", "for", "(", "InetAddress", "endpoint", ":", "endpoints", ")", "{", "Double", "score", "=", "scores", ".", "get", "("...
Return the max score for the endpoint in the provided list, or -1.0 if no node have a score.
[ "Return", "the", "max", "score", "for", "the", "endpoint", "in", "the", "provided", "list", "or", "-", "1", ".", "0", "if", "no", "node", "have", "a", "score", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java#L339-L352
36,240
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/FSError.java
FSError.findNested
public static FSError findNested(Throwable top) { for (Throwable t = top; t != null; t = t.getCause()) { if (t instanceof FSError) return (FSError) t; } return null; }
java
public static FSError findNested(Throwable top) { for (Throwable t = top; t != null; t = t.getCause()) { if (t instanceof FSError) return (FSError) t; } return null; }
[ "public", "static", "FSError", "findNested", "(", "Throwable", "top", ")", "{", "for", "(", "Throwable", "t", "=", "top", ";", "t", "!=", "null", ";", "t", "=", "t", ".", "getCause", "(", ")", ")", "{", "if", "(", "t", "instanceof", "FSError", ")",...
Unwraps the Throwable cause chain looking for an FSError instance @param top the top-level Throwable to unwrap @return FSError if found any, null otherwise
[ "Unwraps", "the", "Throwable", "cause", "chain", "looking", "for", "an", "FSError", "instance" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/FSError.java#L38-L47
36,241
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
SizeTieredCompactionStrategy.hotness
private static double hotness(SSTableReader sstr) { // system tables don't have read meters, just use 0.0 for the hotness return sstr.getReadMeter() == null ? 0.0 : sstr.getReadMeter().twoHourRate() / sstr.estimatedKeys(); }
java
private static double hotness(SSTableReader sstr) { // system tables don't have read meters, just use 0.0 for the hotness return sstr.getReadMeter() == null ? 0.0 : sstr.getReadMeter().twoHourRate() / sstr.estimatedKeys(); }
[ "private", "static", "double", "hotness", "(", "SSTableReader", "sstr", ")", "{", "// system tables don't have read meters, just use 0.0 for the hotness", "return", "sstr", ".", "getReadMeter", "(", ")", "==", "null", "?", "0.0", ":", "sstr", ".", "getReadMeter", "(",...
Returns the reads per second per key for this sstable, or 0.0 if the sstable has no read meter
[ "Returns", "the", "reads", "per", "second", "per", "key", "for", "this", "sstable", "or", "0", ".", "0", "if", "the", "sstable", "has", "no", "read", "meter" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java#L172-L176
36,242
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cli/CliUtils.java
CliUtils.unescapeSQLString
public static String unescapeSQLString(String b) { if (b.charAt(0) == '\'' && b.charAt(b.length()-1) == '\'') b = b.substring(1, b.length()-1); return StringEscapeUtils.unescapeJava(b); }
java
public static String unescapeSQLString(String b) { if (b.charAt(0) == '\'' && b.charAt(b.length()-1) == '\'') b = b.substring(1, b.length()-1); return StringEscapeUtils.unescapeJava(b); }
[ "public", "static", "String", "unescapeSQLString", "(", "String", "b", ")", "{", "if", "(", "b", ".", "charAt", "(", "0", ")", "==", "'", "'", "&&", "b", ".", "charAt", "(", "b", ".", "length", "(", ")", "-", "1", ")", "==", "'", "'", ")", "b...
Strips leading and trailing "'" characters, and handles and escaped characters such as \n, \r, etc. @param b - string to unescape @return String - unexspaced string
[ "Strips", "leading", "and", "trailing", "characters", "and", "handles", "and", "escaped", "characters", "such", "as", "\\", "n", "\\", "r", "etc", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliUtils.java#L37-L42
36,243
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cli/CliUtils.java
CliUtils.getIndexOperator
public static IndexOperator getIndexOperator(String operator) { if (operator.equals("=")) { return IndexOperator.EQ; } else if (operator.equals(">=")) { return IndexOperator.GTE; } else if (operator.equals(">")) { re...
java
public static IndexOperator getIndexOperator(String operator) { if (operator.equals("=")) { return IndexOperator.EQ; } else if (operator.equals(">=")) { return IndexOperator.GTE; } else if (operator.equals(">")) { re...
[ "public", "static", "IndexOperator", "getIndexOperator", "(", "String", "operator", ")", "{", "if", "(", "operator", ".", "equals", "(", "\"=\"", ")", ")", "{", "return", "IndexOperator", ".", "EQ", ";", "}", "else", "if", "(", "operator", ".", "equals", ...
Returns IndexOperator from string representation @param operator - string representing IndexOperator (=, >=, >, <, <=) @return IndexOperator - enum value of IndexOperator or null if not found
[ "Returns", "IndexOperator", "from", "string", "representation" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliUtils.java#L60-L84
36,244
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cli/CliUtils.java
CliUtils.getCfNamesByKeySpace
public static Set<String> getCfNamesByKeySpace(KsDef keySpace) { Set<String> names = new LinkedHashSet<String>(); for (CfDef cfDef : keySpace.getCf_defs()) { names.add(cfDef.getName()); } return names; }
java
public static Set<String> getCfNamesByKeySpace(KsDef keySpace) { Set<String> names = new LinkedHashSet<String>(); for (CfDef cfDef : keySpace.getCf_defs()) { names.add(cfDef.getName()); } return names; }
[ "public", "static", "Set", "<", "String", ">", "getCfNamesByKeySpace", "(", "KsDef", "keySpace", ")", "{", "Set", "<", "String", ">", "names", "=", "new", "LinkedHashSet", "<", "String", ">", "(", ")", ";", "for", "(", "CfDef", "cfDef", ":", "keySpace", ...
Returns set of column family names in specified keySpace. @param keySpace - keyspace definition to get column family names from. @return Set - column family names
[ "Returns", "set", "of", "column", "family", "names", "in", "specified", "keySpace", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliUtils.java#L91-L101
36,245
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cli/CliUtils.java
CliUtils.getKeySpaceDef
public static KsDef getKeySpaceDef(String keyspaceName, List<KsDef> keyspaces) { keyspaceName = keyspaceName.toUpperCase(); for (KsDef ksDef : keyspaces) { if (ksDef.name.toUpperCase().equals(keyspaceName)) return ksDef; } return null; }
java
public static KsDef getKeySpaceDef(String keyspaceName, List<KsDef> keyspaces) { keyspaceName = keyspaceName.toUpperCase(); for (KsDef ksDef : keyspaces) { if (ksDef.name.toUpperCase().equals(keyspaceName)) return ksDef; } return null; }
[ "public", "static", "KsDef", "getKeySpaceDef", "(", "String", "keyspaceName", ",", "List", "<", "KsDef", ">", "keyspaces", ")", "{", "keyspaceName", "=", "keyspaceName", ".", "toUpperCase", "(", ")", ";", "for", "(", "KsDef", "ksDef", ":", "keyspaces", ")", ...
Parse the statement from cli and return KsDef @param keyspaceName - name of the keyspace to lookup @param keyspaces - List of known keyspaces @return metadata about keyspace or null
[ "Parse", "the", "statement", "from", "cli", "and", "return", "KsDef" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliUtils.java#L111-L122
36,246
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.getViewHlr
public Hlr getViewHlr(final String hlrId) throws GeneralException, UnauthorizedException, NotFoundException { if (hlrId == null) { throw new IllegalArgumentException("Hrl ID must be specified."); } return messageBirdService.requestByID(HLRPATH, hlrId, Hlr.class); }
java
public Hlr getViewHlr(final String hlrId) throws GeneralException, UnauthorizedException, NotFoundException { if (hlrId == null) { throw new IllegalArgumentException("Hrl ID must be specified."); } return messageBirdService.requestByID(HLRPATH, hlrId, Hlr.class); }
[ "public", "Hlr", "getViewHlr", "(", "final", "String", "hlrId", ")", "throws", "GeneralException", ",", "UnauthorizedException", ",", "NotFoundException", "{", "if", "(", "hlrId", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Hrl ID m...
Retrieves the information of an existing HLR. You only need to supply the unique message id that was returned upon creation or receiving. @param hlrId ID as returned by getRequestHlr in the id variable @return Hlr Object @throws UnauthorizedException if client is unauthorized @throws GeneralException general exce...
[ "Retrieves", "the", "information", "of", "an", "existing", "HLR", ".", "You", "only", "need", "to", "supply", "the", "unique", "message", "id", "that", "was", "returned", "upon", "creation", "or", "receiving", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L121-L126
36,247
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendMessage
public MessageResponse sendMessage(final Message message) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(MESSAGESPATH, message, MessageResponse.class); }
java
public MessageResponse sendMessage(final Message message) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(MESSAGESPATH, message, MessageResponse.class); }
[ "public", "MessageResponse", "sendMessage", "(", "final", "Message", "message", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "return", "messageBirdService", ".", "sendPayLoad", "(", "MESSAGESPATH", ",", "message", ",", "MessageResponse", ".", ...
Send a message through the messagebird platform @param message Message object to be send @return Message Response @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Send", "a", "message", "through", "the", "messagebird", "platform" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L140-L142
36,248
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendFlashMessage
public MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients) throws UnauthorizedException, GeneralException { final Message message = new Message(originator, body, recipients); message.setType(MsgType.flash); return messageBirdService.sen...
java
public MessageResponse sendFlashMessage(final String originator, final String body, final List<BigInteger> recipients) throws UnauthorizedException, GeneralException { final Message message = new Message(originator, body, recipients); message.setType(MsgType.flash); return messageBirdService.sen...
[ "public", "MessageResponse", "sendFlashMessage", "(", "final", "String", "originator", ",", "final", "String", "body", ",", "final", "List", "<", "BigInteger", ">", "recipients", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "final", "Message...
Convenient function to send a simple flash message to a list of recipients @param originator Originator of the message, this will get truncated to 11 chars @param body Body of the message @param recipients List of recipients @return MessageResponse @throws UnauthorizedException if client is unauthorized @throws ...
[ "Convenient", "function", "to", "send", "a", "simple", "flash", "message", "to", "a", "list", "of", "recipients" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L185-L189
36,249
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteMessage
public void deleteMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException { if (id == null) { throw new IllegalArgumentException("Message ID must be specified."); } messageBirdService.deleteByID(MESSAGESPATH, id); }
java
public void deleteMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException { if (id == null) { throw new IllegalArgumentException("Message ID must be specified."); } messageBirdService.deleteByID(MESSAGESPATH, id); }
[ "public", "void", "deleteMessage", "(", "final", "String", "id", ")", "throws", "UnauthorizedException", ",", "GeneralException", ",", "NotFoundException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Message ID...
Delete a message from the Messagebird server @param id A unique random ID which is created on the MessageBird platform @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Delete", "a", "message", "from", "the", "Messagebird", "server" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L226-L231
36,250
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteVoiceMessage
public void deleteVoiceMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException { if (id == null) { throw new IllegalArgumentException("Message ID must be specified."); } messageBirdService.deleteByID(VOICEMESSAGESPATH, id); }
java
public void deleteVoiceMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException { if (id == null) { throw new IllegalArgumentException("Message ID must be specified."); } messageBirdService.deleteByID(VOICEMESSAGESPATH, id); }
[ "public", "void", "deleteVoiceMessage", "(", "final", "String", "id", ")", "throws", "UnauthorizedException", ",", "GeneralException", ",", "NotFoundException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Messa...
Delete a voice message from the Messagebird server @param id A unique random ID which is created on the MessageBird platform @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Delete", "a", "voice", "message", "from", "the", "Messagebird", "server" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L301-L306
36,251
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listVoiceMessages
public VoiceMessageList listVoiceMessages(final Integer offset, final Integer limit) throws UnauthorizedException, GeneralException { if (offset != null && offset < 0) { throw new IllegalArgumentException("Offset must be > 0"); } if (limit != null && limit < 0) { throw ne...
java
public VoiceMessageList listVoiceMessages(final Integer offset, final Integer limit) throws UnauthorizedException, GeneralException { if (offset != null && offset < 0) { throw new IllegalArgumentException("Offset must be > 0"); } if (limit != null && limit < 0) { throw ne...
[ "public", "VoiceMessageList", "listVoiceMessages", "(", "final", "Integer", "offset", ",", "final", "Integer", "limit", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "offset", "!=", "null", "&&", "offset", "<", "0", ")", "{", ...
List voice messages @param offset offset for result list @param limit limit for result list @return VoiceMessageList @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "List", "voice", "messages" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L332-L340
36,252
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteContact
void deleteContact(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } messageBirdService.deleteByID(CONTACTPATH, id); }
java
void deleteContact(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } messageBirdService.deleteByID(CONTACTPATH, id); }
[ "void", "deleteContact", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Contact ID must be spe...
Deletes an existing contact. You only need to supply the unique id that was returned upon creation.
[ "Deletes", "an", "existing", "contact", ".", "You", "only", "need", "to", "supply", "the", "unique", "id", "that", "was", "returned", "upon", "creation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L541-L546
36,253
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendContact
public Contact sendContact(final ContactRequest contactRequest) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(CONTACTPATH, contactRequest, Contact.class); }
java
public Contact sendContact(final ContactRequest contactRequest) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(CONTACTPATH, contactRequest, Contact.class); }
[ "public", "Contact", "sendContact", "(", "final", "ContactRequest", "contactRequest", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "return", "messageBirdService", ".", "sendPayLoad", "(", "CONTACTPATH", ",", "contactRequest", ",", "Contact", "."...
Creates a new contact object. MessageBird returns the created contact object with each request.
[ "Creates", "a", "new", "contact", "object", ".", "MessageBird", "returns", "the", "created", "contact", "object", "with", "each", "request", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L571-L573
36,254
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.updateContact
public Contact updateContact(final String id, ContactRequest contactRequest) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } String request = CONTACTPATH + "/" + id; return messageBirdSe...
java
public Contact updateContact(final String id, ContactRequest contactRequest) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } String request = CONTACTPATH + "/" + id; return messageBirdSe...
[ "public", "Contact", "updateContact", "(", "final", "String", "id", ",", "ContactRequest", "contactRequest", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
Updates an existing contact. You only need to supply the unique id that was returned upon creation.
[ "Updates", "an", "existing", "contact", ".", "You", "only", "need", "to", "supply", "the", "unique", "id", "that", "was", "returned", "upon", "creation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L579-L585
36,255
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewContact
public Contact viewContact(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } return messageBirdService.requestByID(CONTACTPATH, id, Contact.class); }
java
public Contact viewContact(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } return messageBirdService.requestByID(CONTACTPATH, id, Contact.class); }
[ "public", "Contact", "viewContact", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Contact I...
Retrieves the information of an existing contact. You only need to supply the unique contact ID that was returned upon creation or receiving.
[ "Retrieves", "the", "information", "of", "an", "existing", "contact", ".", "You", "only", "need", "to", "supply", "the", "unique", "contact", "ID", "that", "was", "returned", "upon", "creation", "or", "receiving", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L591-L596
36,256
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteGroup
public void deleteGroup(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } messageBirdService.deleteByID(GROUPPATH, id); }
java
public void deleteGroup(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } messageBirdService.deleteByID(GROUPPATH, id); }
[ "public", "void", "deleteGroup", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Group ID mus...
Deletes an existing group. You only need to supply the unique id that was returned upon creation.
[ "Deletes", "an", "existing", "group", ".", "You", "only", "need", "to", "supply", "the", "unique", "id", "that", "was", "returned", "upon", "creation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L602-L607
36,257
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteGroupContact
public void deleteGroupContact(final String groupId, final String contactId) throws NotFoundException, GeneralException, UnauthorizedException { if (groupId == null) { throw new IllegalArgumentException("Group ID must be specified."); } if (contactId == null) { throw new ...
java
public void deleteGroupContact(final String groupId, final String contactId) throws NotFoundException, GeneralException, UnauthorizedException { if (groupId == null) { throw new IllegalArgumentException("Group ID must be specified."); } if (contactId == null) { throw new ...
[ "public", "void", "deleteGroupContact", "(", "final", "String", "groupId", ",", "final", "String", "contactId", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "groupId", "==", "null", ")", "{", "throw", ...
Removes a contact from group. You need to supply the IDs of the group and contact. Does not delete the contact.
[ "Removes", "a", "contact", "from", "group", ".", "You", "need", "to", "supply", "the", "IDs", "of", "the", "group", "and", "contact", ".", "Does", "not", "delete", "the", "contact", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L613-L623
36,258
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendGroup
public Group sendGroup(final GroupRequest groupRequest) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(GROUPPATH, groupRequest, Group.class); }
java
public Group sendGroup(final GroupRequest groupRequest) throws UnauthorizedException, GeneralException { return messageBirdService.sendPayLoad(GROUPPATH, groupRequest, Group.class); }
[ "public", "Group", "sendGroup", "(", "final", "GroupRequest", "groupRequest", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "return", "messageBirdService", ".", "sendPayLoad", "(", "GROUPPATH", ",", "groupRequest", ",", "Group", ".", "class", ...
Creates a new group object. MessageBird returns the created group object with each request.
[ "Creates", "a", "new", "group", "object", ".", "MessageBird", "returns", "the", "created", "group", "object", "with", "each", "request", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L646-L648
36,259
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendGroupContact
public void sendGroupContact(final String groupId, final String[] contactIds) throws NotFoundException, GeneralException, UnauthorizedException { // reuestByID appends the "ID" to the base path, so this workaround // lets us add a query string. String path = String.format("%s%s?%s", groupId, CON...
java
public void sendGroupContact(final String groupId, final String[] contactIds) throws NotFoundException, GeneralException, UnauthorizedException { // reuestByID appends the "ID" to the base path, so this workaround // lets us add a query string. String path = String.format("%s%s?%s", groupId, CON...
[ "public", "void", "sendGroupContact", "(", "final", "String", "groupId", ",", "final", "String", "[", "]", "contactIds", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "// reuestByID appends the \"ID\" to the base path, so th...
Adds contact to group. You need to supply the IDs of the group and contact.
[ "Adds", "contact", "to", "group", ".", "You", "need", "to", "supply", "the", "IDs", "of", "the", "group", "and", "contact", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L654-L659
36,260
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.updateGroup
public Group updateGroup(final String id, final GroupRequest groupRequest) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } String path = String.format("%s/%s", GROUPPATH, id); return messa...
java
public Group updateGroup(final String id, final GroupRequest groupRequest) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } String path = String.format("%s/%s", GROUPPATH, id); return messa...
[ "public", "Group", "updateGroup", "(", "final", "String", "id", ",", "final", "GroupRequest", "groupRequest", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException",...
Updates an existing group. You only need to supply the unique ID that was returned upon creation.
[ "Updates", "an", "existing", "group", ".", "You", "only", "need", "to", "supply", "the", "unique", "ID", "that", "was", "returned", "upon", "creation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L684-L690
36,261
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewGroup
public Group viewGroup(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } return messageBirdService.requestByID(GROUPPATH, id, Group.class); }
java
public Group viewGroup(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Group ID must be specified."); } return messageBirdService.requestByID(GROUPPATH, id, Group.class); }
[ "public", "Group", "viewGroup", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Group ID must...
Retrieves the information of an existing group. You only need to supply the unique group ID that was returned upon creation or receiving.
[ "Retrieves", "the", "information", "of", "an", "existing", "group", ".", "You", "only", "need", "to", "supply", "the", "unique", "group", "ID", "that", "was", "returned", "upon", "creation", "or", "receiving", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L696-L701
36,262
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewConversation
public Conversation viewConversation(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Id must be specified"); } String url = CONVERSATIONS_BASE_URL + CONVERSATION_PATH; return messageBir...
java
public Conversation viewConversation(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Id must be specified"); } String url = CONVERSATIONS_BASE_URL + CONVERSATION_PATH; return messageBir...
[ "public", "Conversation", "viewConversation", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\...
Gets a single conversation. @param id Conversation to retrieved. @return The retrieved conversation.
[ "Gets", "a", "single", "conversation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L709-L715
36,263
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.updateConversation
public Conversation updateConversation(final String id, final ConversationStatus status) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Id must be specified."); } String url = String.format("%s%s/%s", CONVERSATIONS_B...
java
public Conversation updateConversation(final String id, final ConversationStatus status) throws UnauthorizedException, GeneralException { if (id == null) { throw new IllegalArgumentException("Id must be specified."); } String url = String.format("%s%s/%s", CONVERSATIONS_B...
[ "public", "Conversation", "updateConversation", "(", "final", "String", "id", ",", "final", "ConversationStatus", "status", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgum...
Updates a conversation. @param id Conversation to update. @param status New status for the conversation. @return The updated Conversation.
[ "Updates", "a", "conversation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L724-L731
36,264
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listConversations
public ConversationList listConversations(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_PATH; return messageBirdService.requestList(url, offset, limit, ConversationList.class); }
java
public ConversationList listConversations(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_PATH; return messageBirdService.requestList(url, offset, limit, ConversationList.class); }
[ "public", "ConversationList", "listConversations", "(", "final", "int", "offset", ",", "final", "int", "limit", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_PATH", ";", "return...
Gets a Conversation listing with specified pagination options. @param offset Number of objects to skip. @param limit Number of objects to take. @return List of conversations.
[ "Gets", "a", "Conversation", "listing", "with", "specified", "pagination", "options", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L740-L744
36,265
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.startConversation
public Conversation startConversation(ConversationStartRequest request) throws UnauthorizedException, GeneralException { String url = String.format("%s%s/start", CONVERSATIONS_BASE_URL, CONVERSATION_PATH); return messageBirdService.sendPayLoad(url, request, Conversation.class); }
java
public Conversation startConversation(ConversationStartRequest request) throws UnauthorizedException, GeneralException { String url = String.format("%s%s/start", CONVERSATIONS_BASE_URL, CONVERSATION_PATH); return messageBirdService.sendPayLoad(url, request, Conversation.class); }
[ "public", "Conversation", "startConversation", "(", "ConversationStartRequest", "request", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "String", ".", "format", "(", "\"%s%s/start\"", ",", "CONVERSATIONS_BASE_URL", ",", "CO...
Starts a conversation by sending an initial message. @param request Data for this request. @return The created Conversation.
[ "Starts", "a", "conversation", "by", "sending", "an", "initial", "message", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L764-L768
36,266
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listConversationMessages
public ConversationMessageList listConversationMessages( final String conversationId, final int offset, final int limit ) throws UnauthorizedException, GeneralException { String url = String.format( "%s%s/%s%s", CONVERSATIONS_BASE_URL, ...
java
public ConversationMessageList listConversationMessages( final String conversationId, final int offset, final int limit ) throws UnauthorizedException, GeneralException { String url = String.format( "%s%s/%s%s", CONVERSATIONS_BASE_URL, ...
[ "public", "ConversationMessageList", "listConversationMessages", "(", "final", "String", "conversationId", ",", "final", "int", "offset", ",", "final", "int", "limit", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "String"...
Gets a ConversationMessage listing with specified pagination options. @param conversationId Conversation to get messages for. @param offset Number of objects to skip. @param limit Number of objects to take. @return List of messages.
[ "Gets", "a", "ConversationMessage", "listing", "with", "specified", "pagination", "options", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L778-L791
36,267
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listConversationMessages
public ConversationMessageList listConversationMessages( final String conversationId ) throws UnauthorizedException, GeneralException { final int offset = 0; final int limit = 10; return listConversationMessages(conversationId, offset, limit); }
java
public ConversationMessageList listConversationMessages( final String conversationId ) throws UnauthorizedException, GeneralException { final int offset = 0; final int limit = 10; return listConversationMessages(conversationId, offset, limit); }
[ "public", "ConversationMessageList", "listConversationMessages", "(", "final", "String", "conversationId", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "final", "int", "offset", "=", "0", ";", "final", "int", "limit", "=", "10", ";", "return...
Gets a ConversationMessage listing with default pagination options. @param conversationId Conversation to get messages for. @return List of messages.
[ "Gets", "a", "ConversationMessage", "listing", "with", "default", "pagination", "options", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L799-L806
36,268
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewConversationMessage
public ConversationMessage viewConversationMessage(final String messageId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_MESSAGE_PATH; return messageBirdService.requestByID(url, messageId, ConversationMessage.class); ...
java
public ConversationMessage viewConversationMessage(final String messageId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_MESSAGE_PATH; return messageBirdService.requestByID(url, messageId, ConversationMessage.class); ...
[ "public", "ConversationMessage", "viewConversationMessage", "(", "final", "String", "messageId", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_MESSAGE_PATH", ...
Gets a single message. @param messageId Message to retrieve. @return The retrieved message.
[ "Gets", "a", "single", "message", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L814-L818
36,269
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendConversationMessage
public ConversationMessage sendConversationMessage( final String conversationId, final ConversationMessageRequest request ) throws UnauthorizedException, GeneralException { String url = String.format( "%s%s/%s%s", CONVERSATIONS_BASE_URL, ...
java
public ConversationMessage sendConversationMessage( final String conversationId, final ConversationMessageRequest request ) throws UnauthorizedException, GeneralException { String url = String.format( "%s%s/%s%s", CONVERSATIONS_BASE_URL, ...
[ "public", "ConversationMessage", "sendConversationMessage", "(", "final", "String", "conversationId", ",", "final", "ConversationMessageRequest", "request", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "String", ".", "format"...
Sends a message to an existing Conversation. @param conversationId Conversation to send message to. @param request Message to send. @return The newly created message.
[ "Sends", "a", "message", "to", "an", "existing", "Conversation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L827-L839
36,270
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteConversationWebhook
public void deleteConversationWebhook(final String webhookId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; messageBirdService.deleteByID(url, webhookId); }
java
public void deleteConversationWebhook(final String webhookId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; messageBirdService.deleteByID(url, webhookId); }
[ "public", "void", "deleteConversationWebhook", "(", "final", "String", "webhookId", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_WEBHOOK_PATH", ";", "mess...
Deletes a webhook. @param webhookId Webhook to delete.
[ "Deletes", "a", "webhook", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L846-L850
36,271
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendConversationWebhook
public ConversationWebhook sendConversationWebhook(final ConversationWebhookRequest request) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.sendPayLoad(url, request, ConversationWebhook.class); }
java
public ConversationWebhook sendConversationWebhook(final ConversationWebhookRequest request) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.sendPayLoad(url, request, ConversationWebhook.class); }
[ "public", "ConversationWebhook", "sendConversationWebhook", "(", "final", "ConversationWebhookRequest", "request", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_WEBHOOK_PATH", ";", "ret...
Creates a new webhook. @param request Webhook to create. @return Newly created webhook.
[ "Creates", "a", "new", "webhook", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L858-L862
36,272
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewConversationWebhook
public ConversationWebhook viewConversationWebhook(final String webhookId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.requestByID(url, webhookId, ConversationWebhook.class); }
java
public ConversationWebhook viewConversationWebhook(final String webhookId) throws NotFoundException, GeneralException, UnauthorizedException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.requestByID(url, webhookId, ConversationWebhook.class); }
[ "public", "ConversationWebhook", "viewConversationWebhook", "(", "final", "String", "webhookId", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_WEBHOOK_PATH", ...
Gets a single webhook. @param webhookId Webhook to retrieve. @return The retrieved webhook.
[ "Gets", "a", "single", "webhook", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L870-L873
36,273
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listConversationWebhooks
ConversationWebhookList listConversationWebhooks(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.requestList(url, offset, limit, ConversationWebhookList.class); ...
java
ConversationWebhookList listConversationWebhooks(final int offset, final int limit) throws UnauthorizedException, GeneralException { String url = CONVERSATIONS_BASE_URL + CONVERSATION_WEBHOOK_PATH; return messageBirdService.requestList(url, offset, limit, ConversationWebhookList.class); ...
[ "ConversationWebhookList", "listConversationWebhooks", "(", "final", "int", "offset", ",", "final", "int", "limit", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "String", "url", "=", "CONVERSATIONS_BASE_URL", "+", "CONVERSATION_WEBHOOK_PATH", ";",...
Gets a ConversationWebhook listing with the specified pagination options. @param offset Number of objects to skip. @param limit Number of objects to skip. @return List of webhooks.
[ "Gets", "a", "ConversationWebhook", "listing", "with", "the", "specified", "pagination", "options", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L882-L886
36,274
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.sendVoiceCall
public VoiceCallResponse sendVoiceCall(final VoiceCall voiceCall) throws UnauthorizedException, GeneralException { if (voiceCall.getSource() == null) { throw new IllegalArgumentException("Source of voice call must be specified."); } if (voiceCall.getDestination() == null) { ...
java
public VoiceCallResponse sendVoiceCall(final VoiceCall voiceCall) throws UnauthorizedException, GeneralException { if (voiceCall.getSource() == null) { throw new IllegalArgumentException("Source of voice call must be specified."); } if (voiceCall.getDestination() == null) { ...
[ "public", "VoiceCallResponse", "sendVoiceCall", "(", "final", "VoiceCall", "voiceCall", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "voiceCall", ".", "getSource", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalArgume...
Function for voice call to a number @param voiceCall Voice call object @return VoiceCallResponse @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "for", "voice", "call", "to", "a", "number" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L912-L926
36,275
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.listAllVoiceCalls
public VoiceCallResponseList listAllVoiceCalls(Integer page, Integer pageSize) throws GeneralException, UnauthorizedException { String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH); return messageBirdService.requestList(url, new PagedPaging(page, pageSize), VoiceCallResponseList.clas...
java
public VoiceCallResponseList listAllVoiceCalls(Integer page, Integer pageSize) throws GeneralException, UnauthorizedException { String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH); return messageBirdService.requestList(url, new PagedPaging(page, pageSize), VoiceCallResponseList.clas...
[ "public", "VoiceCallResponseList", "listAllVoiceCalls", "(", "Integer", "page", ",", "Integer", "pageSize", ")", "throws", "GeneralException", ",", "UnauthorizedException", "{", "String", "url", "=", "String", ".", "format", "(", "\"%s%s\"", ",", "VOICE_CALLS_BASE_URL...
Function to list all voice calls @return VoiceCallResponseList @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "to", "list", "all", "voice", "calls" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L935-L938
36,276
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewVoiceCall
public VoiceCallResponse viewVoiceCall(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Voice Message ID must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECA...
java
public VoiceCallResponse viewVoiceCall(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Voice Message ID must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECA...
[ "public", "VoiceCallResponse", "viewVoiceCall", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Function to view voice call by id @param id Voice call ID @return VoiceCallResponse @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "to", "view", "voice", "call", "by", "id" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L948-L955
36,277
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.deleteVoiceCall
public void deleteVoiceCall(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Voice Message ID must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH); ...
java
public void deleteVoiceCall(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Voice Message ID must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH); ...
[ "public", "void", "deleteVoiceCall", "(", "final", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Voice Me...
Function to delete voice call by id @param id Voice call ID @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "to", "delete", "voice", "call", "by", "id" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L964-L971
36,278
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewCallLegsByCallId
public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } String url =...
java
public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } String url =...
[ "public", "VoiceCallLegResponse", "viewCallLegsByCallId", "(", "String", "callId", ",", "Integer", "page", ",", "Integer", "pageSize", ")", "throws", "UnsupportedEncodingException", ",", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "callId", "==", ...
Retrieves a listing of all legs. @param callId Voice call ID @param page page to fetch (can be null - will return first page), number of first page is 1 @param pageSize page size @return VoiceCallLegResponse @throws UnsupportedEncodingException no UTF8 supported url @throws UnauthorizedException if client...
[ "Retrieves", "a", "listing", "of", "all", "legs", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L984-L997
36,279
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewCallLegByCallIdAndLegId
public VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (le...
java
public VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (le...
[ "public", "VoiceCallLeg", "viewCallLegByCallIdAndLegId", "(", "final", "String", "callId", ",", "String", "legId", ")", "throws", "UnsupportedEncodingException", ",", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "callId", "...
Retrieves a leg resource. The parameters are the unique ID of the call and of the leg that were returned upon their respective creation. @param callId Voice call ID @param legId ID of leg of specified call {callId} @return VoiceCallLeg @throws UnsupportedEncodingException no UTF8 supported url @throws NotFoundExcepti...
[ "Retrieves", "a", "leg", "resource", ".", "The", "parameters", "are", "the", "unique", "ID", "of", "the", "call", "and", "of", "the", "leg", "that", "were", "returned", "upon", "their", "respective", "creation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L1011-L1034
36,280
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.createWebHook
public WebhookResponseData createWebHook(Webhook webhook) throws UnauthorizedException, GeneralException { if (webhook.getTitle() == null) { throw new IllegalArgumentException("Title of webhook must be specified."); } if (webhook.getUrl() == null) { throw new IllegalArgu...
java
public WebhookResponseData createWebHook(Webhook webhook) throws UnauthorizedException, GeneralException { if (webhook.getTitle() == null) { throw new IllegalArgumentException("Title of webhook must be specified."); } if (webhook.getUrl() == null) { throw new IllegalArgu...
[ "public", "WebhookResponseData", "createWebHook", "(", "Webhook", "webhook", ")", "throws", "UnauthorizedException", ",", "GeneralException", "{", "if", "(", "webhook", ".", "getTitle", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", ...
Function to create web hook @param webhook title, url and token of webHook @return WebHookResponseData @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "to", "create", "web", "hook" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L1164-L1175
36,281
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdClient.java
MessageBirdClient.viewWebHook
public WebhookResponseData viewWebHook(String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Id of webHook must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, WEBHOOKS); ...
java
public WebhookResponseData viewWebHook(String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Id of webHook must be specified."); } String url = String.format("%s%s", VOICE_CALLS_BASE_URL, WEBHOOKS); ...
[ "public", "WebhookResponseData", "viewWebHook", "(", "String", "id", ")", "throws", "NotFoundException", ",", "GeneralException", ",", "UnauthorizedException", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Id of we...
Function to view webhook @param id webHook id @return WebHookResponseData @throws UnauthorizedException if client is unauthorized @throws GeneralException general exception
[ "Function", "to", "view", "webhook" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L1185-L1192
36,282
messagebird/java-rest-api
api/src/main/java/com/messagebird/RequestSigner.java
RequestSigner.computeSignature
private byte[] computeSignature(Request request) { String timestampAndQuery = request.getTimestamp() + '\n' + request.getSortedQueryParameters() + '\n'; byte[] timestampAndQueryBytes = timestampAndQuery.getBytes(CHARSET_UTF8); byte[] bodyHashBytes = getSha256Hash(request.getData...
java
private byte[] computeSignature(Request request) { String timestampAndQuery = request.getTimestamp() + '\n' + request.getSortedQueryParameters() + '\n'; byte[] timestampAndQueryBytes = timestampAndQuery.getBytes(CHARSET_UTF8); byte[] bodyHashBytes = getSha256Hash(request.getData...
[ "private", "byte", "[", "]", "computeSignature", "(", "Request", "request", ")", "{", "String", "timestampAndQuery", "=", "request", ".", "getTimestamp", "(", ")", "+", "'", "'", "+", "request", ".", "getSortedQueryParameters", "(", ")", "+", "'", "'", ";"...
Computes the signature for a request instance. @param request Request to compute signature for. @return HMAC-SHA2556 signature for the provided request.
[ "Computes", "the", "signature", "for", "a", "request", "instance", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/RequestSigner.java#L75-L83
36,283
messagebird/java-rest-api
api/src/main/java/com/messagebird/RequestSigner.java
RequestSigner.appendArrays
private byte[] appendArrays(byte[] first, byte[] second) { byte[] result = new byte[first.length + second.length]; System.arraycopy(first, 0, result, 0, first.length); System.arraycopy(second, 0, result, first.length, second.length); return result; }
java
private byte[] appendArrays(byte[] first, byte[] second) { byte[] result = new byte[first.length + second.length]; System.arraycopy(first, 0, result, 0, first.length); System.arraycopy(second, 0, result, first.length, second.length); return result; }
[ "private", "byte", "[", "]", "appendArrays", "(", "byte", "[", "]", "first", ",", "byte", "[", "]", "second", ")", "{", "byte", "[", "]", "result", "=", "new", "byte", "[", "first", ".", "length", "+", "second", ".", "length", "]", ";", "System", ...
Stitches the two arrays together and returns a new one. @param first Start of the new array. @param second End of the new array. @return New array based on first and second.
[ "Stitches", "the", "two", "arrays", "together", "and", "returns", "a", "new", "one", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/RequestSigner.java#L100-L106
36,284
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.doRequest
<P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException { HttpURLConnection connection = null; InputStream inputStream = null; if (METHOD_PATCH.equalsIgnoreCase(method)) { // It'd perhaps be cleaner to call this in the constructor, b...
java
<P> APIResponse doRequest(final String method, final String url, final P payload) throws GeneralException { HttpURLConnection connection = null; InputStream inputStream = null; if (METHOD_PATCH.equalsIgnoreCase(method)) { // It'd perhaps be cleaner to call this in the constructor, b...
[ "<", "P", ">", "APIResponse", "doRequest", "(", "final", "String", "method", ",", "final", "String", "url", ",", "final", "P", "payload", ")", "throws", "GeneralException", "{", "HttpURLConnection", "connection", "=", "null", ";", "InputStream", "inputStream", ...
Actually sends a HTTP request and returns its body and HTTP status code. @param method HTTP method. @param url Absolute URL. @param payload Payload to JSON encode for the request body. May be null. @param <P> Type of the payload. @return APIResponse containing the response's body and status.
[ "Actually", "sends", "a", "HTTP", "request", "and", "returns", "its", "body", "and", "HTTP", "status", "code", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L219-L253
36,285
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.getAllowedMethods
private static String[] getAllowedMethods(String[] existingMethods) { int listCapacity = existingMethods.length + 1; List<String> allowedMethods = new ArrayList<>(listCapacity); allowedMethods.addAll(Arrays.asList(existingMethods)); allowedMethods.add(METHOD_PATCH); return all...
java
private static String[] getAllowedMethods(String[] existingMethods) { int listCapacity = existingMethods.length + 1; List<String> allowedMethods = new ArrayList<>(listCapacity); allowedMethods.addAll(Arrays.asList(existingMethods)); allowedMethods.add(METHOD_PATCH); return all...
[ "private", "static", "String", "[", "]", "getAllowedMethods", "(", "String", "[", "]", "existingMethods", ")", "{", "int", "listCapacity", "=", "existingMethods", ".", "length", "+", "1", ";", "List", "<", "String", ">", "allowedMethods", "=", "new", "ArrayL...
Appends PATCH to the provided array. @param existingMethods Methods that are, and must be, allowed. @return New array also containing PATCH.
[ "Appends", "PATCH", "to", "the", "provided", "array", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L298-L307
36,286
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.readToEnd
private String readToEnd(InputStream inputStream) { Scanner scanner = new Scanner(inputStream).useDelimiter("\\A"); return scanner.hasNext() ? scanner.next() : ""; }
java
private String readToEnd(InputStream inputStream) { Scanner scanner = new Scanner(inputStream).useDelimiter("\\A"); return scanner.hasNext() ? scanner.next() : ""; }
[ "private", "String", "readToEnd", "(", "InputStream", "inputStream", ")", "{", "Scanner", "scanner", "=", "new", "Scanner", "(", "inputStream", ")", ".", "useDelimiter", "(", "\"\\\\A\"", ")", ";", "return", "scanner", ".", "hasNext", "(", ")", "?", "scanner...
Reads the stream until it has no more bytes and returns a UTF-8 encoded string representation. @param inputStream Stream to read from. @return UTF-8 encoded string representation of stream's contents.
[ "Reads", "the", "stream", "until", "it", "has", "no", "more", "bytes", "and", "returns", "a", "UTF", "-", "8", "encoded", "string", "representation", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L316-L320
36,287
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.isURLAbsolute
private boolean isURLAbsolute(String url) { for (String protocol : PROTOCOLS) { if (url.startsWith(protocol)) { return true; } } return false; }
java
private boolean isURLAbsolute(String url) { for (String protocol : PROTOCOLS) { if (url.startsWith(protocol)) { return true; } } return false; }
[ "private", "boolean", "isURLAbsolute", "(", "String", "url", ")", "{", "for", "(", "String", "protocol", ":", "PROTOCOLS", ")", "{", "if", "(", "url", ".", "startsWith", "(", "protocol", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false"...
Attempts determining whether the provided URL is an absolute one, based on the scheme. @param url provided url @return boolean
[ "Attempts", "determining", "whether", "the", "provided", "URL", "is", "an", "absolute", "one", "based", "on", "the", "scheme", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L328-L336
36,288
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.getConnection
public <P> HttpURLConnection getConnection(final String serviceUrl, final P postData, final String requestType) throws IOException { if (requestType == null || !REQUEST_METHODS.contains(requestType)) { throw new IllegalArgumentException(String.format(REQUEST_METHOD_NOT_ALLOWED, requestType)); ...
java
public <P> HttpURLConnection getConnection(final String serviceUrl, final P postData, final String requestType) throws IOException { if (requestType == null || !REQUEST_METHODS.contains(requestType)) { throw new IllegalArgumentException(String.format(REQUEST_METHOD_NOT_ALLOWED, requestType)); ...
[ "public", "<", "P", ">", "HttpURLConnection", "getConnection", "(", "final", "String", "serviceUrl", ",", "final", "P", "postData", ",", "final", "String", "requestType", ")", "throws", "IOException", "{", "if", "(", "requestType", "==", "null", "||", "!", "...
Create a HttpURLConnection connection object @param serviceUrl URL that needs to be requested @param postData PostDATA, must be not null for requestType is POST @param requestType Request type POST requests without a payload will generate a exception @return base class @throws IOException io exception
[ "Create", "a", "HttpURLConnection", "connection", "object" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L347-L398
36,289
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.getErrorReportOrNull
private List<ErrorReport> getErrorReportOrNull(final String body) { ObjectMapper objectMapper = new ObjectMapper(); try { JsonNode jsonNode = objectMapper.readValue(body, JsonNode.class); ErrorReport[] errors = objectMapper.readValue(jsonNode.get("errors").toString(), ErrorRepor...
java
private List<ErrorReport> getErrorReportOrNull(final String body) { ObjectMapper objectMapper = new ObjectMapper(); try { JsonNode jsonNode = objectMapper.readValue(body, JsonNode.class); ErrorReport[] errors = objectMapper.readValue(jsonNode.get("errors").toString(), ErrorRepor...
[ "private", "List", "<", "ErrorReport", ">", "getErrorReportOrNull", "(", "final", "String", "body", ")", "{", "ObjectMapper", "objectMapper", "=", "new", "ObjectMapper", "(", ")", ";", "try", "{", "JsonNode", "jsonNode", "=", "objectMapper", ".", "readValue", ...
Get the MessageBird error report data. @param body Raw request body. @return Error report, or null if the body can not be deserialized.
[ "Get", "the", "MessageBird", "error", "report", "data", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L435-L452
36,290
messagebird/java-rest-api
api/src/main/java/com/messagebird/MessageBirdServiceImpl.java
MessageBirdServiceImpl.getPathVariables
private String getPathVariables(final Map<String, Object> map) { final StringBuilder bpath = new StringBuilder(); for (Map.Entry<String, Object> param : map.entrySet()) { if (bpath.length() > 1) { bpath.append("&"); } try { bpath.append...
java
private String getPathVariables(final Map<String, Object> map) { final StringBuilder bpath = new StringBuilder(); for (Map.Entry<String, Object> param : map.entrySet()) { if (bpath.length() > 1) { bpath.append("&"); } try { bpath.append...
[ "private", "String", "getPathVariables", "(", "final", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "final", "StringBuilder", "bpath", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Object"...
Build a path variable for GET requests @param map map for getting path variables @return String
[ "Build", "a", "path", "variable", "for", "GET", "requests" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdServiceImpl.java#L532-L545
36,291
messagebird/java-rest-api
api/src/main/java/com/messagebird/objects/Message.java
Message.setPremiumSMS
public void setPremiumSMS(Object shortcode, Object keyword, Object tariff, Object mid) { final Map<String, Object> premiumSMSConfig = new LinkedHashMap<String, Object>(4); premiumSMSConfig.put("shortcode", shortcode); premiumSMSConfig.put("keyword", keyword); premiumSMSConfig.put("tariff...
java
public void setPremiumSMS(Object shortcode, Object keyword, Object tariff, Object mid) { final Map<String, Object> premiumSMSConfig = new LinkedHashMap<String, Object>(4); premiumSMSConfig.put("shortcode", shortcode); premiumSMSConfig.put("keyword", keyword); premiumSMSConfig.put("tariff...
[ "public", "void", "setPremiumSMS", "(", "Object", "shortcode", ",", "Object", "keyword", ",", "Object", "tariff", ",", "Object", "mid", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "premiumSMSConfig", "=", "new", "LinkedHashMap", "<", "String...
Setup premium SMS type @param shortcode @param keyword @param tariff @param mid
[ "Setup", "premium", "SMS", "type" ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/objects/Message.java#L298-L306
36,292
messagebird/java-rest-api
api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java
ConversationHsmLocalizableParameter.defaultValue
public static ConversationHsmLocalizableParameter defaultValue(final String defaultValue) { ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter(); parameter.defaultValue = defaultValue; return parameter; }
java
public static ConversationHsmLocalizableParameter defaultValue(final String defaultValue) { ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter(); parameter.defaultValue = defaultValue; return parameter; }
[ "public", "static", "ConversationHsmLocalizableParameter", "defaultValue", "(", "final", "String", "defaultValue", ")", "{", "ConversationHsmLocalizableParameter", "parameter", "=", "new", "ConversationHsmLocalizableParameter", "(", ")", ";", "parameter", ".", "defaultValue",...
Gets a parameter that does a simple replacement without localization. @param defaultValue String to replace parameter with.
[ "Gets", "a", "parameter", "that", "does", "a", "simple", "replacement", "without", "localization", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java#L29-L34
36,293
messagebird/java-rest-api
api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java
ConversationHsmLocalizableParameter.currency
public static ConversationHsmLocalizableParameter currency(final String defaultValue, final String code, final int amount) { ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter(); parameter.defaultValue = defaultValue; parameter.currency = new ConversationHsmL...
java
public static ConversationHsmLocalizableParameter currency(final String defaultValue, final String code, final int amount) { ConversationHsmLocalizableParameter parameter = new ConversationHsmLocalizableParameter(); parameter.defaultValue = defaultValue; parameter.currency = new ConversationHsmL...
[ "public", "static", "ConversationHsmLocalizableParameter", "currency", "(", "final", "String", "defaultValue", ",", "final", "String", "code", ",", "final", "int", "amount", ")", "{", "ConversationHsmLocalizableParameter", "parameter", "=", "new", "ConversationHsmLocaliza...
Gets a parameter that localizes a currency. @param defaultValue Default for when localization fails. @param code ISO 4217 compliant currency code. @param amount Amount multiplied by 1000. E.g. 12.34 becomes 12340.
[ "Gets", "a", "parameter", "that", "localizes", "a", "currency", "." ]
f92cd93afff413e6dc12aa6e41e69f26cbae8941
https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/objects/conversations/ConversationHsmLocalizableParameter.java#L43-L49
36,294
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/InternetUtils.java
InternetUtils.getInetAddress
public static InetAddress getInetAddress(String hostName) { try { return InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new IllegalStateException("Unknown host: " + e.getMessage() + ". Make sure you have specified the 'GelfUDPAppende...
java
public static InetAddress getInetAddress(String hostName) { try { return InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new IllegalStateException("Unknown host: " + e.getMessage() + ". Make sure you have specified the 'GelfUDPAppende...
[ "public", "static", "InetAddress", "getInetAddress", "(", "String", "hostName", ")", "{", "try", "{", "return", "InetAddress", ".", "getByName", "(", "hostName", ")", ";", "}", "catch", "(", "UnknownHostException", "e", ")", "{", "throw", "new", "IllegalStateE...
Gets the Inet address for the GelfUDPAppender.remoteHost and gives a specialised error message if an exception is thrown @return The Inet address for GelfUDPAppender.remoteHost
[ "Gets", "the", "Inet", "address", "for", "the", "GelfUDPAppender", ".", "remoteHost", "and", "gives", "a", "specialised", "error", "message", "if", "an", "exception", "is", "thrown" ]
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/InternetUtils.java#L49-L56
36,295
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/GelfLayout.java
GelfLayout.mapFields
private Map<String, Object> mapFields(E logEvent) { Map<String, Object> map = new HashMap<String, Object>(); map.put("host", host); map.put("full_message", fullMessageLayout.doLayout(logEvent)); map.put("short_message", shortMessageLayout.doLayout(logEvent)); stackTraceField(m...
java
private Map<String, Object> mapFields(E logEvent) { Map<String, Object> map = new HashMap<String, Object>(); map.put("host", host); map.put("full_message", fullMessageLayout.doLayout(logEvent)); map.put("short_message", shortMessageLayout.doLayout(logEvent)); stackTraceField(m...
[ "private", "Map", "<", "String", ",", "Object", ">", "mapFields", "(", "E", "logEvent", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "map", ".", "put", "(", "\...
Creates a map of properties that represent the GELF message. @param logEvent The log event @return map of gelf properties
[ "Creates", "a", "map", "of", "properties", "that", "represent", "the", "GELF", "message", "." ]
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/GelfLayout.java#L100-L121
36,296
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/GelfLayout.java
GelfLayout.additionalFields
private void additionalFields(Map<String, Object> map, ILoggingEvent eventObject) { if (useLoggerName) { map.put("_loggerName", eventObject.getLoggerName()); } if(useMarker && eventHasMarker(eventObject)) { map.put("_marker", eventObject.getMarker().toString()); ...
java
private void additionalFields(Map<String, Object> map, ILoggingEvent eventObject) { if (useLoggerName) { map.put("_loggerName", eventObject.getLoggerName()); } if(useMarker && eventHasMarker(eventObject)) { map.put("_marker", eventObject.getMarker().toString()); ...
[ "private", "void", "additionalFields", "(", "Map", "<", "String", ",", "Object", ">", "map", ",", "ILoggingEvent", "eventObject", ")", "{", "if", "(", "useLoggerName", ")", "{", "map", ".", "put", "(", "\"_loggerName\"", ",", "eventObject", ".", "getLoggerNa...
Converts the additional fields into proper GELF JSON @param map The map of additional fields @param eventObject The Logging event that we are converting to GELF
[ "Converts", "the", "additional", "fields", "into", "proper", "GELF", "JSON" ]
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/GelfLayout.java#L144-L179
36,297
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/GelfLayout.java
GelfLayout.addAdditionalField
public void addAdditionalField(String keyValue) { String[] splitted = keyValue.split(":"); if (splitted.length != 2) { throw new IllegalArgumentException("additionalField must be of the format key:value, where key is the MDC " + "key, and value is the GELF field name. B...
java
public void addAdditionalField(String keyValue) { String[] splitted = keyValue.split(":"); if (splitted.length != 2) { throw new IllegalArgumentException("additionalField must be of the format key:value, where key is the MDC " + "key, and value is the GELF field name. B...
[ "public", "void", "addAdditionalField", "(", "String", "keyValue", ")", "{", "String", "[", "]", "splitted", "=", "keyValue", ".", "split", "(", "\":\"", ")", ";", "if", "(", "splitted", ".", "length", "!=", "2", ")", "{", "throw", "new", "IllegalArgumen...
Add an additional field. This is mainly here for compatibility with logback.xml @param keyValue This must be in format key:value where key is the MDC key, and value is the GELF field name. e.g "ipAddress:_ip_address"
[ "Add", "an", "additional", "field", ".", "This", "is", "mainly", "here", "for", "compatibility", "with", "logback", ".", "xml" ]
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/GelfLayout.java#L321-L331
36,298
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/GelfLayout.java
GelfLayout.addStaticAdditionalField
public void addStaticAdditionalField(String keyValue) { String[] splitted = keyValue.split(":"); if (splitted.length != 2) { throw new IllegalArgumentException("staticAdditionalField must be of the format key:value, where key is the " + "additional field key (therefore ...
java
public void addStaticAdditionalField(String keyValue) { String[] splitted = keyValue.split(":"); if (splitted.length != 2) { throw new IllegalArgumentException("staticAdditionalField must be of the format key:value, where key is the " + "additional field key (therefore ...
[ "public", "void", "addStaticAdditionalField", "(", "String", "keyValue", ")", "{", "String", "[", "]", "splitted", "=", "keyValue", ".", "split", "(", "\":\"", ")", ";", "if", "(", "splitted", ".", "length", "!=", "2", ")", "{", "throw", "new", "IllegalA...
Add a staticAdditional field. This is mainly here for compatibility with logback.xml @param keyValue This must be in format key:value where key is the additional field key, and value is a static string. e.g "_node_name:www013" @deprecated Use addStaticField instead
[ "Add", "a", "staticAdditional", "field", ".", "This", "is", "mainly", "here", "for", "compatibility", "with", "logback", ".", "xml" ]
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/GelfLayout.java#L341-L352
36,299
Moocar/logback-gelf
src/main/java/me/moocar/logbackgelf/MessageIdProvider.java
MessageIdProvider.get
public byte[] get() { // Uniqueness is guaranteed by combining the hostname and the current nano second, hashing the result, and // selecting the first x bytes of the result String timestamp = String.valueOf(System.nanoTime()); byte[] digestString = (hostname + timestamp).getBytes(); ...
java
public byte[] get() { // Uniqueness is guaranteed by combining the hostname and the current nano second, hashing the result, and // selecting the first x bytes of the result String timestamp = String.valueOf(System.nanoTime()); byte[] digestString = (hostname + timestamp).getBytes(); ...
[ "public", "byte", "[", "]", "get", "(", ")", "{", "// Uniqueness is guaranteed by combining the hostname and the current nano second, hashing the result, and", "// selecting the first x bytes of the result", "String", "timestamp", "=", "String", ".", "valueOf", "(", "System", "."...
Creates a message id that should be unique on every call. The message ID needs to be unique for every message. If a message is chunked, then each chunk in a message needs the same message ID. @return unique message ID
[ "Creates", "a", "message", "id", "that", "should", "be", "unique", "on", "every", "call", ".", "The", "message", "ID", "needs", "to", "be", "unique", "for", "every", "message", ".", "If", "a", "message", "is", "chunked", "then", "each", "chunk", "in", ...
71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d
https://github.com/Moocar/logback-gelf/blob/71dd32c7c417cb5c712b1f3d8b026ad624f2ae8d/src/main/java/me/moocar/logbackgelf/MessageIdProvider.java#L33-L42