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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55,900 | scalecube/scalecube-services | services-discovery/src/main/java/io/scalecube/services/discovery/ClusterAddresses.java | ClusterAddresses.toAddress | public static io.scalecube.transport.Address toAddress(
io.scalecube.services.transport.api.Address address) {
return io.scalecube.transport.Address.create(address.host(), address.port());
} | java | public static io.scalecube.transport.Address toAddress(
io.scalecube.services.transport.api.Address address) {
return io.scalecube.transport.Address.create(address.host(), address.port());
} | [
"public",
"static",
"io",
".",
"scalecube",
".",
"transport",
".",
"Address",
"toAddress",
"(",
"io",
".",
"scalecube",
".",
"services",
".",
"transport",
".",
"api",
".",
"Address",
"address",
")",
"{",
"return",
"io",
".",
"scalecube",
".",
"transport",
... | Converts one address to another.
@param address scalecube services address
@return scalecube cluster address | [
"Converts",
"one",
"address",
"to",
"another",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-discovery/src/main/java/io/scalecube/services/discovery/ClusterAddresses.java#L18-L21 |
55,901 | scalecube/scalecube-services | services-discovery/src/main/java/io/scalecube/services/discovery/ClusterAddresses.java | ClusterAddresses.toAddresses | public static io.scalecube.transport.Address[] toAddresses(Address[] addresses) {
return Arrays.stream(addresses)
.map(ClusterAddresses::toAddress)
.toArray(io.scalecube.transport.Address[]::new);
} | java | public static io.scalecube.transport.Address[] toAddresses(Address[] addresses) {
return Arrays.stream(addresses)
.map(ClusterAddresses::toAddress)
.toArray(io.scalecube.transport.Address[]::new);
} | [
"public",
"static",
"io",
".",
"scalecube",
".",
"transport",
".",
"Address",
"[",
"]",
"toAddresses",
"(",
"Address",
"[",
"]",
"addresses",
")",
"{",
"return",
"Arrays",
".",
"stream",
"(",
"addresses",
")",
".",
"map",
"(",
"ClusterAddresses",
"::",
"... | Converts one address array to another address array.
@param addresses scalecube services addresses
@return scalecube cluster addresses | [
"Converts",
"one",
"address",
"array",
"to",
"another",
"address",
"array",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-discovery/src/main/java/io/scalecube/services/discovery/ClusterAddresses.java#L29-L33 |
55,902 | scalecube/scalecube-services | services-gateway-common/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java | GatewayTemplate.prepareHttpServer | protected final HttpServer prepareHttpServer(
LoopResources loopResources, int port, GatewayMetrics metrics) {
return HttpServer.create()
.tcpConfiguration(
tcpServer -> {
if (loopResources != null) {
tcpServer = tcpServer.runOn(loopResources);
}... | java | protected final HttpServer prepareHttpServer(
LoopResources loopResources, int port, GatewayMetrics metrics) {
return HttpServer.create()
.tcpConfiguration(
tcpServer -> {
if (loopResources != null) {
tcpServer = tcpServer.runOn(loopResources);
}... | [
"protected",
"final",
"HttpServer",
"prepareHttpServer",
"(",
"LoopResources",
"loopResources",
",",
"int",
"port",
",",
"GatewayMetrics",
"metrics",
")",
"{",
"return",
"HttpServer",
".",
"create",
"(",
")",
".",
"tcpConfiguration",
"(",
"tcpServer",
"->",
"{",
... | Builds generic http server with given parameters.
@param loopResources loop resources
@param port listen port
@param metrics gateway metrics
@return http server | [
"Builds",
"generic",
"http",
"server",
"with",
"given",
"parameters",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-common/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java#L37-L55 |
55,903 | scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/rsocket/RSocketClientCodec.java | RSocketClientCodec.encodeAndTransform | private <T> T encodeAndTransform(
ClientMessage message, BiFunction<ByteBuf, ByteBuf, T> transformer)
throws MessageCodecException {
ByteBuf dataBuffer = Unpooled.EMPTY_BUFFER;
ByteBuf headersBuffer = Unpooled.EMPTY_BUFFER;
if (message.hasData(ByteBuf.class)) {
dataBuffer = message.data()... | java | private <T> T encodeAndTransform(
ClientMessage message, BiFunction<ByteBuf, ByteBuf, T> transformer)
throws MessageCodecException {
ByteBuf dataBuffer = Unpooled.EMPTY_BUFFER;
ByteBuf headersBuffer = Unpooled.EMPTY_BUFFER;
if (message.hasData(ByteBuf.class)) {
dataBuffer = message.data()... | [
"private",
"<",
"T",
">",
"T",
"encodeAndTransform",
"(",
"ClientMessage",
"message",
",",
"BiFunction",
"<",
"ByteBuf",
",",
"ByteBuf",
",",
"T",
">",
"transformer",
")",
"throws",
"MessageCodecException",
"{",
"ByteBuf",
"dataBuffer",
"=",
"Unpooled",
".",
"... | Encoder function.
@param message client message.
@param transformer bi function transformer from two headers and data buffers to client
specified object of type T
@param <T> client specified type which could be constructed out of headers and data bufs.
@return T object
@throws MessageCodecException in case if encoding... | [
"Encoder",
"function",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/rsocket/RSocketClientCodec.java#L91-L125 |
55,904 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/transport/api/Address.java | Address.from | public static Address from(String hostAndPort) {
String[] split = hostAndPort.split(":");
if (split.length != 2) {
throw new IllegalArgumentException();
}
String host = split[0];
int port = Integer.parseInt(split[1]);
return new Address(host, port);
} | java | public static Address from(String hostAndPort) {
String[] split = hostAndPort.split(":");
if (split.length != 2) {
throw new IllegalArgumentException();
}
String host = split[0];
int port = Integer.parseInt(split[1]);
return new Address(host, port);
} | [
"public",
"static",
"Address",
"from",
"(",
"String",
"hostAndPort",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"hostAndPort",
".",
"split",
"(",
"\":\"",
")",
";",
"if",
"(",
"split",
".",
"length",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgume... | Create address.
@param hostAndPort host:port
@return address | [
"Create",
"address",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/transport/api/Address.java#L38-L46 |
55,905 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/api/Qualifier.java | Qualifier.asString | public static String asString(String namespace, String action) {
return DELIMITER + namespace + DELIMITER + action;
} | java | public static String asString(String namespace, String action) {
return DELIMITER + namespace + DELIMITER + action;
} | [
"public",
"static",
"String",
"asString",
"(",
"String",
"namespace",
",",
"String",
"action",
")",
"{",
"return",
"DELIMITER",
"+",
"namespace",
"+",
"DELIMITER",
"+",
"action",
";",
"}"
] | Builds qualifier string out of given namespace and action.
@param namespace qualifier namespace.
@param action qualifier action.
@return constructed qualifier. | [
"Builds",
"qualifier",
"string",
"out",
"of",
"given",
"namespace",
"and",
"action",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/Qualifier.java#L27-L29 |
55,906 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/api/Qualifier.java | Qualifier.getQualifierNamespace | public static String getQualifierNamespace(String qualifierAsString) {
int pos = qualifierAsString.indexOf(DELIMITER, 1);
if (pos == -1) {
throw new IllegalArgumentException("Wrong qualifier format: '" + qualifierAsString + "'");
}
return qualifierAsString.substring(1, pos);
} | java | public static String getQualifierNamespace(String qualifierAsString) {
int pos = qualifierAsString.indexOf(DELIMITER, 1);
if (pos == -1) {
throw new IllegalArgumentException("Wrong qualifier format: '" + qualifierAsString + "'");
}
return qualifierAsString.substring(1, pos);
} | [
"public",
"static",
"String",
"getQualifierNamespace",
"(",
"String",
"qualifierAsString",
")",
"{",
"int",
"pos",
"=",
"qualifierAsString",
".",
"indexOf",
"(",
"DELIMITER",
",",
"1",
")",
";",
"if",
"(",
"pos",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
... | Extracts qualifier namespace part from given qualifier string.
@param qualifierAsString qualifier string.
@return qualifier namespace. | [
"Extracts",
"qualifier",
"namespace",
"part",
"from",
"given",
"qualifier",
"string",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/Qualifier.java#L37-L43 |
55,907 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/api/Qualifier.java | Qualifier.getQualifierAction | public static String getQualifierAction(String qualifierAsString) {
int pos = qualifierAsString.lastIndexOf(DELIMITER);
if (pos == -1) {
throw new IllegalArgumentException("Wrong qualifier format: '" + qualifierAsString + "'");
}
return qualifierAsString.substring(pos + 1);
} | java | public static String getQualifierAction(String qualifierAsString) {
int pos = qualifierAsString.lastIndexOf(DELIMITER);
if (pos == -1) {
throw new IllegalArgumentException("Wrong qualifier format: '" + qualifierAsString + "'");
}
return qualifierAsString.substring(pos + 1);
} | [
"public",
"static",
"String",
"getQualifierAction",
"(",
"String",
"qualifierAsString",
")",
"{",
"int",
"pos",
"=",
"qualifierAsString",
".",
"lastIndexOf",
"(",
"DELIMITER",
")",
";",
"if",
"(",
"pos",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"IllegalArgu... | Extracts qualifier action part from given qualifier string.
@param qualifierAsString qualifier string.
@return qualifier action. | [
"Extracts",
"qualifier",
"action",
"part",
"from",
"given",
"qualifier",
"string",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/Qualifier.java#L51-L57 |
55,908 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java | Market.add | public void add(long instrument, long orderId, Side side, long price, long size) {
if (orders.containsKey(orderId)) {
return;
}
OrderBook book = books.get(instrument);
if (book == null) {
return;
}
Order order = new Order(book, side, price, size);
boolean bbo = book.add(side, ... | java | public void add(long instrument, long orderId, Side side, long price, long size) {
if (orders.containsKey(orderId)) {
return;
}
OrderBook book = books.get(instrument);
if (book == null) {
return;
}
Order order = new Order(book, side, price, size);
boolean bbo = book.add(side, ... | [
"public",
"void",
"add",
"(",
"long",
"instrument",
",",
"long",
"orderId",
",",
"Side",
"side",
",",
"long",
"price",
",",
"long",
"size",
")",
"{",
"if",
"(",
"orders",
".",
"containsKey",
"(",
"orderId",
")",
")",
"{",
"return",
";",
"}",
"OrderBo... | Add an order to an order book.
<p>An update event is triggered.
<p>If the order book for the instrument is closed or the order identifier is known, do nothing.
@param instrument the instrument
@param orderId the order identifier
@param side the side
@param price the price
@param size the size | [
"Add",
"an",
"order",
"to",
"an",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java#L61-L78 |
55,909 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java | Market.modify | public void modify(long orderId, long size) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
OrderBook book = order.getOrderBook();
long newSize = Math.max(0, size);
boolean bbo =
book.update(order.getSide(), order.getPrice(), newSize - order.getRemainingQuant... | java | public void modify(long orderId, long size) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
OrderBook book = order.getOrderBook();
long newSize = Math.max(0, size);
boolean bbo =
book.update(order.getSide(), order.getPrice(), newSize - order.getRemainingQuant... | [
"public",
"void",
"modify",
"(",
"long",
"orderId",
",",
"long",
"size",
")",
"{",
"Order",
"order",
"=",
"orders",
".",
"get",
"(",
"orderId",
")",
";",
"if",
"(",
"order",
"==",
"null",
")",
"{",
"return",
";",
"}",
"OrderBook",
"book",
"=",
"ord... | Modify an order in an order book. The order will retain its time priority. If the new size is
zero, the order is deleted from the order book.
<p>An update event is triggered.
<p>If the order identifier is unknown, do nothing.
@param orderId the order identifier
@param size the new size | [
"Modify",
"an",
"order",
"in",
"an",
"order",
"book",
".",
"The",
"order",
"will",
"retain",
"its",
"time",
"priority",
".",
"If",
"the",
"new",
"size",
"is",
"zero",
"the",
"order",
"is",
"deleted",
"from",
"the",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java#L91-L111 |
55,910 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java | Market.execute | public long execute(long orderId, long quantity, long price) {
Order order = orders.get(orderId);
if (order == null) {
return 0;
}
return execute(orderId, order, quantity, price);
} | java | public long execute(long orderId, long quantity, long price) {
Order order = orders.get(orderId);
if (order == null) {
return 0;
}
return execute(orderId, order, quantity, price);
} | [
"public",
"long",
"execute",
"(",
"long",
"orderId",
",",
"long",
"quantity",
",",
"long",
"price",
")",
"{",
"Order",
"order",
"=",
"orders",
".",
"get",
"(",
"orderId",
")",
";",
"if",
"(",
"order",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}"... | Execute a quantity of an order in an order book. If the remaining quantity reaches zero, the
order is deleted from the order book.
<p>A Trade event and an update event are triggered.
<p>If the order identifier is unknown, do nothing.
@param orderId the order identifier
@param quantity the executed quantity
@param pr... | [
"Execute",
"a",
"quantity",
"of",
"an",
"order",
"in",
"an",
"order",
"book",
".",
"If",
"the",
"remaining",
"quantity",
"reaches",
"zero",
"the",
"order",
"is",
"deleted",
"from",
"the",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java#L147-L154 |
55,911 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java | Market.cancel | public long cancel(long orderId, long quantity) {
Order order = orders.get(orderId);
if (order == null) {
return 0;
}
OrderBook book = order.getOrderBook();
long remainingQuantity = order.getRemainingQuantity();
long canceledQuantity = Math.min(quantity, remainingQuantity);
boolean... | java | public long cancel(long orderId, long quantity) {
Order order = orders.get(orderId);
if (order == null) {
return 0;
}
OrderBook book = order.getOrderBook();
long remainingQuantity = order.getRemainingQuantity();
long canceledQuantity = Math.min(quantity, remainingQuantity);
boolean... | [
"public",
"long",
"cancel",
"(",
"long",
"orderId",
",",
"long",
"quantity",
")",
"{",
"Order",
"order",
"=",
"orders",
".",
"get",
"(",
"orderId",
")",
";",
"if",
"(",
"order",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"OrderBook",
"book",
... | Cancel a quantity of an order in an order book. If the remaining quantity reaches zero, the
order is deleted from the order book.
<p>An update event is triggered.
<p>If the order identifier is unknown, do nothing.
@param orderId the order identifier
@param quantity the canceled quantity
@return the remaining quantit... | [
"Cancel",
"a",
"quantity",
"of",
"an",
"order",
"in",
"an",
"order",
"book",
".",
"If",
"the",
"remaining",
"quantity",
"reaches",
"zero",
"the",
"order",
"is",
"deleted",
"from",
"the",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java#L192-L215 |
55,912 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java | Market.delete | public void delete(long orderId) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
OrderBook book = order.getOrderBook();
boolean bbo = book.update(order.getSide(), order.getPrice(), -order.getRemainingQuantity());
orders.remove(orderId);
listener.update(book, bbo... | java | public void delete(long orderId) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
OrderBook book = order.getOrderBook();
boolean bbo = book.update(order.getSide(), order.getPrice(), -order.getRemainingQuantity());
orders.remove(orderId);
listener.update(book, bbo... | [
"public",
"void",
"delete",
"(",
"long",
"orderId",
")",
"{",
"Order",
"order",
"=",
"orders",
".",
"get",
"(",
"orderId",
")",
";",
"if",
"(",
"order",
"==",
"null",
")",
"{",
"return",
";",
"}",
"OrderBook",
"book",
"=",
"order",
".",
"getOrderBook... | Delete an order from an order book.
<p>An update event is triggered.
<p>If the order identifier is unknown, do nothing.
@param orderId the order identifier | [
"Delete",
"an",
"order",
"from",
"an",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/Market.java#L226-L239 |
55,913 | scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java | Client.rsocket | public static Client rsocket(ClientSettings clientSettings) {
RSocketClientCodec clientCodec =
new RSocketClientCodec(
HeadersCodec.getInstance(clientSettings.contentType()),
DataCodec.getInstance(clientSettings.contentType()));
RSocketClientTransport clientTransport =
n... | java | public static Client rsocket(ClientSettings clientSettings) {
RSocketClientCodec clientCodec =
new RSocketClientCodec(
HeadersCodec.getInstance(clientSettings.contentType()),
DataCodec.getInstance(clientSettings.contentType()));
RSocketClientTransport clientTransport =
n... | [
"public",
"static",
"Client",
"rsocket",
"(",
"ClientSettings",
"clientSettings",
")",
"{",
"RSocketClientCodec",
"clientCodec",
"=",
"new",
"RSocketClientCodec",
"(",
"HeadersCodec",
".",
"getInstance",
"(",
"clientSettings",
".",
"contentType",
"(",
")",
")",
",",... | Client on rsocket client transport.
@param clientSettings client settings
@return client | [
"Client",
"on",
"rsocket",
"client",
"transport",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java#L58-L68 |
55,914 | scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java | Client.websocket | public static Client websocket(ClientSettings clientSettings) {
WebsocketClientCodec clientCodec =
new WebsocketClientCodec(DataCodec.getInstance(clientSettings.contentType()));
WebsocketClientTransport clientTransport =
new WebsocketClientTransport(clientSettings, clientCodec, clientSettings.l... | java | public static Client websocket(ClientSettings clientSettings) {
WebsocketClientCodec clientCodec =
new WebsocketClientCodec(DataCodec.getInstance(clientSettings.contentType()));
WebsocketClientTransport clientTransport =
new WebsocketClientTransport(clientSettings, clientCodec, clientSettings.l... | [
"public",
"static",
"Client",
"websocket",
"(",
"ClientSettings",
"clientSettings",
")",
"{",
"WebsocketClientCodec",
"clientCodec",
"=",
"new",
"WebsocketClientCodec",
"(",
"DataCodec",
".",
"getInstance",
"(",
"clientSettings",
".",
"contentType",
"(",
")",
")",
"... | Client on websocket client transport.
@param clientSettings client settings
@return client | [
"Client",
"on",
"websocket",
"client",
"transport",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java#L76-L84 |
55,915 | scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java | Client.http | public static Client http(ClientSettings clientSettings) {
HttpClientCodec clientCodec =
new HttpClientCodec(DataCodec.getInstance(clientSettings.contentType()));
ClientTransport clientTransport =
new HttpClientTransport(clientSettings, clientCodec, clientSettings.loopResources());
return ... | java | public static Client http(ClientSettings clientSettings) {
HttpClientCodec clientCodec =
new HttpClientCodec(DataCodec.getInstance(clientSettings.contentType()));
ClientTransport clientTransport =
new HttpClientTransport(clientSettings, clientCodec, clientSettings.loopResources());
return ... | [
"public",
"static",
"Client",
"http",
"(",
"ClientSettings",
"clientSettings",
")",
"{",
"HttpClientCodec",
"clientCodec",
"=",
"new",
"HttpClientCodec",
"(",
"DataCodec",
".",
"getInstance",
"(",
"clientSettings",
".",
"contentType",
"(",
")",
")",
")",
";",
"C... | Client on http client transport.
@param clientSettings client settings
@return client | [
"Client",
"on",
"http",
"client",
"transport",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/Client.java#L92-L100 |
55,916 | scalecube/scalecube-services | services-examples-runner/src/main/java/io/scalecube/services/examples/ExamplesRunner.java | ExamplesRunner.main | public static void main(String[] args) throws Exception {
ConfigRegistry configRegistry = ConfigBootstrap.configRegistry();
Config config =
configRegistry
.objectProperty("io.scalecube.services.examples", Config.class)
.value()
.orElseThrow(() -> new IllegalStateExce... | java | public static void main(String[] args) throws Exception {
ConfigRegistry configRegistry = ConfigBootstrap.configRegistry();
Config config =
configRegistry
.objectProperty("io.scalecube.services.examples", Config.class)
.value()
.orElseThrow(() -> new IllegalStateExce... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"ConfigRegistry",
"configRegistry",
"=",
"ConfigBootstrap",
".",
"configRegistry",
"(",
")",
";",
"Config",
"config",
"=",
"configRegistry",
".",
"objectPropert... | Main method of gateway runner.
@param args program arguments
@throws Exception exception thrown | [
"Main",
"method",
"of",
"gateway",
"runner",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples-runner/src/main/java/io/scalecube/services/examples/ExamplesRunner.java#L38-L63 |
55,917 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/metrics/Metrics.java | Metrics.register | public <T> Gauge<T> register(
final String component, final String methodName, final Gauge<T> gauge) {
registry.register(
MetricRegistry.name(component, methodName),
new Gauge<T>() {
@Override
public T getValue() {
return gauge.getValue();
}
})... | java | public <T> Gauge<T> register(
final String component, final String methodName, final Gauge<T> gauge) {
registry.register(
MetricRegistry.name(component, methodName),
new Gauge<T>() {
@Override
public T getValue() {
return gauge.getValue();
}
})... | [
"public",
"<",
"T",
">",
"Gauge",
"<",
"T",
">",
"register",
"(",
"final",
"String",
"component",
",",
"final",
"String",
"methodName",
",",
"final",
"Gauge",
"<",
"T",
">",
"gauge",
")",
"{",
"registry",
".",
"register",
"(",
"MetricRegistry",
".",
"n... | Register a Gauge and service registry.
@param component name for the requested timer.
@param methodName for the requested timer.
@param gauge instance.
@return registered gauge in the service registry. | [
"Register",
"a",
"Gauge",
"and",
"service",
"registry",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/metrics/Metrics.java#L49-L61 |
55,918 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/metrics/Metrics.java | Metrics.timer | public static Timer timer(Metrics metrics, String component, String methodName) {
if (metrics != null) {
return metrics.getTimer(component, methodName);
} else {
return null;
}
} | java | public static Timer timer(Metrics metrics, String component, String methodName) {
if (metrics != null) {
return metrics.getTimer(component, methodName);
} else {
return null;
}
} | [
"public",
"static",
"Timer",
"timer",
"(",
"Metrics",
"metrics",
",",
"String",
"component",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"metrics",
"!=",
"null",
")",
"{",
"return",
"metrics",
".",
"getTimer",
"(",
"component",
",",
"methodName",
")"... | if metrics is not null returns a Timer instance for a given component and method name.
@param metrics factory instance to get timer.
@param component name for the requested timer.
@param methodName for the requested timer.
@return timer instance. | [
"if",
"metrics",
"is",
"not",
"null",
"returns",
"a",
"Timer",
"instance",
"for",
"a",
"given",
"component",
"and",
"method",
"name",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/metrics/Metrics.java#L89-L95 |
55,919 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/metrics/Metrics.java | Metrics.counter | public static Counter counter(Metrics metrics, String component, String methodName) {
if (metrics != null) {
return metrics.getCounter(component, methodName);
} else {
return null;
}
} | java | public static Counter counter(Metrics metrics, String component, String methodName) {
if (metrics != null) {
return metrics.getCounter(component, methodName);
} else {
return null;
}
} | [
"public",
"static",
"Counter",
"counter",
"(",
"Metrics",
"metrics",
",",
"String",
"component",
",",
"String",
"methodName",
")",
"{",
"if",
"(",
"metrics",
"!=",
"null",
")",
"{",
"return",
"metrics",
".",
"getCounter",
"(",
"component",
",",
"methodName",... | if metrics is not null returns a Counter instance for a given component and method name.
@param metrics factory instance to get timer.
@param component name for the requested timer.
@param methodName for the requested timer.
@return counter instance. | [
"if",
"metrics",
"is",
"not",
"null",
"returns",
"a",
"Counter",
"instance",
"for",
"a",
"given",
"component",
"and",
"method",
"name",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/metrics/Metrics.java#L105-L111 |
55,920 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/PriceLevel.java | PriceLevel.add | public Order add(long orderId, long size) {
Order order = new Order(this, orderId, size);
orders.add(order);
return order;
} | java | public Order add(long orderId, long size) {
Order order = new Order(this, orderId, size);
orders.add(order);
return order;
} | [
"public",
"Order",
"add",
"(",
"long",
"orderId",
",",
"long",
"size",
")",
"{",
"Order",
"order",
"=",
"new",
"Order",
"(",
"this",
",",
"orderId",
",",
"size",
")",
";",
"orders",
".",
"add",
"(",
"order",
")",
";",
"return",
"order",
";",
"}"
] | Add a new order.
@param orderId the order id
@param size the size
@return the order added to this price level | [
"Add",
"a",
"new",
"order",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/PriceLevel.java#L48-L52 |
55,921 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/PriceLevel.java | PriceLevel.match | public long match(long orderId, Side side, long size, EmitterProcessor<MatchOrder> matchEmmiter) {
long quantity = size;
while (quantity > 0 && !orders.isEmpty()) {
Order order = orders.get(0);
long orderQuantity = order.size();
if (orderQuantity > quantity) {
order.reduce(quantity);
... | java | public long match(long orderId, Side side, long size, EmitterProcessor<MatchOrder> matchEmmiter) {
long quantity = size;
while (quantity > 0 && !orders.isEmpty()) {
Order order = orders.get(0);
long orderQuantity = order.size();
if (orderQuantity > quantity) {
order.reduce(quantity);
... | [
"public",
"long",
"match",
"(",
"long",
"orderId",
",",
"Side",
"side",
",",
"long",
"size",
",",
"EmitterProcessor",
"<",
"MatchOrder",
">",
"matchEmmiter",
")",
"{",
"long",
"quantity",
"=",
"size",
";",
"while",
"(",
"quantity",
">",
"0",
"&&",
"!",
... | Match order if possible.
@param orderId the incoming order id
@param side the incoming order side
@param size incoming order quantity
@param matchEmmiter an emitter to be notified for matches {@link Processor#onNext(Object)}
@return the remaining quantity of the incoming order | [
"Match",
"order",
"if",
"possible",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/PriceLevel.java#L63-L80 |
55,922 | scalecube/scalecube-services | services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/DelegatedLoopResources.java | DelegatedLoopResources.newServerLoopResources | public static DelegatedLoopResources newServerLoopResources(EventLoopGroup workerGroup) {
EventLoopGroup bossGroup =
Epoll.isAvailable()
? new EpollEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY)
: new NioEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY);
return new Del... | java | public static DelegatedLoopResources newServerLoopResources(EventLoopGroup workerGroup) {
EventLoopGroup bossGroup =
Epoll.isAvailable()
? new EpollEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY)
: new NioEventLoopGroup(BOSS_THREADS_NUM, BOSS_THREAD_FACTORY);
return new Del... | [
"public",
"static",
"DelegatedLoopResources",
"newServerLoopResources",
"(",
"EventLoopGroup",
"workerGroup",
")",
"{",
"EventLoopGroup",
"bossGroup",
"=",
"Epoll",
".",
"isAvailable",
"(",
")",
"?",
"new",
"EpollEventLoopGroup",
"(",
"BOSS_THREADS_NUM",
",",
"BOSS_THRE... | Creates new loop resources for server side.
@param workerGroup worker pool
@return loop resources | [
"Creates",
"new",
"loop",
"resources",
"for",
"server",
"side",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-transport-rsocket/src/main/java/io/scalecube/services/transport/rsocket/DelegatedLoopResources.java#L57-L63 |
55,923 | scalecube/scalecube-services | services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/ClientMessage.java | ClientMessage.hasData | public boolean hasData(Class<?> dataClass) {
if (dataClass == null) {
return false;
}
return dataClass.isPrimitive() ? hasData() : dataClass.isInstance(data);
} | java | public boolean hasData(Class<?> dataClass) {
if (dataClass == null) {
return false;
}
return dataClass.isPrimitive() ? hasData() : dataClass.isInstance(data);
} | [
"public",
"boolean",
"hasData",
"(",
"Class",
"<",
"?",
">",
"dataClass",
")",
"{",
"if",
"(",
"dataClass",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"dataClass",
".",
"isPrimitive",
"(",
")",
"?",
"hasData",
"(",
")",
":",
"data... | Boolean method telling message contains data of given type or not.
@param dataClass data class
@return true if message has not null data of given type | [
"Boolean",
"method",
"telling",
"message",
"contains",
"data",
"of",
"given",
"type",
"or",
"not",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-gateway-clientsdk/src/main/java/io/scalecube/services/gateway/clientsdk/ClientMessage.java#L67-L73 |
55,924 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/ServiceEndpoint.java | ServiceEndpoint.serviceReferences | public Collection<ServiceReference> serviceReferences() {
return serviceRegistrations.stream()
.flatMap(sr -> sr.methods().stream().map(sm -> new ServiceReference(sm, sr, this)))
.collect(Collectors.toList());
} | java | public Collection<ServiceReference> serviceReferences() {
return serviceRegistrations.stream()
.flatMap(sr -> sr.methods().stream().map(sm -> new ServiceReference(sm, sr, this)))
.collect(Collectors.toList());
} | [
"public",
"Collection",
"<",
"ServiceReference",
">",
"serviceReferences",
"(",
")",
"{",
"return",
"serviceRegistrations",
".",
"stream",
"(",
")",
".",
"flatMap",
"(",
"sr",
"->",
"sr",
".",
"methods",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"("... | Creates collection of service references from this service endpoint.
@return collection of {@link ServiceReference} | [
"Creates",
"collection",
"of",
"service",
"references",
"from",
"this",
"service",
"endpoint",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/ServiceEndpoint.java#L75-L79 |
55,925 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.oneWay | public Mono<Void> oneWay(ServiceMessage request) {
return Mono.defer(() -> requestOne(request, Void.class).then());
} | java | public Mono<Void> oneWay(ServiceMessage request) {
return Mono.defer(() -> requestOne(request, Void.class).then());
} | [
"public",
"Mono",
"<",
"Void",
">",
"oneWay",
"(",
"ServiceMessage",
"request",
")",
"{",
"return",
"Mono",
".",
"defer",
"(",
"(",
")",
"->",
"requestOne",
"(",
"request",
",",
"Void",
".",
"class",
")",
".",
"then",
"(",
")",
")",
";",
"}"
] | Issues fire-and-forget request.
@param request request message to send.
@return mono publisher completing normally or with error. | [
"Issues",
"fire",
"-",
"and",
"-",
"forget",
"request",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L121-L123 |
55,926 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestOne | public Mono<ServiceMessage> requestOne(ServiceMessage request, Class<?> responseType) {
return Mono.defer(
() -> {
String qualifier = request.qualifier();
if (methodRegistry.containsInvoker(qualifier)) { // local service.
return methodRegistry
.getInvoker(requ... | java | public Mono<ServiceMessage> requestOne(ServiceMessage request, Class<?> responseType) {
return Mono.defer(
() -> {
String qualifier = request.qualifier();
if (methodRegistry.containsInvoker(qualifier)) { // local service.
return methodRegistry
.getInvoker(requ... | [
"public",
"Mono",
"<",
"ServiceMessage",
">",
"requestOne",
"(",
"ServiceMessage",
"request",
",",
"Class",
"<",
"?",
">",
"responseType",
")",
"{",
"return",
"Mono",
".",
"defer",
"(",
"(",
")",
"->",
"{",
"String",
"qualifier",
"=",
"request",
".",
"qu... | Issues request-and-reply request.
@param request request message to send.
@param responseType type of response.
@return mono publisher completing with single response message or with error. | [
"Issues",
"request",
"-",
"and",
"-",
"reply",
"request",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L153-L167 |
55,927 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestOne | public Mono<ServiceMessage> requestOne(
ServiceMessage request, Class<?> responseType, Address address) {
return Mono.defer(
() -> {
requireNonNull(address, "requestOne address parameter is required and must not be null");
requireNonNull(transport, "transport is required and must n... | java | public Mono<ServiceMessage> requestOne(
ServiceMessage request, Class<?> responseType, Address address) {
return Mono.defer(
() -> {
requireNonNull(address, "requestOne address parameter is required and must not be null");
requireNonNull(transport, "transport is required and must n... | [
"public",
"Mono",
"<",
"ServiceMessage",
">",
"requestOne",
"(",
"ServiceMessage",
"request",
",",
"Class",
"<",
"?",
">",
"responseType",
",",
"Address",
"address",
")",
"{",
"return",
"Mono",
".",
"defer",
"(",
"(",
")",
"->",
"{",
"requireNonNull",
"(",... | Given an address issues request-and-reply request to a remote address.
@param request request message to send.
@param responseType type of response.
@param address of remote target service to invoke.
@return mono publisher completing with single response message or with error. | [
"Given",
"an",
"address",
"issues",
"request",
"-",
"and",
"-",
"reply",
"request",
"to",
"a",
"remote",
"address",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L177-L189 |
55,928 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestMany | public Flux<ServiceMessage> requestMany(ServiceMessage request, Class<?> responseType) {
return Flux.defer(
() -> {
String qualifier = request.qualifier();
if (methodRegistry.containsInvoker(qualifier)) { // local service.
return methodRegistry
.getInvoker(req... | java | public Flux<ServiceMessage> requestMany(ServiceMessage request, Class<?> responseType) {
return Flux.defer(
() -> {
String qualifier = request.qualifier();
if (methodRegistry.containsInvoker(qualifier)) { // local service.
return methodRegistry
.getInvoker(req... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"requestMany",
"(",
"ServiceMessage",
"request",
",",
"Class",
"<",
"?",
">",
"responseType",
")",
"{",
"return",
"Flux",
".",
"defer",
"(",
"(",
")",
"->",
"{",
"String",
"qualifier",
"=",
"request",
".",
"q... | Issues request to service which returns stream of service messages back.
@param request request with given headers.
@param responseType type of responses.
@return flux publisher of service responses. | [
"Issues",
"request",
"to",
"service",
"which",
"returns",
"stream",
"of",
"service",
"messages",
"back",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L208-L223 |
55,929 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestMany | public Flux<ServiceMessage> requestMany(
ServiceMessage request, Class<?> responseType, Address address) {
return Flux.defer(
() -> {
requireNonNull(address, "requestMany address parameter is required and must not be null");
requireNonNull(transport, "transport is required and must... | java | public Flux<ServiceMessage> requestMany(
ServiceMessage request, Class<?> responseType, Address address) {
return Flux.defer(
() -> {
requireNonNull(address, "requestMany address parameter is required and must not be null");
requireNonNull(transport, "transport is required and must... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"requestMany",
"(",
"ServiceMessage",
"request",
",",
"Class",
"<",
"?",
">",
"responseType",
",",
"Address",
"address",
")",
"{",
"return",
"Flux",
".",
"defer",
"(",
"(",
")",
"->",
"{",
"requireNonNull",
"("... | Given an address issues request to remote service which returns stream of service messages
back.
@param request request with given headers.
@param responseType type of responses.
@param address of remote target service to invoke.
@return flux publisher of service responses. | [
"Given",
"an",
"address",
"issues",
"request",
"to",
"remote",
"service",
"which",
"returns",
"stream",
"of",
"service",
"messages",
"back",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L234-L246 |
55,930 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestBidirectional | public Flux<ServiceMessage> requestBidirectional(
Publisher<ServiceMessage> publisher, Class<?> responseType) {
return Flux.from(publisher)
.switchOnFirst(
(first, messages) -> {
if (first.hasValue()) {
ServiceMessage request = first.get();
Str... | java | public Flux<ServiceMessage> requestBidirectional(
Publisher<ServiceMessage> publisher, Class<?> responseType) {
return Flux.from(publisher)
.switchOnFirst(
(first, messages) -> {
if (first.hasValue()) {
ServiceMessage request = first.get();
Str... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"requestBidirectional",
"(",
"Publisher",
"<",
"ServiceMessage",
">",
"publisher",
",",
"Class",
"<",
"?",
">",
"responseType",
")",
"{",
"return",
"Flux",
".",
"from",
"(",
"publisher",
")",
".",
"switchOnFirst",
... | Issues stream of service requests to service which returns stream of service messages back.
@param publisher of service requests.
@param responseType type of responses.
@return flux publisher of service responses. | [
"Issues",
"stream",
"of",
"service",
"requests",
"to",
"service",
"which",
"returns",
"stream",
"of",
"service",
"messages",
"back",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L265-L289 |
55,931 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.requestBidirectional | public Flux<ServiceMessage> requestBidirectional(
Publisher<ServiceMessage> publisher, Class<?> responseType, Address address) {
return Flux.defer(
() -> {
requireNonNull(
address, "requestBidirectional address parameter is required and must not be null");
requireNonN... | java | public Flux<ServiceMessage> requestBidirectional(
Publisher<ServiceMessage> publisher, Class<?> responseType, Address address) {
return Flux.defer(
() -> {
requireNonNull(
address, "requestBidirectional address parameter is required and must not be null");
requireNonN... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"requestBidirectional",
"(",
"Publisher",
"<",
"ServiceMessage",
">",
"publisher",
",",
"Class",
"<",
"?",
">",
"responseType",
",",
"Address",
"address",
")",
"{",
"return",
"Flux",
".",
"defer",
"(",
"(",
")",
... | Given an address issues stream of service requests to service which returns stream of service
messages back.
@param publisher of service requests.
@param responseType type of responses.
@param address of remote target service to invoke.
@return flux publisher of service responses. | [
"Given",
"an",
"address",
"issues",
"stream",
"of",
"service",
"requests",
"to",
"service",
"which",
"returns",
"stream",
"of",
"service",
"messages",
"back",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L300-L313 |
55,932 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.api | @SuppressWarnings("unchecked")
public <T> T api(Class<T> serviceInterface) {
final ServiceCall serviceCall = this;
final Map<Method, MethodInfo> genericReturnTypes = Reflect.methodsInfo(serviceInterface);
// noinspection unchecked
return (T)
Proxy.newProxyInstance(
getClass().get... | java | @SuppressWarnings("unchecked")
public <T> T api(Class<T> serviceInterface) {
final ServiceCall serviceCall = this;
final Map<Method, MethodInfo> genericReturnTypes = Reflect.methodsInfo(serviceInterface);
// noinspection unchecked
return (T)
Proxy.newProxyInstance(
getClass().get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"api",
"(",
"Class",
"<",
"T",
">",
"serviceInterface",
")",
"{",
"final",
"ServiceCall",
"serviceCall",
"=",
"this",
";",
"final",
"Map",
"<",
"Method",
",",
"MethodInfo",
... | Create proxy creates a java generic proxy instance by a given service interface.
@param serviceInterface Service Interface type.
@return newly created service proxy object. | [
"Create",
"proxy",
"creates",
"a",
"java",
"generic",
"proxy",
"instance",
"by",
"a",
"given",
"service",
"interface",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L321-L372 |
55,933 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/ServiceCall.java | ServiceCall.toStringOrEqualsOrHashCode | private Optional<Object> toStringOrEqualsOrHashCode(
String method, Class<?> serviceInterface, Object... args) {
switch (method) {
case "toString":
return Optional.of(serviceInterface.toString());
case "equals":
return Optional.of(serviceInterface.equals(args[0]));
case "has... | java | private Optional<Object> toStringOrEqualsOrHashCode(
String method, Class<?> serviceInterface, Object... args) {
switch (method) {
case "toString":
return Optional.of(serviceInterface.toString());
case "equals":
return Optional.of(serviceInterface.equals(args[0]));
case "has... | [
"private",
"Optional",
"<",
"Object",
">",
"toStringOrEqualsOrHashCode",
"(",
"String",
"method",
",",
"Class",
"<",
"?",
">",
"serviceInterface",
",",
"Object",
"...",
"args",
")",
"{",
"switch",
"(",
"method",
")",
"{",
"case",
"\"toString\"",
":",
"return... | check and handle toString or equals or hashcode method where invoked.
@param method that was invoked.
@param serviceInterface for a given service interface.
@param args parameters that where invoked.
@return Optional object as result of to string equals or hashCode result or absent if none of
these where invoked. | [
"check",
"and",
"handle",
"toString",
"or",
"equals",
"or",
"hashcode",
"method",
"where",
"invoked",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/ServiceCall.java#L422-L436 |
55,934 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/Reflect.java | Reflect.inject | public static Microservices inject(Microservices microservices, Collection<Object> services) {
services.forEach(
service ->
Arrays.stream(service.getClass().getDeclaredFields())
.forEach(field -> injectField(microservices, field, service)));
services.forEach(service -> proces... | java | public static Microservices inject(Microservices microservices, Collection<Object> services) {
services.forEach(
service ->
Arrays.stream(service.getClass().getDeclaredFields())
.forEach(field -> injectField(microservices, field, service)));
services.forEach(service -> proces... | [
"public",
"static",
"Microservices",
"inject",
"(",
"Microservices",
"microservices",
",",
"Collection",
"<",
"Object",
">",
"services",
")",
"{",
"services",
".",
"forEach",
"(",
"service",
"->",
"Arrays",
".",
"stream",
"(",
"service",
".",
"getClass",
"(",
... | Inject instances to the microservices instance. either Microservices or ServiceProxy. Scan all
local service instances and inject a service proxy.
@param microservices microservices instance
@param services services set
@return microservices instance | [
"Inject",
"instances",
"to",
"the",
"microservices",
"instance",
".",
"either",
"Microservices",
"or",
"ServiceProxy",
".",
"Scan",
"all",
"local",
"service",
"instances",
"and",
"inject",
"a",
"service",
"proxy",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/Reflect.java#L50-L57 |
55,935 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/Reflect.java | Reflect.parameterizedType | public static Type parameterizedType(Object object) {
if (object != null) {
Type type = object.getClass().getGenericSuperclass();
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments()[0];
}
}
return Object.class;
} | java | public static Type parameterizedType(Object object) {
if (object != null) {
Type type = object.getClass().getGenericSuperclass();
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments()[0];
}
}
return Object.class;
} | [
"public",
"static",
"Type",
"parameterizedType",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"Type",
"type",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getGenericSuperclass",
"(",
")",
";",
"if",
"(",
"type",
"i... | Util function that returns the parameterizedType of a given object.
@param object to inspect
@return the parameterized Type of a given object or Object class if unknown. | [
"Util",
"function",
"that",
"returns",
"the",
"parameterizedType",
"of",
"a",
"given",
"object",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/Reflect.java#L117-L125 |
55,936 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/Reflect.java | Reflect.parameterizedRequestType | public static Type parameterizedRequestType(Method method) {
if (method != null && method.getGenericParameterTypes().length > 0) {
Type type = method.getGenericParameterTypes()[0];
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments()[0];
}
... | java | public static Type parameterizedRequestType(Method method) {
if (method != null && method.getGenericParameterTypes().length > 0) {
Type type = method.getGenericParameterTypes()[0];
if (type instanceof ParameterizedType) {
return ((ParameterizedType) type).getActualTypeArguments()[0];
}
... | [
"public",
"static",
"Type",
"parameterizedRequestType",
"(",
"Method",
"method",
")",
"{",
"if",
"(",
"method",
"!=",
"null",
"&&",
"method",
".",
"getGenericParameterTypes",
"(",
")",
".",
"length",
">",
"0",
")",
"{",
"Type",
"type",
"=",
"method",
".",
... | Util function that returns the parameterized of the request Type of a given object.
@return the parameterized Type of a given object or Object class if unknown. | [
"Util",
"function",
"that",
"returns",
"the",
"parameterized",
"of",
"the",
"request",
"Type",
"of",
"a",
"given",
"object",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/Reflect.java#L156-L165 |
55,937 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/Reflect.java | Reflect.serviceInterfaces | public static Collection<Class<?>> serviceInterfaces(Object serviceObject) {
Class<?>[] interfaces = serviceObject.getClass().getInterfaces();
return Arrays.stream(interfaces)
.filter(interfaceClass -> interfaceClass.isAnnotationPresent(Service.class))
.collect(Collectors.toList());
} | java | public static Collection<Class<?>> serviceInterfaces(Object serviceObject) {
Class<?>[] interfaces = serviceObject.getClass().getInterfaces();
return Arrays.stream(interfaces)
.filter(interfaceClass -> interfaceClass.isAnnotationPresent(Service.class))
.collect(Collectors.toList());
} | [
"public",
"static",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"serviceInterfaces",
"(",
"Object",
"serviceObject",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"interfaces",
"=",
"serviceObject",
".",
"getClass",
"(",
")",
".",
"getInterfaces",
"(",
... | Util function to get service interfaces collections from service instance.
@param serviceObject with extends service interface with @Service annotation.
@return service interface class. | [
"Util",
"function",
"to",
"get",
"service",
"interfaces",
"collections",
"from",
"service",
"instance",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/Reflect.java#L206-L211 |
55,938 | scalecube/scalecube-services | services/src/main/java/io/scalecube/services/Reflect.java | Reflect.validateMethodOrThrow | public static void validateMethodOrThrow(Method method) {
Class<?> returnType = method.getReturnType();
if (returnType.equals(Void.TYPE)) {
return;
} else if (!Publisher.class.isAssignableFrom(returnType)) {
throw new UnsupportedOperationException("Service method return type can be Publisher onl... | java | public static void validateMethodOrThrow(Method method) {
Class<?> returnType = method.getReturnType();
if (returnType.equals(Void.TYPE)) {
return;
} else if (!Publisher.class.isAssignableFrom(returnType)) {
throw new UnsupportedOperationException("Service method return type can be Publisher onl... | [
"public",
"static",
"void",
"validateMethodOrThrow",
"(",
"Method",
"method",
")",
"{",
"Class",
"<",
"?",
">",
"returnType",
"=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnType",
".",
"equals",
"(",
"Void",
".",
"TYPE",
")",
")",
... | Util function to perform basic validation of service message request.
@param method service method. | [
"Util",
"function",
"to",
"perform",
"basic",
"validation",
"of",
"service",
"message",
"request",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services/src/main/java/io/scalecube/services/Reflect.java#L227-L237 |
55,939 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/exceptions/ExceptionMapperExample.java | ExceptionMapperExample.main | public static void main(String[] args) throws InterruptedException {
Microservices ms1 =
Microservices.builder()
.discovery(ScalecubeServiceDiscovery::new)
.transport(ServiceTransports::rsocketServiceTransport)
.defaultErrorMapper(new ServiceAProviderErrorMapper()) // def... | java | public static void main(String[] args) throws InterruptedException {
Microservices ms1 =
Microservices.builder()
.discovery(ScalecubeServiceDiscovery::new)
.transport(ServiceTransports::rsocketServiceTransport)
.defaultErrorMapper(new ServiceAProviderErrorMapper()) // def... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"InterruptedException",
"{",
"Microservices",
"ms1",
"=",
"Microservices",
".",
"builder",
"(",
")",
".",
"discovery",
"(",
"ScalecubeServiceDiscovery",
"::",
"new",
")",
".",
... | Example runner.
@param args program arguments.
@throws InterruptedException exception. | [
"Example",
"runner",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/exceptions/ExceptionMapperExample.java#L20-L66 |
55,940 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java | ServiceMethodInvoker.invokeOne | public Mono<ServiceMessage> invokeOne(
ServiceMessage message, BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Mono.defer(() -> Mono.from(invoke(toRequest(message, dataDecoder))))
.map(this::toResponse)
.onErrorResume(throwable -> Mono.just(errorMapper.toMessage(thro... | java | public Mono<ServiceMessage> invokeOne(
ServiceMessage message, BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Mono.defer(() -> Mono.from(invoke(toRequest(message, dataDecoder))))
.map(this::toResponse)
.onErrorResume(throwable -> Mono.just(errorMapper.toMessage(thro... | [
"public",
"Mono",
"<",
"ServiceMessage",
">",
"invokeOne",
"(",
"ServiceMessage",
"message",
",",
"BiFunction",
"<",
"ServiceMessage",
",",
"Class",
"<",
"?",
">",
",",
"ServiceMessage",
">",
"dataDecoder",
")",
"{",
"return",
"Mono",
".",
"defer",
"(",
"(",... | Invokes service method with single response.
@param message request service message
@param dataDecoder function to create new service message with decoded data
@return mono of service message | [
"Invokes",
"service",
"method",
"with",
"single",
"response",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java#L51-L56 |
55,941 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java | ServiceMethodInvoker.invokeMany | public Flux<ServiceMessage> invokeMany(
ServiceMessage message, BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Flux.defer(() -> Flux.from(invoke(toRequest(message, dataDecoder))))
.map(this::toResponse)
.onErrorResume(throwable -> Flux.just(errorMapper.toMessage(thr... | java | public Flux<ServiceMessage> invokeMany(
ServiceMessage message, BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Flux.defer(() -> Flux.from(invoke(toRequest(message, dataDecoder))))
.map(this::toResponse)
.onErrorResume(throwable -> Flux.just(errorMapper.toMessage(thr... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"invokeMany",
"(",
"ServiceMessage",
"message",
",",
"BiFunction",
"<",
"ServiceMessage",
",",
"Class",
"<",
"?",
">",
",",
"ServiceMessage",
">",
"dataDecoder",
")",
"{",
"return",
"Flux",
".",
"defer",
"(",
"("... | Invokes service method with message stream response.
@param message request service message
@param dataDecoder function to create new service message with decoded data
@return flux of service messages | [
"Invokes",
"service",
"method",
"with",
"message",
"stream",
"response",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java#L65-L70 |
55,942 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java | ServiceMethodInvoker.invokeBidirectional | public Flux<ServiceMessage> invokeBidirectional(
Publisher<ServiceMessage> publisher,
BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Flux.from(publisher)
.map(message -> toRequest(message, dataDecoder))
.transform(this::invoke)
.map(this::toResponse)
... | java | public Flux<ServiceMessage> invokeBidirectional(
Publisher<ServiceMessage> publisher,
BiFunction<ServiceMessage, Class<?>, ServiceMessage> dataDecoder) {
return Flux.from(publisher)
.map(message -> toRequest(message, dataDecoder))
.transform(this::invoke)
.map(this::toResponse)
... | [
"public",
"Flux",
"<",
"ServiceMessage",
">",
"invokeBidirectional",
"(",
"Publisher",
"<",
"ServiceMessage",
">",
"publisher",
",",
"BiFunction",
"<",
"ServiceMessage",
",",
"Class",
"<",
"?",
">",
",",
"ServiceMessage",
">",
"dataDecoder",
")",
"{",
"return",
... | Invokes service method with bidirectional communication.
@param publisher request service message
@param dataDecoder function to create new service message with decoded data
@return flux of service messages | [
"Invokes",
"service",
"method",
"with",
"bidirectional",
"communication",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/methods/ServiceMethodInvoker.java#L79-L87 |
55,943 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java | ServiceMessageCodec.decode | public ServiceMessage decode(ByteBuf dataBuffer, ByteBuf headersBuffer)
throws MessageCodecException {
ServiceMessage.Builder builder = ServiceMessage.builder();
if (dataBuffer.isReadable()) {
builder.data(dataBuffer);
}
if (headersBuffer.isReadable()) {
try (ByteBufInputStream stream... | java | public ServiceMessage decode(ByteBuf dataBuffer, ByteBuf headersBuffer)
throws MessageCodecException {
ServiceMessage.Builder builder = ServiceMessage.builder();
if (dataBuffer.isReadable()) {
builder.data(dataBuffer);
}
if (headersBuffer.isReadable()) {
try (ByteBufInputStream stream... | [
"public",
"ServiceMessage",
"decode",
"(",
"ByteBuf",
"dataBuffer",
",",
"ByteBuf",
"headersBuffer",
")",
"throws",
"MessageCodecException",
"{",
"ServiceMessage",
".",
"Builder",
"builder",
"=",
"ServiceMessage",
".",
"builder",
"(",
")",
";",
"if",
"(",
"dataBuf... | Decode buffers.
@param dataBuffer the buffer of the data (payload)
@param headersBuffer the buffer of the headers
@return a new Service message with {@link ByteBuf} data and with parsed headers.
@throws MessageCodecException when decode fails | [
"Decode",
"buffers",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java#L79-L96 |
55,944 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java | ServiceMessageCodec.decodeData | public static ServiceMessage decodeData(ServiceMessage message, Class<?> dataType)
throws MessageCodecException {
if (dataType == null
|| !message.hasData(ByteBuf.class)
|| ((ByteBuf) message.data()).readableBytes() == 0) {
return message;
}
Object data;
Class<?> targetType ... | java | public static ServiceMessage decodeData(ServiceMessage message, Class<?> dataType)
throws MessageCodecException {
if (dataType == null
|| !message.hasData(ByteBuf.class)
|| ((ByteBuf) message.data()).readableBytes() == 0) {
return message;
}
Object data;
Class<?> targetType ... | [
"public",
"static",
"ServiceMessage",
"decodeData",
"(",
"ServiceMessage",
"message",
",",
"Class",
"<",
"?",
">",
"dataType",
")",
"throws",
"MessageCodecException",
"{",
"if",
"(",
"dataType",
"==",
"null",
"||",
"!",
"message",
".",
"hasData",
"(",
"ByteBuf... | Decode message.
@param message the original message (with {@link ByteBuf} data)
@param dataType the type of the data.
@return a new Service message that upon {@link ServiceMessage#data()} returns the actual data
(of type data type)
@throws MessageCodecException when decode fails | [
"Decode",
"message",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/transport/api/ServiceMessageCodec.java#L107-L128 |
55,945 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/OrderBook.java | OrderBook.enter | public void enter(long orderId, Side side, long price, long size) {
if (orders.containsKey(orderId)) {
return;
}
if (side == Side.BUY) {
buy(orderId, price, size);
} else {
sell(orderId, price, size);
}
} | java | public void enter(long orderId, Side side, long price, long size) {
if (orders.containsKey(orderId)) {
return;
}
if (side == Side.BUY) {
buy(orderId, price, size);
} else {
sell(orderId, price, size);
}
} | [
"public",
"void",
"enter",
"(",
"long",
"orderId",
",",
"Side",
"side",
",",
"long",
"price",
",",
"long",
"size",
")",
"{",
"if",
"(",
"orders",
".",
"containsKey",
"(",
"orderId",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"side",
"==",
"Side"... | Enter an order to this order book.
<p>The incoming order is first matched against resting orders in this order book. This
operation results in zero or more Match events.
<p>If the remaining quantity is not zero after the matching operation, the remaining quantity
is added to this order book and an Add event is trigge... | [
"Enter",
"an",
"order",
"to",
"this",
"order",
"book",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/OrderBook.java#L51-L61 |
55,946 | scalecube/scalecube-services | services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/OrderBook.java | OrderBook.cancel | public void cancel(long orderId, long size) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
long remainingQuantity = order.size();
if (size >= remainingQuantity) {
return;
}
if (size > 0) {
order.resize(size);
} else {
delete(order);
o... | java | public void cancel(long orderId, long size) {
Order order = orders.get(orderId);
if (order == null) {
return;
}
long remainingQuantity = order.size();
if (size >= remainingQuantity) {
return;
}
if (size > 0) {
order.resize(size);
} else {
delete(order);
o... | [
"public",
"void",
"cancel",
"(",
"long",
"orderId",
",",
"long",
"size",
")",
"{",
"Order",
"order",
"=",
"orders",
".",
"get",
"(",
"orderId",
")",
";",
"if",
"(",
"order",
"==",
"null",
")",
"{",
"return",
";",
"}",
"long",
"remainingQuantity",
"="... | Cancel a quantity of an order in this order book. The size refers to the new order size. If the
new order size is set to zero, the order is deleted from this order book.
<p>A Cancel event is triggered.
<p>If the order identifier is unknown, do nothing.
@param orderId the order identifier
@param size the new size | [
"Cancel",
"a",
"quantity",
"of",
"an",
"order",
"in",
"this",
"order",
"book",
".",
"The",
"size",
"refers",
"to",
"the",
"new",
"order",
"size",
".",
"If",
"the",
"new",
"order",
"size",
"is",
"set",
"to",
"zero",
"the",
"order",
"is",
"deleted",
"f... | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-examples/src/main/java/io/scalecube/services/examples/orderbook/service/engine/OrderBook.java#L112-L132 |
55,947 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java | ServiceLoaderUtil.findFirst | public static <T> Optional<T> findFirst(Class<T> clazz) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
return StreamSupport.stream(load.spliterator(), false).findFirst();
} | java | public static <T> Optional<T> findFirst(Class<T> clazz) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
return StreamSupport.stream(load.spliterator(), false).findFirst();
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"findFirst",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"ServiceLoader",
"<",
"T",
">",
"load",
"=",
"ServiceLoader",
".",
"load",
"(",
"clazz",
")",
";",
"return",
"StreamSupport",
"... | Finds the first implementation of the given service type and creates its instance.
@param clazz service type
@return the first implementation of the given service type | [
"Finds",
"the",
"first",
"implementation",
"of",
"the",
"given",
"service",
"type",
"and",
"creates",
"its",
"instance",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java#L21-L24 |
55,948 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java | ServiceLoaderUtil.findFirst | public static <T> Optional<T> findFirst(Class<T> clazz, Predicate<? super T> predicate) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
Stream<T> stream = StreamSupport.stream(load.spliterator(), false);
return stream.filter(predicate).findFirst();
} | java | public static <T> Optional<T> findFirst(Class<T> clazz, Predicate<? super T> predicate) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
Stream<T> stream = StreamSupport.stream(load.spliterator(), false);
return stream.filter(predicate).findFirst();
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"findFirst",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"ServiceLoader",
"<",
"T",
">",
"load",
"=",
"ServiceLoader",
".",
... | Finds the first implementation of the given service type using the given predicate to filter
out found service types and creates its instance.
@param clazz service type
@param predicate service type predicate
@return the first implementation of the given service type | [
"Finds",
"the",
"first",
"implementation",
"of",
"the",
"given",
"service",
"type",
"using",
"the",
"given",
"predicate",
"to",
"filter",
"out",
"found",
"service",
"types",
"and",
"creates",
"its",
"instance",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java#L34-L38 |
55,949 | scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java | ServiceLoaderUtil.findAll | public static <T> Stream<T> findAll(Class<T> clazz) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
return StreamSupport.stream(load.spliterator(), false);
} | java | public static <T> Stream<T> findAll(Class<T> clazz) {
ServiceLoader<T> load = ServiceLoader.load(clazz);
return StreamSupport.stream(load.spliterator(), false);
} | [
"public",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"findAll",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"ServiceLoader",
"<",
"T",
">",
"load",
"=",
"ServiceLoader",
".",
"load",
"(",
"clazz",
")",
";",
"return",
"StreamSupport",
".",
... | Finds all implementations of the given service type and creates their instances.
@param clazz service type
@return implementations' stream of the given service type | [
"Finds",
"all",
"implementations",
"of",
"the",
"given",
"service",
"type",
"and",
"creates",
"their",
"instances",
"."
] | 76c8de6019e5480a1436d12b37acf163f70eea47 | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/ServiceLoaderUtil.java#L46-L49 |
55,950 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/LocalDocumentStore.java | LocalDocumentStore.put | @RequiresTransaction
public void put( String key,
Document document ) {
database.put(key, document);
} | java | @RequiresTransaction
public void put( String key,
Document document ) {
database.put(key, document);
} | [
"@",
"RequiresTransaction",
"public",
"void",
"put",
"(",
"String",
"key",
",",
"Document",
"document",
")",
"{",
"database",
".",
"put",
"(",
"key",
",",
"document",
")",
";",
"}"
] | Store the supplied document and metadata at the given key.
@param key the key or identifier for the document
@param document the document that is to be stored
@see SchematicDb#put(String, Document) | [
"Store",
"the",
"supplied",
"document",
"and",
"metadata",
"at",
"the",
"given",
"key",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/LocalDocumentStore.java#L119-L123 |
55,951 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/LocalDocumentStore.java | LocalDocumentStore.runInTransaction | public <V> V runInTransaction( Callable<V> operation, int retryCountOnLockTimeout, String... keysToLock ) {
// Start a transaction ...
Transactions txns = repoEnv.getTransactions();
int retryCount = retryCountOnLockTimeout;
try {
Transactions.Transaction txn = txns.begin();
... | java | public <V> V runInTransaction( Callable<V> operation, int retryCountOnLockTimeout, String... keysToLock ) {
// Start a transaction ...
Transactions txns = repoEnv.getTransactions();
int retryCount = retryCountOnLockTimeout;
try {
Transactions.Transaction txn = txns.begin();
... | [
"public",
"<",
"V",
">",
"V",
"runInTransaction",
"(",
"Callable",
"<",
"V",
">",
"operation",
",",
"int",
"retryCountOnLockTimeout",
",",
"String",
"...",
"keysToLock",
")",
"{",
"// Start a transaction ...",
"Transactions",
"txns",
"=",
"repoEnv",
".",
"getTra... | Runs the given operation within a transaction, after optionally locking some keys.
@param operation a {@link Callable} instance; may not be null
@param retryCountOnLockTimeout the number of times the operation should be retried if a timeout occurs while trying
to obtain the locks
@param keysToLock an optional {@link S... | [
"Runs",
"the",
"given",
"operation",
"within",
"a",
"transaction",
"after",
"optionally",
"locking",
"some",
"keys",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/LocalDocumentStore.java#L281-L316 |
55,952 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java | Histogram.setStrategy | public void setStrategy( double median,
double standardDeviation,
int sigma ) {
this.bucketingStrategy = new StandardDeviationBucketingStrategy(median, standardDeviation, sigma);
this.bucketWidth = null;
} | java | public void setStrategy( double median,
double standardDeviation,
int sigma ) {
this.bucketingStrategy = new StandardDeviationBucketingStrategy(median, standardDeviation, sigma);
this.bucketWidth = null;
} | [
"public",
"void",
"setStrategy",
"(",
"double",
"median",
",",
"double",
"standardDeviation",
",",
"int",
"sigma",
")",
"{",
"this",
".",
"bucketingStrategy",
"=",
"new",
"StandardDeviationBucketingStrategy",
"(",
"median",
",",
"standardDeviation",
",",
"sigma",
... | Set the histogram to use the standard deviation to determine the bucket sizes.
@param median
@param standardDeviation
@param sigma | [
"Set",
"the",
"histogram",
"to",
"use",
"the",
"standard",
"deviation",
"to",
"determine",
"the",
"bucket",
"sizes",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L81-L86 |
55,953 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java | Histogram.setStrategy | public void setStrategy( T minimum,
T maximum ) {
this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum);
this.bucketWidth = null;
} | java | public void setStrategy( T minimum,
T maximum ) {
this.bucketingStrategy = new ExplicitBucketingStrategy(minimum, maximum);
this.bucketWidth = null;
} | [
"public",
"void",
"setStrategy",
"(",
"T",
"minimum",
",",
"T",
"maximum",
")",
"{",
"this",
".",
"bucketingStrategy",
"=",
"new",
"ExplicitBucketingStrategy",
"(",
"minimum",
",",
"maximum",
")",
";",
"this",
".",
"bucketWidth",
"=",
"null",
";",
"}"
] | Set the histogram to use the supplied minimum and maximum values to determine the bucket size.
@param minimum
@param maximum | [
"Set",
"the",
"histogram",
"to",
"use",
"the",
"supplied",
"minimum",
"and",
"maximum",
"values",
"to",
"determine",
"the",
"bucket",
"size",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L94-L98 |
55,954 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java | Histogram.setSignificantFigures | public Histogram<T> setSignificantFigures( int significantFigures ) {
if (significantFigures != this.significantFigures) {
this.significantFigures = significantFigures;
this.bucketWidth = null;
this.buckets.clear();
}
return this;
} | java | public Histogram<T> setSignificantFigures( int significantFigures ) {
if (significantFigures != this.significantFigures) {
this.significantFigures = significantFigures;
this.bucketWidth = null;
this.buckets.clear();
}
return this;
} | [
"public",
"Histogram",
"<",
"T",
">",
"setSignificantFigures",
"(",
"int",
"significantFigures",
")",
"{",
"if",
"(",
"significantFigures",
"!=",
"this",
".",
"significantFigures",
")",
"{",
"this",
".",
"significantFigures",
"=",
"significantFigures",
";",
"this"... | Set the number of significant figures used in the calculation of the bucket widths.
@param significantFigures the number of significant figures for the bucket widths
@return this histogram, useful for method-chaining
@see #DEFAULT_SIGNIFICANT_FIGURES | [
"Set",
"the",
"number",
"of",
"significant",
"figures",
"used",
"in",
"the",
"calculation",
"of",
"the",
"bucket",
"widths",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L119-L126 |
55,955 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java | Histogram.setBucketCount | public Histogram<T> setBucketCount( int count ) {
if (count != this.bucketCount) {
this.bucketCount = count;
this.bucketWidth = null;
this.buckets.clear();
}
return this;
} | java | public Histogram<T> setBucketCount( int count ) {
if (count != this.bucketCount) {
this.bucketCount = count;
this.bucketWidth = null;
this.buckets.clear();
}
return this;
} | [
"public",
"Histogram",
"<",
"T",
">",
"setBucketCount",
"(",
"int",
"count",
")",
"{",
"if",
"(",
"count",
"!=",
"this",
".",
"bucketCount",
")",
"{",
"this",
".",
"bucketCount",
"=",
"count",
";",
"this",
".",
"bucketWidth",
"=",
"null",
";",
"this",
... | Set the number of buckets that this histogram will use.
@param count the number of buckets
@return this histogram, useful for method-chaining
@see #DEFAULT_BUCKET_COUNT | [
"Set",
"the",
"number",
"of",
"buckets",
"that",
"this",
"histogram",
"will",
"use",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/statistic/Histogram.java#L144-L151 |
55,956 | ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java | JcrResourceAdapter.start | @Override
public synchronized void start( BootstrapContext ctx ) throws ResourceAdapterInternalException {
if (engine == null) {
engine = new ModeShapeEngine();
engine.start();
}
} | java | @Override
public synchronized void start( BootstrapContext ctx ) throws ResourceAdapterInternalException {
if (engine == null) {
engine = new ModeShapeEngine();
engine.start();
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"start",
"(",
"BootstrapContext",
"ctx",
")",
"throws",
"ResourceAdapterInternalException",
"{",
"if",
"(",
"engine",
"==",
"null",
")",
"{",
"engine",
"=",
"new",
"ModeShapeEngine",
"(",
")",
";",
"engine",
"... | This is called when a resource adapter instance is bootstrapped.
@param ctx A bootstrap context containing references
@throws ResourceAdapterInternalException indicates bootstrap failure. | [
"This",
"is",
"called",
"when",
"a",
"resource",
"adapter",
"instance",
"is",
"bootstrapped",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java#L91-L97 |
55,957 | ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java | JcrResourceAdapter.stop | @Override
public synchronized void stop() {
if (engine != null) {
Future<Boolean> shutdown = engine.shutdown();
final int SHUTDOWN_TIMEOUT = 30;
try {
LOGGER.debug("Shutting down engine to stop resource adapter");
if ( ! shutdown.get(SHUTDO... | java | @Override
public synchronized void stop() {
if (engine != null) {
Future<Boolean> shutdown = engine.shutdown();
final int SHUTDOWN_TIMEOUT = 30;
try {
LOGGER.debug("Shutting down engine to stop resource adapter");
if ( ! shutdown.get(SHUTDO... | [
"@",
"Override",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"engine",
"!=",
"null",
")",
"{",
"Future",
"<",
"Boolean",
">",
"shutdown",
"=",
"engine",
".",
"shutdown",
"(",
")",
";",
"final",
"int",
"SHUTDOWN_TIMEOUT",
"=",
"3... | This is called when a resource adapter instance is undeployed or during application server shutdown. | [
"This",
"is",
"called",
"when",
"a",
"resource",
"adapter",
"instance",
"is",
"undeployed",
"or",
"during",
"application",
"server",
"shutdown",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrResourceAdapter.java#L102-L123 |
55,958 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java | BufferManager.serializerFor | public Serializer<?> serializerFor( TypeFactory<?> type ) {
if (type instanceof TupleFactory) {
return ((TupleFactory<?>)type).getSerializer(this);
}
return serializers.serializerFor(type.getType());
} | java | public Serializer<?> serializerFor( TypeFactory<?> type ) {
if (type instanceof TupleFactory) {
return ((TupleFactory<?>)type).getSerializer(this);
}
return serializers.serializerFor(type.getType());
} | [
"public",
"Serializer",
"<",
"?",
">",
"serializerFor",
"(",
"TypeFactory",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"TupleFactory",
")",
"{",
"return",
"(",
"(",
"TupleFactory",
"<",
"?",
">",
")",
"type",
")",
".",
"getSerial... | Obtain a serializer for the given value type.
@param type the type; may not be null
@return the serializer | [
"Obtain",
"a",
"serializer",
"for",
"the",
"given",
"value",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java#L442-L447 |
55,959 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java | BufferManager.bTreeKeySerializerFor | public BTreeKeySerializer<?> bTreeKeySerializerFor( TypeFactory<?> type,
boolean pack ) {
return serializers.bTreeKeySerializerFor(type.getType(), type.getComparator(), pack);
} | java | public BTreeKeySerializer<?> bTreeKeySerializerFor( TypeFactory<?> type,
boolean pack ) {
return serializers.bTreeKeySerializerFor(type.getType(), type.getComparator(), pack);
} | [
"public",
"BTreeKeySerializer",
"<",
"?",
">",
"bTreeKeySerializerFor",
"(",
"TypeFactory",
"<",
"?",
">",
"type",
",",
"boolean",
"pack",
")",
"{",
"return",
"serializers",
".",
"bTreeKeySerializerFor",
"(",
"type",
".",
"getType",
"(",
")",
",",
"type",
".... | Obtain a serializer for the given key type.
@param type the type; may not be null
@param pack true if the serializer can/should pack keys together when possible, or false otherwise
@return the serializer | [
"Obtain",
"a",
"serializer",
"for",
"the",
"given",
"key",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/BufferManager.java#L471-L474 |
55,960 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java | JcrNodeTypeManager.getNodeDefinition | JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) {
if (definitionId == null) return null;
return nodeTypes().getChildNodeDefinition(definitionId);
} | java | JcrNodeDefinition getNodeDefinition( NodeDefinitionId definitionId ) {
if (definitionId == null) return null;
return nodeTypes().getChildNodeDefinition(definitionId);
} | [
"JcrNodeDefinition",
"getNodeDefinition",
"(",
"NodeDefinitionId",
"definitionId",
")",
"{",
"if",
"(",
"definitionId",
"==",
"null",
")",
"return",
"null",
";",
"return",
"nodeTypes",
"(",
")",
".",
"getChildNodeDefinition",
"(",
"definitionId",
")",
";",
"}"
] | Get the node definition given the supplied identifier.
@param definitionId the identifier of the node definition
@return the node definition, or null if there is no such definition (or if the ID was null) | [
"Get",
"the",
"node",
"definition",
"given",
"the",
"supplied",
"identifier",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L218-L221 |
55,961 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java | JcrNodeTypeManager.getPropertyDefinition | JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) {
if (definitionId == null) return null;
return nodeTypes().getPropertyDefinition(definitionId);
} | java | JcrPropertyDefinition getPropertyDefinition( PropertyDefinitionId definitionId ) {
if (definitionId == null) return null;
return nodeTypes().getPropertyDefinition(definitionId);
} | [
"JcrPropertyDefinition",
"getPropertyDefinition",
"(",
"PropertyDefinitionId",
"definitionId",
")",
"{",
"if",
"(",
"definitionId",
"==",
"null",
")",
"return",
"null",
";",
"return",
"nodeTypes",
"(",
")",
".",
"getPropertyDefinition",
"(",
"definitionId",
")",
";"... | Get the property definition given the supplied identifier.
@param definitionId the identifier of the node definition
@return the property definition, or null if there is no such definition (or if the ID was null) | [
"Get",
"the",
"property",
"definition",
"given",
"the",
"supplied",
"identifier",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L229-L232 |
55,962 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java | JcrNodeTypeManager.isDerivedFrom | public boolean isDerivedFrom( String[] testTypeNames,
String primaryTypeName,
String[] mixinNames ) throws RepositoryException {
CheckArg.isNotEmpty(testTypeNames, "testTypeNames");
CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"... | java | public boolean isDerivedFrom( String[] testTypeNames,
String primaryTypeName,
String[] mixinNames ) throws RepositoryException {
CheckArg.isNotEmpty(testTypeNames, "testTypeNames");
CheckArg.isNotEmpty(primaryTypeName, "primaryTypeName"... | [
"public",
"boolean",
"isDerivedFrom",
"(",
"String",
"[",
"]",
"testTypeNames",
",",
"String",
"primaryTypeName",
",",
"String",
"[",
"]",
"mixinNames",
")",
"throws",
"RepositoryException",
"{",
"CheckArg",
".",
"isNotEmpty",
"(",
"testTypeNames",
",",
"\"testTyp... | Determine if any of the test type names are equal to or have been derived from the primary type or any of the mixins.
@param testTypeNames the names of the types or mixins being tested against (never <code>null</code>)
@param primaryTypeName the primary type name (never <code>null</code>)
@param mixinNames the mixin n... | [
"Determine",
"if",
"any",
"of",
"the",
"test",
"type",
"names",
"are",
"equal",
"to",
"or",
"have",
"been",
"derived",
"from",
"the",
"primary",
"type",
"or",
"any",
"of",
"the",
"mixins",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java#L719-L751 |
55,963 | ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/PropertyType.java | PropertyType.valueFromName | public static int valueFromName(String name) {
if (name.equals(TYPENAME_SIMPLE_REFERENCE)) {
return SIMPLE_REFERENCE;
}
return javax.jcr.PropertyType.valueFromName(name);
} | java | public static int valueFromName(String name) {
if (name.equals(TYPENAME_SIMPLE_REFERENCE)) {
return SIMPLE_REFERENCE;
}
return javax.jcr.PropertyType.valueFromName(name);
} | [
"public",
"static",
"int",
"valueFromName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"TYPENAME_SIMPLE_REFERENCE",
")",
")",
"{",
"return",
"SIMPLE_REFERENCE",
";",
"}",
"return",
"javax",
".",
"jcr",
".",
"PropertyType",
".",
... | Returns the numeric constant value of the type with the specified name.
@param name the name of the property type.
@return the numeric constant value.
@throws IllegalArgumentException if <code>name</code> is not a valid
property type name. | [
"Returns",
"the",
"numeric",
"constant",
"value",
"of",
"the",
"type",
"with",
"the",
"specified",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/PropertyType.java#L61-L66 |
55,964 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java | SessionNode.nodeInWorkspace | protected CachedNode nodeInWorkspace( AbstractSessionCache session ) {
return isNew() ? null : session.getWorkspace().getNode(key);
} | java | protected CachedNode nodeInWorkspace( AbstractSessionCache session ) {
return isNew() ? null : session.getWorkspace().getNode(key);
} | [
"protected",
"CachedNode",
"nodeInWorkspace",
"(",
"AbstractSessionCache",
"session",
")",
"{",
"return",
"isNew",
"(",
")",
"?",
"null",
":",
"session",
".",
"getWorkspace",
"(",
")",
".",
"getNode",
"(",
"key",
")",
";",
"}"
] | Get the CachedNode within the workspace cache.
@param session the session; may not be null
@return the workspace cache's node, or null if this node is new | [
"Get",
"the",
"CachedNode",
"within",
"the",
"workspace",
"cache",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java#L311-L313 |
55,965 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java | SessionNode.getSegment | protected final Segment getSegment( NodeCache cache,
CachedNode parent ) {
if (parent != null) {
ChildReference ref = parent.getChildReferences(cache).getChild(key);
if (ref == null) {
// This node doesn't exist in the parent
... | java | protected final Segment getSegment( NodeCache cache,
CachedNode parent ) {
if (parent != null) {
ChildReference ref = parent.getChildReferences(cache).getChild(key);
if (ref == null) {
// This node doesn't exist in the parent
... | [
"protected",
"final",
"Segment",
"getSegment",
"(",
"NodeCache",
"cache",
",",
"CachedNode",
"parent",
")",
"{",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"ChildReference",
"ref",
"=",
"parent",
".",
"getChildReferences",
"(",
"cache",
")",
".",
"getChild... | Get the segment for this node.
@param cache the cache
@param parent the parent node
@return the segment
@throws NodeNotFoundInParentException if the node doesn't exist in the referenced parent | [
"Get",
"the",
"segment",
"for",
"this",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/SessionNode.java#L429-L441 |
55,966 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java | JcrSystemViewExporter.emitValue | private void emitValue( Value value,
ContentHandler contentHandler,
int propertyType,
boolean skipBinary ) throws RepositoryException, SAXException {
if (PropertyType.BINARY == propertyType) {
startElement(contentHa... | java | private void emitValue( Value value,
ContentHandler contentHandler,
int propertyType,
boolean skipBinary ) throws RepositoryException, SAXException {
if (PropertyType.BINARY == propertyType) {
startElement(contentHa... | [
"private",
"void",
"emitValue",
"(",
"Value",
"value",
",",
"ContentHandler",
"contentHandler",
",",
"int",
"propertyType",
",",
"boolean",
"skipBinary",
")",
"throws",
"RepositoryException",
",",
"SAXException",
"{",
"if",
"(",
"PropertyType",
".",
"BINARY",
"=="... | Fires the appropriate SAX events on the content handler to build the XML elements for the value.
@param value the value to be exported
@param contentHandler the SAX content handler for which SAX events will be invoked as the XML document is created.
@param propertyType the {@link PropertyType} for the given value
@par... | [
"Fires",
"the",
"appropriate",
"SAX",
"events",
"on",
"the",
"content",
"handler",
"to",
"build",
"the",
"XML",
"elements",
"for",
"the",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java#L256-L290 |
55,967 | ModeShape/modeshape | web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java | ModeShapeWebdavStore.nodeFor | private Node nodeFor( ITransaction transaction,
ResolvedRequest request ) throws RepositoryException {
return ((JcrSessionTransaction)transaction).nodeFor(request);
} | java | private Node nodeFor( ITransaction transaction,
ResolvedRequest request ) throws RepositoryException {
return ((JcrSessionTransaction)transaction).nodeFor(request);
} | [
"private",
"Node",
"nodeFor",
"(",
"ITransaction",
"transaction",
",",
"ResolvedRequest",
"request",
")",
"throws",
"RepositoryException",
"{",
"return",
"(",
"(",
"JcrSessionTransaction",
")",
"transaction",
")",
".",
"nodeFor",
"(",
"request",
")",
";",
"}"
] | Get the node that corresponds to the resolved request, using the supplied active transaction.
@param transaction the active transaction; may not be null
@param request the resolved request; may not be null and must contain a repository name and workspace name
@return the node; never null
@throws RepositoryException if... | [
"Get",
"the",
"node",
"that",
"corresponds",
"to",
"the",
"resolved",
"request",
"using",
"the",
"supplied",
"active",
"transaction",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java#L639-L642 |
55,968 | ModeShape/modeshape | web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java | ModeShapeWebdavStore.childrenFor | private String[] childrenFor( ITransaction transaction,
ResolvedRequest request ) throws RepositoryException {
return ((JcrSessionTransaction)transaction).childrenFor(request);
} | java | private String[] childrenFor( ITransaction transaction,
ResolvedRequest request ) throws RepositoryException {
return ((JcrSessionTransaction)transaction).childrenFor(request);
} | [
"private",
"String",
"[",
"]",
"childrenFor",
"(",
"ITransaction",
"transaction",
",",
"ResolvedRequest",
"request",
")",
"throws",
"RepositoryException",
"{",
"return",
"(",
"(",
"JcrSessionTransaction",
")",
"transaction",
")",
".",
"childrenFor",
"(",
"request",
... | Determine the names of the children given the supplied request
@param transaction the active transaction; may not be null
@param request the resolved request; may not be null and must contain a repository name and workspace name
@return the children names, or null if there are no children
@throws RepositoryException i... | [
"Determine",
"the",
"names",
"of",
"the",
"children",
"given",
"the",
"supplied",
"request"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-webdav/src/main/java/org/modeshape/web/jcr/webdav/ModeShapeWebdavStore.java#L665-L668 |
55,969 | ModeShape/modeshape | web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestQueryResult.java | RestQueryResult.addColumn | public RestQueryResult addColumn( String name,
String type ) {
if (!StringUtil.isBlank(name)) {
columns.put(name, type);
}
return this;
} | java | public RestQueryResult addColumn( String name,
String type ) {
if (!StringUtil.isBlank(name)) {
columns.put(name, type);
}
return this;
} | [
"public",
"RestQueryResult",
"addColumn",
"(",
"String",
"name",
",",
"String",
"type",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isBlank",
"(",
"name",
")",
")",
"{",
"columns",
".",
"put",
"(",
"name",
",",
"type",
")",
";",
"}",
"return",
"thi... | Adds a new column to this result.
@param name a {@code non-null} string, the name of the column
@param type a {@code non-null} string, the type of the column
@return this instance | [
"Adds",
"a",
"new",
"column",
"to",
"this",
"result",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestQueryResult.java#L53-L59 |
55,970 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalDuplicateIndex.java | LocalDuplicateIndex.create | static <T> LocalDuplicateIndex<T> create( String name,
String workspaceName,
DB db,
Converter<T> converter,
Serializer<T> valueSerialize... | java | static <T> LocalDuplicateIndex<T> create( String name,
String workspaceName,
DB db,
Converter<T> converter,
Serializer<T> valueSerialize... | [
"static",
"<",
"T",
">",
"LocalDuplicateIndex",
"<",
"T",
">",
"create",
"(",
"String",
"name",
",",
"String",
"workspaceName",
",",
"DB",
"db",
",",
"Converter",
"<",
"T",
">",
"converter",
",",
"Serializer",
"<",
"T",
">",
"valueSerializer",
",",
"Comp... | Create a new index that allows duplicate values across all keys.
@param name the name of the index; may not be null or empty
@param workspaceName the name of the workspace; may not be null
@param db the database in which the index information is to be stored; may not be null
@param converter the converter from {@link ... | [
"Create",
"a",
"new",
"index",
"that",
"allows",
"duplicate",
"values",
"across",
"all",
"keys",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalDuplicateIndex.java#L51-L58 |
55,971 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.currentTransactionId | public String currentTransactionId() {
try {
javax.transaction.Transaction txn = txnMgr.getTransaction();
return txn != null ? txn.toString() : null;
} catch (SystemException e) {
return null;
}
} | java | public String currentTransactionId() {
try {
javax.transaction.Transaction txn = txnMgr.getTransaction();
return txn != null ? txn.toString() : null;
} catch (SystemException e) {
return null;
}
} | [
"public",
"String",
"currentTransactionId",
"(",
")",
"{",
"try",
"{",
"javax",
".",
"transaction",
".",
"Transaction",
"txn",
"=",
"txnMgr",
".",
"getTransaction",
"(",
")",
";",
"return",
"txn",
"!=",
"null",
"?",
"txn",
".",
"toString",
"(",
")",
":",... | Get a string representation of the current transaction if there already is an existing transaction.
@return a string representation of the transaction if there is an existing transaction, or null if there is none | [
"Get",
"a",
"string",
"representation",
"of",
"the",
"current",
"transaction",
"if",
"there",
"already",
"is",
"an",
"existing",
"transaction",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L115-L122 |
55,972 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.begin | public Transaction begin() throws NotSupportedException, SystemException, RollbackException {
// check if there isn't an active transaction already
NestableThreadLocalTransaction localTx = LOCAL_TRANSACTION.get();
if (localTx != null) {
// we have an existing local transaction so we ... | java | public Transaction begin() throws NotSupportedException, SystemException, RollbackException {
// check if there isn't an active transaction already
NestableThreadLocalTransaction localTx = LOCAL_TRANSACTION.get();
if (localTx != null) {
// we have an existing local transaction so we ... | [
"public",
"Transaction",
"begin",
"(",
")",
"throws",
"NotSupportedException",
",",
"SystemException",
",",
"RollbackException",
"{",
"// check if there isn't an active transaction already",
"NestableThreadLocalTransaction",
"localTx",
"=",
"LOCAL_TRANSACTION",
".",
"get",
"(",... | Starts a new transaction if one does not already exist, and associate it with the calling thread.
@return the ModeShape transaction
@throws NotSupportedException If the calling thread is already associated with a transaction, and nested transactions are
not supported.
@throws SystemException If the transaction service... | [
"Starts",
"a",
"new",
"transaction",
"if",
"one",
"does",
"not",
"already",
"exist",
"and",
"associate",
"it",
"with",
"the",
"calling",
"thread",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L141-L186 |
55,973 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.commit | public void commit() throws HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException {
Transaction transaction = currentTransaction();
if (transaction == null) {
throw new IllegalStateException("No active transaction");
}
transaction.commit(); ... | java | public void commit() throws HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException {
Transaction transaction = currentTransaction();
if (transaction == null) {
throw new IllegalStateException("No active transaction");
}
transaction.commit(); ... | [
"public",
"void",
"commit",
"(",
")",
"throws",
"HeuristicRollbackException",
",",
"RollbackException",
",",
"HeuristicMixedException",
",",
"SystemException",
"{",
"Transaction",
"transaction",
"=",
"currentTransaction",
"(",
")",
";",
"if",
"(",
"transaction",
"==",... | Commits the current transaction, if one exists.
@throws IllegalStateException If the calling thread is not associated with a transaction.
@throws SystemException If the transaction service fails in an unexpected way.
@throws HeuristicMixedException If a heuristic decision was made and some some parts of the transactio... | [
"Commits",
"the",
"current",
"transaction",
"if",
"one",
"exists",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L259-L265 |
55,974 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java | Transactions.rollback | public void rollback() throws SystemException {
Transaction transaction = currentTransaction();
if (transaction == null) {
throw new IllegalStateException("No active transaction");
}
transaction.rollback();
} | java | public void rollback() throws SystemException {
Transaction transaction = currentTransaction();
if (transaction == null) {
throw new IllegalStateException("No active transaction");
}
transaction.rollback();
} | [
"public",
"void",
"rollback",
"(",
")",
"throws",
"SystemException",
"{",
"Transaction",
"transaction",
"=",
"currentTransaction",
"(",
")",
";",
"if",
"(",
"transaction",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No active transacti... | Rolls back the current transaction, if one exists.
@throws IllegalStateException If the calling thread is not associated with a transaction.
@throws SystemException If the transaction service fails in an unexpected way. | [
"Rolls",
"back",
"the",
"current",
"transaction",
"if",
"one",
"exists",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/txn/Transactions.java#L273-L279 |
55,975 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.without | protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) {
if (removedNodeTypes.isEmpty()) return this;
Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values());
nodeTypes.removeAll(removedNodeTypes);
return new NodeTypes(this.context, nodeType... | java | protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) {
if (removedNodeTypes.isEmpty()) return this;
Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values());
nodeTypes.removeAll(removedNodeTypes);
return new NodeTypes(this.context, nodeType... | [
"protected",
"NodeTypes",
"without",
"(",
"Collection",
"<",
"JcrNodeType",
">",
"removedNodeTypes",
")",
"{",
"if",
"(",
"removedNodeTypes",
".",
"isEmpty",
"(",
")",
")",
"return",
"this",
";",
"Collection",
"<",
"JcrNodeType",
">",
"nodeTypes",
"=",
"new",
... | Obtain a new version of this cache with the specified node types removed from the new cache.
@param removedNodeTypes the node types that are to be removed from the resulting cache; may not be null but may be empty
@return the resulting cache that contains all of the node types within this cache but without the supplie... | [
"Obtain",
"a",
"new",
"version",
"of",
"this",
"cache",
"with",
"the",
"specified",
"node",
"types",
"removed",
"from",
"the",
"new",
"cache",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L359-L364 |
55,976 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.with | protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) {
if (addedNodeTypes.isEmpty()) return this;
Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values());
// if there are updated node types, remove them first (hashcode is based on name alone),
... | java | protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) {
if (addedNodeTypes.isEmpty()) return this;
Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values());
// if there are updated node types, remove them first (hashcode is based on name alone),
... | [
"protected",
"NodeTypes",
"with",
"(",
"Collection",
"<",
"JcrNodeType",
">",
"addedNodeTypes",
")",
"{",
"if",
"(",
"addedNodeTypes",
".",
"isEmpty",
"(",
")",
")",
"return",
"this",
";",
"Collection",
"<",
"JcrNodeType",
">",
"nodeTypes",
"=",
"new",
"Hash... | Obtain a new version of this cache with the specified node types added to the new cache.
@param addedNodeTypes the node types that are to be added to the resulting cache; may not be null but may be empty
@return the resulting cache that contains all of the node types within this cache and the supplied node types; neve... | [
"Obtain",
"a",
"new",
"version",
"of",
"this",
"cache",
"with",
"the",
"specified",
"node",
"types",
"added",
"to",
"the",
"new",
"cache",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L372-L380 |
55,977 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.isTypeOrSubtype | public boolean isTypeOrSubtype( Name nodeTypeName,
Name candidateSupertypeName ) {
if (JcrNtLexicon.BASE.equals(candidateSupertypeName)) {
// If the candidate is 'nt:base', then every node type is a subtype ...
return true;
}
if (nodeTy... | java | public boolean isTypeOrSubtype( Name nodeTypeName,
Name candidateSupertypeName ) {
if (JcrNtLexicon.BASE.equals(candidateSupertypeName)) {
// If the candidate is 'nt:base', then every node type is a subtype ...
return true;
}
if (nodeTy... | [
"public",
"boolean",
"isTypeOrSubtype",
"(",
"Name",
"nodeTypeName",
",",
"Name",
"candidateSupertypeName",
")",
"{",
"if",
"(",
"JcrNtLexicon",
".",
"BASE",
".",
"equals",
"(",
"candidateSupertypeName",
")",
")",
"{",
"// If the candidate is 'nt:base', then every node ... | Determine whether the node's given node type matches or extends the node type with the supplied name.
@param nodeTypeName the name of the node type of a node; may not be null
@param candidateSupertypeName the name of the potential supertype node type; may not be null
@return true if the node type does extend or match ... | [
"Determine",
"whether",
"the",
"node",
"s",
"given",
"node",
"type",
"matches",
"or",
"extends",
"the",
"node",
"type",
"with",
"the",
"supplied",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L441-L450 |
55,978 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.isTypeOrSubtype | public boolean isTypeOrSubtype( Set<Name> nodeTypeNames,
Name candidateSupertypeName ) {
for (Name nodeTypeName : nodeTypeNames) {
if (isTypeOrSubtype(nodeTypeName, candidateSupertypeName)) return true;
}
return false;
} | java | public boolean isTypeOrSubtype( Set<Name> nodeTypeNames,
Name candidateSupertypeName ) {
for (Name nodeTypeName : nodeTypeNames) {
if (isTypeOrSubtype(nodeTypeName, candidateSupertypeName)) return true;
}
return false;
} | [
"public",
"boolean",
"isTypeOrSubtype",
"(",
"Set",
"<",
"Name",
">",
"nodeTypeNames",
",",
"Name",
"candidateSupertypeName",
")",
"{",
"for",
"(",
"Name",
"nodeTypeName",
":",
"nodeTypeNames",
")",
"{",
"if",
"(",
"isTypeOrSubtype",
"(",
"nodeTypeName",
",",
... | Determine whether at least one of the node's given node types matches or extends the node type with the supplied name.
@param nodeTypeNames the names of the node types of a node; may not be null
@param candidateSupertypeName the name of the potential supertype node type; may not be null
@return true if the node type d... | [
"Determine",
"whether",
"at",
"least",
"one",
"of",
"the",
"node",
"s",
"given",
"node",
"types",
"matches",
"or",
"extends",
"the",
"node",
"type",
"with",
"the",
"supplied",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L460-L466 |
55,979 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.allowsNameSiblings | public boolean allowsNameSiblings( Name primaryType,
Set<Name> mixinTypes ) {
if (isUnorderedCollection(primaryType, mixinTypes)) {
// regardless of the actual types, if at least one of them is an unordered collection, SNS are not allowed
return fal... | java | public boolean allowsNameSiblings( Name primaryType,
Set<Name> mixinTypes ) {
if (isUnorderedCollection(primaryType, mixinTypes)) {
// regardless of the actual types, if at least one of them is an unordered collection, SNS are not allowed
return fal... | [
"public",
"boolean",
"allowsNameSiblings",
"(",
"Name",
"primaryType",
",",
"Set",
"<",
"Name",
">",
"mixinTypes",
")",
"{",
"if",
"(",
"isUnorderedCollection",
"(",
"primaryType",
",",
"mixinTypes",
")",
")",
"{",
"// regardless of the actual types, if at least one o... | Determine if either the primary type or any of the mixin types allows SNS.
@param primaryType the primary type name; may not be null
@param mixinTypes the mixin type names; may be null or empty
@return {@code true} if either the primary type or any of the mixin types allows SNS. If neither allow SNS,
this will return ... | [
"Determine",
"if",
"either",
"the",
"primary",
"type",
"or",
"any",
"of",
"the",
"mixin",
"types",
"allows",
"SNS",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L593-L607 |
55,980 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.getBucketIdLengthForUnorderedCollection | public int getBucketIdLengthForUnorderedCollection( Name nodeTypeName, Set<Name> mixinTypes ) {
Set<Name> allTypes = new LinkedHashSet<>();
allTypes.add(nodeTypeName);
if (mixinTypes != null && !mixinTypes.isEmpty()) {
allTypes.addAll(mixinTypes);
}
for (Name typeName... | java | public int getBucketIdLengthForUnorderedCollection( Name nodeTypeName, Set<Name> mixinTypes ) {
Set<Name> allTypes = new LinkedHashSet<>();
allTypes.add(nodeTypeName);
if (mixinTypes != null && !mixinTypes.isEmpty()) {
allTypes.addAll(mixinTypes);
}
for (Name typeName... | [
"public",
"int",
"getBucketIdLengthForUnorderedCollection",
"(",
"Name",
"nodeTypeName",
",",
"Set",
"<",
"Name",
">",
"mixinTypes",
")",
"{",
"Set",
"<",
"Name",
">",
"allTypes",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"allTypes",
".",
"add",
"(",... | Determine the length of a bucket ID for an unordered collection, based on its type and possible mixins.
@param nodeTypeName the primary type of the collection; may not be null.
@param mixinTypes the mixin type names; may be null or empty
@return the order of magnitude, as a power of 16 | [
"Determine",
"the",
"length",
"of",
"a",
"bucket",
"ID",
"for",
"an",
"unordered",
"collection",
"based",
"on",
"its",
"type",
"and",
"possible",
"mixins",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L647-L665 |
55,981 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.isReferenceProperty | public boolean isReferenceProperty( Name nodeTypeName,
Name propertyName ) {
JcrNodeType type = getNodeType(nodeTypeName);
if (type != null) {
for (JcrPropertyDefinition propDefn : type.allPropertyDefinitions(propertyName)) {
int requir... | java | public boolean isReferenceProperty( Name nodeTypeName,
Name propertyName ) {
JcrNodeType type = getNodeType(nodeTypeName);
if (type != null) {
for (JcrPropertyDefinition propDefn : type.allPropertyDefinitions(propertyName)) {
int requir... | [
"public",
"boolean",
"isReferenceProperty",
"(",
"Name",
"nodeTypeName",
",",
"Name",
"propertyName",
")",
"{",
"JcrNodeType",
"type",
"=",
"getNodeType",
"(",
"nodeTypeName",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"for",
"(",
"JcrPropertyDefinit... | Determine if the named property on the node type is a reference property.
@param nodeTypeName the name of the node type; may not be null
@param propertyName the name of the property definition; may not be null
@return true if the property is a {@link PropertyType#REFERENCE}, {@link PropertyType#WEAKREFERENCE}, or
{@li... | [
"Determine",
"if",
"the",
"named",
"property",
"on",
"the",
"node",
"type",
"is",
"a",
"reference",
"property",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L691-L704 |
55,982 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.hasMandatoryPropertyDefinitions | public boolean hasMandatoryPropertyDefinitions( Name primaryType,
Set<Name> mixinTypes ) {
if (mandatoryPropertiesNodeTypes.containsKey(primaryType)) return true;
for (Name mixinType : mixinTypes) {
if (mandatoryPropertiesNodeTypes.contains... | java | public boolean hasMandatoryPropertyDefinitions( Name primaryType,
Set<Name> mixinTypes ) {
if (mandatoryPropertiesNodeTypes.containsKey(primaryType)) return true;
for (Name mixinType : mixinTypes) {
if (mandatoryPropertiesNodeTypes.contains... | [
"public",
"boolean",
"hasMandatoryPropertyDefinitions",
"(",
"Name",
"primaryType",
",",
"Set",
"<",
"Name",
">",
"mixinTypes",
")",
"{",
"if",
"(",
"mandatoryPropertiesNodeTypes",
".",
"containsKey",
"(",
"primaryType",
")",
")",
"return",
"true",
";",
"for",
"... | Determine if the named primary node type or mixin types has at least one mandatory property definitions declared on it or
any of its supertypes.
@param primaryType the primary type name; may not be null
@param mixinTypes the mixin type names; may not be null but may be empty
@return true if any of the named node types... | [
"Determine",
"if",
"the",
"named",
"primary",
"node",
"type",
"or",
"mixin",
"types",
"has",
"at",
"least",
"one",
"mandatory",
"property",
"definitions",
"declared",
"on",
"it",
"or",
"any",
"of",
"its",
"supertypes",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L714-L721 |
55,983 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.hasMandatoryChildNodeDefinitions | public boolean hasMandatoryChildNodeDefinitions( Name primaryType,
Set<Name> mixinTypes ) {
if (mandatoryChildrenNodeTypes.containsKey(primaryType)) return true;
for (Name mixinType : mixinTypes) {
if (mandatoryChildrenNodeTypes.containsKe... | java | public boolean hasMandatoryChildNodeDefinitions( Name primaryType,
Set<Name> mixinTypes ) {
if (mandatoryChildrenNodeTypes.containsKey(primaryType)) return true;
for (Name mixinType : mixinTypes) {
if (mandatoryChildrenNodeTypes.containsKe... | [
"public",
"boolean",
"hasMandatoryChildNodeDefinitions",
"(",
"Name",
"primaryType",
",",
"Set",
"<",
"Name",
">",
"mixinTypes",
")",
"{",
"if",
"(",
"mandatoryChildrenNodeTypes",
".",
"containsKey",
"(",
"primaryType",
")",
")",
"return",
"true",
";",
"for",
"(... | Determine if the named primary node type or mixin types has at least one mandatory child node definitions declared on it or
any of its supertypes.
@param primaryType the primary type name; may not be null
@param mixinTypes the mixin type names; may not be null but may be empty
@return true if any of the the named node... | [
"Determine",
"if",
"the",
"named",
"primary",
"node",
"type",
"or",
"mixin",
"types",
"has",
"at",
"least",
"one",
"mandatory",
"child",
"node",
"definitions",
"declared",
"on",
"it",
"or",
"any",
"of",
"its",
"supertypes",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L732-L739 |
55,984 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.isQueryable | public boolean isQueryable(Name nodeTypeName, Set<Name> mixinTypes) {
if (nonQueryableNodeTypes.contains(nodeTypeName)) {
return false;
}
if (!mixinTypes.isEmpty()) {
for (Name mixinType : mixinTypes) {
if (nonQueryableNodeTypes.contains(mixinType)) {
... | java | public boolean isQueryable(Name nodeTypeName, Set<Name> mixinTypes) {
if (nonQueryableNodeTypes.contains(nodeTypeName)) {
return false;
}
if (!mixinTypes.isEmpty()) {
for (Name mixinType : mixinTypes) {
if (nonQueryableNodeTypes.contains(mixinType)) {
... | [
"public",
"boolean",
"isQueryable",
"(",
"Name",
"nodeTypeName",
",",
"Set",
"<",
"Name",
">",
"mixinTypes",
")",
"{",
"if",
"(",
"nonQueryableNodeTypes",
".",
"contains",
"(",
"nodeTypeName",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"... | Check if the node type and mixin types are queryable or not.
@param nodeTypeName a {@link Name}, never {@code null}
@param mixinTypes the mixin type names; may not be null but may be empty
@return {@code false} if at least one of the node types is not queryable, {@code true} otherwise | [
"Check",
"if",
"the",
"node",
"type",
"and",
"mixin",
"types",
"are",
"queryable",
"or",
"not",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L885-L897 |
55,985 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.canRemoveItem | boolean canRemoveItem( Name primaryTypeNameOfParent,
List<Name> mixinTypeNamesOfParent,
Name itemName,
boolean skipProtected ) {
// First look in the primary type for a matching property definition...
JcrNodeType primaryTyp... | java | boolean canRemoveItem( Name primaryTypeNameOfParent,
List<Name> mixinTypeNamesOfParent,
Name itemName,
boolean skipProtected ) {
// First look in the primary type for a matching property definition...
JcrNodeType primaryTyp... | [
"boolean",
"canRemoveItem",
"(",
"Name",
"primaryTypeNameOfParent",
",",
"List",
"<",
"Name",
">",
"mixinTypeNamesOfParent",
",",
"Name",
"itemName",
",",
"boolean",
"skipProtected",
")",
"{",
"// First look in the primary type for a matching property definition...",
"JcrNode... | Determine if the node and property definitions of the supplied primary type and mixin types allow the item with the
supplied name to be removed.
@param primaryTypeNameOfParent the name of the primary type for the parent node; may not be null
@param mixinTypeNamesOfParent the names of the mixin types for the parent nod... | [
"Determine",
"if",
"the",
"node",
"and",
"property",
"definitions",
"of",
"the",
"supplied",
"primary",
"type",
"and",
"mixin",
"types",
"allow",
"the",
"item",
"with",
"the",
"supplied",
"name",
"to",
"be",
"removed",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1686-L1743 |
55,986 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.findTypeInMapOrList | protected JcrNodeType findTypeInMapOrList( Name typeName,
Collection<JcrNodeType> pendingList ) {
for (JcrNodeType pendingNodeType : pendingList) {
if (pendingNodeType.getInternalName().equals(typeName)) {
return pendingNodeType;
... | java | protected JcrNodeType findTypeInMapOrList( Name typeName,
Collection<JcrNodeType> pendingList ) {
for (JcrNodeType pendingNodeType : pendingList) {
if (pendingNodeType.getInternalName().equals(typeName)) {
return pendingNodeType;
... | [
"protected",
"JcrNodeType",
"findTypeInMapOrList",
"(",
"Name",
"typeName",
",",
"Collection",
"<",
"JcrNodeType",
">",
"pendingList",
")",
"{",
"for",
"(",
"JcrNodeType",
"pendingNodeType",
":",
"pendingList",
")",
"{",
"if",
"(",
"pendingNodeType",
".",
"getInte... | Finds the named type in the given collection of types pending registration if it exists, else returns the type definition
from the repository
@param typeName the name of the type to retrieve
@param pendingList a collection of types that have passed validation but have not yet been committed to the repository
@return t... | [
"Finds",
"the",
"named",
"type",
"in",
"the",
"given",
"collection",
"of",
"types",
"pending",
"registration",
"if",
"it",
"exists",
"else",
"returns",
"the",
"type",
"definition",
"from",
"the",
"repository"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1877-L1886 |
55,987 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.supertypesFor | protected List<JcrNodeType> supertypesFor( NodeTypeDefinition nodeType,
Collection<JcrNodeType> pendingTypes ) throws RepositoryException {
assert nodeType != null;
List<JcrNodeType> supertypes = new LinkedList<JcrNodeType>();
boolean isMixin = no... | java | protected List<JcrNodeType> supertypesFor( NodeTypeDefinition nodeType,
Collection<JcrNodeType> pendingTypes ) throws RepositoryException {
assert nodeType != null;
List<JcrNodeType> supertypes = new LinkedList<JcrNodeType>();
boolean isMixin = no... | [
"protected",
"List",
"<",
"JcrNodeType",
">",
"supertypesFor",
"(",
"NodeTypeDefinition",
"nodeType",
",",
"Collection",
"<",
"JcrNodeType",
">",
"pendingTypes",
")",
"throws",
"RepositoryException",
"{",
"assert",
"nodeType",
"!=",
"null",
";",
"List",
"<",
"JcrN... | Returns the list of node types for the supertypes defined in the given node type.
@param nodeType a node type with a non-null array of supertypes
@param pendingTypes the list of types that have been processed in this type batch but not yet committed to the repository's
set of types
@return a list of node types where e... | [
"Returns",
"the",
"list",
"of",
"node",
"types",
"for",
"the",
"supertypes",
"defined",
"in",
"the",
"given",
"node",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1899-L1929 |
55,988 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.subtypesFor | final Collection<JcrNodeType> subtypesFor( JcrNodeType nodeType ) {
List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>();
for (JcrNodeType type : this.nodeTypes.values()) {
if (type.supertypes().contains(nodeType)) {
subtypes.add(type);
}
}
r... | java | final Collection<JcrNodeType> subtypesFor( JcrNodeType nodeType ) {
List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>();
for (JcrNodeType type : this.nodeTypes.values()) {
if (type.supertypes().contains(nodeType)) {
subtypes.add(type);
}
}
r... | [
"final",
"Collection",
"<",
"JcrNodeType",
">",
"subtypesFor",
"(",
"JcrNodeType",
"nodeType",
")",
"{",
"List",
"<",
"JcrNodeType",
">",
"subtypes",
"=",
"new",
"LinkedList",
"<",
"JcrNodeType",
">",
"(",
")",
";",
"for",
"(",
"JcrNodeType",
"type",
":",
... | Returns the list of subtypes for the given node.
@param nodeType the node type for which subtypes should be returned; may not be null
@return the subtypes for the node | [
"Returns",
"the",
"list",
"of",
"subtypes",
"for",
"the",
"given",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1937-L1945 |
55,989 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.declaredSubtypesFor | final Collection<JcrNodeType> declaredSubtypesFor( JcrNodeType nodeType ) {
CheckArg.isNotNull(nodeType, "nodeType");
String nodeTypeName = nodeType.getName();
List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>();
for (JcrNodeType type : this.nodeTypes.values()) {
if (A... | java | final Collection<JcrNodeType> declaredSubtypesFor( JcrNodeType nodeType ) {
CheckArg.isNotNull(nodeType, "nodeType");
String nodeTypeName = nodeType.getName();
List<JcrNodeType> subtypes = new LinkedList<JcrNodeType>();
for (JcrNodeType type : this.nodeTypes.values()) {
if (A... | [
"final",
"Collection",
"<",
"JcrNodeType",
">",
"declaredSubtypesFor",
"(",
"JcrNodeType",
"nodeType",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"nodeType",
",",
"\"nodeType\"",
")",
";",
"String",
"nodeTypeName",
"=",
"nodeType",
".",
"getName",
"(",
")",
... | Returns the list of declared subtypes for the given node.
@param nodeType the node type for which declared subtypes should be returned; may not be null
@return the subtypes for the node | [
"Returns",
"the",
"list",
"of",
"declared",
"subtypes",
"for",
"the",
"given",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L1953-L1963 |
55,990 | ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java | NodeTypes.validate | protected void validate( JcrNodeType nodeType,
List<JcrNodeType> supertypes,
List<JcrNodeType> pendingTypes ) throws RepositoryException {
validateSupertypes(supertypes);
List<Name> supertypeNames = new ArrayList<Name>(supertypes.size());
... | java | protected void validate( JcrNodeType nodeType,
List<JcrNodeType> supertypes,
List<JcrNodeType> pendingTypes ) throws RepositoryException {
validateSupertypes(supertypes);
List<Name> supertypeNames = new ArrayList<Name>(supertypes.size());
... | [
"protected",
"void",
"validate",
"(",
"JcrNodeType",
"nodeType",
",",
"List",
"<",
"JcrNodeType",
">",
"supertypes",
",",
"List",
"<",
"JcrNodeType",
">",
"pendingTypes",
")",
"throws",
"RepositoryException",
"{",
"validateSupertypes",
"(",
"supertypes",
")",
";",... | Validates that the given node type definition is valid under the ModeShape and JCR type rules within the given context.
@param nodeType the node type to attempt to validate
@param supertypes the names of the supertypes of the node type
@param pendingTypes the list of types previously registered in this batch but not y... | [
"Validates",
"that",
"the",
"given",
"node",
"type",
"definition",
"is",
"valid",
"under",
"the",
"ModeShape",
"and",
"JCR",
"type",
"rules",
"within",
"the",
"given",
"context",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/NodeTypes.java#L2038-L2092 |
55,991 | ModeShape/modeshape | modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java | JcrType.isCaseSensitive | public boolean isCaseSensitive() {
switch (getJcrType()) {
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.DECIMAL:
case PropertyType.WEAKREFERENCE:
case PropertyType.REFERENCE: // conversion is case-insensitive
case Pro... | java | public boolean isCaseSensitive() {
switch (getJcrType()) {
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.DECIMAL:
case PropertyType.WEAKREFERENCE:
case PropertyType.REFERENCE: // conversion is case-insensitive
case Pro... | [
"public",
"boolean",
"isCaseSensitive",
"(",
")",
"{",
"switch",
"(",
"getJcrType",
"(",
")",
")",
"{",
"case",
"PropertyType",
".",
"DOUBLE",
":",
"case",
"PropertyType",
".",
"LONG",
":",
"case",
"PropertyType",
".",
"DECIMAL",
":",
"case",
"PropertyType",... | Get the indicator if the value is case sensitive
@return boolean indicating if the value is case sensitive | [
"Get",
"the",
"indicator",
"if",
"the",
"value",
"is",
"case",
"sensitive"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java#L207-L218 |
55,992 | ModeShape/modeshape | modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java | JcrType.isSigned | public boolean isSigned() {
switch (getJcrType()) {
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.DECIMAL:
case PropertyType.DATE:
return true;
}
return false;
} | java | public boolean isSigned() {
switch (getJcrType()) {
case PropertyType.DOUBLE:
case PropertyType.LONG:
case PropertyType.DECIMAL:
case PropertyType.DATE:
return true;
}
return false;
} | [
"public",
"boolean",
"isSigned",
"(",
")",
"{",
"switch",
"(",
"getJcrType",
"(",
")",
")",
"{",
"case",
"PropertyType",
".",
"DOUBLE",
":",
"case",
"PropertyType",
".",
"LONG",
":",
"case",
"PropertyType",
".",
"DECIMAL",
":",
"case",
"PropertyType",
".",... | Get the indicator if the value is considered a signed value.
@return boolean indicating if value is signed. | [
"Get",
"the",
"indicator",
"if",
"the",
"value",
"is",
"considered",
"a",
"signed",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jdbc-local/src/main/java/org/modeshape/jdbc/JcrType.java#L225-L234 |
55,993 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java | Collections.concat | public static <T> Iterable<T> concat( final Iterable<T> a,
final Iterable<T> b ) {
assert (a != null);
assert (b != null);
return () -> Collections.concat(a.iterator(), b.iterator());
} | java | public static <T> Iterable<T> concat( final Iterable<T> a,
final Iterable<T> b ) {
assert (a != null);
assert (b != null);
return () -> Collections.concat(a.iterator(), b.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"concat",
"(",
"final",
"Iterable",
"<",
"T",
">",
"a",
",",
"final",
"Iterable",
"<",
"T",
">",
"b",
")",
"{",
"assert",
"(",
"a",
"!=",
"null",
")",
";",
"assert",
"(",
"b",
"!=",
... | Concatenate two Iterable sources
@param a a non-null Iterable value
@param b a non-null Iterable value
@return an Iterable that will iterate through all the values from 'a' and then all the values from 'b'
@param <T> the value type | [
"Concatenate",
"two",
"Iterable",
"sources"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java#L53-L59 |
55,994 | ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java | Collections.concat | public static <T> Iterator<T> concat( final Iterator<T> a,
final Iterator<T> b ) {
assert (a != null);
assert (b != null);
return new Iterator<T>() {
@Override
public boolean hasNext() {
return a.hasNext() || b.h... | java | public static <T> Iterator<T> concat( final Iterator<T> a,
final Iterator<T> b ) {
assert (a != null);
assert (b != null);
return new Iterator<T>() {
@Override
public boolean hasNext() {
return a.hasNext() || b.h... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"concat",
"(",
"final",
"Iterator",
"<",
"T",
">",
"a",
",",
"final",
"Iterator",
"<",
"T",
">",
"b",
")",
"{",
"assert",
"(",
"a",
"!=",
"null",
")",
";",
"assert",
"(",
"b",
"!=",
... | Concatenate two Iterators
@param a a non-null Iterator
@param b a non-null Iterator
@return an Iterator that will iterate through all the values of 'a', and then all the values of 'b'
@param <T> the value type | [
"Concatenate",
"two",
"Iterators"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/collection/Collections.java#L69-L95 |
55,995 | ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java | EsIndexColumns.column | public EsIndexColumn column(String name) {
return columns.get(noprefix(name,
EsIndexColumn.LENGTH_PREFIX,
EsIndexColumn.LOWERCASE_PREFIX,
EsIndexColumn.UPPERCASE_PREFIX));
} | java | public EsIndexColumn column(String name) {
return columns.get(noprefix(name,
EsIndexColumn.LENGTH_PREFIX,
EsIndexColumn.LOWERCASE_PREFIX,
EsIndexColumn.UPPERCASE_PREFIX));
} | [
"public",
"EsIndexColumn",
"column",
"(",
"String",
"name",
")",
"{",
"return",
"columns",
".",
"get",
"(",
"noprefix",
"(",
"name",
",",
"EsIndexColumn",
".",
"LENGTH_PREFIX",
",",
"EsIndexColumn",
".",
"LOWERCASE_PREFIX",
",",
"EsIndexColumn",
".",
"UPPERCASE_... | Gets column with given name.
@param name the name of column in index or name of pseudo column like
lower case, upper case or length.
@return real column definition related to the specified name | [
"Gets",
"column",
"with",
"given",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L78-L83 |
55,996 | ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java | EsIndexColumns.noprefix | private String noprefix(String name, String... prefix) {
for (int i = 0; i < prefix.length; i++) {
if (name.startsWith(prefix[i])) {
name = name.replaceAll(prefix[i], "");
}
}
return name;
} | java | private String noprefix(String name, String... prefix) {
for (int i = 0; i < prefix.length; i++) {
if (name.startsWith(prefix[i])) {
name = name.replaceAll(prefix[i], "");
}
}
return name;
} | [
"private",
"String",
"noprefix",
"(",
"String",
"name",
",",
"String",
"...",
"prefix",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"prefix",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"name",
".",
"startsWith",
"(",
"pref... | Cuts name prefix for the pseudo column case.
@param name the name of the column or pseudo column.
@param prefix the list of prefixes to cut.
@return the name without prefix. | [
"Cuts",
"name",
"prefix",
"for",
"the",
"pseudo",
"column",
"case",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L92-L99 |
55,997 | ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java | EsIndexColumns.mappings | public EsRequest mappings( String type ) {
EsRequest mappings = new EsRequest();
EsRequest mappingsValue = new EsRequest();
EsRequest mtype = new EsRequest();
EsRequest properties = new EsRequest();
for (EsIndexColumn col : columns()) {
... | java | public EsRequest mappings( String type ) {
EsRequest mappings = new EsRequest();
EsRequest mappingsValue = new EsRequest();
EsRequest mtype = new EsRequest();
EsRequest properties = new EsRequest();
for (EsIndexColumn col : columns()) {
... | [
"public",
"EsRequest",
"mappings",
"(",
"String",
"type",
")",
"{",
"EsRequest",
"mappings",
"=",
"new",
"EsRequest",
"(",
")",
";",
"EsRequest",
"mappingsValue",
"=",
"new",
"EsRequest",
"(",
")",
";",
"EsRequest",
"mtype",
"=",
"new",
"EsRequest",
"(",
"... | Provides Elasticsearch mapping definition for the given type and
this columns.
@param type the type name for wich this mapping will be applied.
@return mappings definition in the JSON format. | [
"Provides",
"Elasticsearch",
"mapping",
"definition",
"for",
"the",
"given",
"type",
"and",
"this",
"columns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L117-L133 |
55,998 | ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java | EsIndexColumns.fieldMapping | private EsRequest fieldMapping( PropertyType type ) {
EsRequest mappings = new EsRequest();
switch (type) {
case BINARY:
mappings.put("type", "binary");
break;
case BOOLEAN:
mappings.put("type", "boolean");
break;
... | java | private EsRequest fieldMapping( PropertyType type ) {
EsRequest mappings = new EsRequest();
switch (type) {
case BINARY:
mappings.put("type", "binary");
break;
case BOOLEAN:
mappings.put("type", "boolean");
break;
... | [
"private",
"EsRequest",
"fieldMapping",
"(",
"PropertyType",
"type",
")",
"{",
"EsRequest",
"mappings",
"=",
"new",
"EsRequest",
"(",
")",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"BINARY",
":",
"mappings",
".",
"put",
"(",
"\"type\"",
",",
"\"binary\... | Creates mapping definition for the specified column type.
@param type
@return | [
"Creates",
"mapping",
"definition",
"for",
"the",
"specified",
"column",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L141-L165 |
55,999 | ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/shared/ModalDialog.java | ModalDialog.setControls | public void setControls(FormItem... items) {
FormItem[] controls = new FormItem[items.length + 3];
int i = 0;
for (FormItem item : items) {
controls[i++] = item;
}
controls[i++] = new SpacerItem();
controls[i++] = confirmButton;
controls[i++]... | java | public void setControls(FormItem... items) {
FormItem[] controls = new FormItem[items.length + 3];
int i = 0;
for (FormItem item : items) {
controls[i++] = item;
}
controls[i++] = new SpacerItem();
controls[i++] = confirmButton;
controls[i++]... | [
"public",
"void",
"setControls",
"(",
"FormItem",
"...",
"items",
")",
"{",
"FormItem",
"[",
"]",
"controls",
"=",
"new",
"FormItem",
"[",
"items",
".",
"length",
"+",
"3",
"]",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"FormItem",
"item",
":",
"... | Adds controls to this dialog.
@param items controls | [
"Adds",
"controls",
"to",
"this",
"dialog",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/shared/ModalDialog.java#L110-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.