repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
bremersee/comparator | src/main/java/org/bremersee/comparator/ObjectComparatorFactory.java | ObjectComparatorFactory.newInstance | public static ObjectComparatorFactory newInstance(
final String objectComparatorFactoryClassName)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (ObjectComparatorFactory) Class.forName(objectComparatorFactoryClassName).newInstance();
} | java | public static ObjectComparatorFactory newInstance(
final String objectComparatorFactoryClassName)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (ObjectComparatorFactory) Class.forName(objectComparatorFactoryClassName).newInstance();
} | [
"public",
"static",
"ObjectComparatorFactory",
"newInstance",
"(",
"final",
"String",
"objectComparatorFactoryClassName",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"ClassNotFoundException",
"{",
"return",
"(",
"ObjectComparatorFactory",
")",
... | Create a new instance of a the specified factory class.
@param objectComparatorFactoryClassName the factory class
@return a new instance of a the specified factory
@throws InstantiationException if creation of the factory fails
@throws IllegalAccessException if creation of the factory fails
@throws ClassNotFoundExcept... | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"the",
"specified",
"factory",
"class",
"."
] | 6958e6e28a62589106705062f8ffc201a87d9b2a | https://github.com/bremersee/comparator/blob/6958e6e28a62589106705062f8ffc201a87d9b2a/src/main/java/org/bremersee/comparator/ObjectComparatorFactory.java#L47-L51 | train |
bremersee/comparator | src/main/java/org/bremersee/comparator/ObjectComparatorFactory.java | ObjectComparatorFactory.newInstance | public static ObjectComparatorFactory newInstance(final String objectComparatorFactoryClassName,
final ClassLoader classLoader)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (ObjectComparatorFactory) Class
.forName(objectComparatorFactoryClassName, true, ... | java | public static ObjectComparatorFactory newInstance(final String objectComparatorFactoryClassName,
final ClassLoader classLoader)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
return (ObjectComparatorFactory) Class
.forName(objectComparatorFactoryClassName, true, ... | [
"public",
"static",
"ObjectComparatorFactory",
"newInstance",
"(",
"final",
"String",
"objectComparatorFactoryClassName",
",",
"final",
"ClassLoader",
"classLoader",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"ClassNotFoundException",
"{",
"r... | Create a new instance of a the specified factory class by using the specified class loader.
@param objectComparatorFactoryClassName the factory class
@param classLoader the class loader
@return a new instance of a the specified factory
@throws InstantiationException if creation of the factory fail... | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"the",
"specified",
"factory",
"class",
"by",
"using",
"the",
"specified",
"class",
"loader",
"."
] | 6958e6e28a62589106705062f8ffc201a87d9b2a | https://github.com/bremersee/comparator/blob/6958e6e28a62589106705062f8ffc201a87d9b2a/src/main/java/org/bremersee/comparator/ObjectComparatorFactory.java#L63-L69 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.defaultInitializer | public static Initializer defaultInitializer() {
return newInitializer()
.setCloseConcurrency(0)
.setTestOnLogicalOpen(false)
.setTestOnLogicalClose(false)
.setIncompleteTransactionOnClosePolicy(ConnectionPoolConnection.IncompleteTransactionPolicy.REPORT)
... | java | public static Initializer defaultInitializer() {
return newInitializer()
.setCloseConcurrency(0)
.setTestOnLogicalOpen(false)
.setTestOnLogicalClose(false)
.setIncompleteTransactionOnClosePolicy(ConnectionPoolConnection.IncompleteTransactionPolicy.REPORT)
... | [
"public",
"static",
"Initializer",
"defaultInitializer",
"(",
")",
"{",
"return",
"newInitializer",
"(",
")",
".",
"setCloseConcurrency",
"(",
"0",
")",
".",
"setTestOnLogicalOpen",
"(",
"false",
")",
".",
"setTestOnLogicalClose",
"(",
"false",
")",
".",
"setInc... | Creates a segment initializer with default values.
@return The segment initializer with default values. | [
"Creates",
"a",
"segment",
"initializer",
"with",
"default",
"values",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L225-L240 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.reopen | private void reopen(final ConnectionPoolConnection conn) {
if(isActive) {
if(conn.reopenAttempts == 0) {
conn.reopenAttempts++;
reopenService.execute(new Reopener(conn));
} else {
long delayMillis = 100L * conn.reopenAttempts;
if(delayMillis > max... | java | private void reopen(final ConnectionPoolConnection conn) {
if(isActive) {
if(conn.reopenAttempts == 0) {
conn.reopenAttempts++;
reopenService.execute(new Reopener(conn));
} else {
long delayMillis = 100L * conn.reopenAttempts;
if(delayMillis > max... | [
"private",
"void",
"reopen",
"(",
"final",
"ConnectionPoolConnection",
"conn",
")",
"{",
"if",
"(",
"isActive",
")",
"{",
"if",
"(",
"conn",
".",
"reopenAttempts",
"==",
"0",
")",
"{",
"conn",
".",
"reopenAttempts",
"++",
";",
"reopenService",
".",
"execut... | Schedule connection reopen.
@param conn The connection. | [
"Schedule",
"connection",
"reopen",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L722-L737 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.close | final void close(final ConnectionPoolConnection conn) {
if(closeQueue != null) {
closeQueue.add(conn);
} else {
closer.close(conn);
}
} | java | final void close(final ConnectionPoolConnection conn) {
if(closeQueue != null) {
closeQueue.add(conn);
} else {
closer.close(conn);
}
} | [
"final",
"void",
"close",
"(",
"final",
"ConnectionPoolConnection",
"conn",
")",
"{",
"if",
"(",
"closeQueue",
"!=",
"null",
")",
"{",
"closeQueue",
".",
"add",
"(",
"conn",
")",
";",
"}",
"else",
"{",
"closer",
".",
"close",
"(",
"conn",
")",
";",
"... | Adds a connection to the close queue.
@param conn The connection. | [
"Adds",
"a",
"connection",
"to",
"the",
"close",
"queue",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L923-L929 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.getPassword | final String getPassword() {
if(passwordSource == null) {
return dbConnection.password;
} else {
String usePassword = passwordSource.getPassword(dbConnection.name);
if(!Strings.isNullOrEmpty(usePassword)) {
return usePassword;
} else {
usePassword ... | java | final String getPassword() {
if(passwordSource == null) {
return dbConnection.password;
} else {
String usePassword = passwordSource.getPassword(dbConnection.name);
if(!Strings.isNullOrEmpty(usePassword)) {
return usePassword;
} else {
usePassword ... | [
"final",
"String",
"getPassword",
"(",
")",
"{",
"if",
"(",
"passwordSource",
"==",
"null",
")",
"{",
"return",
"dbConnection",
".",
"password",
";",
"}",
"else",
"{",
"String",
"usePassword",
"=",
"passwordSource",
".",
"getPassword",
"(",
"dbConnection",
"... | Gets the password for connection creation.
@return The password. | [
"Gets",
"the",
"password",
"for",
"connection",
"creation",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1159-L1171 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.createRealConnection | private Connection createRealConnection(final long timeoutMillis) throws SQLException {
if(timeoutMillis < 1L) {
String usePassword = getPassword();
Connection conn = dbConnection.datasource == null ?
DriverManager.getConnection(dbConnection.connectionString, dbConnection.use... | java | private Connection createRealConnection(final long timeoutMillis) throws SQLException {
if(timeoutMillis < 1L) {
String usePassword = getPassword();
Connection conn = dbConnection.datasource == null ?
DriverManager.getConnection(dbConnection.connectionString, dbConnection.use... | [
"private",
"Connection",
"createRealConnection",
"(",
"final",
"long",
"timeoutMillis",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"timeoutMillis",
"<",
"1L",
")",
"{",
"String",
"usePassword",
"=",
"getPassword",
"(",
")",
";",
"Connection",
"conn",
"=",
... | Creates a real database connection, failing if one is not obtained in the specified time.
@param timeoutMillis The timeout in milliseconds.
@return The connection.
@throws SQLException on connection problem or timeout waiting for connection. | [
"Creates",
"a",
"real",
"database",
"connection",
"failing",
"if",
"one",
"is",
"not",
"obtained",
"in",
"the",
"specified",
"time",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1179-L1204 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.activate | final void activate() throws SQLException {
for(ConnectionPoolConnection conn : connections) {
conn.forceRealClose();
conn.realOpen();
conn.logicalClose(true); //Tests the connection
}
if(closeQueue != null) {
closeQueue.clear();
}
availableQueue.clear... | java | final void activate() throws SQLException {
for(ConnectionPoolConnection conn : connections) {
conn.forceRealClose();
conn.realOpen();
conn.logicalClose(true); //Tests the connection
}
if(closeQueue != null) {
closeQueue.clear();
}
availableQueue.clear... | [
"final",
"void",
"activate",
"(",
")",
"throws",
"SQLException",
"{",
"for",
"(",
"ConnectionPoolConnection",
"conn",
":",
"connections",
")",
"{",
"conn",
".",
"forceRealClose",
"(",
")",
";",
"conn",
".",
"realOpen",
"(",
")",
";",
"conn",
".",
"logicalC... | Activates the segment by opening and testing all connections.
@throws SQLException if connections could not be created. | [
"Activates",
"the",
"segment",
"by",
"opening",
"and",
"testing",
"all",
"connections",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1210-L1233 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.isIdle | final boolean isIdle() {
for(ConnectionPoolConnection conn : connections) {
if(conn.state.get() == ConnectionPoolConnection.STATE_OPEN) {
return false;
}
}
return true;
} | java | final boolean isIdle() {
for(ConnectionPoolConnection conn : connections) {
if(conn.state.get() == ConnectionPoolConnection.STATE_OPEN) {
return false;
}
}
return true;
} | [
"final",
"boolean",
"isIdle",
"(",
")",
"{",
"for",
"(",
"ConnectionPoolConnection",
"conn",
":",
"connections",
")",
"{",
"if",
"(",
"conn",
".",
"state",
".",
"get",
"(",
")",
"==",
"ConnectionPoolConnection",
".",
"STATE_OPEN",
")",
"{",
"return",
"fals... | Determine if this segment is currently idle.
@return Is the segment idle? | [
"Determine",
"if",
"this",
"segment",
"is",
"currently",
"idle",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1239-L1246 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.deactivateNow | final void deactivateNow() {
isActive = false;
stats.deactivate();
availableQueue.clear();
reopenExecutor.getQueue().clear();
for(ConnectionPoolConnection conn : connections) {
conn.forceRealClose();
conn.state.set(ConnectionPoolConnection.STATE_DISCONNECTED);
}
... | java | final void deactivateNow() {
isActive = false;
stats.deactivate();
availableQueue.clear();
reopenExecutor.getQueue().clear();
for(ConnectionPoolConnection conn : connections) {
conn.forceRealClose();
conn.state.set(ConnectionPoolConnection.STATE_DISCONNECTED);
}
... | [
"final",
"void",
"deactivateNow",
"(",
")",
"{",
"isActive",
"=",
"false",
";",
"stats",
".",
"deactivate",
"(",
")",
";",
"availableQueue",
".",
"clear",
"(",
")",
";",
"reopenExecutor",
".",
"getQueue",
"(",
")",
".",
"clear",
"(",
")",
";",
"for",
... | Deactivates the pool immediately - real-closing all connections out from under the logical connections. | [
"Deactivates",
"the",
"pool",
"immediately",
"-",
"real",
"-",
"closing",
"all",
"connections",
"out",
"from",
"under",
"the",
"logical",
"connections",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1301-L1310 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.getActiveConnectionCount | public final int getActiveConnectionCount() {
if(!isActive) {
return 0;
}
int count = 0;
for(ConnectionPoolConnection conn : connections) {
if(conn.state.get() != ConnectionPoolConnection.STATE_AVAILABLE) {
count++;
}
}
return count;
} | java | public final int getActiveConnectionCount() {
if(!isActive) {
return 0;
}
int count = 0;
for(ConnectionPoolConnection conn : connections) {
if(conn.state.get() != ConnectionPoolConnection.STATE_AVAILABLE) {
count++;
}
}
return count;
} | [
"public",
"final",
"int",
"getActiveConnectionCount",
"(",
")",
"{",
"if",
"(",
"!",
"isActive",
")",
"{",
"return",
"0",
";",
"}",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"ConnectionPoolConnection",
"conn",
":",
"connections",
")",
"{",
"if",
"(",
... | Gets the number of active connections.
@return The number of active connections. | [
"Gets",
"the",
"number",
"of",
"active",
"connections",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1324-L1338 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java | ConnectionPoolSegment.logError | void logError(final String message) {
if(logger != null) {
try {
StringBuilder buf = new StringBuilder(name);
buf.append(":");
buf.append(message);
logger.error(buf.toString());
} catch(Throwable t) {
//Ignore - logging shou... | java | void logError(final String message) {
if(logger != null) {
try {
StringBuilder buf = new StringBuilder(name);
buf.append(":");
buf.append(message);
logger.error(buf.toString());
} catch(Throwable t) {
//Ignore - logging shou... | [
"void",
"logError",
"(",
"final",
"String",
"message",
")",
"{",
"if",
"(",
"logger",
"!=",
"null",
")",
"{",
"try",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"name",
")",
";",
"buf",
".",
"append",
"(",
"\":\"",
")",
";",
"buf",... | Logs an error message.
@param message The message. | [
"Logs",
"an",
"error",
"message",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolSegment.java#L1464-L1475 | train |
attribyte/acp | src/main/java/org/attribyte/sql/pool/Util.java | Util.getStack | static final String getStack(final boolean filter) {
StringBuilder buf = new StringBuilder();
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
for(int i = 2; i < stack.length; i++) {
if(!filter) {
buf.append(stack[i].toString());
buf.append(NEW_LINE)... | java | static final String getStack(final boolean filter) {
StringBuilder buf = new StringBuilder();
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
for(int i = 2; i < stack.length; i++) {
if(!filter) {
buf.append(stack[i].toString());
buf.append(NEW_LINE)... | [
"static",
"final",
"String",
"getStack",
"(",
"final",
"boolean",
"filter",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StackTraceElement",
"[",
"]",
"stack",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getStackTra... | Gets the current stack as a string.
@param filter Should calls from the pool be filtered?
@return The stack as a string. | [
"Gets",
"the",
"current",
"stack",
"as",
"a",
"string",
"."
] | dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659 | https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/Util.java#L97-L113 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.