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
100,200
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.getKeyAsString
public String getKeyAsString(Key key) { Objects.requireNonNull(key, Required.KEY.toString()); return encodeBase64(key.getEncoded()); }
java
public String getKeyAsString(Key key) { Objects.requireNonNull(key, Required.KEY.toString()); return encodeBase64(key.getEncoded()); }
[ "public", "String", "getKeyAsString", "(", "Key", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "return", "encodeBase64", "(", "key", ".", "getEncoded", "(", ")", ")", "...
Convert a Key to string encoded as Base64 @param key The key (private or public) @return A string representation of the key
[ "Convert", "a", "Key", "to", "string", "encoded", "as", "Base64" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L279-L283
100,201
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.getPrivateKeyFromString
public PrivateKey getPrivateKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePrivate(new PKCS8EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecE...
java
public PrivateKey getPrivateKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePrivate(new PKCS8EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecE...
[ "public", "PrivateKey", "getPrivateKeyFromString", "(", "String", "key", ")", "throws", "MangooEncryptionException", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "try", "{", "return", "Key...
Generates Private Key from Base64 encoded string @param key Base64 encoded string which represents the key @return The PrivateKey @throws MangooEncryptionException if getting private key from string fails
[ "Generates", "Private", "Key", "from", "Base64", "encoded", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L293-L301
100,202
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.getPublicKeyFromString
public PublicKey getPublicKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePublic(new X509EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecExcep...
java
public PublicKey getPublicKeyFromString(String key) throws MangooEncryptionException { Objects.requireNonNull(key, Required.KEY.toString()); try { return KeyFactory.getInstance(ALGORITHM).generatePublic(new X509EncodedKeySpec(decodeBase64(key))); } catch (InvalidKeySpecExcep...
[ "public", "PublicKey", "getPublicKeyFromString", "(", "String", "key", ")", "throws", "MangooEncryptionException", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "try", "{", "return", "KeyFa...
Generates Public Key from Base64 encoded string @param key Base64 encoded string which represents the key @return The PublicKey @throws MangooEncryptionException if getting public key from string fails
[ "Generates", "Public", "Key", "from", "Base64", "encoded", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L311-L319
100,203
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.encodeBase64
private String encodeBase64(byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); return org.apache.commons.codec.binary.Base64.encodeBase64String(bytes); }
java
private String encodeBase64(byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); return org.apache.commons.codec.binary.Base64.encodeBase64String(bytes); }
[ "private", "String", "encodeBase64", "(", "byte", "[", "]", "bytes", ")", "{", "Objects", ".", "requireNonNull", "(", "bytes", ",", "Required", ".", "BYTES", ".", "toString", "(", ")", ")", ";", "return", "org", ".", "apache", ".", "commons", ".", "cod...
Encode bytes array to Base64 string @param bytes The bytes @return Encoded string
[ "Encode", "bytes", "array", "to", "Base64", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L327-L330
100,204
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java
Crypto.decodeBase64
private byte[] decodeBase64(String text) { Objects.requireNonNull(text, Required.PLAIN_TEXT.toString()); return org.apache.commons.codec.binary.Base64.decodeBase64(text); }
java
private byte[] decodeBase64(String text) { Objects.requireNonNull(text, Required.PLAIN_TEXT.toString()); return org.apache.commons.codec.binary.Base64.decodeBase64(text); }
[ "private", "byte", "[", "]", "decodeBase64", "(", "String", "text", ")", "{", "Objects", ".", "requireNonNull", "(", "text", ",", "Required", ".", "PLAIN_TEXT", ".", "toString", "(", ")", ")", ";", "return", "org", ".", "apache", ".", "commons", ".", "...
Decode Base64 encoded string to bytes array @param text The string @return Bytes array
[ "Decode", "Base64", "encoded", "string", "to", "bytes", "array" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L338-L341
100,205
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.hexJBcrypt
public static String hexJBcrypt(String data) { Objects.requireNonNull(data, Required.DATA.toString()); return BCrypt.hashpw(data, BCrypt.gensalt(Default.JBCRYPT_ROUNDS.toInt())); }
java
public static String hexJBcrypt(String data) { Objects.requireNonNull(data, Required.DATA.toString()); return BCrypt.hashpw(data, BCrypt.gensalt(Default.JBCRYPT_ROUNDS.toInt())); }
[ "public", "static", "String", "hexJBcrypt", "(", "String", "data", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "return", "BCrypt", ".", "hashpw", "(", "data", ",", "BCrypt", ...
Hashes a given cleartext data with JBCrypt @param data The cleartext data @return JBCrypted hashed value
[ "Hashes", "a", "given", "cleartext", "data", "with", "JBCrypt" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L32-L36
100,206
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.hexSHA512
public static String hexSHA512(String data) { Objects.requireNonNull(data, Required.DATA.toString()); return DigestUtils.sha512Hex(data); }
java
public static String hexSHA512(String data) { Objects.requireNonNull(data, Required.DATA.toString()); return DigestUtils.sha512Hex(data); }
[ "public", "static", "String", "hexSHA512", "(", "String", "data", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "return", "DigestUtils", ".", "sha512Hex", "(", "data", ")", ";"...
Hashes a given cleartext data with SHA512 @param data The cleartext data @return SHA512 hashed value
[ "Hashes", "a", "given", "cleartext", "data", "with", "SHA512" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L44-L48
100,207
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.hexSHA512
public static String hexSHA512(String data, String salt) { Objects.requireNonNull(data, Required.DATA.toString()); Objects.requireNonNull(salt, Required.SALT.toString()); return DigestUtils.sha512Hex(data + salt); }
java
public static String hexSHA512(String data, String salt) { Objects.requireNonNull(data, Required.DATA.toString()); Objects.requireNonNull(salt, Required.SALT.toString()); return DigestUtils.sha512Hex(data + salt); }
[ "public", "static", "String", "hexSHA512", "(", "String", "data", ",", "String", "salt", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "Objects", ".", "requireNonNull", "(", "s...
Hashes a given cleartext data with SHA512 and an appended salt @param data The cleartext data @param salt The salt to use @return SHA512 hashed value
[ "Hashes", "a", "given", "cleartext", "data", "with", "SHA512", "and", "an", "appended", "salt" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L57-L62
100,208
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.checkJBCrypt
public static boolean checkJBCrypt(String data, String hash) { Objects.requireNonNull(data, Required.DATA.toString()); Objects.requireNonNull(hash, Required.HASH.toString()); return BCrypt.checkpw(data, hash); }
java
public static boolean checkJBCrypt(String data, String hash) { Objects.requireNonNull(data, Required.DATA.toString()); Objects.requireNonNull(hash, Required.HASH.toString()); return BCrypt.checkpw(data, hash); }
[ "public", "static", "boolean", "checkJBCrypt", "(", "String", "data", ",", "String", "hash", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "Objects", ".", "requireNonNull", "(", ...
Checks a given data against a JBCrypted hash @param data The cleartext data @param hash The JBCrypt hashed value @return True if it is a match, false otherwise
[ "Checks", "a", "given", "data", "against", "a", "JBCrypted", "hash" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L71-L76
100,209
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.serializeToBase64
public static String serializeToBase64(Serializable object) { Objects.requireNonNull(object, Required.OBJECT.toString()); byte[] serialize = SerializationUtils.serialize(object); return base64Encoder.encodeToString(serialize); }
java
public static String serializeToBase64(Serializable object) { Objects.requireNonNull(object, Required.OBJECT.toString()); byte[] serialize = SerializationUtils.serialize(object); return base64Encoder.encodeToString(serialize); }
[ "public", "static", "String", "serializeToBase64", "(", "Serializable", "object", ")", "{", "Objects", ".", "requireNonNull", "(", "object", ",", "Required", ".", "OBJECT", ".", "toString", "(", ")", ")", ";", "byte", "[", "]", "serialize", "=", "Serializati...
Serializes an object into an Base64 encoded data string @param object The object to serialize @return The base64 encoded data string
[ "Serializes", "an", "object", "into", "an", "Base64", "encoded", "data", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L84-L89
100,210
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java
CodecUtils.deserializeFromBase64
public static <T> T deserializeFromBase64(String data) { Objects.requireNonNull(data, Required.DATA.toString()); byte[] bytes = base64Decoder.decode(data); return SerializationUtils.deserialize(bytes); }
java
public static <T> T deserializeFromBase64(String data) { Objects.requireNonNull(data, Required.DATA.toString()); byte[] bytes = base64Decoder.decode(data); return SerializationUtils.deserialize(bytes); }
[ "public", "static", "<", "T", ">", "T", "deserializeFromBase64", "(", "String", "data", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ",", "Required", ".", "DATA", ".", "toString", "(", ")", ")", ";", "byte", "[", "]", "bytes", "=", "base64D...
Deserialize a given Base64 encoded data string into an object @param data The base64 encoded data string @param <T> Just for JavaDoc can be ignored @return The required object
[ "Deserialize", "a", "given", "Base64", "encoded", "data", "string", "into", "an", "object" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/CodecUtils.java#L98-L103
100,211
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.getString
public Optional<String> getString(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value)) { return Optional.of(value); } return Optional.empty(); }
java
public Optional<String> getString(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value)) { return Optional.of(value); } return Optional.empty(); }
[ "public", "Optional", "<", "String", ">", "getString", "(", "String", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "String", "value", "=", "this", ".", "values", ".", ...
Retrieves an optional string value corresponding to the name of the form element @param key The name of the form element @return Optional of String
[ "Retrieves", "an", "optional", "string", "value", "corresponding", "to", "the", "name", "of", "the", "form", "element" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L39-L48
100,212
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.getBoolean
public Optional<Boolean> getBoolean(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value)) { if (("1").equals(value)) { return Optional.of(Boolean.TRUE); } else if (("tru...
java
public Optional<Boolean> getBoolean(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value)) { if (("1").equals(value)) { return Optional.of(Boolean.TRUE); } else if (("tru...
[ "public", "Optional", "<", "Boolean", ">", "getBoolean", "(", "String", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "String", "value", "=", "this", ".", "values", ".",...
Retrieves an optional boolean value corresponding to the name of the form element 0 maps to false 1 maps to true "true" maps to true "false" maps to false @param key The name of the form element @return Optional of Boolean
[ "Retrieves", "an", "optional", "boolean", "value", "corresponding", "to", "the", "name", "of", "the", "form", "element" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L61-L80
100,213
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.getInteger
public Optional<Integer> getInteger(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value) && NumberUtils.isCreatable(value)) { return Optional.of(Integer.valueOf(value)); } return O...
java
public Optional<Integer> getInteger(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value) && NumberUtils.isCreatable(value)) { return Optional.of(Integer.valueOf(value)); } return O...
[ "public", "Optional", "<", "Integer", ">", "getInteger", "(", "String", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "String", "value", "=", "this", ".", "values", ".",...
Retrieves an optional integer value corresponding to the name of the form element @param key The name of the form element @return Optional of Integer
[ "Retrieves", "an", "optional", "integer", "value", "corresponding", "to", "the", "name", "of", "the", "form", "element" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L88-L97
100,214
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.getFile
public Optional<InputStream> getFile() { if (!this.files.isEmpty()) { return Optional.of(this.files.get(0)); } return Optional.empty(); }
java
public Optional<InputStream> getFile() { if (!this.files.isEmpty()) { return Optional.of(this.files.get(0)); } return Optional.empty(); }
[ "public", "Optional", "<", "InputStream", ">", "getFile", "(", ")", "{", "if", "(", "!", "this", ".", "files", ".", "isEmpty", "(", ")", ")", "{", "return", "Optional", ".", "of", "(", "this", ".", "files", ".", "get", "(", "0", ")", ")", ";", ...
Retrieves a single file of the form. If the the form has multiple files, the first will be returned @return File or null if no file is present
[ "Retrieves", "a", "single", "file", "of", "the", "form", ".", "If", "the", "the", "form", "has", "multiple", "files", "the", "first", "will", "be", "returned" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L148-L154
100,215
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.addValueList
public void addValueList(String key, String value) { Objects.requireNonNull(key, Required.KEY.toString()); if (!valueMap.containsKey(key)) { List<String> values = new ArrayList<>(); values.add(value); valueMap.put(key, values); } else { ...
java
public void addValueList(String key, String value) { Objects.requireNonNull(key, Required.KEY.toString()); if (!valueMap.containsKey(key)) { List<String> values = new ArrayList<>(); values.add(value); valueMap.put(key, values); } else { ...
[ "public", "void", "addValueList", "(", "String", "key", ",", "String", "value", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "if", "(", "!", "valueMap", ".", "containsKey", "(...
Adds an additional item to the value list @param key The name of the form element @param value The value to store
[ "Adds", "an", "additional", "item", "to", "the", "value", "list" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L188-L202
100,216
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java
Form.getValueList
public List<String> getValueList(String key) { Objects.requireNonNull(key, Required.KEY.toString()); return this.valueMap.get(key); }
java
public List<String> getValueList(String key) { Objects.requireNonNull(key, Required.KEY.toString()); return this.valueMap.get(key); }
[ "public", "List", "<", "String", ">", "getValueList", "(", "String", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "return", "this", ".", "valueMap", ".", "get", "(", ...
Retrieves the value list for a given key @param key The name of the form element @return A value list with elements
[ "Retrieves", "the", "value", "list", "for", "a", "given", "key" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Form.java#L210-L214
100,217
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/services/EventBusService.java
EventBusService.register
public void register(Object eventListener) { Objects.requireNonNull(eventListener, Required.EVENT_LISTENER.toString()); this.eventBus.register(eventListener); this.listeners.getAndIncrement(); }
java
public void register(Object eventListener) { Objects.requireNonNull(eventListener, Required.EVENT_LISTENER.toString()); this.eventBus.register(eventListener); this.listeners.getAndIncrement(); }
[ "public", "void", "register", "(", "Object", "eventListener", ")", "{", "Objects", ".", "requireNonNull", "(", "eventListener", ",", "Required", ".", "EVENT_LISTENER", ".", "toString", "(", ")", ")", ";", "this", ".", "eventBus", ".", "register", "(", "event...
Registers an event listener to the event bus @param eventListener The listener to register
[ "Registers", "an", "event", "listener", "to", "the", "event", "bus" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/EventBusService.java#L32-L37
100,218
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/services/EventBusService.java
EventBusService.unregister
public void unregister(Object eventListener) throws MangooEventBusException { Objects.requireNonNull(eventListener, Required.EVENT_LISTENER.toString()); try { this.eventBus.unregister(eventListener); } catch (IllegalArgumentException e) { throw new MangooEventBus...
java
public void unregister(Object eventListener) throws MangooEventBusException { Objects.requireNonNull(eventListener, Required.EVENT_LISTENER.toString()); try { this.eventBus.unregister(eventListener); } catch (IllegalArgumentException e) { throw new MangooEventBus...
[ "public", "void", "unregister", "(", "Object", "eventListener", ")", "throws", "MangooEventBusException", "{", "Objects", ".", "requireNonNull", "(", "eventListener", ",", "Required", ".", "EVENT_LISTENER", ".", "toString", "(", ")", ")", ";", "try", "{", "this"...
Unregisters an event listener to the event bus @param eventListener The listener to unregister @throws MangooEventBusException when unregistering an event fails
[ "Unregisters", "an", "event", "listener", "to", "the", "event", "bus" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/EventBusService.java#L45-L57
100,219
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/services/EventBusService.java
EventBusService.publish
public void publish(Object event) { Objects.requireNonNull(event, Required.EVENT.toString()); this.eventBus.post(event); this.events.getAndIncrement(); }
java
public void publish(Object event) { Objects.requireNonNull(event, Required.EVENT.toString()); this.eventBus.post(event); this.events.getAndIncrement(); }
[ "public", "void", "publish", "(", "Object", "event", ")", "{", "Objects", ".", "requireNonNull", "(", "event", ",", "Required", ".", "EVENT", ".", "toString", "(", ")", ")", ";", "this", ".", "eventBus", ".", "post", "(", "event", ")", ";", "this", "...
Publishes an event to the event bus @param event The event to publish
[ "Publishes", "an", "event", "to", "the", "event", "bus" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/EventBusService.java#L64-L69
100,220
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/FormHandler.java
FormHandler.getForm
@SuppressWarnings("rawtypes") protected Form getForm(HttpServerExchange exchange) throws IOException { final Form form = Application.getInstance(Form.class); if (RequestUtils.isPostPutPatch(exchange)) { final Builder builder = FormParserFactory.builder(); builder.setDefaultCh...
java
@SuppressWarnings("rawtypes") protected Form getForm(HttpServerExchange exchange) throws IOException { final Form form = Application.getInstance(Form.class); if (RequestUtils.isPostPutPatch(exchange)) { final Builder builder = FormParserFactory.builder(); builder.setDefaultCh...
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "protected", "Form", "getForm", "(", "HttpServerExchange", "exchange", ")", "throws", "IOException", "{", "final", "Form", "form", "=", "Application", ".", "getInstance", "(", "Form", ".", "class", ")", ";", "...
Retrieves the form parameter from a request @param exchange The Undertow HttpServerExchange @throws IOException
[ "Retrieves", "the", "form", "parameter", "from", "a", "request" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/FormHandler.java#L49-L86
100,221
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Session.java
Session.put
public void put(String key, String value) { if (INVALID_CHRACTERTS.contains(key) || INVALID_CHRACTERTS.contains(value)) { LOG.error("Session key or value can not contain the following characters: spaces, |, & or :"); } else { this.changed = true; this.values.put(key,...
java
public void put(String key, String value) { if (INVALID_CHRACTERTS.contains(key) || INVALID_CHRACTERTS.contains(value)) { LOG.error("Session key or value can not contain the following characters: spaces, |, & or :"); } else { this.changed = true; this.values.put(key,...
[ "public", "void", "put", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "INVALID_CHRACTERTS", ".", "contains", "(", "key", ")", "||", "INVALID_CHRACTERTS", ".", "contains", "(", "value", ")", ")", "{", "LOG", ".", "error", "(", "\"S...
Adds a value to the session, overwriting an existing value @param key The key to store the value @param value The value to store
[ "Adds", "a", "value", "to", "the", "session", "overwriting", "an", "existing", "value" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Session.java#L99-L106
100,222
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/DispatcherHandler.java
DispatcherHandler.getMethodParameters
private Map<String, Class<?>> getMethodParameters() { final Map<String, Class<?>> parameters = new LinkedHashMap<>(); for (final Method declaredMethod : this.controllerClass.getDeclaredMethods()) { if (declaredMethod.getName().equals(this.controllerMethodName) && declaredMethod.getParameterC...
java
private Map<String, Class<?>> getMethodParameters() { final Map<String, Class<?>> parameters = new LinkedHashMap<>(); for (final Method declaredMethod : this.controllerClass.getDeclaredMethods()) { if (declaredMethod.getName().equals(this.controllerMethodName) && declaredMethod.getParameterC...
[ "private", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "getMethodParameters", "(", ")", "{", "final", "Map", "<", "String", ",", "Class", "<", "?", ">", ">", "parameters", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "for", "(", "f...
Converts the method parameter of a mapped controller method to a map @return A Map containing the declared methods of the method parameters and their class type
[ "Converts", "the", "method", "parameter", "of", "a", "mapped", "controller", "method", "to", "a", "map" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/DispatcherHandler.java#L162-L172
100,223
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/routes/WebSocketRoute.java
WebSocketRoute.onController
public WebSocketRoute onController(Class<?> clazz) { Objects.requireNonNull(clazz, Required.URL.toString()); this.controllerClass = clazz; return this; }
java
public WebSocketRoute onController(Class<?> clazz) { Objects.requireNonNull(clazz, Required.URL.toString()); this.controllerClass = clazz; return this; }
[ "public", "WebSocketRoute", "onController", "(", "Class", "<", "?", ">", "clazz", ")", "{", "Objects", ".", "requireNonNull", "(", "clazz", ",", "Required", ".", "URL", ".", "toString", "(", ")", ")", ";", "this", ".", "controllerClass", "=", "clazz", ";...
Sets the controller class for this WebSocket route @param clazz The controller class @return WebSocketRoute instance
[ "Sets", "the", "controller", "class", "for", "this", "WebSocket", "route" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/routes/WebSocketRoute.java#L45-L50
100,224
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java
JsonUtils.toJson
public static String toJson(Object object) { Objects.requireNonNull(object, Required.OBJECT.toString()); String json = null; try { json = mapper.writeValueAsString(object); } catch (JsonProcessingException e) { LOG.error("Failed to convert object to json"...
java
public static String toJson(Object object) { Objects.requireNonNull(object, Required.OBJECT.toString()); String json = null; try { json = mapper.writeValueAsString(object); } catch (JsonProcessingException e) { LOG.error("Failed to convert object to json"...
[ "public", "static", "String", "toJson", "(", "Object", "object", ")", "{", "Objects", ".", "requireNonNull", "(", "object", ",", "Required", ".", "OBJECT", ".", "toString", "(", ")", ")", ";", "String", "json", "=", "null", ";", "try", "{", "json", "="...
Converts a given object to a Json string @param object The object to convert @return json string or null if conversion fails
[ "Converts", "a", "given", "object", "to", "a", "Json", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java#L45-L56
100,225
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java
JsonUtils.fromJson
public static ReadContext fromJson(String json) { Objects.requireNonNull(json, Required.JSON.toString()); return JsonPath.parse(json); }
java
public static ReadContext fromJson(String json) { Objects.requireNonNull(json, Required.JSON.toString()); return JsonPath.parse(json); }
[ "public", "static", "ReadContext", "fromJson", "(", "String", "json", ")", "{", "Objects", ".", "requireNonNull", "(", "json", ",", "Required", ".", "JSON", ".", "toString", "(", ")", ")", ";", "return", "JsonPath", ".", "parse", "(", "json", ")", ";", ...
Converts a given Json string to an JSONPath ReadContext @param json The json string to convert @return JSPNPath read context
[ "Converts", "a", "given", "Json", "string", "to", "an", "JSONPath", "ReadContext" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java#L83-L87
100,226
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java
JsonUtils.fromJson
public static <T> T fromJson(String json, Class<T> clazz) { Objects.requireNonNull(json, Required.JSON.toString()); Objects.requireNonNull(clazz, Required.CLASS.toString()); T object = null; try { object = mapper.readValue(json, clazz); } catch (IOException e...
java
public static <T> T fromJson(String json, Class<T> clazz) { Objects.requireNonNull(json, Required.JSON.toString()); Objects.requireNonNull(clazz, Required.CLASS.toString()); T object = null; try { object = mapper.readValue(json, clazz); } catch (IOException e...
[ "public", "static", "<", "T", ">", "T", "fromJson", "(", "String", "json", ",", "Class", "<", "T", ">", "clazz", ")", "{", "Objects", ".", "requireNonNull", "(", "json", ",", "Required", ".", "JSON", ".", "toString", "(", ")", ")", ";", "Objects", ...
Converts a given Json string to given Class @param json The json string to convert @param clazz The Class to convert to @param <T> JavaDoc wants this, just ignore it @return The converted class or null if conversion fails
[ "Converts", "a", "given", "Json", "string", "to", "given", "Class" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/JsonUtils.java#L98-L110
100,227
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java
Validator.get
public String get(String key) { Objects.requireNonNull(key, Required.KEY.toString()); return this.values.get(key); }
java
public String get(String key) { Objects.requireNonNull(key, Required.KEY.toString()); return this.values.get(key); }
[ "public", "String", "get", "(", "String", "key", ")", "{", "Objects", ".", "requireNonNull", "(", "key", ",", "Required", ".", "KEY", ".", "toString", "(", ")", ")", ";", "return", "this", ".", "values", ".", "get", "(", "key", ")", ";", "}" ]
Retrieves a form value corresponding to the name of the form element @param key The name of the form element @return The value of the form or null if not present
[ "Retrieves", "a", "form", "value", "corresponding", "to", "the", "name", "of", "the", "form", "element" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L530-L534
100,228
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java
OutboundCookiesHandler.setSessionCookie
protected void setSessionCookie(HttpServerExchange exchange) { Session session = this.attachment.getSession(); if (session.isInvalid()) { Cookie cookie = new CookieImpl(this.config.getSessionCookieName()) .setSecure(this.config.isSessionCookieSecure()) ...
java
protected void setSessionCookie(HttpServerExchange exchange) { Session session = this.attachment.getSession(); if (session.isInvalid()) { Cookie cookie = new CookieImpl(this.config.getSessionCookieName()) .setSecure(this.config.isSessionCookieSecure()) ...
[ "protected", "void", "setSessionCookie", "(", "HttpServerExchange", "exchange", ")", "{", "Session", "session", "=", "this", ".", "attachment", ".", "getSession", "(", ")", ";", "if", "(", "session", ".", "isInvalid", "(", ")", ")", "{", "Cookie", "cookie", ...
Sets the session cookie to the current HttpServerExchange @param exchange The Undertow HttpServerExchange
[ "Sets", "the", "session", "cookie", "to", "the", "current", "HttpServerExchange" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java#L68-L118
100,229
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java
OutboundCookiesHandler.setAuthenticationCookie
protected void setAuthenticationCookie(HttpServerExchange exchange) { Authentication authentication = this.attachment.getAuthentication(); if (authentication.isInvalid() || authentication.isLogout()) { Cookie cookie = new CookieImpl(this.config.getAuthenticationCookieName()) ...
java
protected void setAuthenticationCookie(HttpServerExchange exchange) { Authentication authentication = this.attachment.getAuthentication(); if (authentication.isInvalid() || authentication.isLogout()) { Cookie cookie = new CookieImpl(this.config.getAuthenticationCookieName()) ...
[ "protected", "void", "setAuthenticationCookie", "(", "HttpServerExchange", "exchange", ")", "{", "Authentication", "authentication", "=", "this", ".", "attachment", ".", "getAuthentication", "(", ")", ";", "if", "(", "authentication", ".", "isInvalid", "(", ")", "...
Sets the authentication cookie to the current HttpServerExchange @param exchange The Undertow HttpServerExchange
[ "Sets", "the", "authentication", "cookie", "to", "the", "current", "HttpServerExchange" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java#L125-L179
100,230
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java
OutboundCookiesHandler.setFlashCookie
protected void setFlashCookie(HttpServerExchange exchange) { Flash flash = this.attachment.getFlash(); Form form = this.attachment.getForm(); if (flash.isDiscard() || flash.isInvalid()) { final Cookie cookie = new CookieImpl(this.config.getFlashCookieName()) ...
java
protected void setFlashCookie(HttpServerExchange exchange) { Flash flash = this.attachment.getFlash(); Form form = this.attachment.getForm(); if (flash.isDiscard() || flash.isInvalid()) { final Cookie cookie = new CookieImpl(this.config.getFlashCookieName()) ...
[ "protected", "void", "setFlashCookie", "(", "HttpServerExchange", "exchange", ")", "{", "Flash", "flash", "=", "this", ".", "attachment", ".", "getFlash", "(", ")", ";", "Form", "form", "=", "this", ".", "attachment", ".", "getForm", "(", ")", ";", "if", ...
Sets the flash cookie to current HttpServerExchange @param exchange The Undertow HttpServerExchange @throws MangooCookieException
[ "Sets", "the", "flash", "cookie", "to", "current", "HttpServerExchange" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/OutboundCookiesHandler.java#L187-L236
100,231
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java
ResponseHandler.handleBinaryResponse
protected void handleBinaryResponse(HttpServerExchange exchange, Response response) { exchange.dispatch(exchange.getDispatchExecutor(), Application.getInstance(BinaryHandler.class).withResponse(response)); }
java
protected void handleBinaryResponse(HttpServerExchange exchange, Response response) { exchange.dispatch(exchange.getDispatchExecutor(), Application.getInstance(BinaryHandler.class).withResponse(response)); }
[ "protected", "void", "handleBinaryResponse", "(", "HttpServerExchange", "exchange", ",", "Response", "response", ")", "{", "exchange", ".", "dispatch", "(", "exchange", ".", "getDispatchExecutor", "(", ")", ",", "Application", ".", "getInstance", "(", "BinaryHandler...
Handles a binary response to the client by sending the binary content from the response to the undertow output stream @param exchange The Undertow HttpServerExchange @param response The response object @throws IOException
[ "Handles", "a", "binary", "response", "to", "the", "client", "by", "sending", "the", "binary", "content", "from", "the", "response", "to", "the", "undertow", "output", "stream" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java#L53-L55
100,232
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java
ResponseHandler.handleRedirectResponse
protected void handleRedirectResponse(HttpServerExchange exchange, Response response) { exchange.setStatusCode(StatusCodes.FOUND); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(entry -> ...
java
protected void handleRedirectResponse(HttpServerExchange exchange, Response response) { exchange.setStatusCode(StatusCodes.FOUND); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(entry -> ...
[ "protected", "void", "handleRedirectResponse", "(", "HttpServerExchange", "exchange", ",", "Response", "response", ")", "{", "exchange", ".", "setStatusCode", "(", "StatusCodes", ".", "FOUND", ")", ";", "Server", ".", "headers", "(", ")", ".", "entrySet", "(", ...
Handles a redirect response to the client by sending a 403 status code to the client @param exchange The Undertow HttpServerExchange @param response The response object
[ "Handles", "a", "redirect", "response", "to", "the", "client", "by", "sending", "a", "403", "status", "code", "to", "the", "client" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java#L63-L75
100,233
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java
ResponseHandler.handleRenderedResponse
protected void handleRenderedResponse(HttpServerExchange exchange, Response response) { exchange.setStatusCode(response.getStatusCode()); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(en...
java
protected void handleRenderedResponse(HttpServerExchange exchange, Response response) { exchange.setStatusCode(response.getStatusCode()); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(en...
[ "protected", "void", "handleRenderedResponse", "(", "HttpServerExchange", "exchange", ",", "Response", "response", ")", "{", "exchange", ".", "setStatusCode", "(", "response", ".", "getStatusCode", "(", ")", ")", ";", "Server", ".", "headers", "(", ")", ".", "...
Handles a rendered response to the client by sending the rendered body from the response object @param exchange The Undertow HttpServerExchange @param response The response object
[ "Handles", "a", "rendered", "response", "to", "the", "client", "by", "sending", "the", "rendered", "body", "from", "the", "response", "object" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java#L83-L95
100,234
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/core/Application.java
Application.prepareMode
private static void prepareMode(Mode providedMode) { final String applicationMode = System.getProperty(Key.APPLICATION_MODE.toString()); if (StringUtils.isNotBlank(applicationMode)) { switch (applicationMode.toLowerCase(Locale.ENGLISH)) { case "dev" : mode = Mode.DEV; ...
java
private static void prepareMode(Mode providedMode) { final String applicationMode = System.getProperty(Key.APPLICATION_MODE.toString()); if (StringUtils.isNotBlank(applicationMode)) { switch (applicationMode.toLowerCase(Locale.ENGLISH)) { case "dev" : mode = Mode.DEV; ...
[ "private", "static", "void", "prepareMode", "(", "Mode", "providedMode", ")", "{", "final", "String", "applicationMode", "=", "System", ".", "getProperty", "(", "Key", ".", "APPLICATION_MODE", ".", "toString", "(", ")", ")", ";", "if", "(", "StringUtils", "....
Sets the mode the application is running in @param providedMode A given mode or null
[ "Sets", "the", "mode", "the", "application", "is", "running", "in" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Application.java#L229-L243
100,235
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/core/Application.java
Application.prepareConfig
private static void prepareConfig() { Config config = getInstance(Config.class); int bitLength = getBitLength(config.getApplicationSecret()); if (bitLength < KEY_MIN_BIT_LENGTH) { LOG.error("Application requires a 512 bit application secret. The current property for applicat...
java
private static void prepareConfig() { Config config = getInstance(Config.class); int bitLength = getBitLength(config.getApplicationSecret()); if (bitLength < KEY_MIN_BIT_LENGTH) { LOG.error("Application requires a 512 bit application secret. The current property for applicat...
[ "private", "static", "void", "prepareConfig", "(", ")", "{", "Config", "config", "=", "getInstance", "(", "Config", ".", "class", ")", ";", "int", "bitLength", "=", "getBitLength", "(", "config", ".", "getApplicationSecret", "(", ")", ")", ";", "if", "(", ...
Checks for config failures that prevent the application from starting
[ "Checks", "for", "config", "failures", "that", "prevent", "the", "application", "from", "starting" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Application.java#L262-L311
100,236
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/core/Application.java
Application.prepareRoutes
private static void prepareRoutes() { injector.getInstance(MangooBootstrap.class).initializeRoutes(); Router.getRequestRoutes().forEach((RequestRoute requestRoute) -> { if (!methodExists(requestRoute.getControllerMethod(), requestRoute.getControllerClass())) { LOG.er...
java
private static void prepareRoutes() { injector.getInstance(MangooBootstrap.class).initializeRoutes(); Router.getRequestRoutes().forEach((RequestRoute requestRoute) -> { if (!methodExists(requestRoute.getControllerMethod(), requestRoute.getControllerClass())) { LOG.er...
[ "private", "static", "void", "prepareRoutes", "(", ")", "{", "injector", ".", "getInstance", "(", "MangooBootstrap", ".", "class", ")", ".", "initializeRoutes", "(", ")", ";", "Router", ".", "getRequestRoutes", "(", ")", ".", "forEach", "(", "(", "RequestRou...
Validate if the routes that are defined in the router are valid
[ "Validate", "if", "the", "routes", "that", "are", "defined", "in", "the", "router", "are", "valid" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Application.java#L392-L406
100,237
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/core/Application.java
Application.createRoutes
private static void createRoutes() { pathHandler = new PathHandler(getRoutingHandler()); Router.getWebSocketRoutes().forEach((WebSocketRoute webSocketRoute) -> pathHandler.addExactPath(webSocketRoute.getUrl(), Handlers.websocket(getInstance(WebSocketHandler.clas...
java
private static void createRoutes() { pathHandler = new PathHandler(getRoutingHandler()); Router.getWebSocketRoutes().forEach((WebSocketRoute webSocketRoute) -> pathHandler.addExactPath(webSocketRoute.getUrl(), Handlers.websocket(getInstance(WebSocketHandler.clas...
[ "private", "static", "void", "createRoutes", "(", ")", "{", "pathHandler", "=", "new", "PathHandler", "(", "getRoutingHandler", "(", ")", ")", ";", "Router", ".", "getWebSocketRoutes", "(", ")", ".", "forEach", "(", "(", "WebSocketRoute", "webSocketRoute", ")"...
Create routes for WebSockets ServerSentEvent and Resource files
[ "Create", "routes", "for", "WebSockets", "ServerSentEvent", "and", "Resource", "files" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Application.java#L425-L450
100,238
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/core/Application.java
Application.getLogo
public static String getLogo() { String logo = ""; try (InputStream inputStream = Resources.getResource(Default.LOGO_FILE.toString()).openStream()) { logo = IOUtils.toString(inputStream, Default.ENCODING.toString()); } catch (final IOException e) { LOG.error("Failed to ge...
java
public static String getLogo() { String logo = ""; try (InputStream inputStream = Resources.getResource(Default.LOGO_FILE.toString()).openStream()) { logo = IOUtils.toString(inputStream, Default.ENCODING.toString()); } catch (final IOException e) { LOG.error("Failed to ge...
[ "public", "static", "String", "getLogo", "(", ")", "{", "String", "logo", "=", "\"\"", ";", "try", "(", "InputStream", "inputStream", "=", "Resources", ".", "getResource", "(", "Default", ".", "LOGO_FILE", ".", "toString", "(", ")", ")", ".", "openStream",...
Retrieves the logo from the logo file and returns the string @return The mangoo I/O logo string
[ "Retrieves", "the", "logo", "from", "the", "logo", "file", "and", "returns", "the", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Application.java#L570-L579
100,239
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java
Authentication.validLogin
public boolean validLogin(String identifier, String password, String hash) { Objects.requireNonNull(identifier, Required.USERNAME.toString()); Objects.requireNonNull(password, Required.PASSWORD.toString()); Objects.requireNonNull(hash, Required.HASH.toString()); Cache cache = Applicatio...
java
public boolean validLogin(String identifier, String password, String hash) { Objects.requireNonNull(identifier, Required.USERNAME.toString()); Objects.requireNonNull(password, Required.PASSWORD.toString()); Objects.requireNonNull(hash, Required.HASH.toString()); Cache cache = Applicatio...
[ "public", "boolean", "validLogin", "(", "String", "identifier", ",", "String", "password", ",", "String", "hash", ")", "{", "Objects", ".", "requireNonNull", "(", "identifier", ",", "Required", ".", "USERNAME", ".", "toString", "(", ")", ")", ";", "Objects",...
Creates a hashed value of a given clear text password and checks if the value matches a given, already hashed password @param identifier The identifier to authenticate @param password The clear text password @param hash The previously hashed password to check @return True if the new hashed password matches the hash, f...
[ "Creates", "a", "hashed", "value", "of", "a", "given", "clear", "text", "password", "and", "checks", "if", "the", "value", "matches", "a", "given", "already", "hashed", "password" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java#L109-L123
100,240
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java
Authentication.userHasLock
public boolean userHasLock(String username) { Objects.requireNonNull(username, Required.USERNAME.toString()); boolean lock = false; Config config = Application.getInstance(Config.class); Cache cache = Application.getInstance(CacheProvider.class).getCache(CacheName.AUTH); ...
java
public boolean userHasLock(String username) { Objects.requireNonNull(username, Required.USERNAME.toString()); boolean lock = false; Config config = Application.getInstance(Config.class); Cache cache = Application.getInstance(CacheProvider.class).getCache(CacheName.AUTH); ...
[ "public", "boolean", "userHasLock", "(", "String", "username", ")", "{", "Objects", ".", "requireNonNull", "(", "username", ",", "Required", ".", "USERNAME", ".", "toString", "(", ")", ")", ";", "boolean", "lock", "=", "false", ";", "Config", "config", "="...
Checks if a username is locked because of to many failed login attempts @param username The username to check @return true if the user has a lock, false otherwise
[ "Checks", "if", "a", "username", "is", "locked", "because", "of", "to", "many", "failed", "login", "attempts" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java#L174-L186
100,241
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java
Authentication.validSecondFactor
public boolean validSecondFactor(String secret, String number) { Objects.requireNonNull(secret, Required.SECRET.toString()); Objects.requireNonNull(number, Required.TOTP.toString()); return TotpUtils.verifiedTotp(secret, number); }
java
public boolean validSecondFactor(String secret, String number) { Objects.requireNonNull(secret, Required.SECRET.toString()); Objects.requireNonNull(number, Required.TOTP.toString()); return TotpUtils.verifiedTotp(secret, number); }
[ "public", "boolean", "validSecondFactor", "(", "String", "secret", ",", "String", "number", ")", "{", "Objects", ".", "requireNonNull", "(", "secret", ",", "Required", ".", "SECRET", ".", "toString", "(", ")", ")", ";", "Objects", ".", "requireNonNull", "(",...
Checks if a given number for 2FA is valid for the given secret @param secret The plaintext secret to use for checking @param number The number entered by the user @return True if number is valid, false otherwise
[ "Checks", "if", "a", "given", "number", "for", "2FA", "is", "valid", "for", "the", "given", "secret" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Authentication.java#L195-L200
100,242
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/routes/ControllerRoute.java
ControllerRoute.withRoutes
public void withRoutes(MangooRoute... routes) { Objects.requireNonNull(routes, Required.ROUTE.toString()); for (MangooRoute route : routes) { RequestRoute requestRoute = (RequestRoute) route; requestRoute.withControllerClass(this.controllerClass); if (hasBas...
java
public void withRoutes(MangooRoute... routes) { Objects.requireNonNull(routes, Required.ROUTE.toString()); for (MangooRoute route : routes) { RequestRoute requestRoute = (RequestRoute) route; requestRoute.withControllerClass(this.controllerClass); if (hasBas...
[ "public", "void", "withRoutes", "(", "MangooRoute", "...", "routes", ")", "{", "Objects", ".", "requireNonNull", "(", "routes", ",", "Required", ".", "ROUTE", ".", "toString", "(", ")", ")", ";", "for", "(", "MangooRoute", "route", ":", "routes", ")", "{...
Sets the given routes to the defined controller class @param routes The routes to be configured for the controller
[ "Sets", "the", "given", "routes", "to", "the", "defined", "controller", "class" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/routes/ControllerRoute.java#L43-L79
100,243
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java
ByteUtils.bitLength
public static int bitLength (byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); int byteLength = bytes.length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYTES; } return...
java
public static int bitLength (byte[] bytes) { Objects.requireNonNull(bytes, Required.BYTES.toString()); int byteLength = bytes.length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYTES; } return...
[ "public", "static", "int", "bitLength", "(", "byte", "[", "]", "bytes", ")", "{", "Objects", ".", "requireNonNull", "(", "bytes", ",", "Required", ".", "BYTES", ".", "toString", "(", ")", ")", ";", "int", "byteLength", "=", "bytes", ".", "length", ";",...
Calculates the bit length of a given byte array @param bytes The byte array @return The number of bit
[ "Calculates", "the", "bit", "length", "of", "a", "given", "byte", "array" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java#L26-L36
100,244
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java
ByteUtils.bitLength
public static int bitLength (String string) { Objects.requireNonNull(string, Required.STRING.toString()); int byteLength = string.getBytes(StandardCharsets.UTF_8).length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYT...
java
public static int bitLength (String string) { Objects.requireNonNull(string, Required.STRING.toString()); int byteLength = string.getBytes(StandardCharsets.UTF_8).length; int length = 0; if (byteLength <= MAX_BYTE_LENGTH && byteLength > 0) { length = byteLength * BYT...
[ "public", "static", "int", "bitLength", "(", "String", "string", ")", "{", "Objects", ".", "requireNonNull", "(", "string", ",", "Required", ".", "STRING", ".", "toString", "(", ")", ")", ";", "int", "byteLength", "=", "string", ".", "getBytes", "(", "St...
Calculates the bit length of a given string @param string The string @return The number of bit
[ "Calculates", "the", "bit", "length", "of", "a", "given", "string" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/ByteUtils.java#L44-L54
100,245
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthorizationHandler.java
AuthorizationHandler.isNotBlank
private boolean isNotBlank(String subject, String resource, String operation) { return StringUtils.isNotBlank(subject) && StringUtils.isNotBlank(resource) && StringUtils.isNotBlank(operation); }
java
private boolean isNotBlank(String subject, String resource, String operation) { return StringUtils.isNotBlank(subject) && StringUtils.isNotBlank(resource) && StringUtils.isNotBlank(operation); }
[ "private", "boolean", "isNotBlank", "(", "String", "subject", ",", "String", "resource", ",", "String", "operation", ")", "{", "return", "StringUtils", ".", "isNotBlank", "(", "subject", ")", "&&", "StringUtils", ".", "isNotBlank", "(", "resource", ")", "&&", ...
Checks if any of the given strings is blank @param subject The subject to validate @param resource The resource to validate @param operation The operation to validate @return True if all strings are not blank, false otherwise
[ "Checks", "if", "any", "of", "the", "given", "strings", "is", "blank" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthorizationHandler.java#L67-L69
100,246
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthorizationHandler.java
AuthorizationHandler.endRequest
private void endRequest(HttpServerExchange exchange) { exchange.setStatusCode(StatusCodes.UNAUTHORIZED); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(entry -> exchange.getResponseHeader...
java
private void endRequest(HttpServerExchange exchange) { exchange.setStatusCode(StatusCodes.UNAUTHORIZED); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(entry -> exchange.getResponseHeader...
[ "private", "void", "endRequest", "(", "HttpServerExchange", "exchange", ")", "{", "exchange", ".", "setStatusCode", "(", "StatusCodes", ".", "UNAUTHORIZED", ")", ";", "Server", ".", "headers", "(", ")", ".", "entrySet", "(", ")", ".", "stream", "(", ")", "...
Ends the current request by sending a HTTP 401 status code and the default unauthorized template @param exchange The HttpServerExchange
[ "Ends", "the", "current", "request", "by", "sending", "a", "HTTP", "401", "status", "code", "and", "the", "default", "unauthorized", "template" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthorizationHandler.java#L75-L85
100,247
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.register
public <T> ServiceGraphModule register(Class<? extends T> type, ServiceAdapter<T> factory) { registeredServiceAdapters.put(type, factory); return this; }
java
public <T> ServiceGraphModule register(Class<? extends T> type, ServiceAdapter<T> factory) { registeredServiceAdapters.put(type, factory); return this; }
[ "public", "<", "T", ">", "ServiceGraphModule", "register", "(", "Class", "<", "?", "extends", "T", ">", "type", ",", "ServiceAdapter", "<", "T", ">", "factory", ")", "{", "registeredServiceAdapters", ".", "put", "(", "type", ",", "factory", ")", ";", "re...
Puts an instance of class and its factory to the factoryMap @param <T> type of service @param type key with which the specified factory is to be associated @param factory value to be associated with the specified type @return ServiceGraphModule with change
[ "Puts", "an", "instance", "of", "class", "and", "its", "factory", "to", "the", "factoryMap" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L143-L146
100,248
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.registerForSpecificKey
public <T> ServiceGraphModule registerForSpecificKey(Key<T> key, ServiceAdapter<T> factory) { keys.put(key, factory); return this; }
java
public <T> ServiceGraphModule registerForSpecificKey(Key<T> key, ServiceAdapter<T> factory) { keys.put(key, factory); return this; }
[ "public", "<", "T", ">", "ServiceGraphModule", "registerForSpecificKey", "(", "Key", "<", "T", ">", "key", ",", "ServiceAdapter", "<", "T", ">", "factory", ")", "{", "keys", ".", "put", "(", "key", ",", "factory", ")", ";", "return", "this", ";", "}" ]
Puts the key and its factory to the keys @param key key with which the specified factory is to be associated @param factory value to be associated with the specified key @param <T> type of service @return ServiceGraphModule with change
[ "Puts", "the", "key", "and", "its", "factory", "to", "the", "keys" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L156-L159
100,249
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.addDependency
public ServiceGraphModule addDependency(Key<?> key, Key<?> keyDependency) { addedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
java
public ServiceGraphModule addDependency(Key<?> key, Key<?> keyDependency) { addedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
[ "public", "ServiceGraphModule", "addDependency", "(", "Key", "<", "?", ">", "key", ",", "Key", "<", "?", ">", "keyDependency", ")", "{", "addedDependencies", ".", "computeIfAbsent", "(", "key", ",", "key1", "->", "new", "HashSet", "<>", "(", ")", ")", "....
Adds the dependency for key @param key key for adding dependency @param keyDependency key of dependency @return ServiceGraphModule with change
[ "Adds", "the", "dependency", "for", "key" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L173-L176
100,250
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceGraphModule.java
ServiceGraphModule.removeDependency
public ServiceGraphModule removeDependency(Key<?> key, Key<?> keyDependency) { removedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
java
public ServiceGraphModule removeDependency(Key<?> key, Key<?> keyDependency) { removedDependencies.computeIfAbsent(key, key1 -> new HashSet<>()).add(keyDependency); return this; }
[ "public", "ServiceGraphModule", "removeDependency", "(", "Key", "<", "?", ">", "key", ",", "Key", "<", "?", ">", "keyDependency", ")", "{", "removedDependencies", ".", "computeIfAbsent", "(", "key", ",", "key1", "->", "new", "HashSet", "<>", "(", ")", ")",...
Removes the dependency @param key key for removing dependency @param keyDependency key of dependency @return ServiceGraphModule with change
[ "Removes", "the", "dependency" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L185-L188
100,251
softindex/datakernel
core-csp/src/main/java/io/datakernel/csp/process/ChannelLZ4Compressor.java
ChannelLZ4Compressor.getInput
@Override public ChannelInput<ByteBuf> getInput() { return input -> { this.input = sanitize(input); //noinspection ConstantConditions if (this.input != null && this.output != null) startProcess(); return getProcessCompletion(); }; }
java
@Override public ChannelInput<ByteBuf> getInput() { return input -> { this.input = sanitize(input); //noinspection ConstantConditions if (this.input != null && this.output != null) startProcess(); return getProcessCompletion(); }; }
[ "@", "Override", "public", "ChannelInput", "<", "ByteBuf", ">", "getInput", "(", ")", "{", "return", "input", "->", "{", "this", ".", "input", "=", "sanitize", "(", "input", ")", ";", "//noinspection ConstantConditions", "if", "(", "this", ".", "input", "!...
check input for clarity
[ "check", "input", "for", "clarity" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-csp/src/main/java/io/datakernel/csp/process/ChannelLZ4Compressor.java#L123-L131
100,252
softindex/datakernel
boot/src/main/java/io/datakernel/worker/WorkerPools.java
WorkerPools.getCurrentInstance
public <T> T getCurrentInstance(Class<T> type) { return getCurrentInstance(Key.get(type)); }
java
public <T> T getCurrentInstance(Class<T> type) { return getCurrentInstance(Key.get(type)); }
[ "public", "<", "T", ">", "T", "getCurrentInstance", "(", "Class", "<", "T", ">", "type", ")", "{", "return", "getCurrentInstance", "(", "Key", ".", "get", "(", "type", ")", ")", ";", "}" ]
region getCurrentInstance overloads
[ "region", "getCurrentInstance", "overloads" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/worker/WorkerPools.java#L73-L75
100,253
softindex/datakernel
boot/src/main/java/io/datakernel/worker/WorkerPools.java
WorkerPools.getCurrentInstanceProvider
public <T> Provider<T> getCurrentInstanceProvider(Class<T> type) { return getCurrentInstanceProvider(Key.get(type)); }
java
public <T> Provider<T> getCurrentInstanceProvider(Class<T> type) { return getCurrentInstanceProvider(Key.get(type)); }
[ "public", "<", "T", ">", "Provider", "<", "T", ">", "getCurrentInstanceProvider", "(", "Class", "<", "T", ">", "type", ")", "{", "return", "getCurrentInstanceProvider", "(", "Key", ".", "get", "(", "type", ")", ")", ";", "}" ]
region getCurrentInstanceProvider overloads
[ "region", "getCurrentInstanceProvider", "overloads" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/worker/WorkerPools.java#L91-L93
100,254
softindex/datakernel
boot/src/main/java/io/datakernel/worker/WorkerPools.java
WorkerPools.getInstances
public <T> List<T> getInstances(Class<T> type) { return getInstances(Key.get(type)); }
java
public <T> List<T> getInstances(Class<T> type) { return getInstances(Key.get(type)); }
[ "public", "<", "T", ">", "List", "<", "T", ">", "getInstances", "(", "Class", "<", "T", ">", "type", ")", "{", "return", "getInstances", "(", "Key", ".", "get", "(", "type", ")", ")", ";", "}" ]
region getInstances overloads
[ "region", "getInstances", "overloads" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/worker/WorkerPools.java#L105-L107
100,255
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.open
public static AsyncFile open(Executor executor, Path path, Set<OpenOption> openOptions) throws IOException { FileChannel channel = doOpenChannel(path, openOptions); return new AsyncFile(executor, channel, path, null); }
java
public static AsyncFile open(Executor executor, Path path, Set<OpenOption> openOptions) throws IOException { FileChannel channel = doOpenChannel(path, openOptions); return new AsyncFile(executor, channel, path, null); }
[ "public", "static", "AsyncFile", "open", "(", "Executor", "executor", ",", "Path", "path", ",", "Set", "<", "OpenOption", ">", "openOptions", ")", "throws", "IOException", "{", "FileChannel", "channel", "=", "doOpenChannel", "(", "path", ",", "openOptions", ")...
Opens file synchronously. @param executor executor for running tasks in other thread @param path the path of the file to open or create @param openOptions options specifying how the file is opened
[ "Opens", "file", "synchronously", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L69-L72
100,256
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.delete
public static Promise<Void> delete(Executor executor, Path path) { return ofBlockingRunnable(executor, () -> { try { Files.delete(path); } catch (IOException e) { throw new UncheckedException(e); } }); }
java
public static Promise<Void> delete(Executor executor, Path path) { return ofBlockingRunnable(executor, () -> { try { Files.delete(path); } catch (IOException e) { throw new UncheckedException(e); } }); }
[ "public", "static", "Promise", "<", "Void", ">", "delete", "(", "Executor", "executor", ",", "Path", "path", ")", "{", "return", "ofBlockingRunnable", "(", "executor", ",", "(", ")", "->", "{", "try", "{", "Files", ".", "delete", "(", "path", ")", ";",...
Deletes the file concurrently. @param path the path of the file to open or create
[ "Deletes", "the", "file", "concurrently", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L105-L113
100,257
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.move
public static Promise<Void> move(Executor executor, Path source, Path target, CopyOption... options) { return ofBlockingRunnable(executor, () -> { try { Files.move(source, target, options); } catch (IOException e) { throw new UncheckedException(e); } }); }
java
public static Promise<Void> move(Executor executor, Path source, Path target, CopyOption... options) { return ofBlockingRunnable(executor, () -> { try { Files.move(source, target, options); } catch (IOException e) { throw new UncheckedException(e); } }); }
[ "public", "static", "Promise", "<", "Void", ">", "move", "(", "Executor", "executor", ",", "Path", "source", ",", "Path", "target", ",", "CopyOption", "...", "options", ")", "{", "return", "ofBlockingRunnable", "(", "executor", ",", "(", ")", "->", "{", ...
Moves or renames a file to a target file. @param executor executor for running tasks in another thread @param source the path to the file to move @param target the path to the target file (may be associated with a different provider to the source path) @param options options specifying how the move should be done
[ "Moves", "or", "renames", "a", "file", "to", "a", "target", "file", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L134-L142
100,258
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.createDirectories
public static Promise<Void> createDirectories(Executor executor, Path dir, FileAttribute... attrs) { return ofBlockingRunnable(executor, () -> { try { Files.createDirectories(dir, attrs); } catch (IOException e) { throw new UncheckedException(e); } }); }
java
public static Promise<Void> createDirectories(Executor executor, Path dir, FileAttribute... attrs) { return ofBlockingRunnable(executor, () -> { try { Files.createDirectories(dir, attrs); } catch (IOException e) { throw new UncheckedException(e); } }); }
[ "public", "static", "Promise", "<", "Void", ">", "createDirectories", "(", "Executor", "executor", ",", "Path", "dir", ",", "FileAttribute", "...", "attrs", ")", "{", "return", "ofBlockingRunnable", "(", "executor", ",", "(", ")", "->", "{", "try", "{", "F...
Creates a directory by creating all nonexistent parent directories first. @param executor executor for running tasks in other thread @param dir the directory to create @param attrs an optional list of file attributes to set atomically when creating the directory
[ "Creates", "a", "directory", "by", "creating", "all", "nonexistent", "parent", "directories", "first", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L186-L194
100,259
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.write
public Promise<Void> write(ByteBuf buf) { return sanitize(ofBlockingRunnable(executor, () -> { synchronized (mutexLock) { try { int writtenBytes; do { ByteBuffer byteBuffer = buf.toReadByteBuffer(); writtenBytes = channel.write(byteBuffer); buf.ofReadByteBuffer(byteBuffer); } w...
java
public Promise<Void> write(ByteBuf buf) { return sanitize(ofBlockingRunnable(executor, () -> { synchronized (mutexLock) { try { int writtenBytes; do { ByteBuffer byteBuffer = buf.toReadByteBuffer(); writtenBytes = channel.write(byteBuffer); buf.ofReadByteBuffer(byteBuffer); } w...
[ "public", "Promise", "<", "Void", ">", "write", "(", "ByteBuf", "buf", ")", "{", "return", "sanitize", "(", "ofBlockingRunnable", "(", "executor", ",", "(", ")", "->", "{", "synchronized", "(", "mutexLock", ")", "{", "try", "{", "int", "writtenBytes", ";...
Writes all bytes of the buffer into this file at its internal position asynchronously. @param buf byte buffer to be written
[ "Writes", "all", "bytes", "of", "the", "buffer", "into", "this", "file", "at", "its", "internal", "position", "asynchronously", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L260-L277
100,260
softindex/datakernel
core-promise/src/main/java/io/datakernel/file/AsyncFile.java
AsyncFile.forceAndClose
public Promise<Void> forceAndClose(boolean forceMetadata) { if (!isOpen()) return Promise.ofException(FILE_CLOSED); return ofBlockingRunnable(executor, () -> { try { channel.force(forceMetadata); channel.close(); } catch (IOException e) { throw new UncheckedException(e); } }); }
java
public Promise<Void> forceAndClose(boolean forceMetadata) { if (!isOpen()) return Promise.ofException(FILE_CLOSED); return ofBlockingRunnable(executor, () -> { try { channel.force(forceMetadata); channel.close(); } catch (IOException e) { throw new UncheckedException(e); } }); }
[ "public", "Promise", "<", "Void", ">", "forceAndClose", "(", "boolean", "forceMetadata", ")", "{", "if", "(", "!", "isOpen", "(", ")", ")", "return", "Promise", ".", "ofException", "(", "FILE_CLOSED", ")", ";", "return", "ofBlockingRunnable", "(", "executor"...
Forces physical write and then closes the channel if the file is opened. @param forceMetadata whether or not to force metadata writes too
[ "Forces", "physical", "write", "and", "then", "closes", "the", "channel", "if", "the", "file", "is", "opened", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-promise/src/main/java/io/datakernel/file/AsyncFile.java#L367-L377
100,261
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java
StreamSorterStorageImpl.create
public static <T> StreamSorterStorageImpl<T> create(Executor executor, BinarySerializer<T> serializer, Path path) { checkArgument(!path.getFileName().toString().contains("%d"), "Filename should not contain '%d'"); try { Files.createDirectories(path); } catch (IOException e) { throw new UncheckedIOExcepti...
java
public static <T> StreamSorterStorageImpl<T> create(Executor executor, BinarySerializer<T> serializer, Path path) { checkArgument(!path.getFileName().toString().contains("%d"), "Filename should not contain '%d'"); try { Files.createDirectories(path); } catch (IOException e) { throw new UncheckedIOExcepti...
[ "public", "static", "<", "T", ">", "StreamSorterStorageImpl", "<", "T", ">", "create", "(", "Executor", "executor", ",", "BinarySerializer", "<", "T", ">", "serializer", ",", "Path", "path", ")", "{", "checkArgument", "(", "!", "path", ".", "getFileName", ...
Creates a new storage @param executor executor for running tasks in new thread @param serializer for serialization to bytes @param path path in which will store received data
[ "Creates", "a", "new", "storage" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java#L83-L92
100,262
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java
StreamSorterStorageImpl.read
@Override public Promise<StreamSupplier<T>> read(int partition) { Path path = partitionPath(partition); return AsyncFile.openAsync(executor, path, set(READ)) .map(file -> ChannelFileReader.readFile(file).withBufferSize(readBlockSize) .transformWith(ChannelLZ4Decompressor.create()) .transformWith(Ch...
java
@Override public Promise<StreamSupplier<T>> read(int partition) { Path path = partitionPath(partition); return AsyncFile.openAsync(executor, path, set(READ)) .map(file -> ChannelFileReader.readFile(file).withBufferSize(readBlockSize) .transformWith(ChannelLZ4Decompressor.create()) .transformWith(Ch...
[ "@", "Override", "public", "Promise", "<", "StreamSupplier", "<", "T", ">", ">", "read", "(", "int", "partition", ")", "{", "Path", "path", "=", "partitionPath", "(", "partition", ")", ";", "return", "AsyncFile", ".", "openAsync", "(", "executor", ",", "...
Returns supplier for reading data from this storage. It read it from external memory, decompresses and deserializes it @param partition index of partition to read
[ "Returns", "supplier", "for", "reading", "data", "from", "this", "storage", ".", "It", "read", "it", "from", "external", "memory", "decompresses", "and", "deserializes", "it" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java#L146-L154
100,263
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java
StreamSorterStorageImpl.cleanup
@Override public Promise<Void> cleanup(List<Integer> partitionsToDelete) { return Promise.ofBlockingCallable(executor, () -> { for (Integer partitionToDelete : partitionsToDelete) { Path path1 = partitionPath(partitionToDelete); try { Files.delete(path1); } catch (IOException e) { logger.war...
java
@Override public Promise<Void> cleanup(List<Integer> partitionsToDelete) { return Promise.ofBlockingCallable(executor, () -> { for (Integer partitionToDelete : partitionsToDelete) { Path path1 = partitionPath(partitionToDelete); try { Files.delete(path1); } catch (IOException e) { logger.war...
[ "@", "Override", "public", "Promise", "<", "Void", ">", "cleanup", "(", "List", "<", "Integer", ">", "partitionsToDelete", ")", "{", "return", "Promise", ".", "ofBlockingCallable", "(", "executor", ",", "(", ")", "->", "{", "for", "(", "Integer", "partitio...
Method which removes all creating files
[ "Method", "which", "removes", "all", "creating", "files" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamSorterStorageImpl.java#L159-L172
100,264
softindex/datakernel
core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java
ValueStats.resetStats
@Override public void resetStats() { smoothedSum = 0.0; smoothedSqr = 0.0; smoothedCount = 0.0; smoothedMin = 0.0; smoothedMax = 0.0; lastMaxInteger = Integer.MIN_VALUE; lastMinInteger = Integer.MAX_VALUE; lastSumInteger = 0; lastSqrInteger = 0; lastCountInteger = 0; lastValueInteger = 0; las...
java
@Override public void resetStats() { smoothedSum = 0.0; smoothedSqr = 0.0; smoothedCount = 0.0; smoothedMin = 0.0; smoothedMax = 0.0; lastMaxInteger = Integer.MIN_VALUE; lastMinInteger = Integer.MAX_VALUE; lastSumInteger = 0; lastSqrInteger = 0; lastCountInteger = 0; lastValueInteger = 0; las...
[ "@", "Override", "public", "void", "resetStats", "(", ")", "{", "smoothedSum", "=", "0.0", ";", "smoothedSqr", "=", "0.0", ";", "smoothedCount", "=", "0.0", ";", "smoothedMin", "=", "0.0", ";", "smoothedMax", "=", "0.0", ";", "lastMaxInteger", "=", "Intege...
Resets stats and sets new parameters
[ "Resets", "stats", "and", "sets", "new", "parameters" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java#L232-L266
100,265
softindex/datakernel
core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java
ValueStats.getSmoothedStandardDeviation
@JmxAttribute(optional = true) public double getSmoothedStandardDeviation() { if (totalCount == 0) { return 0.0; } double avg = smoothedSum / smoothedCount; double variance = smoothedSqr / smoothedCount - avg * avg; if (variance < 0.0) variance = 0.0; return sqrt(variance); }
java
@JmxAttribute(optional = true) public double getSmoothedStandardDeviation() { if (totalCount == 0) { return 0.0; } double avg = smoothedSum / smoothedCount; double variance = smoothedSqr / smoothedCount - avg * avg; if (variance < 0.0) variance = 0.0; return sqrt(variance); }
[ "@", "JmxAttribute", "(", "optional", "=", "true", ")", "public", "double", "getSmoothedStandardDeviation", "(", ")", "{", "if", "(", "totalCount", "==", "0", ")", "{", "return", "0.0", ";", "}", "double", "avg", "=", "smoothedSum", "/", "smoothedCount", "...
Returns smoothed standard deviation @return smoothed standard deviation
[ "Returns", "smoothed", "standard", "deviation" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java#L544-L555
100,266
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceAdapters.java
ServiceAdapters.forBlockingService
public static ServiceAdapter<BlockingService> forBlockingService() { return new SimpleServiceAdapter<BlockingService>() { @Override protected void start(BlockingService instance) throws Exception { instance.start(); } @Override protected void stop(BlockingService instance) throws Exception { i...
java
public static ServiceAdapter<BlockingService> forBlockingService() { return new SimpleServiceAdapter<BlockingService>() { @Override protected void start(BlockingService instance) throws Exception { instance.start(); } @Override protected void stop(BlockingService instance) throws Exception { i...
[ "public", "static", "ServiceAdapter", "<", "BlockingService", ">", "forBlockingService", "(", ")", "{", "return", "new", "SimpleServiceAdapter", "<", "BlockingService", ">", "(", ")", "{", "@", "Override", "protected", "void", "start", "(", "BlockingService", "ins...
Returns factory which transforms blocking Service to asynchronous non-blocking ConcurrentService. It runs blocking operations from other thread from executor.
[ "Returns", "factory", "which", "transforms", "blocking", "Service", "to", "asynchronous", "non", "-", "blocking", "ConcurrentService", ".", "It", "runs", "blocking", "operations", "from", "other", "thread", "from", "executor", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceAdapters.java#L204-L216
100,267
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceAdapters.java
ServiceAdapters.forTimer
public static ServiceAdapter<Timer> forTimer() { return new SimpleServiceAdapter<Timer>(false, false) { @Override protected void start(Timer instance) { } @Override protected void stop(Timer instance) { instance.cancel(); } }; }
java
public static ServiceAdapter<Timer> forTimer() { return new SimpleServiceAdapter<Timer>(false, false) { @Override protected void start(Timer instance) { } @Override protected void stop(Timer instance) { instance.cancel(); } }; }
[ "public", "static", "ServiceAdapter", "<", "Timer", ">", "forTimer", "(", ")", "{", "return", "new", "SimpleServiceAdapter", "<", "Timer", ">", "(", "false", ",", "false", ")", "{", "@", "Override", "protected", "void", "start", "(", "Timer", "instance", "...
Returns factory which transforms Timer to ConcurrentService. On starting it doing nothing, on stop it cancel timer.
[ "Returns", "factory", "which", "transforms", "Timer", "to", "ConcurrentService", ".", "On", "starting", "it", "doing", "nothing", "on", "stop", "it", "cancel", "timer", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceAdapters.java#L235-L246
100,268
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceAdapters.java
ServiceAdapters.forExecutorService
public static ServiceAdapter<ExecutorService> forExecutorService() { return new SimpleServiceAdapter<ExecutorService>(false, true) { @Override protected void start(ExecutorService instance) { } @Override protected void stop(ExecutorService instance) throws Exception { List<Runnable> runnables = in...
java
public static ServiceAdapter<ExecutorService> forExecutorService() { return new SimpleServiceAdapter<ExecutorService>(false, true) { @Override protected void start(ExecutorService instance) { } @Override protected void stop(ExecutorService instance) throws Exception { List<Runnable> runnables = in...
[ "public", "static", "ServiceAdapter", "<", "ExecutorService", ">", "forExecutorService", "(", ")", "{", "return", "new", "SimpleServiceAdapter", "<", "ExecutorService", ">", "(", "false", ",", "true", ")", "{", "@", "Override", "protected", "void", "start", "(",...
Returns factory which transforms ExecutorService to ConcurrentService. On starting it doing nothing, on stopping it shuts down ExecutorService.
[ "Returns", "factory", "which", "transforms", "ExecutorService", "to", "ConcurrentService", ".", "On", "starting", "it", "doing", "nothing", "on", "stopping", "it", "shuts", "down", "ExecutorService", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceAdapters.java#L251-L269
100,269
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceAdapters.java
ServiceAdapters.forCloseable
public static ServiceAdapter<Closeable> forCloseable() { return new SimpleServiceAdapter<Closeable>(false, true) { @Override protected void start(Closeable instance) { } @Override protected void stop(Closeable instance) throws Exception { instance.close(); } }; }
java
public static ServiceAdapter<Closeable> forCloseable() { return new SimpleServiceAdapter<Closeable>(false, true) { @Override protected void start(Closeable instance) { } @Override protected void stop(Closeable instance) throws Exception { instance.close(); } }; }
[ "public", "static", "ServiceAdapter", "<", "Closeable", ">", "forCloseable", "(", ")", "{", "return", "new", "SimpleServiceAdapter", "<", "Closeable", ">", "(", "false", ",", "true", ")", "{", "@", "Override", "protected", "void", "start", "(", "Closeable", ...
Returns factory which transforms Closeable object to ConcurrentService. On starting it doing nothing, on stopping it close Closeable.
[ "Returns", "factory", "which", "transforms", "Closeable", "object", "to", "ConcurrentService", ".", "On", "starting", "it", "doing", "nothing", "on", "stopping", "it", "close", "Closeable", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceAdapters.java#L274-L285
100,270
softindex/datakernel
boot/src/main/java/io/datakernel/service/ServiceAdapters.java
ServiceAdapters.forDataSource
public static ServiceAdapter<DataSource> forDataSource() { return new SimpleServiceAdapter<DataSource>(true, false) { @Override protected void start(DataSource instance) throws Exception { Connection connection = instance.getConnection(); connection.close(); } @Override protected void stop(Dat...
java
public static ServiceAdapter<DataSource> forDataSource() { return new SimpleServiceAdapter<DataSource>(true, false) { @Override protected void start(DataSource instance) throws Exception { Connection connection = instance.getConnection(); connection.close(); } @Override protected void stop(Dat...
[ "public", "static", "ServiceAdapter", "<", "DataSource", ">", "forDataSource", "(", ")", "{", "return", "new", "SimpleServiceAdapter", "<", "DataSource", ">", "(", "true", ",", "false", ")", "{", "@", "Override", "protected", "void", "start", "(", "DataSource"...
Returns factory which transforms DataSource object to ConcurrentService. On starting it checks connecting , on stopping it close DataSource.
[ "Returns", "factory", "which", "transforms", "DataSource", "object", "to", "ConcurrentService", ".", "On", "starting", "it", "checks", "connecting", "on", "stopping", "it", "close", "DataSource", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceAdapters.java#L290-L302
100,271
softindex/datakernel
core-http/src/main/java/io/datakernel/http/HttpUtils.java
HttpUtils.renderQueryString
public static String renderQueryString(Map<String, String> q, String enc) { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> e : q.entrySet()) { String name = urlEncode(e.getKey(), enc); sb.append(name); if (e.getValue() != null) { sb.append('='); sb.append(urlEncode(e.getValu...
java
public static String renderQueryString(Map<String, String> q, String enc) { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> e : q.entrySet()) { String name = urlEncode(e.getKey(), enc); sb.append(name); if (e.getValue() != null) { sb.append('='); sb.append(urlEncode(e.getValu...
[ "public", "static", "String", "renderQueryString", "(", "Map", "<", "String", ",", "String", ">", "q", ",", "String", "enc", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",...
Method which creates string with parameters and its value in format URL @param q map in which keys if name of parameters, value - value of parameters. @param enc encoding of this string @return string with parameters and its value in format URL
[ "Method", "which", "creates", "string", "with", "parameters", "and", "its", "value", "in", "format", "URL" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/HttpUtils.java#L190-L204
100,272
softindex/datakernel
core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java
ByteBufQueue.peekBuf
@Nullable @Contract(pure = true) public ByteBuf peekBuf() { return hasRemaining() ? bufs[first] : null; }
java
@Nullable @Contract(pure = true) public ByteBuf peekBuf() { return hasRemaining() ? bufs[first] : null; }
[ "@", "Nullable", "@", "Contract", "(", "pure", "=", "true", ")", "public", "ByteBuf", "peekBuf", "(", ")", "{", "return", "hasRemaining", "(", ")", "?", "bufs", "[", "first", "]", ":", "null", ";", "}" ]
Returns the first ByteBuf of this queue if the queue is not empty. Otherwise returns null. @return the first ByteBuf of the queue or {@code null}
[ "Returns", "the", "first", "ByteBuf", "of", "this", "queue", "if", "the", "queue", "is", "not", "empty", ".", "Otherwise", "returns", "null", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L346-L350
100,273
softindex/datakernel
core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java
ByteBufQueue.remainingBufs
@Contract(pure = true) public int remainingBufs() { return last >= first ? last - first : bufs.length + (last - first); }
java
@Contract(pure = true) public int remainingBufs() { return last >= first ? last - first : bufs.length + (last - first); }
[ "@", "Contract", "(", "pure", "=", "true", ")", "public", "int", "remainingBufs", "(", ")", "{", "return", "last", ">=", "first", "?", "last", "-", "first", ":", "bufs", ".", "length", "+", "(", "last", "-", "first", ")", ";", "}" ]
Returns the number of ByteBufs in this queue.
[ "Returns", "the", "number", "of", "ByteBufs", "in", "this", "queue", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L372-L375
100,274
softindex/datakernel
core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java
ByteBufQueue.remainingBytes
@Contract(pure = true) public int remainingBytes() { int result = 0; for (int i = first; i != last; i = next(i)) { result += bufs[i].readRemaining(); } return result; }
java
@Contract(pure = true) public int remainingBytes() { int result = 0; for (int i = first; i != last; i = next(i)) { result += bufs[i].readRemaining(); } return result; }
[ "@", "Contract", "(", "pure", "=", "true", ")", "public", "int", "remainingBytes", "(", ")", "{", "int", "result", "=", "0", ";", "for", "(", "int", "i", "=", "first", ";", "i", "!=", "last", ";", "i", "=", "next", "(", "i", ")", ")", "{", "r...
Returns the number of bytes in this queue.
[ "Returns", "the", "number", "of", "bytes", "in", "this", "queue", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L380-L387
100,275
softindex/datakernel
core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java
ByteBufQueue.peekByte
@Contract(pure = true) public byte peekByte() { assert hasRemaining(); ByteBuf buf = bufs[first]; return buf.peek(); }
java
@Contract(pure = true) public byte peekByte() { assert hasRemaining(); ByteBuf buf = bufs[first]; return buf.peek(); }
[ "@", "Contract", "(", "pure", "=", "true", ")", "public", "byte", "peekByte", "(", ")", "{", "assert", "hasRemaining", "(", ")", ";", "ByteBuf", "buf", "=", "bufs", "[", "first", "]", ";", "return", "buf", ".", "peek", "(", ")", ";", "}" ]
Returns the first byte from this queue without any recycling. @see #getByte().
[ "Returns", "the", "first", "byte", "from", "this", "queue", "without", "any", "recycling", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBufQueue.java#L444-L449
100,276
softindex/datakernel
core-http/src/main/java/io/datakernel/http/HttpServerConnection.java
HttpServerConnection.onStartLine
@SuppressWarnings("PointlessArithmeticExpression") @Override protected void onStartLine(byte[] line, int limit) throws ParseException { switchPool(server.poolReadWrite); HttpMethod method = getHttpMethod(line); if (method == null) { throw new UnknownFormatException(HttpServerConnection.class, "Unknown ...
java
@SuppressWarnings("PointlessArithmeticExpression") @Override protected void onStartLine(byte[] line, int limit) throws ParseException { switchPool(server.poolReadWrite); HttpMethod method = getHttpMethod(line); if (method == null) { throw new UnknownFormatException(HttpServerConnection.class, "Unknown ...
[ "@", "SuppressWarnings", "(", "\"PointlessArithmeticExpression\"", ")", "@", "Override", "protected", "void", "onStartLine", "(", "byte", "[", "]", "line", ",", "int", "limit", ")", "throws", "ParseException", "{", "switchPool", "(", "server", ".", "poolReadWrite"...
This method is called after received line of header. @param line received line of header.
[ "This", "method", "is", "called", "after", "received", "line", "of", "header", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/HttpServerConnection.java#L114-L155
100,277
softindex/datakernel
core-http/src/main/java/io/datakernel/http/HttpServerConnection.java
HttpServerConnection.onHeader
@Override protected void onHeader(HttpHeader header, byte[] array, int off, int len) throws ParseException { if (header == HttpHeaders.EXPECT) { if (equalsLowerCaseAscii(EXPECT_100_CONTINUE, array, off, len)) { socket.write(ByteBuf.wrapForReading(EXPECT_RESPONSE_CONTINUE)); } } if (request.headers.size...
java
@Override protected void onHeader(HttpHeader header, byte[] array, int off, int len) throws ParseException { if (header == HttpHeaders.EXPECT) { if (equalsLowerCaseAscii(EXPECT_100_CONTINUE, array, off, len)) { socket.write(ByteBuf.wrapForReading(EXPECT_RESPONSE_CONTINUE)); } } if (request.headers.size...
[ "@", "Override", "protected", "void", "onHeader", "(", "HttpHeader", "header", ",", "byte", "[", "]", "array", ",", "int", "off", ",", "int", "len", ")", "throws", "ParseException", "{", "if", "(", "header", "==", "HttpHeaders", ".", "EXPECT", ")", "{", ...
This method is called after receiving header. It sets its value to request. @param header received header
[ "This", "method", "is", "called", "after", "receiving", "header", ".", "It", "sets", "its", "value", "to", "request", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/HttpServerConnection.java#L201-L212
100,278
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamMerger.java
StreamMerger.create
public static <K, T> StreamMerger<K, T> create(Function<T, K> keyFunction, Comparator<K> keyComparator, boolean distinct) { return new StreamMerger<>(keyFunction, keyComparator, distinct); }
java
public static <K, T> StreamMerger<K, T> create(Function<T, K> keyFunction, Comparator<K> keyComparator, boolean distinct) { return new StreamMerger<>(keyFunction, keyComparator, distinct); }
[ "public", "static", "<", "K", ",", "T", ">", "StreamMerger", "<", "K", ",", "T", ">", "create", "(", "Function", "<", "T", ",", "K", ">", "keyFunction", ",", "Comparator", "<", "K", ">", "keyComparator", ",", "boolean", "distinct", ")", "{", "return"...
Returns new instance of StreamMerger @param keyComparator comparator for compare keys @param keyFunction function for counting key @param distinct if it is true it means that in result will be not objects with same key @param <K> type of key for mapping @param <T> type of output data
[ "Returns", "new", "instance", "of", "StreamMerger" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamMerger.java#L57-L61
100,279
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducerSimple.java
StreamReducerSimple.create
public static <K, I, O, A> StreamReducerSimple<K, I, O, A> create(Function<I, K> keyFunction, Comparator<K> keyComparator, Reducer<K, I, O, A> reducer) { return new StreamReducerSimple<>(keyFunction, keyComparator, reducer); }
java
public static <K, I, O, A> StreamReducerSimple<K, I, O, A> create(Function<I, K> keyFunction, Comparator<K> keyComparator, Reducer<K, I, O, A> reducer) { return new StreamReducerSimple<>(keyFunction, keyComparator, reducer); }
[ "public", "static", "<", "K", ",", "I", ",", "O", ",", "A", ">", "StreamReducerSimple", "<", "K", ",", "I", ",", "O", ",", "A", ">", "create", "(", "Function", "<", "I", ",", "K", ">", "keyFunction", ",", "Comparator", "<", "K", ">", "keyComparat...
Creates a new instance of StreamReducerSimple @param keyComparator comparator for compare keys @param keyFunction function for counting key
[ "Creates", "a", "new", "instance", "of", "StreamReducerSimple" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducerSimple.java#L54-L58
100,280
softindex/datakernel
cloud-lsmt-aggregation/src/main/java/io/datakernel/aggregation/Aggregation.java
Aggregation.create
public static Aggregation create(Eventloop eventloop, Executor executor, DefiningClassLoader classLoader, AggregationChunkStorage aggregationChunkStorage, AggregationStructure structure) { checkArgument(structure != null, "Cannot create Aggregation with AggregationStructure that is null"); return new Aggregation...
java
public static Aggregation create(Eventloop eventloop, Executor executor, DefiningClassLoader classLoader, AggregationChunkStorage aggregationChunkStorage, AggregationStructure structure) { checkArgument(structure != null, "Cannot create Aggregation with AggregationStructure that is null"); return new Aggregation...
[ "public", "static", "Aggregation", "create", "(", "Eventloop", "eventloop", ",", "Executor", "executor", ",", "DefiningClassLoader", "classLoader", ",", "AggregationChunkStorage", "aggregationChunkStorage", ",", "AggregationStructure", "structure", ")", "{", "checkArgument"...
Instantiates an aggregation with the specified structure, that runs in a given event loop, uses the specified class loader for creating dynamic classes, saves data and metadata to given storages. Maximum size of chunk is 1,000,000 bytes. No more than 1,000,000 records stay in memory while sorting. Maximum duration of c...
[ "Instantiates", "an", "aggregation", "with", "the", "specified", "structure", "that", "runs", "in", "a", "given", "event", "loop", "uses", "the", "specified", "class", "loader", "for", "creating", "dynamic", "classes", "saves", "data", "and", "metadata", "to", ...
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-lsmt-aggregation/src/main/java/io/datakernel/aggregation/Aggregation.java#L127-L131
100,281
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducer.java
StreamReducer.create
public static <K, O, A> StreamReducer<K, O, A> create(Comparator<K> keyComparator) { return new StreamReducer<>(keyComparator); }
java
public static <K, O, A> StreamReducer<K, O, A> create(Comparator<K> keyComparator) { return new StreamReducer<>(keyComparator); }
[ "public", "static", "<", "K", ",", "O", ",", "A", ">", "StreamReducer", "<", "K", ",", "O", ",", "A", ">", "create", "(", "Comparator", "<", "K", ">", "keyComparator", ")", "{", "return", "new", "StreamReducer", "<>", "(", "keyComparator", ")", ";", ...
Creates a new instance of StreamReducer @param keyComparator comparator for compare keys
[ "Creates", "a", "new", "instance", "of", "StreamReducer" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducer.java#L45-L47
100,282
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducer.java
StreamReducer.newInput
@Override public <I> StreamConsumer<I> newInput(Function<I, K> keyFunction, Reducer<K, I, O, A> reducer) { return super.newInput(keyFunction, reducer); }
java
@Override public <I> StreamConsumer<I> newInput(Function<I, K> keyFunction, Reducer<K, I, O, A> reducer) { return super.newInput(keyFunction, reducer); }
[ "@", "Override", "public", "<", "I", ">", "StreamConsumer", "<", "I", ">", "newInput", "(", "Function", "<", "I", ",", "K", ">", "keyFunction", ",", "Reducer", "<", "K", ",", "I", ",", "O", ",", "A", ">", "reducer", ")", "{", "return", "super", "...
Creates a new input stream for this reducer @param keyFunction function for counting key @param reducer reducer witch will performs actions with its stream @param <I> type of input data @return new consumer
[ "Creates", "a", "new", "input", "stream", "for", "this", "reducer" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamReducer.java#L63-L66
100,283
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/StreamJoin.java
StreamJoin.create
public static <K, L, R, V> StreamJoin<K, L, R, V> create(Comparator<K> keyComparator, Function<L, K> leftKeyFunction, Function<R, K> rightKeyFunction, Joiner<K, L, R, V> joiner) { return new StreamJoin<...
java
public static <K, L, R, V> StreamJoin<K, L, R, V> create(Comparator<K> keyComparator, Function<L, K> leftKeyFunction, Function<R, K> rightKeyFunction, Joiner<K, L, R, V> joiner) { return new StreamJoin<...
[ "public", "static", "<", "K", ",", "L", ",", "R", ",", "V", ">", "StreamJoin", "<", "K", ",", "L", ",", "R", ",", "V", ">", "create", "(", "Comparator", "<", "K", ">", "keyComparator", ",", "Function", "<", "L", ",", "K", ">", "leftKeyFunction", ...
Creates a new instance of StreamJoin @param keyComparator comparator for compare keys @param leftKeyFunction function for counting keys of left stream @param rightKeyFunction function for counting keys of right stream @param joiner joiner which will join streams
[ "Creates", "a", "new", "instance", "of", "StreamJoin" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/StreamJoin.java#L178-L182
100,284
softindex/datakernel
core-http/src/main/java/io/datakernel/dns/DnsProtocol.java
DnsProtocol.createDnsQueryPayload
public static ByteBuf createDnsQueryPayload(DnsTransaction transaction) { ByteBuf byteBuf = ByteBufPool.allocate(MAX_SIZE); byteBuf.writeShort(transaction.getId()); // standard query flags, 1 question and 0 of other stuff byteBuf.write(STANDARD_QUERY_HEADER); // query domain name byte componentSize = 0; ...
java
public static ByteBuf createDnsQueryPayload(DnsTransaction transaction) { ByteBuf byteBuf = ByteBufPool.allocate(MAX_SIZE); byteBuf.writeShort(transaction.getId()); // standard query flags, 1 question and 0 of other stuff byteBuf.write(STANDARD_QUERY_HEADER); // query domain name byte componentSize = 0; ...
[ "public", "static", "ByteBuf", "createDnsQueryPayload", "(", "DnsTransaction", "transaction", ")", "{", "ByteBuf", "byteBuf", "=", "ByteBufPool", ".", "allocate", "(", "MAX_SIZE", ")", ";", "byteBuf", ".", "writeShort", "(", "transaction", ".", "getId", "(", ")"...
Creates a bytebuf with a DNS query payload @param transaction DNS transaction to encode @return ByteBuf with DNS message payload data
[ "Creates", "a", "bytebuf", "with", "a", "DNS", "query", "payload" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/dns/DnsProtocol.java#L90-L121
100,285
softindex/datakernel
core-datastream/src/main/java/io/datakernel/stream/processor/BufferReader.java
BufferReader.read
@Override public int read() throws IOException { if (pos >= limit) return -1; try { int c = buf[pos] & 0xff; if (c < 0x80) { pos++; } else if (c < 0xE0) { c = (char) ((c & 0x1F) << 6 | buf[pos + 1] & 0x3F); pos += 2; } else { c = (char) ((c & 0x0F) << 12 | (buf[pos + 1] & 0x3F) << 6...
java
@Override public int read() throws IOException { if (pos >= limit) return -1; try { int c = buf[pos] & 0xff; if (c < 0x80) { pos++; } else if (c < 0xE0) { c = (char) ((c & 0x1F) << 6 | buf[pos + 1] & 0x3F); pos += 2; } else { c = (char) ((c & 0x0F) << 12 | (buf[pos + 1] & 0x3F) << 6...
[ "@", "Override", "public", "int", "read", "(", ")", "throws", "IOException", "{", "if", "(", "pos", ">=", "limit", ")", "return", "-", "1", ";", "try", "{", "int", "c", "=", "buf", "[", "pos", "]", "&", "0xff", ";", "if", "(", "c", "<", "0x80",...
Reads a single character @return the character read, as an integer @throws IOException if an I/O error occurs
[ "Reads", "a", "single", "character" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-datastream/src/main/java/io/datakernel/stream/processor/BufferReader.java#L96-L118
100,286
softindex/datakernel
core-http/src/main/java/io/datakernel/http/stream/BufsConsumerGzipInflater.java
BufsConsumerGzipInflater.skipHeaders
private void skipHeaders(int flag) { // trying to skip optional gzip file members if any is present if ((flag & FEXTRA) != 0) { skipExtra(flag); } else if ((flag & FNAME) != 0) { skipTerminatorByte(flag, FNAME); } else if ((flag & FCOMMENT) != 0) { skipTerminatorByte(flag, FCOMMENT); } else if ((flag...
java
private void skipHeaders(int flag) { // trying to skip optional gzip file members if any is present if ((flag & FEXTRA) != 0) { skipExtra(flag); } else if ((flag & FNAME) != 0) { skipTerminatorByte(flag, FNAME); } else if ((flag & FCOMMENT) != 0) { skipTerminatorByte(flag, FCOMMENT); } else if ((flag...
[ "private", "void", "skipHeaders", "(", "int", "flag", ")", "{", "// trying to skip optional gzip file members if any is present", "if", "(", "(", "flag", "&", "FEXTRA", ")", "!=", "0", ")", "{", "skipExtra", "(", "flag", ")", ";", "}", "else", "if", "(", "("...
region skip header fields
[ "region", "skip", "header", "fields" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/stream/BufsConsumerGzipInflater.java#L223-L234
100,287
softindex/datakernel
cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java
RemoteFsClusterClient.withPartition
public RemoteFsClusterClient withPartition(Object id, FsClient client) { clients.put(id, client); aliveClients.put(id, client); return this; }
java
public RemoteFsClusterClient withPartition(Object id, FsClient client) { clients.put(id, client); aliveClients.put(id, client); return this; }
[ "public", "RemoteFsClusterClient", "withPartition", "(", "Object", "id", ",", "FsClient", "client", ")", "{", "clients", ".", "put", "(", "id", ",", "client", ")", ";", "aliveClients", ".", "put", "(", "id", ",", "client", ")", ";", "return", "this", ";"...
Adds given client with given partition id to this cluster
[ "Adds", "given", "client", "with", "given", "partition", "id", "to", "this", "cluster" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java#L98-L102
100,288
softindex/datakernel
cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java
RemoteFsClusterClient.withReplicationCount
public RemoteFsClusterClient withReplicationCount(int replicationCount) { checkArgument(1 <= replicationCount && replicationCount <= clients.size(), "Replication count cannot be less than one or more than number of clients"); this.replicationCount = replicationCount; return this; }
java
public RemoteFsClusterClient withReplicationCount(int replicationCount) { checkArgument(1 <= replicationCount && replicationCount <= clients.size(), "Replication count cannot be less than one or more than number of clients"); this.replicationCount = replicationCount; return this; }
[ "public", "RemoteFsClusterClient", "withReplicationCount", "(", "int", "replicationCount", ")", "{", "checkArgument", "(", "1", "<=", "replicationCount", "&&", "replicationCount", "<=", "clients", ".", "size", "(", ")", ",", "\"Replication count cannot be less than one or...
Sets the replication count that determines how many copies of the file should persist over the cluster.
[ "Sets", "the", "replication", "count", "that", "determines", "how", "many", "copies", "of", "the", "file", "should", "persist", "over", "the", "cluster", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java#L107-L111
100,289
softindex/datakernel
cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java
RemoteFsClusterClient.ofFailure
private static <T, U> Promise<T> ofFailure(String message, List<Try<U>> failed) { StacklessException exception = new StacklessException(RemoteFsClusterClient.class, message); failed.stream() .map(Try::getExceptionOrNull) .filter(Objects::nonNull) .forEach(exception::addSuppressed); return Promise.ofEx...
java
private static <T, U> Promise<T> ofFailure(String message, List<Try<U>> failed) { StacklessException exception = new StacklessException(RemoteFsClusterClient.class, message); failed.stream() .map(Try::getExceptionOrNull) .filter(Objects::nonNull) .forEach(exception::addSuppressed); return Promise.ofEx...
[ "private", "static", "<", "T", ",", "U", ">", "Promise", "<", "T", ">", "ofFailure", "(", "String", "message", ",", "List", "<", "Try", "<", "U", ">", ">", "failed", ")", "{", "StacklessException", "exception", "=", "new", "StacklessException", "(", "R...
shortcut for creating single Exception from list of possibly failed tries
[ "shortcut", "for", "creating", "single", "Exception", "from", "list", "of", "possibly", "failed", "tries" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-fs/src/main/java/io/datakernel/remotefs/RemoteFsClusterClient.java#L239-L246
100,290
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.cast
public static Expression cast(Expression expression, Class<?> type) { return cast(expression, getType(type)); }
java
public static Expression cast(Expression expression, Class<?> type) { return cast(expression, getType(type)); }
[ "public", "static", "Expression", "cast", "(", "Expression", "expression", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "cast", "(", "expression", ",", "getType", "(", "type", ")", ")", ";", "}" ]
Casts expression to the type @param expression expressions which will be casted @param type expression will be casted to the 'type' @return new instance of the Expression which is casted to the type
[ "Casts", "expression", "to", "the", "type" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L99-L101
100,291
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.cmpEq
public static PredicateDef cmpEq(Expression left, Expression right) { return cmp(CompareOperation.EQ, left, right); }
java
public static PredicateDef cmpEq(Expression left, Expression right) { return cmp(CompareOperation.EQ, left, right); }
[ "public", "static", "PredicateDef", "cmpEq", "(", "Expression", "left", ",", "Expression", "right", ")", "{", "return", "cmp", "(", "CompareOperation", ".", "EQ", ",", "left", ",", "right", ")", ";", "}" ]
Verifies that the arguments are equal @param left first argument which will be compared @param right second argument which will be compared @return new instance of the PredicateDefCmp
[ "Verifies", "that", "the", "arguments", "are", "equal" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L191-L193
100,292
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.asEquals
public static Expression asEquals(List<String> properties) { PredicateDefAnd predicate = PredicateDefAnd.create(); for (String property : properties) { predicate.add(cmpEq( property(self(), property), property(cast(arg(0), ExpressionCast.THIS_TYPE), property))); } return predicate; }
java
public static Expression asEquals(List<String> properties) { PredicateDefAnd predicate = PredicateDefAnd.create(); for (String property : properties) { predicate.add(cmpEq( property(self(), property), property(cast(arg(0), ExpressionCast.THIS_TYPE), property))); } return predicate; }
[ "public", "static", "Expression", "asEquals", "(", "List", "<", "String", ">", "properties", ")", "{", "PredicateDefAnd", "predicate", "=", "PredicateDefAnd", ".", "create", "(", ")", ";", "for", "(", "String", "property", ":", "properties", ")", "{", "predi...
Verifies that the properties are equal @param properties list of the properties @return new instance of the Expression
[ "Verifies", "that", "the", "properties", "are", "equal" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L261-L269
100,293
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.asString
public static Expression asString(List<String> properties) { ExpressionToString toString = new ExpressionToString(); for (String property : properties) { toString.withArgument(property + "=", property(self(), property)); } return toString; }
java
public static Expression asString(List<String> properties) { ExpressionToString toString = new ExpressionToString(); for (String property : properties) { toString.withArgument(property + "=", property(self(), property)); } return toString; }
[ "public", "static", "Expression", "asString", "(", "List", "<", "String", ">", "properties", ")", "{", "ExpressionToString", "toString", "=", "new", "ExpressionToString", "(", ")", ";", "for", "(", "String", "property", ":", "properties", ")", "{", "toString",...
Returns the string which was constructed from properties @param properties list of the properties @return new instance of the ExpressionToString
[ "Returns", "the", "string", "which", "was", "constructed", "from", "properties" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L277-L283
100,294
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.hashCodeOfThis
public static ExpressionHash hashCodeOfThis(List<String> properties) { List<Expression> arguments = new ArrayList<>(); for (String property : properties) { arguments.add(property(new VarThis(), property)); } return new ExpressionHash(arguments); }
java
public static ExpressionHash hashCodeOfThis(List<String> properties) { List<Expression> arguments = new ArrayList<>(); for (String property : properties) { arguments.add(property(new VarThis(), property)); } return new ExpressionHash(arguments); }
[ "public", "static", "ExpressionHash", "hashCodeOfThis", "(", "List", "<", "String", ">", "properties", ")", "{", "List", "<", "Expression", ">", "arguments", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "property", ":", "properties", ...
Returns hash of the properties @param properties list of the properties which will be hashed @return new instance of the ExpressionHash
[ "Returns", "hash", "of", "the", "properties" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L371-L377
100,295
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.add
public static ExpressionArithmeticOp add(Expression left, Expression right) { return new ExpressionArithmeticOp(ArithmeticOperation.ADD, left, right); }
java
public static ExpressionArithmeticOp add(Expression left, Expression right) { return new ExpressionArithmeticOp(ArithmeticOperation.ADD, left, right); }
[ "public", "static", "ExpressionArithmeticOp", "add", "(", "Expression", "left", ",", "Expression", "right", ")", "{", "return", "new", "ExpressionArithmeticOp", "(", "ArithmeticOperation", ".", "ADD", ",", "left", ",", "right", ")", ";", "}" ]
Returns sum of arguments @param left first argument which will be added @param right second argument which will be added @return new instance of the ExpressionArithmeticOp
[ "Returns", "sum", "of", "arguments" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L426-L428
100,296
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.constructor
public static ExpressionConstructor constructor(Class<?> type, Expression... fields) { return new ExpressionConstructor(type, asList(fields)); }
java
public static ExpressionConstructor constructor(Class<?> type, Expression... fields) { return new ExpressionConstructor(type, asList(fields)); }
[ "public", "static", "ExpressionConstructor", "constructor", "(", "Class", "<", "?", ">", "type", ",", "Expression", "...", "fields", ")", "{", "return", "new", "ExpressionConstructor", "(", "type", ",", "asList", "(", "fields", ")", ")", ";", "}" ]
Returns new instance of class @param type type of the constructor @param fields fields for constructor @return new instance of the ExpressionConstructor
[ "Returns", "new", "instance", "of", "class" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L461-L463
100,297
softindex/datakernel
core-codegen/src/main/java/io/datakernel/codegen/Expressions.java
Expressions.newLocal
public static VarLocal newLocal(Context ctx, Type type) { int local = ctx.getGeneratorAdapter().newLocal(type); return new VarLocal(local); }
java
public static VarLocal newLocal(Context ctx, Type type) { int local = ctx.getGeneratorAdapter().newLocal(type); return new VarLocal(local); }
[ "public", "static", "VarLocal", "newLocal", "(", "Context", "ctx", ",", "Type", "type", ")", "{", "int", "local", "=", "ctx", ".", "getGeneratorAdapter", "(", ")", ".", "newLocal", "(", "type", ")", ";", "return", "new", "VarLocal", "(", "local", ")", ...
Returns a new local variable from a given context @param ctx context of a dynamic class @param type the type of the local variable to be created @return new instance of {@link VarLocal}
[ "Returns", "a", "new", "local", "variable", "from", "a", "given", "context" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-codegen/src/main/java/io/datakernel/codegen/Expressions.java#L507-L510
100,298
softindex/datakernel
core-http/src/main/java/io/datakernel/dns/DnsCache.java
DnsCache.tryToResolve
@Nullable public DnsQueryCacheResult tryToResolve(DnsQuery query) { CachedDnsQueryResult cachedResult = cache.get(query); if (cachedResult == null) { logger.trace("{} cache miss", query); return null; } DnsResponse result = cachedResult.response; assert result != null; // results with null responses ...
java
@Nullable public DnsQueryCacheResult tryToResolve(DnsQuery query) { CachedDnsQueryResult cachedResult = cache.get(query); if (cachedResult == null) { logger.trace("{} cache miss", query); return null; } DnsResponse result = cachedResult.response; assert result != null; // results with null responses ...
[ "@", "Nullable", "public", "DnsQueryCacheResult", "tryToResolve", "(", "DnsQuery", "query", ")", "{", "CachedDnsQueryResult", "cachedResult", "=", "cache", ".", "get", "(", "query", ")", ";", "if", "(", "cachedResult", "==", "null", ")", "{", "logger", ".", ...
Tries to get status of the entry for some query from the cache. @param query DNS query @return DnsQueryCacheResult for this query
[ "Tries", "to", "get", "status", "of", "the", "entry", "for", "some", "query", "from", "the", "cache", "." ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/dns/DnsCache.java#L105-L130
100,299
softindex/datakernel
core-http/src/main/java/io/datakernel/dns/DnsCache.java
DnsCache.add
public void add(DnsQuery query, DnsResponse response) { assert eventloop.inEventloopThread() : "Concurrent cache adds are not allowed"; long expirationTime = now.currentTimeMillis(); if (response.isSuccessful()) { assert response.getRecord() != null; // where are my advanced contracts so that Intellj would kno...
java
public void add(DnsQuery query, DnsResponse response) { assert eventloop.inEventloopThread() : "Concurrent cache adds are not allowed"; long expirationTime = now.currentTimeMillis(); if (response.isSuccessful()) { assert response.getRecord() != null; // where are my advanced contracts so that Intellj would kno...
[ "public", "void", "add", "(", "DnsQuery", "query", ",", "DnsResponse", "response", ")", "{", "assert", "eventloop", ".", "inEventloopThread", "(", ")", ":", "\"Concurrent cache adds are not allowed\"", ";", "long", "expirationTime", "=", "now", ".", "currentTimeMill...
Adds DnsResponse to this cache @param response response to add
[ "Adds", "DnsResponse", "to", "this", "cache" ]
090ca1116416c14d463d49d275cb1daaafa69c56
https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/dns/DnsCache.java#L145-L170