Merge 3e751f8157 into 858a12b3ff
commit
a764af7696
|
|
@ -91,6 +91,11 @@ public class Page<ITEM_T> {
|
|||
private final long totalCount;
|
||||
private final List<ITEM_T> items;
|
||||
|
||||
final String nonNullItemsString = "Required non-null items";
|
||||
final String nonNegativeValueOfItems = "Required non-negative value of items before";
|
||||
final String positiveValueOfPageSize = "Required positive value of page size";
|
||||
final String nonNegativeValueOfTotalItems = "Required non-negative value of total items";
|
||||
|
||||
/**
|
||||
* Creates a new page.
|
||||
*
|
||||
|
|
@ -104,13 +109,13 @@ public class Page<ITEM_T> {
|
|||
* @throws IllegalArgumentException when {@code totalCount} is negative
|
||||
*/
|
||||
public Page(Collection<? extends ITEM_T> items, long itemsBefore, int pageSize, long totalCount) {
|
||||
requireNonNull(items, "Required non-null items");
|
||||
requireNonNull(items, nonNullItemsString);
|
||||
this.items = new ArrayList<>(items);
|
||||
checkArgument(itemsBefore >= 0, "Required non-negative value of items before");
|
||||
checkArgument(itemsBefore >= 0, nonNegativeValueOfItems);
|
||||
this.itemsBefore = itemsBefore;
|
||||
checkArgument(pageSize > 0, "Required positive value of page size");
|
||||
checkArgument(pageSize > 0, positiveValueOfPageSize);
|
||||
this.pageSize = pageSize;
|
||||
checkArgument(totalCount >= 0, "Required non-negative value of total items");
|
||||
checkArgument(totalCount >= 0, nonNegativeValueOfTotalItems);
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ import org.eclipse.che.api.core.jsonrpc.commons.ResponseDispatcher;
|
|||
import org.eclipse.che.api.core.websocket.commons.WebSocketMessageTransmitter;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
private static final String endpointIdMustNotBeNull = "Endpoint ID must not be null"
|
||||
private static final String endpointIdMustNotBeEmpty = "Endpoint ID must not be empty"
|
||||
|
||||
|
||||
/** Endpoint ID configurator to defined endpoint id that the request should be addressed to. */
|
||||
public class EndpointIdConfigurator {
|
||||
private static final Logger LOGGER = getLogger(EndpointIdConfigurator.class);
|
||||
|
|
@ -40,8 +44,8 @@ public class EndpointIdConfigurator {
|
|||
}
|
||||
|
||||
public MethodNameConfigurator endpointId(String id) {
|
||||
checkNotNull(id, "Endpoint ID must not be null");
|
||||
checkArgument(!id.isEmpty(), "Endpoint ID must not be empty");
|
||||
checkNotNull(id, endpointIdMustNotBeNull);
|
||||
checkArgument(!id.isEmpty(), endpointIdMustNotBeEmpty);
|
||||
|
||||
LOGGER.debug("Configuring outgoing request endpoint ID: " + id);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public class SendConfiguratorFromOne<P> {
|
|||
private final P pValue;
|
||||
private final String endpointId;
|
||||
|
||||
private static final String resultClassMustNotBeNull= "Result class value must not be null";
|
||||
|
||||
SendConfiguratorFromOne(
|
||||
JsonRpcMarshaller marshaller,
|
||||
ResponseDispatcher dispatcher,
|
||||
|
|
@ -79,7 +81,7 @@ public class SendConfiguratorFromOne<P> {
|
|||
|
||||
public <R> JsonRpcPromise<R> sendAndReceiveResultAsDto(
|
||||
final Class<R> rClass, int timeoutInMillis) {
|
||||
checkNotNull(rClass, "Result class value must not be null");
|
||||
checkNotNull(rClass, resultClassMustNotBeNull);
|
||||
|
||||
final String requestId = transmitRequest();
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import org.apache.maven.plugins.annotations.Parameter;
|
|||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||
import org.eclipse.che.dto.generator.DtoGenerator;
|
||||
|
||||
|
||||
|
||||
/** Mojo to run {@link org.eclipse.che.dto.generator.DtoGenerator}. */
|
||||
@Mojo(name = "generate", requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
public class DtoGeneratorMojo extends AbstractMojo {
|
||||
|
|
@ -38,10 +40,12 @@ public class DtoGeneratorMojo extends AbstractMojo {
|
|||
@Parameter(property = "che.dto.skip", defaultValue = "false")
|
||||
private boolean skip;
|
||||
|
||||
private static String skippingTheExecution= "Skipping the execution";
|
||||
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException {
|
||||
if (skip) {
|
||||
getLog().info("Skipping the execution");
|
||||
getLog().info(skippingTheExecution);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
|
|||
public class FileStoresMeterBinder implements MeterBinder {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FileStoresMeterBinder.class);
|
||||
private static final String unallocatedSpaceForFileStorage = "Unallocated space for file storage"
|
||||
|
||||
@Override
|
||||
public void bindTo(MeterRegistry registry) {
|
||||
|
|
@ -42,7 +43,7 @@ public class FileStoresMeterBinder implements MeterBinder {
|
|||
|
||||
Gauge.builder("disk.free", fileStore, exceptionToNonWrapper(FileStore::getUnallocatedSpace))
|
||||
.tags(tagsWithPath)
|
||||
.description("Unallocated space for file storage")
|
||||
.description(unallocatedSpaceForFileStorage)
|
||||
.baseUnit("bytes")
|
||||
.strongReference(true)
|
||||
.register(registry);
|
||||
|
|
|
|||
Loading…
Reference in New Issue