id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
53,400 | lopspower/CircularProgressBar | circularprogressbar-example/src/main/java/com/mikhaellopez/circularprogressbarsample/MainActivity.java | MainActivity.adjustAlpha | private int adjustAlpha(int color, float factor) {
int alpha = Math.round(Color.alpha(color) * factor);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return Color.argb(alpha, red, green, blue);
} | java | private int adjustAlpha(int color, float factor) {
int alpha = Math.round(Color.alpha(color) * factor);
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return Color.argb(alpha, red, green, blue);
} | [
"private",
"int",
"adjustAlpha",
"(",
"int",
"color",
",",
"float",
"factor",
")",
"{",
"int",
"alpha",
"=",
"Math",
".",
"round",
"(",
"Color",
".",
"alpha",
"(",
"color",
")",
"*",
"factor",
")",
";",
"int",
"red",
"=",
"Color",
".",
"red",
"(",
... | Transparent the given color by the factor
The more the factor closer to zero the more the color gets transparent
@param color The color to transparent
@param factor 1.0f to 0.0f
@return int - A transplanted color | [
"Transparent",
"the",
"given",
"color",
"by",
"the",
"factor",
"The",
"more",
"the",
"factor",
"closer",
"to",
"zero",
"the",
"more",
"the",
"color",
"gets",
"transparent"
] | a805979677f76f6a441dfca2f85f3b01ae6a3e18 | https://github.com/lopspower/CircularProgressBar/blob/a805979677f76f6a441dfca2f85f3b01ae6a3e18/circularprogressbar-example/src/main/java/com/mikhaellopez/circularprogressbarsample/MainActivity.java#L119-L125 |
53,401 | hazelcast/hazelcast-kubernetes | src/main/java/com/hazelcast/kubernetes/KubernetesClient.java | KubernetesClient.callGet | private JsonObject callGet(final String urlString) {
return RetryUtils.retry(new Callable<JsonObject>() {
@Override
public JsonObject call() {
return Json
.parse(RestClient.create(urlString).withHeader("Authorization", String.format("Bearer %s", ap... | java | private JsonObject callGet(final String urlString) {
return RetryUtils.retry(new Callable<JsonObject>() {
@Override
public JsonObject call() {
return Json
.parse(RestClient.create(urlString).withHeader("Authorization", String.format("Bearer %s", ap... | [
"private",
"JsonObject",
"callGet",
"(",
"final",
"String",
"urlString",
")",
"{",
"return",
"RetryUtils",
".",
"retry",
"(",
"new",
"Callable",
"<",
"JsonObject",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"JsonObject",
"call",
"(",
")",
"{",
"return"... | Makes a REST call to Kubernetes API and returns the result JSON.
@param urlString Kubernetes API REST endpoint
@return parsed JSON
@throws KubernetesClientException if Kubernetes API didn't respond with 200 and a valid JSON content | [
"Makes",
"a",
"REST",
"call",
"to",
"Kubernetes",
"API",
"and",
"returns",
"the",
"result",
"JSON",
"."
] | b1144067addf56d1446a9e1007f5cb3290b86815 | https://github.com/hazelcast/hazelcast-kubernetes/blob/b1144067addf56d1446a9e1007f5cb3290b86815/src/main/java/com/hazelcast/kubernetes/KubernetesClient.java#L453-L464 |
53,402 | hazelcast/hazelcast-kubernetes | src/main/java/com/hazelcast/kubernetes/RestClient.java | RestClient.buildSslSocketFactory | private SSLSocketFactory buildSslSocketFactory() {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
keyStore.setCertificateEntry("ca", generateCertificate());
TrustManagerFactory tmf = TrustManagerFactory.getIn... | java | private SSLSocketFactory buildSslSocketFactory() {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
keyStore.setCertificateEntry("ca", generateCertificate());
TrustManagerFactory tmf = TrustManagerFactory.getIn... | [
"private",
"SSLSocketFactory",
"buildSslSocketFactory",
"(",
")",
"{",
"try",
"{",
"KeyStore",
"keyStore",
"=",
"KeyStore",
".",
"getInstance",
"(",
"KeyStore",
".",
"getDefaultType",
"(",
")",
")",
";",
"keyStore",
".",
"load",
"(",
"null",
",",
"null",
")"... | Builds SSL Socket Factory with the public CA Certificate from Kubernetes Master. | [
"Builds",
"SSL",
"Socket",
"Factory",
"with",
"the",
"public",
"CA",
"Certificate",
"from",
"Kubernetes",
"Master",
"."
] | b1144067addf56d1446a9e1007f5cb3290b86815 | https://github.com/hazelcast/hazelcast-kubernetes/blob/b1144067addf56d1446a9e1007f5cb3290b86815/src/main/java/com/hazelcast/kubernetes/RestClient.java#L174-L190 |
53,403 | hazelcast/hazelcast-kubernetes | src/main/java/com/hazelcast/kubernetes/RestClient.java | RestClient.generateCertificate | private Certificate generateCertificate()
throws IOException, CertificateException {
InputStream caInput = null;
try {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
caInput = new ByteArrayInputStream(caCertificate.getBytes("UTF-8"));
ret... | java | private Certificate generateCertificate()
throws IOException, CertificateException {
InputStream caInput = null;
try {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
caInput = new ByteArrayInputStream(caCertificate.getBytes("UTF-8"));
ret... | [
"private",
"Certificate",
"generateCertificate",
"(",
")",
"throws",
"IOException",
",",
"CertificateException",
"{",
"InputStream",
"caInput",
"=",
"null",
";",
"try",
"{",
"CertificateFactory",
"cf",
"=",
"CertificateFactory",
".",
"getInstance",
"(",
"\"X.509\"",
... | Generates CA Certificate from the default CA Cert file or from the externally provided "ca-certificate" property. | [
"Generates",
"CA",
"Certificate",
"from",
"the",
"default",
"CA",
"Cert",
"file",
"or",
"from",
"the",
"externally",
"provided",
"ca",
"-",
"certificate",
"property",
"."
] | b1144067addf56d1446a9e1007f5cb3290b86815 | https://github.com/hazelcast/hazelcast-kubernetes/blob/b1144067addf56d1446a9e1007f5cb3290b86815/src/main/java/com/hazelcast/kubernetes/RestClient.java#L195-L205 |
53,404 | verhas/License3j | src/main/java/javax0/license3j/License.java | License.isOK | public boolean isOK(PublicKey key) {
try {
final var digester = MessageDigest.getInstance(get(DIGEST_KEY).getString());
final var ser = unsigned();
final var digestValue = digester.digest(ser);
final var cipher = Cipher.getInstance(key.getAlgorithm());
... | java | public boolean isOK(PublicKey key) {
try {
final var digester = MessageDigest.getInstance(get(DIGEST_KEY).getString());
final var ser = unsigned();
final var digestValue = digester.digest(ser);
final var cipher = Cipher.getInstance(key.getAlgorithm());
... | [
"public",
"boolean",
"isOK",
"(",
"PublicKey",
"key",
")",
"{",
"try",
"{",
"final",
"var",
"digester",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"get",
"(",
"DIGEST_KEY",
")",
".",
"getString",
"(",
")",
")",
";",
"final",
"var",
"ser",
"=",
"uns... | Returns true if the license is signed and the authenticity of the signature can be checked successfully
using the key.
@param key encryption key to check the authenticity of the license signature
@return {@code true} if the license was properly signed and is intact. In any other cases it returns
{@code false}. | [
"Returns",
"true",
"if",
"the",
"license",
"is",
"signed",
"and",
"the",
"authenticity",
"of",
"the",
"signature",
"can",
"be",
"checked",
"successfully",
"using",
"the",
"key",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/License.java#L135-L147 |
53,405 | verhas/License3j | src/main/java/javax0/license3j/License.java | License.featuresSorted | private Feature[] featuresSorted(Set<String> excluded) {
return this.features.values().stream().filter(f -> !excluded.contains(f.name()))
.sorted(Comparator.comparing(Feature::name)).toArray(Feature[]::new);
} | java | private Feature[] featuresSorted(Set<String> excluded) {
return this.features.values().stream().filter(f -> !excluded.contains(f.name()))
.sorted(Comparator.comparing(Feature::name)).toArray(Feature[]::new);
} | [
"private",
"Feature",
"[",
"]",
"featuresSorted",
"(",
"Set",
"<",
"String",
">",
"excluded",
")",
"{",
"return",
"this",
".",
"features",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"f",
"->",
"!",
"excluded",
".",
"contain... | Get all the features in an array except the excluded ones in sorted order. The sorting is done on the name.
@param excluded the set of the names of the features that are not included to the result
@return the array of the features sorted. | [
"Get",
"all",
"the",
"features",
"in",
"an",
"array",
"except",
"the",
"excluded",
"ones",
"in",
"sorted",
"order",
".",
"The",
"sorting",
"is",
"done",
"on",
"the",
"name",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/License.java#L217-L220 |
53,406 | verhas/License3j | src/main/java/javax0/license3j/Feature.java | Feature.serialized | public byte[] serialized() {
final var nameBuffer = name.getBytes(StandardCharsets.UTF_8);
final var typeLength = Integer.BYTES;
final var nameLength = Integer.BYTES + nameBuffer.length;
final var valueLength = type.fixedSize == VARIABLE_LENGTH ? Integer.BYTES + value.length : type.fixed... | java | public byte[] serialized() {
final var nameBuffer = name.getBytes(StandardCharsets.UTF_8);
final var typeLength = Integer.BYTES;
final var nameLength = Integer.BYTES + nameBuffer.length;
final var valueLength = type.fixedSize == VARIABLE_LENGTH ? Integer.BYTES + value.length : type.fixed... | [
"public",
"byte",
"[",
"]",
"serialized",
"(",
")",
"{",
"final",
"var",
"nameBuffer",
"=",
"name",
".",
"getBytes",
"(",
"StandardCharsets",
".",
"UTF_8",
")",
";",
"final",
"var",
"typeLength",
"=",
"Integer",
".",
"BYTES",
";",
"final",
"var",
"nameLe... | Convert a feature to byte array. The bytes will have the following structure
<pre>
[4-byte type][4-byte name length][4-byte value length][name][value]
</pre>
<p>
or
<pre>
[4-byte type][4-byte name length][name][value]
</pre>
<p>
if the length of the value can be determined from the type (some types have fixed length ... | [
"Convert",
"a",
"feature",
"to",
"byte",
"array",
".",
"The",
"bytes",
"will",
"have",
"the",
"following",
"structure"
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/Feature.java#L141-L154 |
53,407 | verhas/License3j | src/main/java/javax0/license3j/io/LicenseReader.java | LicenseReader.read | public License read(IOFormat format) throws IOException {
switch (format) {
case BINARY:
return License.Create.from(ByteArrayReader.readInput(is));
case BASE64:
return License.Create.from(Base64.getDecoder().decode(ByteArrayReader.readInput(is)));
... | java | public License read(IOFormat format) throws IOException {
switch (format) {
case BINARY:
return License.Create.from(ByteArrayReader.readInput(is));
case BASE64:
return License.Create.from(Base64.getDecoder().decode(ByteArrayReader.readInput(is)));
... | [
"public",
"License",
"read",
"(",
"IOFormat",
"format",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
"BINARY",
":",
"return",
"License",
".",
"Create",
".",
"from",
"(",
"ByteArrayReader",
".",
"readInput",
"(",
"is",
")",
... | Read the license from the input assuming that the format of the license on the input has the format specified by
the argument.
@param format the assumed format of the license, can be {@link IOFormat#STRING},
{@link IOFormat#BASE64} or {@link IOFormat#BINARY}
@return the license
@throws IOException if the input cannot ... | [
"Read",
"the",
"license",
"from",
"the",
"input",
"assuming",
"that",
"the",
"format",
"of",
"the",
"license",
"on",
"the",
"input",
"has",
"the",
"format",
"specified",
"by",
"the",
"argument",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/io/LicenseReader.java#L102-L112 |
53,408 | verhas/License3j | src/main/java/javax0/license3j/io/KeyPairWriter.java | KeyPairWriter.write | public void write(LicenseKeyPair pair, IOFormat format) throws IOException {
switch (format) {
case BINARY:
osPrivate.write(pair.getPrivate());
osPublic.write(pair.getPublic());
return;
case BASE64:
osPrivate.write(Base64.ge... | java | public void write(LicenseKeyPair pair, IOFormat format) throws IOException {
switch (format) {
case BINARY:
osPrivate.write(pair.getPrivate());
osPublic.write(pair.getPublic());
return;
case BASE64:
osPrivate.write(Base64.ge... | [
"public",
"void",
"write",
"(",
"LicenseKeyPair",
"pair",
",",
"IOFormat",
"format",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
"BINARY",
":",
"osPrivate",
".",
"write",
"(",
"pair",
".",
"getPrivate",
"(",
")",
")",
";... | Write the key pair into the output files.
@param pair the key pair to write.
@param format that can be {@link IOFormat#BINARY} or {@link IOFormat#BASE64}. Using {@link IOFormat#STRING}
will throw exception as keys, as opposed to licenses, cannot be saved in string format.
@throws IOException when the underlying media ... | [
"Write",
"the",
"key",
"pair",
"into",
"the",
"output",
"files",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/io/KeyPairWriter.java#L41-L53 |
53,409 | verhas/License3j | src/main/java/javax0/license3j/io/LicenseWriter.java | LicenseWriter.write | public void write(License license, IOFormat format) throws IOException {
switch (format) {
case BINARY:
os.write(license.serialized());
return;
case BASE64:
os.write(Base64.getEncoder().encode(license.serialized()));
return;... | java | public void write(License license, IOFormat format) throws IOException {
switch (format) {
case BINARY:
os.write(license.serialized());
return;
case BASE64:
os.write(Base64.getEncoder().encode(license.serialized()));
return;... | [
"public",
"void",
"write",
"(",
"License",
"license",
",",
"IOFormat",
"format",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
"BINARY",
":",
"os",
".",
"write",
"(",
"license",
".",
"serialized",
"(",
")",
")",
";",
"re... | Write the license into the output.
@param license the license itself
@param format the desired format of the license, can be {@link IOFormat#STRING},
{@link IOFormat#BASE64} or {@link IOFormat#BINARY}
@throws IOException if the output cannot be written | [
"Write",
"the",
"license",
"into",
"the",
"output",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/io/LicenseWriter.java#L35-L48 |
53,410 | verhas/License3j | src/main/java/javax0/license3j/crypto/LicenseKeyPair.java | LicenseKeyPair.getPrivate | public byte[] getPrivate() {
keyNotNull(pair.getPrivate());
Key key = pair.getPrivate();
return getKeyBytes(key);
} | java | public byte[] getPrivate() {
keyNotNull(pair.getPrivate());
Key key = pair.getPrivate();
return getKeyBytes(key);
} | [
"public",
"byte",
"[",
"]",
"getPrivate",
"(",
")",
"{",
"keyNotNull",
"(",
"pair",
".",
"getPrivate",
"(",
")",
")",
";",
"Key",
"key",
"=",
"pair",
".",
"getPrivate",
"(",
")",
";",
"return",
"getKeyBytes",
"(",
"key",
")",
";",
"}"
] | Get the byte representation of the private key as it is returned by the underlying security library. This is
NOT the byte array that contains the algorithm at the start. This is the key in raw format.
@return the key as bytes | [
"Get",
"the",
"byte",
"representation",
"of",
"the",
"private",
"key",
"as",
"it",
"is",
"returned",
"by",
"the",
"underlying",
"security",
"library",
".",
"This",
"is",
"NOT",
"the",
"byte",
"array",
"that",
"contains",
"the",
"algorithm",
"at",
"the",
"s... | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/crypto/LicenseKeyPair.java#L56-L60 |
53,411 | verhas/License3j | src/main/java/javax0/license3j/crypto/LicenseKeyPair.java | LicenseKeyPair.getPublic | public byte[] getPublic() {
keyNotNull(pair.getPublic());
Key key = pair.getPublic();
return getKeyBytes(key);
} | java | public byte[] getPublic() {
keyNotNull(pair.getPublic());
Key key = pair.getPublic();
return getKeyBytes(key);
} | [
"public",
"byte",
"[",
"]",
"getPublic",
"(",
")",
"{",
"keyNotNull",
"(",
"pair",
".",
"getPublic",
"(",
")",
")",
";",
"Key",
"key",
"=",
"pair",
".",
"getPublic",
"(",
")",
";",
"return",
"getKeyBytes",
"(",
"key",
")",
";",
"}"
] | Get the byte representation of the public key as it is returned by the underlying security library. This is
NOT the byte array that contains the algorithm at the start. This is the key in raw format.
@return the key as bytes | [
"Get",
"the",
"byte",
"representation",
"of",
"the",
"public",
"key",
"as",
"it",
"is",
"returned",
"by",
"the",
"underlying",
"security",
"library",
".",
"This",
"is",
"NOT",
"the",
"byte",
"array",
"that",
"contains",
"the",
"algorithm",
"at",
"the",
"st... | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/crypto/LicenseKeyPair.java#L68-L72 |
53,412 | verhas/License3j | src/main/java/javax0/license3j/HardwareBinder.java | HardwareBinder.getMachineIdString | public String getMachineIdString() throws NoSuchAlgorithmException,
SocketException, UnknownHostException {
return calculator.getMachineIdString(useNetwork, useHostName, useArchitecture);
} | java | public String getMachineIdString() throws NoSuchAlgorithmException,
SocketException, UnknownHostException {
return calculator.getMachineIdString(useNetwork, useHostName, useArchitecture);
} | [
"public",
"String",
"getMachineIdString",
"(",
")",
"throws",
"NoSuchAlgorithmException",
",",
"SocketException",
",",
"UnknownHostException",
"{",
"return",
"calculator",
".",
"getMachineIdString",
"(",
"useNetwork",
",",
"useHostName",
",",
"useArchitecture",
")",
";"... | Get the machine id as an UUID string.
@return the UUID as a string
@throws UnknownHostException in case some error
@throws SocketException in case some error
@throws NoSuchAlgorithmException in case some error | [
"Get",
"the",
"machine",
"id",
"as",
"an",
"UUID",
"string",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/HardwareBinder.java#L181-L184 |
53,413 | verhas/License3j | src/main/java/javax0/license3j/HardwareBinder.java | HardwareBinder.assertUUID | public boolean assertUUID(final UUID uuid)
throws NoSuchAlgorithmException, SocketException,
UnknownHostException {
return calculator.assertUUID(uuid, useNetwork, useHostName, useArchitecture);
} | java | public boolean assertUUID(final UUID uuid)
throws NoSuchAlgorithmException, SocketException,
UnknownHostException {
return calculator.assertUUID(uuid, useNetwork, useHostName, useArchitecture);
} | [
"public",
"boolean",
"assertUUID",
"(",
"final",
"UUID",
"uuid",
")",
"throws",
"NoSuchAlgorithmException",
",",
"SocketException",
",",
"UnknownHostException",
"{",
"return",
"calculator",
".",
"assertUUID",
"(",
"uuid",
",",
"useNetwork",
",",
"useHostName",
",",
... | Asserts that the current machine has the UUID.
@param uuid expected
@return true if the argument passed is the uuid of the current machine.
@throws UnknownHostException in case some error
@throws SocketException in case some error
@throws NoSuchAlgorithmException in case some error | [
"Asserts",
"that",
"the",
"current",
"machine",
"has",
"the",
"UUID",
"."
] | f44c6e81b3eb59ab591cc757792749d3556b4afb | https://github.com/verhas/License3j/blob/f44c6e81b3eb59ab591cc757792749d3556b4afb/src/main/java/javax0/license3j/HardwareBinder.java#L195-L199 |
53,414 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.createSessionId | @Nonnull
public String createSessionId( @Nonnull final String sessionId ) {
return isEncodeNodeIdInSessionId() ? _sessionIdFormat.createSessionId(sessionId, _nodeIdService.getMemcachedNodeId() ) : sessionId;
} | java | @Nonnull
public String createSessionId( @Nonnull final String sessionId ) {
return isEncodeNodeIdInSessionId() ? _sessionIdFormat.createSessionId(sessionId, _nodeIdService.getMemcachedNodeId() ) : sessionId;
} | [
"@",
"Nonnull",
"public",
"String",
"createSessionId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
")",
"{",
"return",
"isEncodeNodeIdInSessionId",
"(",
")",
"?",
"_sessionIdFormat",
".",
"createSessionId",
"(",
"sessionId",
",",
"_nodeIdService",
".",
"g... | Creates a new sessionId based on the given one, usually by appending a randomly selected memcached node id.
If the memcachedNodes were configured using a single node without nodeId, the sessionId is returned unchanged. | [
"Creates",
"a",
"new",
"sessionId",
"based",
"on",
"the",
"given",
"one",
"usually",
"by",
"appending",
"a",
"randomly",
"selected",
"memcached",
"node",
"id",
".",
"If",
"the",
"memcachedNodes",
"were",
"configured",
"using",
"a",
"single",
"node",
"without",... | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L402-L405 |
53,415 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.setNodeAvailable | public void setNodeAvailable(@Nullable final String nodeId, final boolean available) {
if ( _nodeIdService != null ) {
_nodeIdService.setNodeAvailable(nodeId, available);
}
} | java | public void setNodeAvailable(@Nullable final String nodeId, final boolean available) {
if ( _nodeIdService != null ) {
_nodeIdService.setNodeAvailable(nodeId, available);
}
} | [
"public",
"void",
"setNodeAvailable",
"(",
"@",
"Nullable",
"final",
"String",
"nodeId",
",",
"final",
"boolean",
"available",
")",
"{",
"if",
"(",
"_nodeIdService",
"!=",
"null",
")",
"{",
"_nodeIdService",
".",
"setNodeAvailable",
"(",
"nodeId",
",",
"availa... | Mark the given nodeId as available as specified.
@param nodeId the nodeId to update
@param available specifies if the node was abailable or not | [
"Mark",
"the",
"given",
"nodeId",
"as",
"available",
"as",
"specified",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L412-L416 |
53,416 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.isValidForMemcached | public boolean isValidForMemcached(final String sessionId) {
if ( isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
if ( nodeId == null ) {
LOG.debug( "The sessionId does not contain a nodeId so that the memcached node could not be i... | java | public boolean isValidForMemcached(final String sessionId) {
if ( isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
if ( nodeId == null ) {
LOG.debug( "The sessionId does not contain a nodeId so that the memcached node could not be i... | [
"public",
"boolean",
"isValidForMemcached",
"(",
"final",
"String",
"sessionId",
")",
"{",
"if",
"(",
"isEncodeNodeIdInSessionId",
"(",
")",
")",
"{",
"final",
"String",
"nodeId",
"=",
"_sessionIdFormat",
".",
"extractMemcachedId",
"(",
"sessionId",
")",
";",
"i... | Can be used to determine if the given sessionId can be used to interact with memcached.
@see #canHitMemcached(String) | [
"Can",
"be",
"used",
"to",
"determine",
"if",
"the",
"given",
"sessionId",
"can",
"be",
"used",
"to",
"interact",
"with",
"memcached",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L431-L440 |
53,417 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.canHitMemcached | public boolean canHitMemcached(final String sessionId) {
if ( isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
if ( nodeId == null ) {
LOG.debug( "The sessionId does not contain a nodeId so that the memcached node could not be ident... | java | public boolean canHitMemcached(final String sessionId) {
if ( isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
if ( nodeId == null ) {
LOG.debug( "The sessionId does not contain a nodeId so that the memcached node could not be ident... | [
"public",
"boolean",
"canHitMemcached",
"(",
"final",
"String",
"sessionId",
")",
"{",
"if",
"(",
"isEncodeNodeIdInSessionId",
"(",
")",
")",
"{",
"final",
"String",
"nodeId",
"=",
"_sessionIdFormat",
".",
"extractMemcachedId",
"(",
"sessionId",
")",
";",
"if",
... | Can be used to determine if the given sessionId can be used to interact with memcached.
This also checks if the related memcached is available.
@see #isValidForMemcached(String) | [
"Can",
"be",
"used",
"to",
"determine",
"if",
"the",
"given",
"sessionId",
"can",
"be",
"used",
"to",
"interact",
"with",
"memcached",
".",
"This",
"also",
"checks",
"if",
"the",
"related",
"memcached",
"is",
"available",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L447-L460 |
53,418 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.setNodeAvailableForSessionId | public String setNodeAvailableForSessionId(final String sessionId, final boolean available) {
if ( _nodeIdService != null && isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId(sessionId);
if ( nodeId != null ) {
_nodeIdService.setNodeAvailable(nodeId, available);
r... | java | public String setNodeAvailableForSessionId(final String sessionId, final boolean available) {
if ( _nodeIdService != null && isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId(sessionId);
if ( nodeId != null ) {
_nodeIdService.setNodeAvailable(nodeId, available);
r... | [
"public",
"String",
"setNodeAvailableForSessionId",
"(",
"final",
"String",
"sessionId",
",",
"final",
"boolean",
"available",
")",
"{",
"if",
"(",
"_nodeIdService",
"!=",
"null",
"&&",
"isEncodeNodeIdInSessionId",
"(",
")",
")",
"{",
"final",
"String",
"nodeId",
... | Mark the memcached node encoded in the given sessionId as available or not. If nodeIds shall
not be encoded in the sessionId or if the given sessionId does not contain a nodeId no
action will be taken.
@param sessionId the sessionId that may contain a node id.
@param available specifies if the possibly referenced node... | [
"Mark",
"the",
"memcached",
"node",
"encoded",
"in",
"the",
"given",
"sessionId",
"as",
"available",
"or",
"not",
".",
"If",
"nodeIds",
"shall",
"not",
"be",
"encoded",
"in",
"the",
"sessionId",
"or",
"if",
"the",
"given",
"sessionId",
"does",
"not",
"cont... | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L482-L494 |
53,419 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.changeSessionIdForTomcatFailover | public String changeSessionIdForTomcatFailover( @Nonnull final String sessionId, final String jvmRoute ) {
final String newSessionId = jvmRoute != null && !jvmRoute.trim().isEmpty()
? _sessionIdFormat.changeJvmRoute( sessionId, jvmRoute )
: _sessionIdFormat.stripJvmRoute(sessionI... | java | public String changeSessionIdForTomcatFailover( @Nonnull final String sessionId, final String jvmRoute ) {
final String newSessionId = jvmRoute != null && !jvmRoute.trim().isEmpty()
? _sessionIdFormat.changeJvmRoute( sessionId, jvmRoute )
: _sessionIdFormat.stripJvmRoute(sessionI... | [
"public",
"String",
"changeSessionIdForTomcatFailover",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"final",
"String",
"jvmRoute",
")",
"{",
"final",
"String",
"newSessionId",
"=",
"jvmRoute",
"!=",
"null",
"&&",
"!",
"jvmRoute",
".",
"trim",
"(",
... | Changes the sessionId by setting the given jvmRoute and replacing the memcachedNodeId if it's currently
set to a failoverNodeId.
@param sessionId the current session id
@param jvmRoute the new jvmRoute to set.
@return the session id with maybe new jvmRoute and/or new memcachedId. | [
"Changes",
"the",
"sessionId",
"by",
"setting",
"the",
"given",
"jvmRoute",
"and",
"replacing",
"the",
"memcachedNodeId",
"if",
"it",
"s",
"currently",
"set",
"to",
"a",
"failoverNodeId",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L520-L534 |
53,420 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.getCouchbaseBucketURIs | public List<URI> getCouchbaseBucketURIs() {
if(!isCouchbaseBucketConfig())
throw new IllegalStateException("This is not a couchbase bucket configuration.");
final List<URI> result = new ArrayList<URI>(_address2Ids.size());
final Matcher matcher = COUCHBASE_BUCKET_NODE_PATTERN.matcher... | java | public List<URI> getCouchbaseBucketURIs() {
if(!isCouchbaseBucketConfig())
throw new IllegalStateException("This is not a couchbase bucket configuration.");
final List<URI> result = new ArrayList<URI>(_address2Ids.size());
final Matcher matcher = COUCHBASE_BUCKET_NODE_PATTERN.matcher... | [
"public",
"List",
"<",
"URI",
">",
"getCouchbaseBucketURIs",
"(",
")",
"{",
"if",
"(",
"!",
"isCouchbaseBucketConfig",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"This is not a couchbase bucket configuration.\"",
")",
";",
"final",
"List",
"<",
... | Returns a list of couchbase REST interface uris if the current configuration is
a couchbase bucket configuration.
@see #isCouchbaseBucketConfig() | [
"Returns",
"a",
"list",
"of",
"couchbase",
"REST",
"interface",
"uris",
"if",
"the",
"current",
"configuration",
"is",
"a",
"couchbase",
"bucket",
"configuration",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L557-L570 |
53,421 | magro/memcached-session-manager | tomcat6/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java | MemcachedBackupSessionManager.setMaxActiveSessions | public void setMaxActiveSessions( final int max ) {
final int oldMaxActiveSessions = _maxActiveSessions;
_maxActiveSessions = max;
support.firePropertyChange( "maxActiveSessions",
Integer.valueOf( oldMaxActiveSessions ),
Integer.valueOf( _maxActiveSessions ) );
... | java | public void setMaxActiveSessions( final int max ) {
final int oldMaxActiveSessions = _maxActiveSessions;
_maxActiveSessions = max;
support.firePropertyChange( "maxActiveSessions",
Integer.valueOf( oldMaxActiveSessions ),
Integer.valueOf( _maxActiveSessions ) );
... | [
"public",
"void",
"setMaxActiveSessions",
"(",
"final",
"int",
"max",
")",
"{",
"final",
"int",
"oldMaxActiveSessions",
"=",
"_maxActiveSessions",
";",
"_maxActiveSessions",
"=",
"max",
";",
"support",
".",
"firePropertyChange",
"(",
"\"maxActiveSessions\"",
",",
"I... | Set the maximum number of active Sessions allowed, or -1 for no limit.
@param max
The new maximum number of sessions | [
"Set",
"the",
"maximum",
"number",
"of",
"active",
"Sessions",
"allowed",
"or",
"-",
"1",
"for",
"no",
"limit",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/tomcat6/src/main/java/de/javakaffee/web/msm/MemcachedBackupSessionManager.java#L288-L294 |
53,422 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/ReadOnlyRequestsCache.java | ReadOnlyRequestsCache.modifyingRequest | public void modifyingRequest( final String requestId ) {
if ( _log.isDebugEnabled() ) {
_log.debug( "Registering modifying request: " + requestId );
}
incrementOrPut( _blacklist, requestId );
_readOnlyRequests.remove( requestId );
} | java | public void modifyingRequest( final String requestId ) {
if ( _log.isDebugEnabled() ) {
_log.debug( "Registering modifying request: " + requestId );
}
incrementOrPut( _blacklist, requestId );
_readOnlyRequests.remove( requestId );
} | [
"public",
"void",
"modifyingRequest",
"(",
"final",
"String",
"requestId",
")",
"{",
"if",
"(",
"_log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"_log",
".",
"debug",
"(",
"\"Registering modifying request: \"",
"+",
"requestId",
")",
";",
"}",
"incrementOrPu... | Registers the given requestURI as a modifying request, which can be seen as a blacklist for
readonly requests. There's a limit on number and time for modifying requests beeing stored.
@param requestId the request uri to track. | [
"Registers",
"the",
"given",
"requestURI",
"as",
"a",
"modifying",
"request",
"which",
"can",
"be",
"seen",
"as",
"a",
"blacklist",
"for",
"readonly",
"requests",
".",
"There",
"s",
"a",
"limit",
"on",
"number",
"and",
"time",
"for",
"modifying",
"requests",... | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/ReadOnlyRequestsCache.java#L83-L89 |
53,423 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/ReadOnlyRequestsCache.java | ReadOnlyRequestsCache.isReadOnlyRequest | public boolean isReadOnlyRequest( final String requestId ) {
if ( _log.isDebugEnabled() ) {
_log.debug( "Asked for readonly request: " + requestId + " ("+ _readOnlyRequests.containsKey( requestId ) +")" );
}
// TODO: add some threshold
return _readOnlyRequests.containsKey( re... | java | public boolean isReadOnlyRequest( final String requestId ) {
if ( _log.isDebugEnabled() ) {
_log.debug( "Asked for readonly request: " + requestId + " ("+ _readOnlyRequests.containsKey( requestId ) +")" );
}
// TODO: add some threshold
return _readOnlyRequests.containsKey( re... | [
"public",
"boolean",
"isReadOnlyRequest",
"(",
"final",
"String",
"requestId",
")",
"{",
"if",
"(",
"_log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"_log",
".",
"debug",
"(",
"\"Asked for readonly request: \"",
"+",
"requestId",
"+",
"\" (\"",
"+",
"_readOn... | Determines, if the given requestURI is a readOnly request and not blacklisted as a modifying request.
@param requestId the request uri to check
@return <code>true</code> if the given request uri can be regarded as read only. | [
"Determines",
"if",
"the",
"given",
"requestURI",
"is",
"a",
"readOnly",
"request",
"and",
"not",
"blacklisted",
"as",
"a",
"modifying",
"request",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/ReadOnlyRequestsCache.java#L96-L102 |
53,424 | magro/memcached-session-manager | flexjson-serializer/src/main/java/de/javakaffee/web/msm/serializer/json/JSONTranscoder.java | JSONTranscoder.deserializeAttributes | @Override
public ConcurrentMap<String, Object> deserializeAttributes(final byte[] in) {
final InputStreamReader inputStream = new InputStreamReader( new ByteArrayInputStream( in ) );
if (LOG.isDebugEnabled()) {
LOG.debug("deserialize the stream");
}
try {
return deserializer.deserializeInto(inp... | java | @Override
public ConcurrentMap<String, Object> deserializeAttributes(final byte[] in) {
final InputStreamReader inputStream = new InputStreamReader( new ByteArrayInputStream( in ) );
if (LOG.isDebugEnabled()) {
LOG.debug("deserialize the stream");
}
try {
return deserializer.deserializeInto(inp... | [
"@",
"Override",
"public",
"ConcurrentMap",
"<",
"String",
",",
"Object",
">",
"deserializeAttributes",
"(",
"final",
"byte",
"[",
"]",
"in",
")",
"{",
"final",
"InputStreamReader",
"inputStream",
"=",
"new",
"InputStreamReader",
"(",
"new",
"ByteArrayInputStream"... | Return the deserialized map
@param in bytes to deserialize
@return map of deserialized objects | [
"Return",
"the",
"deserialized",
"map"
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/flexjson-serializer/src/main/java/de/javakaffee/web/msm/serializer/json/JSONTranscoder.java#L68-L80 |
53,425 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java | LockingStrategy.onBackupWithoutLoadedSession | protected void onBackupWithoutLoadedSession( @Nonnull final String sessionId, @Nonnull final String requestId,
@Nonnull final BackupSessionService backupSessionService ) {
if ( !_sessionIdFormat.isValid( sessionId ) ) {
return;
}
try {
final long start = Sy... | java | protected void onBackupWithoutLoadedSession( @Nonnull final String sessionId, @Nonnull final String requestId,
@Nonnull final BackupSessionService backupSessionService ) {
if ( !_sessionIdFormat.isValid( sessionId ) ) {
return;
}
try {
final long start = Sy... | [
"protected",
"void",
"onBackupWithoutLoadedSession",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"@",
"Nonnull",
"final",
"String",
"requestId",
",",
"@",
"Nonnull",
"final",
"BackupSessionService",
"backupSessionService",
")",
"{",
"if",
"(",
"!",
"... | Is invoked for the backup of a non-sticky session that was not accessed for the current request. | [
"Is",
"invoked",
"for",
"the",
"backup",
"of",
"a",
"non",
"-",
"sticky",
"session",
"that",
"was",
"not",
"accessed",
"for",
"the",
"current",
"request",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java#L219-L266 |
53,426 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java | LockingStrategy.onAfterBackupSession | protected void onAfterBackupSession( @Nonnull final MemcachedBackupSession session, final boolean backupWasForced,
@Nonnull final Future<BackupResult> result, @Nonnull final String requestId,
@Nonnull final BackupSessionService backupSessionService ) {
if ( !_sessionIdFormat.isValid( se... | java | protected void onAfterBackupSession( @Nonnull final MemcachedBackupSession session, final boolean backupWasForced,
@Nonnull final Future<BackupResult> result, @Nonnull final String requestId,
@Nonnull final BackupSessionService backupSessionService ) {
if ( !_sessionIdFormat.isValid( se... | [
"protected",
"void",
"onAfterBackupSession",
"(",
"@",
"Nonnull",
"final",
"MemcachedBackupSession",
"session",
",",
"final",
"boolean",
"backupWasForced",
",",
"@",
"Nonnull",
"final",
"Future",
"<",
"BackupResult",
">",
"result",
",",
"@",
"Nonnull",
"final",
"S... | Is invoked after the backup of the session is initiated, it's represented by the provided backupResult. The
requestId is identifying the request. | [
"Is",
"invoked",
"after",
"the",
"backup",
"of",
"the",
"session",
"is",
"initiated",
"it",
"s",
"represented",
"by",
"the",
"provided",
"backupResult",
".",
"The",
"requestId",
"is",
"identifying",
"the",
"request",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java#L272-L324 |
53,427 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java | LockingStrategy.onAfterDeleteFromMemcached | protected void onAfterDeleteFromMemcached( @Nonnull final String sessionId ) {
final long start = System.currentTimeMillis();
final String validityInfoKey = _sessionIdFormat.createValidityInfoKeyName( sessionId );
_storage.delete( validityInfoKey );
if (_storeSecondaryBackup) {
... | java | protected void onAfterDeleteFromMemcached( @Nonnull final String sessionId ) {
final long start = System.currentTimeMillis();
final String validityInfoKey = _sessionIdFormat.createValidityInfoKeyName( sessionId );
_storage.delete( validityInfoKey );
if (_storeSecondaryBackup) {
... | [
"protected",
"void",
"onAfterDeleteFromMemcached",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
")",
"{",
"final",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"final",
"String",
"validityInfoKey",
"=",
"_sessionIdFormat",
".",
... | Invoked after a non-sticky session is removed from memcached. | [
"Invoked",
"after",
"a",
"non",
"-",
"sticky",
"session",
"is",
"removed",
"from",
"memcached",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LockingStrategy.java#L377-L393 |
53,428 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java | MemcachedSessionService.startInternal | void startInternal() throws LifecycleException {
_log.info( getClass().getSimpleName() + " starts initialization... (configured" +
" nodes definition " + _memcachedNodes + ", failover nodes " + _failoverNodes + ")" );
_statistics = Statistics.create( _enableStatistics );
_memca... | java | void startInternal() throws LifecycleException {
_log.info( getClass().getSimpleName() + " starts initialization... (configured" +
" nodes definition " + _memcachedNodes + ", failover nodes " + _failoverNodes + ")" );
_statistics = Statistics.create( _enableStatistics );
_memca... | [
"void",
"startInternal",
"(",
")",
"throws",
"LifecycleException",
"{",
"_log",
".",
"info",
"(",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
"+",
"\" starts initialization... (configured\"",
"+",
"\" nodes definition \"",
"+",
"_memcachedNodes",
"+",
"\",... | Initialize this manager. | [
"Initialize",
"this",
"manager",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java#L431-L467 |
53,429 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java | MemcachedSessionService.backupSession | public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) {
if ( !_enabled.get() ) {
return new SimpleFuture<BackupResult>( BackupResult.SKIPPED );
}
final MemcachedBackupSession msmSession = _manager.getSessionIntern... | java | public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) {
if ( !_enabled.get() ) {
return new SimpleFuture<BackupResult>( BackupResult.SKIPPED );
}
final MemcachedBackupSession msmSession = _manager.getSessionIntern... | [
"public",
"Future",
"<",
"BackupResult",
">",
"backupSession",
"(",
"final",
"String",
"sessionId",
",",
"final",
"boolean",
"sessionIdChanged",
",",
"final",
"String",
"requestId",
")",
"{",
"if",
"(",
"!",
"_enabled",
".",
"get",
"(",
")",
")",
"{",
"ret... | Backup the session for the provided session id in memcached if the session was modified or
if the session needs to be relocated. In non-sticky session-mode the session should not be
loaded from memcached for just storing it again but only metadata should be updated.
@param sessionId
the if of the session to backup
@pa... | [
"Backup",
"the",
"session",
"for",
"the",
"provided",
"session",
"id",
"in",
"memcached",
"if",
"the",
"session",
"was",
"modified",
"or",
"if",
"the",
"session",
"needs",
"to",
"be",
"relocated",
".",
"In",
"non",
"-",
"sticky",
"session",
"-",
"mode",
... | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedSessionService.java#L1058-L1105 |
53,430 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.createSessionId | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Creating new session id with orig id '" + sessionId + "' and memcached id '" + memcachedId + "'." );
}
if ( memcachedId == null ... | java | @Nonnull
public String createSessionId(@Nonnull final String sessionId, @Nullable final String memcachedId) {
if ( LOG.isDebugEnabled() ) {
LOG.debug( "Creating new session id with orig id '" + sessionId + "' and memcached id '" + memcachedId + "'." );
}
if ( memcachedId == null ... | [
"@",
"Nonnull",
"public",
"String",
"createSessionId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"@",
"Nullable",
"final",
"String",
"memcachedId",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
... | Create a session id including the provided memcachedId.
@param sessionId
the original session id, it might contain the jvm route
@param memcachedId
the memcached id to encode in the session id, may be <code>null</code>.
@return the sessionId which now contains the memcachedId if one was provided, otherwise
the session... | [
"Create",
"a",
"session",
"id",
"including",
"the",
"provided",
"memcachedId",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L71-L85 |
53,431 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.extractMemcachedId | @CheckForNull
public String extractMemcachedId( @Nonnull final String sessionId ) {
final int idxDash = sessionId.indexOf( '-' );
if ( idxDash < 0 ) {
return null;
}
final int idxDot = sessionId.indexOf( '.' );
if ( idxDot < 0 ) {
return sessionId.subs... | java | @CheckForNull
public String extractMemcachedId( @Nonnull final String sessionId ) {
final int idxDash = sessionId.indexOf( '-' );
if ( idxDash < 0 ) {
return null;
}
final int idxDot = sessionId.indexOf( '.' );
if ( idxDot < 0 ) {
return sessionId.subs... | [
"@",
"CheckForNull",
"public",
"String",
"extractMemcachedId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
")",
"{",
"final",
"int",
"idxDash",
"=",
"sessionId",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"idxDash",
"<",
"0",
")",
"{",
... | Extract the memcached id from the given session id.
@param sessionId
the session id including the memcached id and eventually the
jvmRoute.
@return the memcached id or null if the session id didn't contain any
memcached id. | [
"Extract",
"the",
"memcached",
"id",
"from",
"the",
"given",
"session",
"id",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L158-L172 |
53,432 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.extractJvmRoute | @CheckForNull
public String extractJvmRoute( @Nonnull final String sessionId ) {
final int idxDot = sessionId.indexOf( '.' );
return idxDot < 0 ? null : sessionId.substring( idxDot + 1 );
} | java | @CheckForNull
public String extractJvmRoute( @Nonnull final String sessionId ) {
final int idxDot = sessionId.indexOf( '.' );
return idxDot < 0 ? null : sessionId.substring( idxDot + 1 );
} | [
"@",
"CheckForNull",
"public",
"String",
"extractJvmRoute",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
")",
"{",
"final",
"int",
"idxDot",
"=",
"sessionId",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"return",
"idxDot",
"<",
"0",
"?",
"null",
":"... | Extract the jvm route from the given session id if existing.
@param sessionId
the session id possibly including the memcached id and eventually the
jvmRoute.
@return the jvm route or null if the session id didn't contain any. | [
"Extract",
"the",
"jvm",
"route",
"from",
"the",
"given",
"session",
"id",
"if",
"existing",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L182-L186 |
53,433 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.stripJvmRoute | @Nonnull
public String stripJvmRoute( @Nonnull final String sessionId ) {
final int idxDot = sessionId.indexOf( '.' );
return idxDot < 0 ? sessionId : sessionId.substring( 0, idxDot );
} | java | @Nonnull
public String stripJvmRoute( @Nonnull final String sessionId ) {
final int idxDot = sessionId.indexOf( '.' );
return idxDot < 0 ? sessionId : sessionId.substring( 0, idxDot );
} | [
"@",
"Nonnull",
"public",
"String",
"stripJvmRoute",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
")",
"{",
"final",
"int",
"idxDot",
"=",
"sessionId",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"return",
"idxDot",
"<",
"0",
"?",
"sessionId",
":",
... | Remove the jvm route from the given session id if existing.
@param sessionId
the session id possibly including the memcached id and eventually the
jvmRoute.
@return the session id without the jvm route. | [
"Remove",
"the",
"jvm",
"route",
"from",
"the",
"given",
"session",
"id",
"if",
"existing",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L196-L200 |
53,434 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/DummyMemcachedSessionService.java | DummyMemcachedSessionService.backupSession | public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) {
final MemcachedBackupSession session = _manager.getSessionInternal( sessionId );
if ( session == null ) {
if(_log.isDebugEnabled())
_log.deb... | java | public Future<BackupResult> backupSession( final String sessionId, final boolean sessionIdChanged, final String requestId ) {
final MemcachedBackupSession session = _manager.getSessionInternal( sessionId );
if ( session == null ) {
if(_log.isDebugEnabled())
_log.deb... | [
"public",
"Future",
"<",
"BackupResult",
">",
"backupSession",
"(",
"final",
"String",
"sessionId",
",",
"final",
"boolean",
"sessionIdChanged",
",",
"final",
"String",
"requestId",
")",
"{",
"final",
"MemcachedBackupSession",
"session",
"=",
"_manager",
".",
"get... | Store the provided session in memcached if the session was modified
or if the session needs to be relocated.
@param session
the session to save
@param sessionRelocationRequired
specifies, if the session id was changed due to a memcached failover or tomcat failover.
@return the {@link BackupResultStatus} | [
"Store",
"the",
"provided",
"session",
"in",
"memcached",
"if",
"the",
"session",
"was",
"modified",
"or",
"if",
"the",
"session",
"needs",
"to",
"be",
"relocated",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/DummyMemcachedSessionService.java#L96-L116 |
53,435 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java | MemcachedBackupSession.filterAttribute | private boolean filterAttribute( final String name ) {
if ( this.manager == null ) {
throw new IllegalStateException( "There's no manager set." );
}
final Pattern pattern = ((SessionManager)manager).getMemcachedSessionService().getSessionAttributePattern();
if ( pattern == nu... | java | private boolean filterAttribute( final String name ) {
if ( this.manager == null ) {
throw new IllegalStateException( "There's no manager set." );
}
final Pattern pattern = ((SessionManager)manager).getMemcachedSessionService().getSessionAttributePattern();
if ( pattern == nu... | [
"private",
"boolean",
"filterAttribute",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"manager",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"There's no manager set.\"",
")",
";",
"}",
"final",
"Pattern",
"patte... | Check whether the given attribute name matches our name pattern and shall be stored in memcached.
@return true if the name matches | [
"Check",
"whether",
"the",
"given",
"attribute",
"name",
"matches",
"our",
"name",
"pattern",
"and",
"shall",
"be",
"stored",
"in",
"memcached",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java#L258-L267 |
53,436 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java | MemcachedBackupSession.getMemcachedExpirationTime | int getMemcachedExpirationTime() {
if ( !_sticky ) {
throw new IllegalStateException( "The memcached expiration time cannot be determined in non-sticky mode." );
}
if ( _lastMemcachedExpirationTime == 0 ) {
return 0;
}
final long timeIdleInMillis = _lastB... | java | int getMemcachedExpirationTime() {
if ( !_sticky ) {
throw new IllegalStateException( "The memcached expiration time cannot be determined in non-sticky mode." );
}
if ( _lastMemcachedExpirationTime == 0 ) {
return 0;
}
final long timeIdleInMillis = _lastB... | [
"int",
"getMemcachedExpirationTime",
"(",
")",
"{",
"if",
"(",
"!",
"_sticky",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The memcached expiration time cannot be determined in non-sticky mode.\"",
")",
";",
"}",
"if",
"(",
"_lastMemcachedExpirationTime",
"... | Gets the time in seconds when this session will expire in memcached.
If the session was stored in memcached with expiration 0 this method will just
return 0.
@return the time in seconds | [
"Gets",
"the",
"time",
"in",
"seconds",
"when",
"this",
"session",
"will",
"expire",
"in",
"memcached",
".",
"If",
"the",
"session",
"was",
"stored",
"in",
"memcached",
"with",
"expiration",
"0",
"this",
"method",
"will",
"just",
"return",
"0",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java#L312-L330 |
53,437 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java | MemcachedBackupSession.getAttributesFiltered | public ConcurrentMap<String, Object> getAttributesFiltered() {
if ( this.manager == null ) {
throw new IllegalStateException( "There's no manager set." );
}
final Pattern pattern = ((SessionManager)manager).getMemcachedSessionService().getSessionAttributePattern();
final Conc... | java | public ConcurrentMap<String, Object> getAttributesFiltered() {
if ( this.manager == null ) {
throw new IllegalStateException( "There's no manager set." );
}
final Pattern pattern = ((SessionManager)manager).getMemcachedSessionService().getSessionAttributePattern();
final Conc... | [
"public",
"ConcurrentMap",
"<",
"String",
",",
"Object",
">",
"getAttributesFiltered",
"(",
")",
"{",
"if",
"(",
"this",
".",
"manager",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"There's no manager set.\"",
")",
";",
"}",
"final"... | Filter map of attributes using our name pattern.
@return the filtered attribute map that only includes attributes that shall be stored in memcached. | [
"Filter",
"map",
"of",
"attributes",
"using",
"our",
"name",
"pattern",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedBackupSession.java#L591-L607 |
53,438 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.put | public V put( final K key, final V value ) {
synchronized ( _map ) {
final ManagedItem<V> previous = _map.put( key, new ManagedItem<V>( value, System.currentTimeMillis() ) );
while ( _map.size() > _size ) {
_map.remove( _map.keySet().iterator().next() );
}
... | java | public V put( final K key, final V value ) {
synchronized ( _map ) {
final ManagedItem<V> previous = _map.put( key, new ManagedItem<V>( value, System.currentTimeMillis() ) );
while ( _map.size() > _size ) {
_map.remove( _map.keySet().iterator().next() );
}
... | [
"public",
"V",
"put",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"final",
"ManagedItem",
"<",
"V",
">",
"previous",
"=",
"_map",
".",
"put",
"(",
"key",
",",
"new",
"ManagedItem",
"<",
"V"... | Put the key and value.
@param key
the key
@param value
the value
@return the previously associated value or <code>null</code>. | [
"Put",
"the",
"key",
"and",
"value",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L89-L99 |
53,439 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.get | public V get( final K key ) {
synchronized ( _map ) {
final ManagedItem<V> item = _map.get( key );
if ( item == null ) {
return null;
}
if ( _ttl > -1 && System.currentTimeMillis() - item._insertionTime > _ttl ) {
_map.remove( key )... | java | public V get( final K key ) {
synchronized ( _map ) {
final ManagedItem<V> item = _map.get( key );
if ( item == null ) {
return null;
}
if ( _ttl > -1 && System.currentTimeMillis() - item._insertionTime > _ttl ) {
_map.remove( key )... | [
"public",
"V",
"get",
"(",
"final",
"K",
"key",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"final",
"ManagedItem",
"<",
"V",
">",
"item",
"=",
"_map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"return",
... | Returns the value that was stored to the given key.
@param key
the key
@return the stored value or <code>null</code> | [
"Returns",
"the",
"value",
"that",
"was",
"stored",
"to",
"the",
"given",
"key",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L158-L170 |
53,440 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.getKeys | public List<K> getKeys() {
synchronized ( _map ) {
return new java.util.ArrayList<K>( _map.keySet() );
}
} | java | public List<K> getKeys() {
synchronized ( _map ) {
return new java.util.ArrayList<K>( _map.keySet() );
}
} | [
"public",
"List",
"<",
"K",
">",
"getKeys",
"(",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"return",
"new",
"java",
".",
"util",
".",
"ArrayList",
"<",
"K",
">",
"(",
"_map",
".",
"keySet",
"(",
")",
")",
";",
"}",
"}"
] | The list of all keys, whose order is the order in which its entries were last accessed,
from least-recently accessed to most-recently.
@return a new list. | [
"The",
"list",
"of",
"all",
"keys",
"whose",
"order",
"is",
"the",
"order",
"in",
"which",
"its",
"entries",
"were",
"last",
"accessed",
"from",
"least",
"-",
"recently",
"accessed",
"to",
"most",
"-",
"recently",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L191-L195 |
53,441 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/LRUCache.java | LRUCache.getKeysSortedByValue | public List<K> getKeysSortedByValue( final Comparator<V> comparator ) {
synchronized ( _map ) {
@SuppressWarnings( "unchecked" )
final
Entry<K, ManagedItem<V>>[] a = _map.entrySet().toArray( new Map.Entry[_map.size()] );
final Comparator<Entry<K, ManagedItem<V>>> ... | java | public List<K> getKeysSortedByValue( final Comparator<V> comparator ) {
synchronized ( _map ) {
@SuppressWarnings( "unchecked" )
final
Entry<K, ManagedItem<V>>[] a = _map.entrySet().toArray( new Map.Entry[_map.size()] );
final Comparator<Entry<K, ManagedItem<V>>> ... | [
"public",
"List",
"<",
"K",
">",
"getKeysSortedByValue",
"(",
"final",
"Comparator",
"<",
"V",
">",
"comparator",
")",
"{",
"synchronized",
"(",
"_map",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"Entry",
"<",
"K",
",",
"Managed... | The keys sorted by the given value comparator.
@return the underlying set, see {@link LinkedHashMap#keySet()}. | [
"The",
"keys",
"sorted",
"by",
"the",
"given",
"value",
"comparator",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/LRUCache.java#L202-L218 |
53,442 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java | NodeAvailabilityCache.isNodeAvailable | public boolean isNodeAvailable( @Nonnull final K key ) {
final ManagedItem<Boolean> item = _map.get( key );
if ( item == null ) {
return updateIsNodeAvailable( key );
} else if ( isExpired( item ) ) {
_map.remove( key );
return updateIsNodeAvailable( key );
... | java | public boolean isNodeAvailable( @Nonnull final K key ) {
final ManagedItem<Boolean> item = _map.get( key );
if ( item == null ) {
return updateIsNodeAvailable( key );
} else if ( isExpired( item ) ) {
_map.remove( key );
return updateIsNodeAvailable( key );
... | [
"public",
"boolean",
"isNodeAvailable",
"(",
"@",
"Nonnull",
"final",
"K",
"key",
")",
"{",
"final",
"ManagedItem",
"<",
"Boolean",
">",
"item",
"=",
"_map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"return",
"upda... | Determines, if the node is available. If it's not cached, it's loaded
from the cache loader.
@param key
the key to check
@return <code>true</code> if the node is marked as available. | [
"Determines",
"if",
"the",
"node",
"is",
"available",
".",
"If",
"it",
"s",
"not",
"cached",
"it",
"s",
"loaded",
"from",
"the",
"cache",
"loader",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java#L115-L125 |
53,443 | magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java | NodeAvailabilityCache.getUnavailableNodes | public Set<K> getUnavailableNodes() {
final Set<K> result = new HashSet<K>();
for ( final Map.Entry<K, ManagedItem<Boolean>> entry : _map.entrySet() ) {
if ( !entry.getValue()._value.booleanValue() && !isExpired( entry.getValue() ) ) {
result.add( entry.getKey() );
... | java | public Set<K> getUnavailableNodes() {
final Set<K> result = new HashSet<K>();
for ( final Map.Entry<K, ManagedItem<Boolean>> entry : _map.entrySet() ) {
if ( !entry.getValue()._value.booleanValue() && !isExpired( entry.getValue() ) ) {
result.add( entry.getKey() );
... | [
"public",
"Set",
"<",
"K",
">",
"getUnavailableNodes",
"(",
")",
"{",
"final",
"Set",
"<",
"K",
">",
"result",
"=",
"new",
"HashSet",
"<",
"K",
">",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"K",
",",
"ManagedItem",
"<",
"Bool... | A set of nodes that are stored as unavailable.
@return a set of unavailable nodes, never <code>null</code>. | [
"A",
"set",
"of",
"nodes",
"that",
"are",
"stored",
"as",
"unavailable",
"."
] | 716e147c9840ab10298c4d2b9edd0662058331e6 | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/NodeAvailabilityCache.java#L156-L164 |
53,444 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HealthCheck.java | HealthCheck.health | @GET
@Path("/health")
@Produces(MediaType.APPLICATION_JSON)
public HealthStatus health() throws ExecutionException, InterruptedException {
final HealthStatus status = new HealthStatus();
final Future<HealthDetails> dbStatus = healthDBService.dbStatus();
final Future<List<HealthDetai... | java | @GET
@Path("/health")
@Produces(MediaType.APPLICATION_JSON)
public HealthStatus health() throws ExecutionException, InterruptedException {
final HealthStatus status = new HealthStatus();
final Future<HealthDetails> dbStatus = healthDBService.dbStatus();
final Future<List<HealthDetai... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/health\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"HealthStatus",
"health",
"(",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
"{",
"final",
"HealthStatus",
"status",
... | Get health status
@return {@link HealthStatus} with details
@throws ExecutionException The computation of health status threw an exception
@throws InterruptedException The thread, which compute health status, was interrupted | [
"Get",
"health",
"status"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HealthCheck.java#L60-L73 |
53,445 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/SearchManager.java | SearchManager.extractUsername | @Produces
@LoggedIn
public String extractUsername() {
final KeycloakPrincipal principal = (KeycloakPrincipal) httpServletRequest.getUserPrincipal();
if (principal != null) {
logger.debug("Running with Keycloak context");
KeycloakSecurityContext kcSecurityContext = princi... | java | @Produces
@LoggedIn
public String extractUsername() {
final KeycloakPrincipal principal = (KeycloakPrincipal) httpServletRequest.getUserPrincipal();
if (principal != null) {
logger.debug("Running with Keycloak context");
KeycloakSecurityContext kcSecurityContext = princi... | [
"@",
"Produces",
"@",
"LoggedIn",
"public",
"String",
"extractUsername",
"(",
")",
"{",
"final",
"KeycloakPrincipal",
"principal",
"=",
"(",
"KeycloakPrincipal",
")",
"httpServletRequest",
".",
"getUserPrincipal",
"(",
")",
";",
"if",
"(",
"principal",
"!=",
"nu... | Extract the username to be used in multiple queries
@return current logged in user | [
"Extract",
"the",
"username",
"to",
"be",
"used",
"in",
"multiple",
"queries"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/SearchManager.java#L75-L95 |
53,446 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HttpRequestUtil.java | HttpRequestUtil.extractAeroGearSenderInformation | public static String extractAeroGearSenderInformation(final HttpServletRequest request) {
String client = request.getHeader("aerogear-sender");
if (hasValue(client)) {
return client;
}
// if there was no usage of our custom header, we simply return the user-agent value
... | java | public static String extractAeroGearSenderInformation(final HttpServletRequest request) {
String client = request.getHeader("aerogear-sender");
if (hasValue(client)) {
return client;
}
// if there was no usage of our custom header, we simply return the user-agent value
... | [
"public",
"static",
"String",
"extractAeroGearSenderInformation",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"String",
"client",
"=",
"request",
".",
"getHeader",
"(",
"\"aerogear-sender\"",
")",
";",
"if",
"(",
"hasValue",
"(",
"client",
")",
")",
... | Reads the "aerogear-sender" header to check if an AeroGear Sender client was used. If the header value is NULL
the value of the standard "user-agent" header is returned
@param request to inspect
@return value of header | [
"Reads",
"the",
"aerogear",
"-",
"sender",
"header",
"to",
"check",
"if",
"an",
"AeroGear",
"Sender",
"client",
"was",
"used",
".",
"If",
"the",
"header",
"value",
"is",
"NULL",
"the",
"value",
"of",
"the",
"standard",
"user",
"-",
"agent",
"header",
"is... | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/HttpRequestUtil.java#L66-L73 |
53,447 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/AndroidVariantEndpoint.java | AndroidVariantEndpoint.updateAndroidVariant | @PUT
@Path("/{androidID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateAndroidVariant(
@PathParam("pushAppID") String id,
@PathParam("androidID") String androidID,
AndroidVariant updatedAndroidApplication) {
... | java | @PUT
@Path("/{androidID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateAndroidVariant(
@PathParam("pushAppID") String id,
@PathParam("androidID") String androidID,
AndroidVariant updatedAndroidApplication) {
... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/{androidID}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"updateAndroidVariant",
"(",
"@",
"PathParam",
"(",
"... | Update Android Variant
@param id id of {@link PushApplication}
@param androidID id of {@link AndroidVariant}
@param updatedAndroidApplication new info of {@link AndroidVariant}
@return updated {@link AndroidVariant}
@statuscode 200 The Android Variant updated s... | [
"Update",
"Android",
"Variant"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/AndroidVariantEndpoint.java#L119-L155 |
53,448 | aerogear/aerogear-unifiedpush-server | model/api/src/main/java/org/jboss/aerogear/unifiedpush/api/validation/DeviceTokenValidator.java | DeviceTokenValidator.isValidDeviceTokenForVariant | public static boolean isValidDeviceTokenForVariant(final String deviceToken, final VariantType type) {
switch (type) {
case IOS:
return IOS_DEVICE_TOKEN.matcher(deviceToken).matches();
case ANDROID:
return ANDROID_DEVICE_TOKEN.matcher(deviceToken).matches(... | java | public static boolean isValidDeviceTokenForVariant(final String deviceToken, final VariantType type) {
switch (type) {
case IOS:
return IOS_DEVICE_TOKEN.matcher(deviceToken).matches();
case ANDROID:
return ANDROID_DEVICE_TOKEN.matcher(deviceToken).matches(... | [
"public",
"static",
"boolean",
"isValidDeviceTokenForVariant",
"(",
"final",
"String",
"deviceToken",
",",
"final",
"VariantType",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"IOS",
":",
"return",
"IOS_DEVICE_TOKEN",
".",
"matcher",
"(",
"deviceTo... | Helper to run quick up-front validations.
@param deviceToken the submitted device token
@param type type of the variant
@return true if the token is valid | [
"Helper",
"to",
"run",
"quick",
"up",
"-",
"front",
"validations",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/model/api/src/main/java/org/jboss/aerogear/unifiedpush/api/validation/DeviceTokenValidator.java#L70-L80 |
53,449 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoader.java | TokenLoader.tryToDispatchTokens | private boolean tryToDispatchTokens(MessageHolderWithTokens msg) {
try {
dispatchTokensEvent.fire(msg);
return true;
} catch (MessageDeliveryException e) {
Throwable cause = e.getCause();
if (isQueueFullException(cause)) {
return false;
... | java | private boolean tryToDispatchTokens(MessageHolderWithTokens msg) {
try {
dispatchTokensEvent.fire(msg);
return true;
} catch (MessageDeliveryException e) {
Throwable cause = e.getCause();
if (isQueueFullException(cause)) {
return false;
... | [
"private",
"boolean",
"tryToDispatchTokens",
"(",
"MessageHolderWithTokens",
"msg",
")",
"{",
"try",
"{",
"dispatchTokensEvent",
".",
"fire",
"(",
"msg",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"MessageDeliveryException",
"e",
")",
"{",
"Throwable",
... | Tries to dispatch tokens; returns true if tokens were successfully queued.
Detects when queue is full and in that case returns false.
@return returns true if tokens were successfully queued; returns false if queue was full | [
"Tries",
"to",
"dispatch",
"tokens",
";",
"returns",
"true",
"if",
"tokens",
"were",
"successfully",
"queued",
".",
"Detects",
"when",
"queue",
"is",
"full",
"and",
"in",
"that",
"case",
"returns",
"false",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoader.java#L236-L247 |
53,450 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/util/FCMTopicManager.java | FCMTopicManager.delete | private int delete(String urlS) throws IOException {
URL url = new URL(urlS);
HttpURLConnection conn = prepareAuthorizedConnection(url);
conn.setRequestMethod("DELETE");
conn.connect();
return conn.getResponseCode();
} | java | private int delete(String urlS) throws IOException {
URL url = new URL(urlS);
HttpURLConnection conn = prepareAuthorizedConnection(url);
conn.setRequestMethod("DELETE");
conn.connect();
return conn.getResponseCode();
} | [
"private",
"int",
"delete",
"(",
"String",
"urlS",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"urlS",
")",
";",
"HttpURLConnection",
"conn",
"=",
"prepareAuthorizedConnection",
"(",
"url",
")",
";",
"conn",
".",
"setRequestMetho... | Sends DELETE HTTP request to provided URL. Request is authorized using Google API key.
@param urlS target URL string | [
"Sends",
"DELETE",
"HTTP",
"request",
"to",
"provided",
"URL",
".",
"Request",
"is",
"authorized",
"using",
"Google",
"API",
"key",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/util/FCMTopicManager.java#L108-L114 |
53,451 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/util/FCMTopicManager.java | FCMTopicManager.get | private String get(String urlS) throws IOException {
URL url = new URL(urlS);
HttpURLConnection conn = prepareAuthorizedConnection(url);
conn.setRequestMethod("GET");
// Read response
StringBuilder result = new StringBuilder();
try (BufferedReader rd = new BufferedReader(... | java | private String get(String urlS) throws IOException {
URL url = new URL(urlS);
HttpURLConnection conn = prepareAuthorizedConnection(url);
conn.setRequestMethod("GET");
// Read response
StringBuilder result = new StringBuilder();
try (BufferedReader rd = new BufferedReader(... | [
"private",
"String",
"get",
"(",
"String",
"urlS",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"urlS",
")",
";",
"HttpURLConnection",
"conn",
"=",
"prepareAuthorizedConnection",
"(",
"url",
")",
";",
"conn",
".",
"setRequestMetho... | Sends GET HTTP request to provided URL. Request is authorized using Google API key.
@param urlS target URL string | [
"Sends",
"GET",
"HTTP",
"request",
"to",
"provided",
"URL",
".",
"Request",
"is",
"authorized",
"using",
"Google",
"API",
"key",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/util/FCMTopicManager.java#L121-L134 |
53,452 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoaderUtils.java | TokenLoaderUtils.isCategoryOnlyCriteria | public static boolean isCategoryOnlyCriteria(final Criteria criteria) {
return isEmpty(criteria.getAliases()) && // we are not subscribing to alias topic (yet)
isEmpty(criteria.getDeviceTypes()) && // we are not subscribing to device type topic (yet)
!isEmpty(criteria.get... | java | public static boolean isCategoryOnlyCriteria(final Criteria criteria) {
return isEmpty(criteria.getAliases()) && // we are not subscribing to alias topic (yet)
isEmpty(criteria.getDeviceTypes()) && // we are not subscribing to device type topic (yet)
!isEmpty(criteria.get... | [
"public",
"static",
"boolean",
"isCategoryOnlyCriteria",
"(",
"final",
"Criteria",
"criteria",
")",
"{",
"return",
"isEmpty",
"(",
"criteria",
".",
"getAliases",
"(",
")",
")",
"&&",
"// we are not subscribing to alias topic (yet)",
"isEmpty",
"(",
"criteria",
".",
... | Helper method to check if only categories are applied. Useful in FCM land, where we use topics | [
"Helper",
"method",
"to",
"check",
"if",
"only",
"categories",
"are",
"applied",
".",
"Useful",
"in",
"FCM",
"land",
"where",
"we",
"use",
"topics"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoaderUtils.java#L61-L66 |
53,453 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoaderUtils.java | TokenLoaderUtils.isEmptyCriteria | public static boolean isEmptyCriteria(final Criteria criteria) {
return isEmpty(criteria.getAliases()) &&
isEmpty(criteria.getDeviceTypes()) &&
isEmpty(criteria.getCategories());
} | java | public static boolean isEmptyCriteria(final Criteria criteria) {
return isEmpty(criteria.getAliases()) &&
isEmpty(criteria.getDeviceTypes()) &&
isEmpty(criteria.getCategories());
} | [
"public",
"static",
"boolean",
"isEmptyCriteria",
"(",
"final",
"Criteria",
"criteria",
")",
"{",
"return",
"isEmpty",
"(",
"criteria",
".",
"getAliases",
"(",
")",
")",
"&&",
"isEmpty",
"(",
"criteria",
".",
"getDeviceTypes",
"(",
")",
")",
"&&",
"isEmpty",... | Helper method to check if all criteria are empty. Useful in FCM land, where we use topics. | [
"Helper",
"method",
"to",
"check",
"if",
"all",
"criteria",
"are",
"empty",
".",
"Useful",
"in",
"FCM",
"land",
"where",
"we",
"use",
"topics",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/token/TokenLoaderUtils.java#L71-L76 |
53,454 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/PushSearchServiceImpl.java | PushSearchServiceImpl.loadDashboardData | @Override
public DashboardData loadDashboardData() {
long totalApps = totalApplicationNumber();
long totalDevices = totalDeviceNumber();
long totalMessages = totalMessages();
final DashboardData data = new DashboardData();
data.setApplications(totalApps);
data.setD... | java | @Override
public DashboardData loadDashboardData() {
long totalApps = totalApplicationNumber();
long totalDevices = totalDeviceNumber();
long totalMessages = totalMessages();
final DashboardData data = new DashboardData();
data.setApplications(totalApps);
data.setD... | [
"@",
"Override",
"public",
"DashboardData",
"loadDashboardData",
"(",
")",
"{",
"long",
"totalApps",
"=",
"totalApplicationNumber",
"(",
")",
";",
"long",
"totalDevices",
"=",
"totalDeviceNumber",
"(",
")",
";",
"long",
"totalMessages",
"=",
"totalMessages",
"(",
... | Receives the dashboard data for the given user | [
"Receives",
"the",
"dashboard",
"data",
"for",
"the",
"given",
"user"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/PushSearchServiceImpl.java#L80-L94 |
53,455 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/PushSearchServiceImpl.java | PushSearchServiceImpl.getVariantsWithWarnings | @Override
public List<ApplicationVariant> getVariantsWithWarnings() {
final List<String> warningIDs = flatPushMessageInformationDao.findVariantIDsWithWarnings();
if (warningIDs.isEmpty()) {
return Collections.emptyList();
}
return wrapApplicationVariant(pushApplicationDa... | java | @Override
public List<ApplicationVariant> getVariantsWithWarnings() {
final List<String> warningIDs = flatPushMessageInformationDao.findVariantIDsWithWarnings();
if (warningIDs.isEmpty()) {
return Collections.emptyList();
}
return wrapApplicationVariant(pushApplicationDa... | [
"@",
"Override",
"public",
"List",
"<",
"ApplicationVariant",
">",
"getVariantsWithWarnings",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"warningIDs",
"=",
"flatPushMessageInformationDao",
".",
"findVariantIDsWithWarnings",
"(",
")",
";",
"if",
"(",
"warn... | Loads all the Variant objects where we did notice some failures on sending
for the given user | [
"Loads",
"all",
"the",
"Variant",
"objects",
"where",
"we",
"did",
"notice",
"some",
"failures",
"on",
"sending",
"for",
"the",
"given",
"user"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/PushSearchServiceImpl.java#L100-L108 |
53,456 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/metrics/PushMetricsEndpoint.java | PushMetricsEndpoint.pushMessageInformationPerApplication | @GET
@Path("/application/{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response pushMessageInformationPerApplication(
@PathParam("id") String id,
@QueryParam("page") Integer page,
@QueryParam("per_page") Integer pageSize,
@QueryParam("sort") String sorti... | java | @GET
@Path("/application/{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response pushMessageInformationPerApplication(
@PathParam("id") String id,
@QueryParam("page") Integer page,
@QueryParam("per_page") Integer pageSize,
@QueryParam("sort") String sorti... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/application/{id}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"pushMessageInformationPerApplication",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"String",
"id",
",",
"@",
"Query... | GET info about submitted push messages for the given Push Application
@param id id of {@link org.jboss.aerogear.unifiedpush.api.PushApplication}
@param page page number
@param pageSize number of items per page
@param sorting sorting order: {@code asc} (default) or {@code desc}
@param search search qu... | [
"GET",
"info",
"about",
"submitted",
"push",
"messages",
"for",
"the",
"given",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/metrics/PushMetricsEndpoint.java#L59-L87 |
53,457 | aerogear/aerogear-unifiedpush-server | common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java | ConfigurationUtils.tryGetGlobalProperty | public static String tryGetGlobalProperty(String key, String defaultValue) {
try {
String value = System.getenv(formatEnvironmentVariable(key));
if (value == null) {
value = tryGetProperty(key, defaultValue);
}
return value;
} catch (Securi... | java | public static String tryGetGlobalProperty(String key, String defaultValue) {
try {
String value = System.getenv(formatEnvironmentVariable(key));
if (value == null) {
value = tryGetProperty(key, defaultValue);
}
return value;
} catch (Securi... | [
"public",
"static",
"String",
"tryGetGlobalProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"formatEnvironmentVariable",
"(",
"key",
")",
")",
";",
"if",
"(",
"value",... | Get a global string property. This method will first try to get the value from an
environment variable and if that does not exist it will look up a system property.
@param key Name of the variable
@param defaultValue Returned if neither env var nor system property are defined
@return String the value of the Environment... | [
"Get",
"a",
"global",
"string",
"property",
".",
"This",
"method",
"will",
"first",
"try",
"to",
"get",
"the",
"value",
"from",
"an",
"environment",
"variable",
"and",
"if",
"that",
"does",
"not",
"exist",
"it",
"will",
"look",
"up",
"a",
"system",
"prop... | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java#L81-L92 |
53,458 | aerogear/aerogear-unifiedpush-server | common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java | ConfigurationUtils.tryGetGlobalIntegerProperty | public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) {
try {
String value = System.getenv(formatEnvironmentVariable(key));
if (value == null) {
return tryGetIntegerProperty(key, defaultValue);
} else {
return Inte... | java | public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) {
try {
String value = System.getenv(formatEnvironmentVariable(key));
if (value == null) {
return tryGetIntegerProperty(key, defaultValue);
} else {
return Inte... | [
"public",
"static",
"Integer",
"tryGetGlobalIntegerProperty",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"formatEnvironmentVariable",
"(",
"key",
")",
")",
";",
"if",
"(",
... | Get a global integer property. This method will first try to get the value from an
environment variable and if that does not exist it will look up a system property.
@param key Name of the variable
@param defaultValue Returned if neither env var nor system property are defined
@return String the value of the Environmen... | [
"Get",
"a",
"global",
"integer",
"property",
".",
"This",
"method",
"will",
"first",
"try",
"to",
"get",
"the",
"value",
"from",
"an",
"environment",
"variable",
"and",
"if",
"that",
"does",
"not",
"exist",
"it",
"will",
"look",
"up",
"a",
"system",
"pro... | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java#L111-L123 |
53,459 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/WindowsVariantEndpoint.java | WindowsVariantEndpoint.listAllWindowsVariationsForPushApp | @GET
@Produces(MediaType.APPLICATION_JSON)
public Response listAllWindowsVariationsForPushApp(@PathParam("pushAppID") String pushApplicationID) {
final PushApplication application = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID);
return Response.ok(getVariants(application)).b... | java | @GET
@Produces(MediaType.APPLICATION_JSON)
public Response listAllWindowsVariationsForPushApp(@PathParam("pushAppID") String pushApplicationID) {
final PushApplication application = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID);
return Response.ok(getVariants(application)).b... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"listAllWindowsVariationsForPushApp",
"(",
"@",
"PathParam",
"(",
"\"pushAppID\"",
")",
"String",
"pushApplicationID",
")",
"{",
"final",
"PushApplication",
"application... | List Windows Variants for Push Application
@param pushApplicationID id of {@link PushApplication}
@return list of {@link WindowsVariant}s | [
"List",
"Windows",
"Variants",
"for",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/WindowsVariantEndpoint.java#L99-L104 |
53,460 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/WindowsVariantEndpoint.java | WindowsVariantEndpoint.updateWindowsVariant | @PUT
@Path("/{windowsID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateWindowsVariant(
@PathParam("windowsID") String windowsID,
WindowsVariant updatedWindowsVariant) {
WindowsVariant windowsVariant = (WindowsVariant)... | java | @PUT
@Path("/{windowsID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateWindowsVariant(
@PathParam("windowsID") String windowsID,
WindowsVariant updatedWindowsVariant) {
WindowsVariant windowsVariant = (WindowsVariant)... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/{windowsID}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"updateWindowsVariant",
"(",
"@",
"PathParam",
"(",
"... | Update Windows Variant
@param windowsID id of {@link WindowsVariant}
@param updatedWindowsVariant new info of {@link WindowsVariant}
@return updated {@link WindowsVariant}
@statuscode 200 The Windows Variant updated successfully
@statuscode 400 The format of the client request was inc... | [
"Update",
"Windows",
"Variant"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/WindowsVariantEndpoint.java#L118-L158 |
53,461 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java | AbstractJMSMessageProducer.sendNonTransacted | protected void sendNonTransacted(Destination destination, Serializable message) {
send(destination, message, null, null, false);
} | java | protected void sendNonTransacted(Destination destination, Serializable message) {
send(destination, message, null, null, false);
} | [
"protected",
"void",
"sendNonTransacted",
"(",
"Destination",
"destination",
",",
"Serializable",
"message",
")",
"{",
"send",
"(",
"destination",
",",
"message",
",",
"null",
",",
"null",
",",
"false",
")",
";",
"}"
] | Sends message to the destination in non-transactional manner.
@param destination where to send
@param message what to send
Since non-transacted session is used, the message is send immediately without requiring to commit enclosing transaction. | [
"Sends",
"message",
"to",
"the",
"destination",
"in",
"non",
"-",
"transactional",
"manner",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java#L54-L56 |
53,462 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java | AbstractJMSMessageProducer.sendTransacted | protected void sendTransacted(Destination destination, Serializable message) {
send(destination, message, null, null, true);
} | java | protected void sendTransacted(Destination destination, Serializable message) {
send(destination, message, null, null, true);
} | [
"protected",
"void",
"sendTransacted",
"(",
"Destination",
"destination",
",",
"Serializable",
"message",
")",
"{",
"send",
"(",
"destination",
",",
"message",
",",
"null",
",",
"null",
",",
"true",
")",
";",
"}"
] | Sends message to the destination in transactional manner.
@param destination where to send
@param message what to send
Since transacted session is used, the message won't be committed until whole enclosing transaction ends | [
"Sends",
"message",
"to",
"the",
"destination",
"in",
"transactional",
"manner",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java#L66-L68 |
53,463 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java | AbstractJMSMessageProducer.sendNonTransacted | protected void sendNonTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
send(destination, message, propertyName, propertValue, false);
} | java | protected void sendNonTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
send(destination, message, propertyName, propertValue, false);
} | [
"protected",
"void",
"sendNonTransacted",
"(",
"Destination",
"destination",
",",
"Serializable",
"message",
",",
"String",
"propertyName",
",",
"String",
"propertValue",
")",
"{",
"send",
"(",
"destination",
",",
"message",
",",
"propertyName",
",",
"propertValue",... | Sends message to destination with given JMS message property name and value in non-transactional manner.
@param destination where to send
@param message what to send
@param propertyName property of obj
@param propertValue value of obj
Since non-transacted session is used, the message is send immediately without requi... | [
"Sends",
"message",
"to",
"destination",
"with",
"given",
"JMS",
"message",
"property",
"name",
"and",
"value",
"in",
"non",
"-",
"transactional",
"manner",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java#L80-L82 |
53,464 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java | AbstractJMSMessageProducer.sendTransacted | protected void sendTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
send(destination, message, propertyName, propertValue, true);
} | java | protected void sendTransacted(Destination destination, Serializable message, String propertyName, String propertValue) {
send(destination, message, propertyName, propertValue, true);
} | [
"protected",
"void",
"sendTransacted",
"(",
"Destination",
"destination",
",",
"Serializable",
"message",
",",
"String",
"propertyName",
",",
"String",
"propertValue",
")",
"{",
"send",
"(",
"destination",
",",
"message",
",",
"propertyName",
",",
"propertValue",
... | Sends message to destination with given JMS message property name and value in transactional manner.
@param destination where to send
@param message what to send
@param propertyName property of obj
@param propertValue value of obj
Since transacted session is used, the message won't be committed until whole enclosing ... | [
"Sends",
"message",
"to",
"destination",
"with",
"given",
"JMS",
"message",
"property",
"name",
"and",
"value",
"in",
"transactional",
"manner",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/jms/AbstractJMSMessageProducer.java#L94-L96 |
53,465 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/cache/SimpleApnsClientCache.java | SimpleApnsClientCache.disconnectOnChange | public void disconnectOnChange(@Observes final iOSVariantUpdateEvent iOSVariantUpdateEvent) {
final iOSVariant variant = iOSVariantUpdateEvent.getiOSVariant();
final String connectionKey = extractConnectionKey(variant);
final ApnsClient client = apnsClientExpiringMap.remove(connectionKey);
... | java | public void disconnectOnChange(@Observes final iOSVariantUpdateEvent iOSVariantUpdateEvent) {
final iOSVariant variant = iOSVariantUpdateEvent.getiOSVariant();
final String connectionKey = extractConnectionKey(variant);
final ApnsClient client = apnsClientExpiringMap.remove(connectionKey);
... | [
"public",
"void",
"disconnectOnChange",
"(",
"@",
"Observes",
"final",
"iOSVariantUpdateEvent",
"iOSVariantUpdateEvent",
")",
"{",
"final",
"iOSVariant",
"variant",
"=",
"iOSVariantUpdateEvent",
".",
"getiOSVariant",
"(",
")",
";",
"final",
"String",
"connectionKey",
... | Receives iOS variant change event to remove client from the cache and also tear down the connection.
@param iOSVariantUpdateEvent event fired when updating the variant | [
"Receives",
"iOS",
"variant",
"change",
"event",
"to",
"remove",
"client",
"from",
"the",
"cache",
"and",
"also",
"tear",
"down",
"the",
"connection",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/cache/SimpleApnsClientCache.java#L94-L102 |
53,466 | aerogear/aerogear-unifiedpush-server | service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/ClientInstallationServiceImpl.java | ClientInstallationServiceImpl.findAllDeviceTokenForVariantIDByCriteria | @Override
public ResultsStream.QueryBuilder<String> findAllDeviceTokenForVariantIDByCriteria(String variantID, List<String> categories, List<String> aliases, List<String> deviceTypes, int maxResults, String lastTokenFromPreviousBatch) {
return installationDao.findAllDeviceTokenForVariantIDByCriteria(variant... | java | @Override
public ResultsStream.QueryBuilder<String> findAllDeviceTokenForVariantIDByCriteria(String variantID, List<String> categories, List<String> aliases, List<String> deviceTypes, int maxResults, String lastTokenFromPreviousBatch) {
return installationDao.findAllDeviceTokenForVariantIDByCriteria(variant... | [
"@",
"Override",
"public",
"ResultsStream",
".",
"QueryBuilder",
"<",
"String",
">",
"findAllDeviceTokenForVariantIDByCriteria",
"(",
"String",
"variantID",
",",
"List",
"<",
"String",
">",
"categories",
",",
"List",
"<",
"String",
">",
"aliases",
",",
"List",
"... | Finder for 'send', used for Android and iOS clients | [
"Finder",
"for",
"send",
"used",
"for",
"Android",
"and",
"iOS",
"clients"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/service/src/main/java/org/jboss/aerogear/unifiedpush/service/impl/ClientInstallationServiceImpl.java#L223-L226 |
53,467 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/InstallationManagementEndpoint.java | InstallationManagementEndpoint.findInstallation | @GET
@Path("/{installationID}")
@Produces(MediaType.APPLICATION_JSON)
public Response findInstallation(@PathParam("variantID") String variantId, @PathParam("installationID") String installationId) {
Installation installation = clientInstallationService.findById(installationId);
if (install... | java | @GET
@Path("/{installationID}")
@Produces(MediaType.APPLICATION_JSON)
public Response findInstallation(@PathParam("variantID") String variantId, @PathParam("installationID") String installationId) {
Installation installation = clientInstallationService.findById(installationId);
if (install... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{installationID}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"findInstallation",
"(",
"@",
"PathParam",
"(",
"\"variantID\"",
")",
"String",
"variantId",
",",
"@",
"PathParam",... | Get Installation of specified Variant
@param variantId id of {@link org.jboss.aerogear.unifiedpush.api.Variant}
@param installationId id of {@link Installation}
@return requested {@link Installation}
@statuscode 404 The requested Installation resource does not exist | [
"Get",
"Installation",
"of",
"specified",
"Variant"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/InstallationManagementEndpoint.java#L130-L142 |
53,468 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/InstallationManagementEndpoint.java | InstallationManagementEndpoint.updateInstallation | @PUT
@Path("/{installationID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateInstallation(Installation entity, @PathParam("variantID") String variantId, @PathParam("installationID") String installationId) {
Installation installation = clientI... | java | @PUT
@Path("/{installationID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updateInstallation(Installation entity, @PathParam("variantID") String variantId, @PathParam("installationID") String installationId) {
Installation installation = clientI... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/{installationID}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"updateInstallation",
"(",
"Installation",
"entity",... | Update Installation of specified Variant
@param entity new info of {@link Installation}
@param variantId id of {@link org.jboss.aerogear.unifiedpush.api.Variant}
@param installationId id of {@link Installation}
@return updated {@link Installation}
@statuscode 204 The Installation update... | [
"Update",
"Installation",
"of",
"specified",
"Variant"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/InstallationManagementEndpoint.java#L155-L171 |
53,469 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/ExportEndpoint.java | ExportEndpoint.exportInstallations | @GET
@Path("/{variantId}/installations/")
@Produces(MediaType.APPLICATION_JSON)
@GZIP
public Response exportInstallations(@PathParam("variantId") String variantId) {
return Response.ok(getSearch().findAllInstallationsByVariantForDeveloper(variantId, 0, Integer.MAX_VALUE, null).getResultList()).b... | java | @GET
@Path("/{variantId}/installations/")
@Produces(MediaType.APPLICATION_JSON)
@GZIP
public Response exportInstallations(@PathParam("variantId") String variantId) {
return Response.ok(getSearch().findAllInstallationsByVariantForDeveloper(variantId, 0, Integer.MAX_VALUE, null).getResultList()).b... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{variantId}/installations/\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"GZIP",
"public",
"Response",
"exportInstallations",
"(",
"@",
"PathParam",
"(",
"\"variantId\"",
")",
"String",
"variantId"... | Endpoint for exporting as JSON file device installations for a given variant.
Only Keycloak authenticated can access it
@param variantId the variant ID
@return list of {@link org.jboss.aerogear.unifiedpush.api.Installation}s | [
"Endpoint",
"for",
"exporting",
"as",
"JSON",
"file",
"device",
"installations",
"for",
"a",
"given",
"variant",
".",
"Only",
"Keycloak",
"authenticated",
"can",
"access",
"it"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/ExportEndpoint.java#L50-L56 |
53,470 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/FCMPushNotificationSender.java | FCMPushNotificationSender.processFCM | private void processFCM(AndroidVariant androidVariant, List<String> pushTargets, Message fcmMessage, ConfigurableFCMSender sender) throws IOException {
// push targets can be registration IDs OR topics (starting /topic/), but they can't be mixed.
if (pushTargets.get(0).startsWith(Constants.TOPIC_PREFI... | java | private void processFCM(AndroidVariant androidVariant, List<String> pushTargets, Message fcmMessage, ConfigurableFCMSender sender) throws IOException {
// push targets can be registration IDs OR topics (starting /topic/), but they can't be mixed.
if (pushTargets.get(0).startsWith(Constants.TOPIC_PREFI... | [
"private",
"void",
"processFCM",
"(",
"AndroidVariant",
"androidVariant",
",",
"List",
"<",
"String",
">",
"pushTargets",
",",
"Message",
"fcmMessage",
",",
"ConfigurableFCMSender",
"sender",
")",
"throws",
"IOException",
"{",
"// push targets can be registration IDs OR t... | Process the HTTP POST to the FCM infrastructure for the given list of registrationIDs. | [
"Process",
"the",
"HTTP",
"POST",
"to",
"the",
"FCM",
"infrastructure",
"for",
"the",
"given",
"list",
"of",
"registrationIDs",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/FCMPushNotificationSender.java#L142-L165 |
53,471 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.registerPushApplication | @POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response registerPushApplication(PushApplication pushApp) {
try {
validateModelClass(pushApp);
} catch (ConstraintViolationException cve) {
logger.trace("Unable to create Push Ap... | java | @POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response registerPushApplication(PushApplication pushApp) {
try {
validateModelClass(pushApp);
} catch (ConstraintViolationException cve) {
logger.trace("Unable to create Push Ap... | [
"@",
"POST",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"registerPushApplication",
"(",
"PushApplication",
"pushApp",
")",
"{",
"try",
"{",
"validateModelC... | Create Push Application
@param pushApp new {@link PushApplication}
@return created {@link PushApplication}
@statuscode 201 The PushApplication Variant created successfully
@statuscode 400 The format of the client request was incorrect
@statuscode 409 The PushApplication already exists | [
"Create",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L75-L102 |
53,472 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.listAllPushApplications | @GET
@Produces(MediaType.APPLICATION_JSON)
public Response listAllPushApplications(@QueryParam("page") Integer page,
@QueryParam("per_page") Integer pageSize,
@QueryParam("includeDeviceCount") @DefaultValue("false") boolean ... | java | @GET
@Produces(MediaType.APPLICATION_JSON)
public Response listAllPushApplications(@QueryParam("page") Integer page,
@QueryParam("per_page") Integer pageSize,
@QueryParam("includeDeviceCount") @DefaultValue("false") boolean ... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"listAllPushApplications",
"(",
"@",
"QueryParam",
"(",
"\"page\"",
")",
"Integer",
"page",
",",
"@",
"QueryParam",
"(",
"\"per_page\"",
")",
"Integer",
"pageSize"... | List Push Applications
@param page page number
@param pageSize number of items per page
@param includeDeviceCount put device count into response headers, default {@code false}
@param includeActivity put activity into response headers, default {@code false}
@return ... | [
"List",
"Push",
"Applications"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L119-L150 |
53,473 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.findById | @GET
@Path("/{pushAppID}")
@Produces(MediaType.APPLICATION_JSON)
public Response findById(
@PathParam("pushAppID") String pushApplicationID,
@QueryParam("includeDeviceCount") @DefaultValue("false") boolean includeDeviceCount,
@QueryParam("includeActivity") @DefaultValu... | java | @GET
@Path("/{pushAppID}")
@Produces(MediaType.APPLICATION_JSON)
public Response findById(
@PathParam("pushAppID") String pushApplicationID,
@QueryParam("includeDeviceCount") @DefaultValue("false") boolean includeDeviceCount,
@QueryParam("includeActivity") @DefaultValu... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{pushAppID}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"findById",
"(",
"@",
"PathParam",
"(",
"\"pushAppID\"",
")",
"String",
"pushApplicationID",
",",
"@",
"QueryParam",
"... | Get Push Application.
@param pushApplicationID id of {@link PushApplication}
@param includeDeviceCount boolean param to put device count into response headers, default {@code false}
@param includeActivity boolean param to put activity into response headers, default {@code false}
@return ... | [
"Get",
"Push",
"Application",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L167-L192 |
53,474 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.updatePushApplication | @PUT
@Path("/{pushAppID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updatePushApplication(@PathParam("pushAppID") String pushApplicationID, PushApplication updatedPushApp) {
PushApplication pushApp = getSearch().findByPushApplicationIDForDevelo... | java | @PUT
@Path("/{pushAppID}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response updatePushApplication(@PathParam("pushAppID") String pushApplicationID, PushApplication updatedPushApp) {
PushApplication pushApp = getSearch().findByPushApplicationIDForDevelo... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/{pushAppID}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"updatePushApplication",
"(",
"@",
"PathParam",
"(",
... | Update Push Application
@param pushApplicationID id of {@link PushApplication}
@param updatedPushApp new info of {@link PushApplication}
@return updated {@link PushApplication}
@statuscode 204 The PushApplication updated successfully
@statuscode 400 The format of the client request was incorrect
@statusco... | [
"Update",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L219-L251 |
53,475 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.resetMasterSecret | @PUT
@Path("/{pushAppID}/reset")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response resetMasterSecret(@PathParam("pushAppID") String pushApplicationID) {
//PushApplication pushApp = pushAppService.findByPushApplicationIDForDeveloper(pushApplicationID, ex... | java | @PUT
@Path("/{pushAppID}/reset")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response resetMasterSecret(@PathParam("pushAppID") String pushApplicationID) {
//PushApplication pushApp = pushAppService.findByPushApplicationIDForDeveloper(pushApplicationID, ex... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"/{pushAppID}/reset\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"resetMasterSecret",
"(",
"@",
"PathParam",
"(",
... | Reset MasterSecret for Push Application
@param pushApplicationID id of {@link PushApplication}
@return updated {@link PushApplication}
@statuscode 200 The MasterSecret for Push Application reset successfully
@statuscode 404 The requested PushApplication resource does not exist | [
"Reset",
"MasterSecret",
"for",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L262-L282 |
53,476 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.deletePushApplication | @DELETE
@Path("/{pushAppID}")
@Produces(MediaType.APPLICATION_JSON)
public Response deletePushApplication(@PathParam("pushAppID") String pushApplicationID) {
PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID);
if (pushApp != null) {
log... | java | @DELETE
@Path("/{pushAppID}")
@Produces(MediaType.APPLICATION_JSON)
public Response deletePushApplication(@PathParam("pushAppID") String pushApplicationID) {
PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID);
if (pushApp != null) {
log... | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"/{pushAppID}\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"deletePushApplication",
"(",
"@",
"PathParam",
"(",
"\"pushAppID\"",
")",
"String",
"pushApplicationID",
")",
"{",
"... | Delete Push Application
@param pushApplicationID id of {@link PushApplication}
@return no content
@statuscode 204 The PushApplication successfully deleted
@statuscode 404 The requested PushApplication resource does not exist | [
"Delete",
"Push",
"Application"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L293-L306 |
53,477 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java | PushApplicationEndpoint.countInstallations | @GET
@Path("/{pushAppID}/count")
@Produces(MediaType.APPLICATION_JSON)
public Response countInstallations(@PathParam("pushAppID") String pushApplicationID) {
logger.trace("counting devices by type for push application '{}'", pushApplicationID);
Map<String, Long> result = pushAppService.coun... | java | @GET
@Path("/{pushAppID}/count")
@Produces(MediaType.APPLICATION_JSON)
public Response countInstallations(@PathParam("pushAppID") String pushApplicationID) {
logger.trace("counting devices by type for push application '{}'", pushApplicationID);
Map<String, Long> result = pushAppService.coun... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{pushAppID}/count\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"countInstallations",
"(",
"@",
"PathParam",
"(",
"\"pushAppID\"",
")",
"String",
"pushApplicationID",
")",
"{",
"... | Count Push Applications
@param pushApplicationID id of {@link PushApplication}
@return count number for each {@link org.jboss.aerogear.unifiedpush.api.VariantType} | [
"Count",
"Push",
"Applications"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/PushApplicationEndpoint.java#L314-L322 |
53,478 | aerogear/aerogear-unifiedpush-server | push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/configuration/SenderConfigurationProvider.java | SenderConfigurationProvider.validateAndSanitizeConfiguration | private SenderConfiguration validateAndSanitizeConfiguration(VariantType type, SenderConfiguration configuration) {
switch (type) {
case ANDROID:
if (configuration.batchSize() > 1000) {
logger.warn(String
.format("Sender configuration -... | java | private SenderConfiguration validateAndSanitizeConfiguration(VariantType type, SenderConfiguration configuration) {
switch (type) {
case ANDROID:
if (configuration.batchSize() > 1000) {
logger.warn(String
.format("Sender configuration -... | [
"private",
"SenderConfiguration",
"validateAndSanitizeConfiguration",
"(",
"VariantType",
"type",
",",
"SenderConfiguration",
"configuration",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"ANDROID",
":",
"if",
"(",
"configuration",
".",
"batchSize",
"(",
")",
... | Validates that configuration is correct with regards to push networks limitations or implementation, etc. | [
"Validates",
"that",
"configuration",
"is",
"correct",
"with",
"regards",
"to",
"push",
"networks",
"limitations",
"or",
"implementation",
"etc",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/push-sender/src/main/java/org/jboss/aerogear/unifiedpush/message/configuration/SenderConfigurationProvider.java#L73-L87 |
53,479 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/CommonUtils.java | CommonUtils.isAscendingOrder | public static Boolean isAscendingOrder(String sorting) {
return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE;
} | java | public static Boolean isAscendingOrder(String sorting) {
return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE;
} | [
"public",
"static",
"Boolean",
"isAscendingOrder",
"(",
"String",
"sorting",
")",
"{",
"return",
"\"desc\"",
".",
"equalsIgnoreCase",
"(",
"sorting",
")",
"?",
"Boolean",
".",
"FALSE",
":",
"Boolean",
".",
"TRUE",
";",
"}"
] | Verify if the string sorting matches with asc or desc
Returns FALSE when sorting query value matches desc, otherwise it returns TRUE.
@param sorting the sorting value from the http header
@return false for desc or true for as | [
"Verify",
"if",
"the",
"string",
"sorting",
"matches",
"with",
"asc",
"or",
"desc",
"Returns",
"FALSE",
"when",
"sorting",
"query",
"value",
"matches",
"desc",
"otherwise",
"it",
"returns",
"TRUE",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/util/CommonUtils.java#L35-L37 |
53,480 | aerogear/aerogear-unifiedpush-server | model/push/src/main/java/org/jboss/aerogear/unifiedpush/message/UnifiedPushMessage.java | UnifiedPushMessage.toStrippedJsonString | public String toStrippedJsonString() {
try {
final Map<String, Object> json = new LinkedHashMap<>();
json.put("alert", this.message.getAlert());
json.put("priority", this.message.getPriority().toString());
if (this.getMessage().getBadge()>0) {
json... | java | public String toStrippedJsonString() {
try {
final Map<String, Object> json = new LinkedHashMap<>();
json.put("alert", this.message.getAlert());
json.put("priority", this.message.getPriority().toString());
if (this.getMessage().getBadge()>0) {
json... | [
"public",
"String",
"toStrippedJsonString",
"(",
")",
"{",
"try",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"json",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"json",
".",
"put",
"(",
"\"alert\"",
",",
"this",
".",
"message",
".",
... | Returns a JSON representation of the payload. This does not include any pushed data,
just the alert of the message. This also contains the entire criteria object.
@see #toMinimizedJsonString()
@return JSON payload | [
"Returns",
"a",
"JSON",
"representation",
"of",
"the",
"payload",
".",
"This",
"does",
"not",
"include",
"any",
"pushed",
"data",
"just",
"the",
"alert",
"of",
"the",
"message",
".",
"This",
"also",
"contains",
"the",
"entire",
"criteria",
"object",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/model/push/src/main/java/org/jboss/aerogear/unifiedpush/message/UnifiedPushMessage.java#L79-L95 |
53,481 | aerogear/aerogear-unifiedpush-server | model/push/src/main/java/org/jboss/aerogear/unifiedpush/message/UnifiedPushMessage.java | UnifiedPushMessage.toMinimizedJsonString | public String toMinimizedJsonString() {
try {
final Map<String, Object> json = new LinkedHashMap<>();
json.put("alert", this.message.getAlert());
if (this.getMessage().getBadge()>0) {
json.put("badge", Integer.toString(this.getMessage().getBadge()));
... | java | public String toMinimizedJsonString() {
try {
final Map<String, Object> json = new LinkedHashMap<>();
json.put("alert", this.message.getAlert());
if (this.getMessage().getBadge()>0) {
json.put("badge", Integer.toString(this.getMessage().getBadge()));
... | [
"public",
"String",
"toMinimizedJsonString",
"(",
")",
"{",
"try",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"json",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"json",
".",
"put",
"(",
"\"alert\"",
",",
"this",
".",
"message",
".",... | Returns a minimized JSON representation of the payload. This does not include potentially large objects, like
alias or category from the given criteria.
@see #toStrippedJsonString()
@return minizmized JSON payload | [
"Returns",
"a",
"minimized",
"JSON",
"representation",
"of",
"the",
"payload",
".",
"This",
"does",
"not",
"include",
"potentially",
"large",
"objects",
"like",
"alias",
"or",
"category",
"from",
"the",
"given",
"criteria",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/model/push/src/main/java/org/jboss/aerogear/unifiedpush/message/UnifiedPushMessage.java#L105-L126 |
53,482 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/AbstractBaseEndpoint.java | AbstractBaseEndpoint.validateModelClass | protected void validateModelClass(Object model) {
final Set<ConstraintViolation<Object>> violations = validator.validate(model);
// in case of an invalid model, we throw a ConstraintViolationException, containing the violations:
if (!violations.isEmpty()) {
throw new ConstraintViola... | java | protected void validateModelClass(Object model) {
final Set<ConstraintViolation<Object>> violations = validator.validate(model);
// in case of an invalid model, we throw a ConstraintViolationException, containing the violations:
if (!violations.isEmpty()) {
throw new ConstraintViola... | [
"protected",
"void",
"validateModelClass",
"(",
"Object",
"model",
")",
"{",
"final",
"Set",
"<",
"ConstraintViolation",
"<",
"Object",
">",
">",
"violations",
"=",
"validator",
".",
"validate",
"(",
"model",
")",
";",
"// in case of an invalid model, we throw a Con... | Generic validator used to identify constraint violations of the given model class.
@param model object to validate
@throws ConstraintViolationException if constraint violations on the given model have been identified. | [
"Generic",
"validator",
"used",
"to",
"identify",
"constraint",
"violations",
"of",
"the",
"given",
"model",
"class",
"."
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/AbstractBaseEndpoint.java#L70-L78 |
53,483 | aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/AbstractBaseEndpoint.java | AbstractBaseEndpoint.createBadRequestResponse | protected ResponseBuilder createBadRequestResponse(Set<ConstraintViolation<?>> violations) {
final Map<String, String> responseObj = violations.stream()
.collect(Collectors.toMap(v -> v.getPropertyPath().toString(), ConstraintViolation::getMessage));
return Response.status(Response.Stat... | java | protected ResponseBuilder createBadRequestResponse(Set<ConstraintViolation<?>> violations) {
final Map<String, String> responseObj = violations.stream()
.collect(Collectors.toMap(v -> v.getPropertyPath().toString(), ConstraintViolation::getMessage));
return Response.status(Response.Stat... | [
"protected",
"ResponseBuilder",
"createBadRequestResponse",
"(",
"Set",
"<",
"ConstraintViolation",
"<",
"?",
">",
">",
"violations",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"responseObj",
"=",
"violations",
".",
"stream",
"(",
")",
".",
... | Helper function to create a 400 Bad Request response, containing a JSON map giving details about the violations
@param violations set of occurred constraint violations
@return 400 Bad Request response, containing details on the constraint violations | [
"Helper",
"function",
"to",
"create",
"a",
"400",
"Bad",
"Request",
"response",
"containing",
"a",
"JSON",
"map",
"giving",
"details",
"about",
"the",
"violations"
] | c7b798f085449117d84345d8c378b27165cad32b | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/AbstractBaseEndpoint.java#L86-L92 |
53,484 | google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java | InferenceEngine.checkBlockEndContext | private static void checkBlockEndContext(RenderUnitNode node, Context endContext) {
if (!endContext.isValidEndContextForContentKind(
MoreObjects.firstNonNull(node.getContentKind(), SanitizedContentKind.HTML))) {
String msg =
String.format(
"A block of kind=\"%s\" cannot end in ... | java | private static void checkBlockEndContext(RenderUnitNode node, Context endContext) {
if (!endContext.isValidEndContextForContentKind(
MoreObjects.firstNonNull(node.getContentKind(), SanitizedContentKind.HTML))) {
String msg =
String.format(
"A block of kind=\"%s\" cannot end in ... | [
"private",
"static",
"void",
"checkBlockEndContext",
"(",
"RenderUnitNode",
"node",
",",
"Context",
"endContext",
")",
"{",
"if",
"(",
"!",
"endContext",
".",
"isValidEndContextForContentKind",
"(",
"MoreObjects",
".",
"firstNonNull",
"(",
"node",
".",
"getContentKi... | Checks that the end context of a block is compatible with its start context.
@throws SoyAutoescapeException if they mismatch. | [
"Checks",
"that",
"the",
"end",
"context",
"of",
"a",
"block",
"is",
"compatible",
"with",
"its",
"start",
"context",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java#L113-L124 |
53,485 | google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java | InferenceEngine.inferStrictRenderUnitNode | static void inferStrictRenderUnitNode(
RenderUnitNode node, Inferences inferences, ErrorReporter errorReporter) {
InferenceEngine inferenceEngine = new InferenceEngine(inferences, errorReporter);
// Context started off as startContext and we have propagated context through all of
// node's children, s... | java | static void inferStrictRenderUnitNode(
RenderUnitNode node, Inferences inferences, ErrorReporter errorReporter) {
InferenceEngine inferenceEngine = new InferenceEngine(inferences, errorReporter);
// Context started off as startContext and we have propagated context through all of
// node's children, s... | [
"static",
"void",
"inferStrictRenderUnitNode",
"(",
"RenderUnitNode",
"node",
",",
"Inferences",
"inferences",
",",
"ErrorReporter",
"errorReporter",
")",
"{",
"InferenceEngine",
"inferenceEngine",
"=",
"new",
"InferenceEngine",
"(",
"inferences",
",",
"errorReporter",
... | Applies strict contextual autoescaping to the given node's children.
<p>The start context is the given node's declared {@link ContentKind}, and it is enforced that
the block's inferred end context matches the start context.
<p>This method is used to visit the content of {let} and {param} nodes with a {@code kind}
att... | [
"Applies",
"strict",
"contextual",
"autoescaping",
"to",
"the",
"given",
"node",
"s",
"children",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java#L135-L145 |
53,486 | google/closure-templates | java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java | FormatNumDirective.parseFormat | private static String parseFormat(List<? extends TargetExpr> args) {
String numberFormatType = !args.isEmpty() ? args.get(0).getText() : "'" + DEFAULT_FORMAT + "'";
if (!JS_ARGS_TO_ENUM.containsKey(numberFormatType)) {
String validKeys = Joiner.on("', '").join(JS_ARGS_TO_ENUM.keySet());
throw new I... | java | private static String parseFormat(List<? extends TargetExpr> args) {
String numberFormatType = !args.isEmpty() ? args.get(0).getText() : "'" + DEFAULT_FORMAT + "'";
if (!JS_ARGS_TO_ENUM.containsKey(numberFormatType)) {
String validKeys = Joiner.on("', '").join(JS_ARGS_TO_ENUM.keySet());
throw new I... | [
"private",
"static",
"String",
"parseFormat",
"(",
"List",
"<",
"?",
"extends",
"TargetExpr",
">",
"args",
")",
"{",
"String",
"numberFormatType",
"=",
"!",
"args",
".",
"isEmpty",
"(",
")",
"?",
"args",
".",
"get",
"(",
"0",
")",
".",
"getText",
"(",
... | Validates that the provided format matches a supported format, and returns the value, if not,
this throws an exception.
@param args The list of provided arguments.
@return String The number format type. | [
"Validates",
"that",
"the",
"provided",
"format",
"matches",
"a",
"supported",
"format",
"and",
"returns",
"the",
"value",
"if",
"not",
"this",
"throws",
"an",
"exception",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/i18ndirectives/FormatNumDirective.java#L245-L255 |
53,487 | google/closure-templates | java/src/com/google/template/soy/data/SoyProtoValue.java | SoyProtoValue.clazz | private ProtoClass clazz() {
ProtoClass localClazz = clazz;
if (localClazz == null) {
localClazz = classCache.getUnchecked(proto.getDescriptorForType());
clazz = localClazz;
}
return localClazz;
} | java | private ProtoClass clazz() {
ProtoClass localClazz = clazz;
if (localClazz == null) {
localClazz = classCache.getUnchecked(proto.getDescriptorForType());
clazz = localClazz;
}
return localClazz;
} | [
"private",
"ProtoClass",
"clazz",
"(",
")",
"{",
"ProtoClass",
"localClazz",
"=",
"clazz",
";",
"if",
"(",
"localClazz",
"==",
"null",
")",
"{",
"localClazz",
"=",
"classCache",
".",
"getUnchecked",
"(",
"proto",
".",
"getDescriptorForType",
"(",
")",
")",
... | it if we can | [
"it",
"if",
"we",
"can"
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SoyProtoValue.java#L205-L212 |
53,488 | google/closure-templates | java/src/com/google/template/soy/data/SoyProtoValue.java | SoyProtoValue.getProtoField | public SoyValue getProtoField(String name) {
FieldWithInterpreter field = clazz().fields.get(name);
if (field == null) {
throw new IllegalArgumentException(
"Proto " + proto.getClass().getName() + " does not have a field of name " + name);
}
if (field.shouldCheckFieldPresenceToEmulateJsp... | java | public SoyValue getProtoField(String name) {
FieldWithInterpreter field = clazz().fields.get(name);
if (field == null) {
throw new IllegalArgumentException(
"Proto " + proto.getClass().getName() + " does not have a field of name " + name);
}
if (field.shouldCheckFieldPresenceToEmulateJsp... | [
"public",
"SoyValue",
"getProtoField",
"(",
"String",
"name",
")",
"{",
"FieldWithInterpreter",
"field",
"=",
"clazz",
"(",
")",
".",
"fields",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumen... | Gets a value for the field for the underlying proto object. Not intended for general use.
@param name The proto field name.
@return The value of the given field for the underlying proto object, or NullData if either the
field does not exist or the value is not set in the underlying proto (according to the jspb
semanti... | [
"Gets",
"a",
"value",
"for",
"the",
"field",
"for",
"the",
"underlying",
"proto",
"object",
".",
"Not",
"intended",
"for",
"general",
"use",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/SoyProtoValue.java#L227-L238 |
53,489 | google/closure-templates | java/src/com/google/template/soy/internal/proto/Field.java | Field.getFieldsForType | public static <T extends Field> ImmutableMap<String, T> getFieldsForType(
Descriptor descriptor, Set<FieldDescriptor> extensions, Factory<T> factory) {
ImmutableMap.Builder<String, T> fields = ImmutableMap.builder();
for (FieldDescriptor fieldDescriptor : descriptor.getFields()) {
if (ProtoUtils.sho... | java | public static <T extends Field> ImmutableMap<String, T> getFieldsForType(
Descriptor descriptor, Set<FieldDescriptor> extensions, Factory<T> factory) {
ImmutableMap.Builder<String, T> fields = ImmutableMap.builder();
for (FieldDescriptor fieldDescriptor : descriptor.getFields()) {
if (ProtoUtils.sho... | [
"public",
"static",
"<",
"T",
"extends",
"Field",
">",
"ImmutableMap",
"<",
"String",
",",
"T",
">",
"getFieldsForType",
"(",
"Descriptor",
"descriptor",
",",
"Set",
"<",
"FieldDescriptor",
">",
"extensions",
",",
"Factory",
"<",
"T",
">",
"factory",
")",
... | Returns the set of fields indexed by soy accessor name for the given type. | [
"Returns",
"the",
"set",
"of",
"fields",
"indexed",
"by",
"soy",
"accessor",
"name",
"for",
"the",
"given",
"type",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/Field.java#L57-L94 |
53,490 | google/closure-templates | java/src/com/google/template/soy/jbcsrc/JbcSrcValueFactory.java | JbcSrcValueFactory.soyTypeForProtoOrEnum | private Optional<SoyType> soyTypeForProtoOrEnum(Class<?> type, Method method) {
// Message isn't supported because we can't get a descriptor from it.
if (type == Message.class) {
reporter.invalidReturnType(Message.class, method);
return Optional.absent();
}
Optional<String> fullName = nameFr... | java | private Optional<SoyType> soyTypeForProtoOrEnum(Class<?> type, Method method) {
// Message isn't supported because we can't get a descriptor from it.
if (type == Message.class) {
reporter.invalidReturnType(Message.class, method);
return Optional.absent();
}
Optional<String> fullName = nameFr... | [
"private",
"Optional",
"<",
"SoyType",
">",
"soyTypeForProtoOrEnum",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Method",
"method",
")",
"{",
"// Message isn't supported because we can't get a descriptor from it.",
"if",
"(",
"type",
"==",
"Message",
".",
"class",
")... | Attempts to discover the SoyType for a proto or proto enum, reporting an error if unable to. | [
"Attempts",
"to",
"discover",
"the",
"SoyType",
"for",
"a",
"proto",
"or",
"proto",
"enum",
"reporting",
"an",
"error",
"if",
"unable",
"to",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/JbcSrcValueFactory.java#L720-L737 |
53,491 | google/closure-templates | java/src/com/google/template/soy/jbcsrc/JbcSrcValueFactory.java | JbcSrcValueFactory.isOrContains | private boolean isOrContains(SoyType type, SoyType.Kind kind) {
if (type.getKind() == kind) {
return true;
}
if (type.getKind() == SoyType.Kind.UNION) {
for (SoyType member : ((UnionType) type).getMembers()) {
if (member.getKind() == kind) {
return true;
}
}
}... | java | private boolean isOrContains(SoyType type, SoyType.Kind kind) {
if (type.getKind() == kind) {
return true;
}
if (type.getKind() == SoyType.Kind.UNION) {
for (SoyType member : ((UnionType) type).getMembers()) {
if (member.getKind() == kind) {
return true;
}
}
}... | [
"private",
"boolean",
"isOrContains",
"(",
"SoyType",
"type",
",",
"SoyType",
".",
"Kind",
"kind",
")",
"{",
"if",
"(",
"type",
".",
"getKind",
"(",
")",
"==",
"kind",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"type",
".",
"getKind",
"(",
")... | Returns true if the type is the given kind or contains the given kind. | [
"Returns",
"true",
"if",
"the",
"type",
"is",
"the",
"given",
"kind",
"or",
"contains",
"the",
"given",
"kind",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/JbcSrcValueFactory.java#L740-L752 |
53,492 | google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.getFieldName | public static String getFieldName(
Descriptors.FieldDescriptor field, boolean capitializeFirstLetter) {
String fieldName = field.getName();
if (SPECIAL_CASES.containsKey(fieldName)) {
String output = SPECIAL_CASES.get(fieldName);
if (capitializeFirstLetter) {
return output;
} els... | java | public static String getFieldName(
Descriptors.FieldDescriptor field, boolean capitializeFirstLetter) {
String fieldName = field.getName();
if (SPECIAL_CASES.containsKey(fieldName)) {
String output = SPECIAL_CASES.get(fieldName);
if (capitializeFirstLetter) {
return output;
} els... | [
"public",
"static",
"String",
"getFieldName",
"(",
"Descriptors",
".",
"FieldDescriptor",
"field",
",",
"boolean",
"capitializeFirstLetter",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"if",
"(",
"SPECIAL_CASES",
".",
"containsK... | Returns the Java name for a proto field. | [
"Returns",
"the",
"Java",
"name",
"for",
"a",
"proto",
"field",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L137-L149 |
53,493 | google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.underscoresToCamelCase | public static String underscoresToCamelCase(String input, boolean capitializeNextLetter) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
char ch = input.charAt(i);
if ('a' <= ch && ch <= 'z') {
if (capitializeNextLetter) {
result.append((cha... | java | public static String underscoresToCamelCase(String input, boolean capitializeNextLetter) {
StringBuilder result = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
char ch = input.charAt(i);
if ('a' <= ch && ch <= 'z') {
if (capitializeNextLetter) {
result.append((cha... | [
"public",
"static",
"String",
"underscoresToCamelCase",
"(",
"String",
"input",
",",
"boolean",
"capitializeNextLetter",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"input"... | Converts underscore field names to camel case, while preserving camel case field names. | [
"Converts",
"underscore",
"field",
"names",
"to",
"camel",
"case",
"while",
"preserving",
"camel",
"case",
"field",
"names",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L160-L189 |
53,494 | google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.hasConflictingClassName | private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) {
if (name.equals(messageDesc.getName())) {
return true;
}
for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) {
if (name.equals(enumDesc.getName())) {
return true;
}
}
f... | java | private static boolean hasConflictingClassName(DescriptorProto messageDesc, String name) {
if (name.equals(messageDesc.getName())) {
return true;
}
for (EnumDescriptorProto enumDesc : messageDesc.getEnumTypeList()) {
if (name.equals(enumDesc.getName())) {
return true;
}
}
f... | [
"private",
"static",
"boolean",
"hasConflictingClassName",
"(",
"DescriptorProto",
"messageDesc",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"messageDesc",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"f... | Used by the other overload, descends recursively into messages. | [
"Used",
"by",
"the",
"other",
"overload",
"descends",
"recursively",
"into",
"messages",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L298-L313 |
53,495 | google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.hasConflictingClassName | private static boolean hasConflictingClassName(FileDescriptorProto file, String name) {
for (EnumDescriptorProto enumDesc : file.getEnumTypeList()) {
if (name.equals(enumDesc.getName())) {
return true;
}
}
for (ServiceDescriptorProto serviceDesc : file.getServiceList()) {
if (name.... | java | private static boolean hasConflictingClassName(FileDescriptorProto file, String name) {
for (EnumDescriptorProto enumDesc : file.getEnumTypeList()) {
if (name.equals(enumDesc.getName())) {
return true;
}
}
for (ServiceDescriptorProto serviceDesc : file.getServiceList()) {
if (name.... | [
"private",
"static",
"boolean",
"hasConflictingClassName",
"(",
"FileDescriptorProto",
"file",
",",
"String",
"name",
")",
"{",
"for",
"(",
"EnumDescriptorProto",
"enumDesc",
":",
"file",
".",
"getEnumTypeList",
"(",
")",
")",
"{",
"if",
"(",
"name",
".",
"equ... | Checks whether any generated classes conflict with the given name. | [
"Checks",
"whether",
"any",
"generated",
"classes",
"conflict",
"with",
"the",
"given",
"name",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L316-L333 |
53,496 | google/closure-templates | java/src/com/google/template/soy/data/restricted/IntegerData.java | IntegerData.forValue | public static IntegerData forValue(long value) {
if (value > 10 || value < -1) {
return new IntegerData(value);
}
switch ((int) value) {
case -1:
return MINUS_ONE;
case 0:
return ZERO;
case 1:
return ONE;
case 2:
return TWO;
case 3:
... | java | public static IntegerData forValue(long value) {
if (value > 10 || value < -1) {
return new IntegerData(value);
}
switch ((int) value) {
case -1:
return MINUS_ONE;
case 0:
return ZERO;
case 1:
return ONE;
case 2:
return TWO;
case 3:
... | [
"public",
"static",
"IntegerData",
"forValue",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"value",
">",
"10",
"||",
"value",
"<",
"-",
"1",
")",
"{",
"return",
"new",
"IntegerData",
"(",
"value",
")",
";",
"}",
"switch",
"(",
"(",
"int",
")",
"valu... | Gets a IntegerData instance for the given value.
@param value The desired value.
@return A IntegerData instance with the given value. | [
"Gets",
"a",
"IntegerData",
"instance",
"for",
"the",
"given",
"value",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/restricted/IntegerData.java#L82-L114 |
53,497 | google/closure-templates | java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java | GenPyCallExprVisitor.exec | PyExpr exec(CallNode callNode, LocalVariableStack localVarStack, ErrorReporter errorReporter) {
this.localVarStack = localVarStack;
this.errorReporter = errorReporter;
PyExpr callExpr = visit(callNode);
this.localVarStack = null;
this.errorReporter = null;
return callExpr;
} | java | PyExpr exec(CallNode callNode, LocalVariableStack localVarStack, ErrorReporter errorReporter) {
this.localVarStack = localVarStack;
this.errorReporter = errorReporter;
PyExpr callExpr = visit(callNode);
this.localVarStack = null;
this.errorReporter = null;
return callExpr;
} | [
"PyExpr",
"exec",
"(",
"CallNode",
"callNode",
",",
"LocalVariableStack",
"localVarStack",
",",
"ErrorReporter",
"errorReporter",
")",
"{",
"this",
".",
"localVarStack",
"=",
"localVarStack",
";",
"this",
".",
"errorReporter",
"=",
"errorReporter",
";",
"PyExpr",
... | Generates the Python expression for a given call.
<p>Important: If there are CallParamContentNode children whose contents are not computable as
Python expressions, then this function assumes that, elsewhere, code has been generated to
define their respective {@code param<n>} temporary variables.
<p>Here are five exam... | [
"Generates",
"the",
"Python",
"expression",
"for",
"a",
"given",
"call",
"."
] | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java#L114-L121 |
53,498 | google/closure-templates | java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java | GenPyCallExprVisitor.visitCallBasicNode | @Override
protected PyExpr visitCallBasicNode(CallBasicNode node) {
String calleeName = node.getCalleeName();
// Build the Python expr text for the callee.
String calleeExprText;
TemplateNode template = getTemplateIfInSameFile(node);
if (template != null) {
// If in the same module no names... | java | @Override
protected PyExpr visitCallBasicNode(CallBasicNode node) {
String calleeName = node.getCalleeName();
// Build the Python expr text for the callee.
String calleeExprText;
TemplateNode template = getTemplateIfInSameFile(node);
if (template != null) {
// If in the same module no names... | [
"@",
"Override",
"protected",
"PyExpr",
"visitCallBasicNode",
"(",
"CallBasicNode",
"node",
")",
"{",
"String",
"calleeName",
"=",
"node",
".",
"getCalleeName",
"(",
")",
";",
"// Build the Python expr text for the callee.",
"String",
"calleeExprText",
";",
"TemplateNod... | Visits basic call nodes and builds the call expression. If the callee is in the file, it can be
accessed directly, but if it's in another file, the module name must be prefixed.
@param node The basic call node.
@return The call Python expression. | [
"Visits",
"basic",
"call",
"nodes",
"and",
"builds",
"the",
"call",
"expression",
".",
"If",
"the",
"callee",
"is",
"in",
"the",
"file",
"it",
"can",
"be",
"accessed",
"directly",
"but",
"if",
"it",
"s",
"in",
"another",
"file",
"the",
"module",
"name",
... | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java#L130-L148 |
53,499 | google/closure-templates | java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java | GenPyCallExprVisitor.visitCallDelegateNode | @Override
protected PyExpr visitCallDelegateNode(CallDelegateNode node) {
ExprRootNode variantSoyExpr = node.getDelCalleeVariantExpr();
PyExpr variantPyExpr;
if (variantSoyExpr == null) {
// Case 1: Delegate call with empty variant.
variantPyExpr = new PyStringExpr("''");
} else {
//... | java | @Override
protected PyExpr visitCallDelegateNode(CallDelegateNode node) {
ExprRootNode variantSoyExpr = node.getDelCalleeVariantExpr();
PyExpr variantPyExpr;
if (variantSoyExpr == null) {
// Case 1: Delegate call with empty variant.
variantPyExpr = new PyStringExpr("''");
} else {
//... | [
"@",
"Override",
"protected",
"PyExpr",
"visitCallDelegateNode",
"(",
"CallDelegateNode",
"node",
")",
"{",
"ExprRootNode",
"variantSoyExpr",
"=",
"node",
".",
"getDelCalleeVariantExpr",
"(",
")",
";",
"PyExpr",
"variantPyExpr",
";",
"if",
"(",
"variantSoyExpr",
"==... | Visits a delegate call node and builds the call expression to retrieve the function and execute
it. The get_delegate_fn returns the function directly, so its output can be called directly.
@param node The delegate call node.
@return The call Python expression. | [
"Visits",
"a",
"delegate",
"call",
"node",
"and",
"builds",
"the",
"call",
"expression",
"to",
"retrieve",
"the",
"function",
"and",
"execute",
"it",
".",
"The",
"get_delegate_fn",
"returns",
"the",
"function",
"directly",
"so",
"its",
"output",
"can",
"be",
... | cc61e1dff70ae97f24f417a57410081bc498bd56 | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java#L157-L179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.