Skip to content

Commit

Permalink
Fix about 90 javadoc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Serega290696 authored and sbeltser committed Oct 4, 2016
1 parent 33db477 commit 5ecf69b
Show file tree
Hide file tree
Showing 108 changed files with 923 additions and 328 deletions.
Expand Up @@ -35,7 +35,7 @@ public interface FileSystemLogEventService {
* Create log user and log group and give them permissions to access * Create log user and log group and give them permissions to access
* logs of application with specific id. * logs of application with specific id.
* *
* @param applicationId the application id * @param appender the appender
* @param config the File log appender config * @param config the File log appender config
* @param path the path to logs directory * @param path the path to logs directory
*/ */
Expand Down
Expand Up @@ -88,7 +88,8 @@ private Properties generateProperties(FlumeNodes parameters) {
} }


@Override @Override
public ListenableFuture<AppendAsyncResultPojo> sendEventToFlumeAsync(Event event) throws EventDeliveryException { public ListenableFuture<AppendAsyncResultPojo> sendEventToFlumeAsync(Event event)
throws EventDeliveryException {
return currentClient.appendAsync(event); return currentClient.appendAsync(event);
} }


Expand Down
Expand Up @@ -42,6 +42,13 @@ public abstract class FlumeClientManager<T> {
private static final Logger LOG = LoggerFactory.getLogger(FlumeClientManager.class); private static final Logger LOG = LoggerFactory.getLogger(FlumeClientManager.class);
protected AsyncRpcClient currentClient = null; protected AsyncRpcClient currentClient = null;


/**
* Create new instance of <code>FlumeClientManager</code>.
*
* @param configuration is configuration of new instance <code>FlumeClientManager</code>
* @param <T> type of <code>FlumeClientManager</code> parameters
* @return new instance of <code>FlumeClientManager</code>
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> FlumeClientManager<T> getInstance(FlumeConfig configuration) { public static <T> FlumeClientManager<T> getInstance(FlumeConfig configuration) {
FlumeClientManager<?> clientManager = null; FlumeClientManager<?> clientManager = null;
Expand Down Expand Up @@ -75,9 +82,15 @@ public static <T> FlumeClientManager<T> getInstance(FlumeConfig configuration) {
public abstract ListenableFuture<AppendAsyncResultPojo> sendEventToFlumeAsync(Event event) public abstract ListenableFuture<AppendAsyncResultPojo> sendEventToFlumeAsync(Event event)
throws EventDeliveryException; throws EventDeliveryException;


public abstract ListenableFuture<AppendBatchAsyncResultPojo> sendEventsToFlumeAsync(List<Event> events) public abstract ListenableFuture<AppendBatchAsyncResultPojo>
sendEventsToFlumeAsync(List<Event> events)
throws EventDeliveryException; throws EventDeliveryException;


/**
* Initialized current client using parameters.
*
* @param parameters is parameters of client
*/
public void init(T parameters) { public void init(T parameters) {
if (parameters != null) { if (parameters != null) {
currentClient = initManager(parameters); currentClient = initManager(parameters);
Expand All @@ -90,6 +103,12 @@ public void init(T parameters) {
} }
} }


/**
* Initialized current client using parameters.
*
* @param parameters is parameters of client
* @param clientThreadPoolSize is amount of client thread pool
*/
public void init(T parameters, int clientThreadPoolSize) { public void init(T parameters, int clientThreadPoolSize) {
if (parameters != null) { if (parameters != null) {
currentClient = initManager(parameters, clientThreadPoolSize); currentClient = initManager(parameters, clientThreadPoolSize);
Expand All @@ -102,6 +121,9 @@ public void init(T parameters, int clientThreadPoolSize) {
} }
} }


/**
* Immediately closes the client and field <code>currentClient</code> assign on null.
*/
public void cleanUp() { public void cleanUp() {
LOG.debug("Close flume rpc client."); LOG.debug("Close flume rpc client.");
if (currentClient != null) { if (currentClient != null) {
Expand Down
Expand Up @@ -22,6 +22,12 @@ public class AppendAsyncResultPojo {
public boolean isSuccessful; public boolean isSuccessful;
public Event event; public Event event;


/**
* Create new instance of <code>AppendBatchAsyncResultPojo</code>.
*
* @param isSuccessful is represent successful or not the result
* @param event the event
*/
public AppendAsyncResultPojo(boolean isSuccessful, Event event) { public AppendAsyncResultPojo(boolean isSuccessful, Event event) {
super(); super();
this.isSuccessful = isSuccessful; this.isSuccessful = isSuccessful;
Expand Down
Expand Up @@ -24,6 +24,12 @@ public class AppendBatchAsyncResultPojo {
public boolean isSuccessful; public boolean isSuccessful;
public List<Event> events; public List<Event> events;


/**
* Create new instance of <code>AppendBatchAsyncResultPojo</code>.
*
* @param isSuccessful is represent successful or not the result
* @param events is <code>List</code> of events
*/
public AppendBatchAsyncResultPojo(boolean isSuccessful, List<Event> events) { public AppendBatchAsyncResultPojo(boolean isSuccessful, List<Event> events) {
super(); super();
this.isSuccessful = isSuccessful; this.isSuccessful = isSuccessful;
Expand Down
Expand Up @@ -25,7 +25,8 @@
import java.util.List; import java.util.List;


public interface AsyncRpcClient extends RpcClient { public interface AsyncRpcClient extends RpcClient {
public ListenableFuture<AppendAsyncResultPojo> appendAsync(Event event) throws EventDeliveryException; public ListenableFuture<AppendAsyncResultPojo> appendAsync(Event event)
throws EventDeliveryException;


public ListenableFuture<AppendBatchAsyncResultPojo> appendBatchAsync(List<Event> events) public ListenableFuture<AppendBatchAsyncResultPojo> appendBatchAsync(List<Event> events)
throws EventDeliveryException; throws EventDeliveryException;
Expand Down
Expand Up @@ -41,6 +41,12 @@ public class AvroAsyncRpcClient implements AsyncRpcClient {
ArrayBlockingQueue<RpcClient> clientQueue; ArrayBlockingQueue<RpcClient> clientQueue;
ListeningExecutorService executorService; ListeningExecutorService executorService;


/**
* Create new instance of <code>AvroAsyncRpcClient</code>.
*
* @param starterProp the properties of starter
* @param numberOfClientThreads is number of client's threads
*/
public AvroAsyncRpcClient(Properties starterProp, int numberOfClientThreads) { public AvroAsyncRpcClient(Properties starterProp, int numberOfClientThreads) {
clientQueue = new ArrayBlockingQueue<RpcClient>(numberOfClientThreads); clientQueue = new ArrayBlockingQueue<RpcClient>(numberOfClientThreads);


Expand All @@ -54,6 +60,13 @@ public AvroAsyncRpcClient(Properties starterProp, int numberOfClientThreads) {
.listeningDecorator(Executors.newFixedThreadPool(numberOfClientThreads)); .listeningDecorator(Executors.newFixedThreadPool(numberOfClientThreads));
} }


/**
* Create new instance of <code>AvroAsyncRpcClient</code>.
*
* @param hostname the RPC hostname, use it to create RPC client
* @param port the RPC port, use it to create RPC client
* @param numberOfThreads is number of client's threads
*/
public AvroAsyncRpcClient(String hostname, Integer port, int numberOfThreads) { public AvroAsyncRpcClient(String hostname, Integer port, int numberOfThreads) {
int numberOfClientThreads = numberOfThreads; int numberOfClientThreads = numberOfThreads;


Expand All @@ -69,6 +82,12 @@ public AvroAsyncRpcClient(String hostname, Integer port, int numberOfThreads) {
.listeningDecorator(Executors.newFixedThreadPool(numberOfClientThreads)); .listeningDecorator(Executors.newFixedThreadPool(numberOfClientThreads));
} }


/**
* Async append event to RPC client, return listenable future.
*
* @param event to adding by RPC
* @return listenable future
*/
public ListenableFuture<AppendAsyncResultPojo> appendAsync(final Event event) public ListenableFuture<AppendAsyncResultPojo> appendAsync(final Event event)
throws EventDeliveryException { throws EventDeliveryException {
ListenableFuture<AppendAsyncResultPojo> future = executorService.submit( ListenableFuture<AppendAsyncResultPojo> future = executorService.submit(
Expand All @@ -83,6 +102,12 @@ public AppendAsyncResultPojo call() throws Exception {
return future; return future;
} }


/**
* Async append some events to RPC client, return listenable future.
*
* @param events to adding by RPC
* @return listenable future
*/
public ListenableFuture<AppendBatchAsyncResultPojo> appendBatchAsync(final List<Event> events) public ListenableFuture<AppendBatchAsyncResultPojo> appendBatchAsync(final List<Event> events)
throws EventDeliveryException { throws EventDeliveryException {
ListenableFuture<AppendBatchAsyncResultPojo> future = executorService ListenableFuture<AppendBatchAsyncResultPojo> future = executorService
Expand Down
Expand Up @@ -17,15 +17,12 @@
package org.kaaproject.kaa.server.appenders.mongo.appender; package org.kaaproject.kaa.server.appenders.mongo.appender;


import static com.mongodb.util.JSON.parse; import static com.mongodb.util.JSON.parse;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoDaoUtil.decodeReservedCharacteres;
import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoDaoUtil.encodeReservedCharacteres; import static org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoDaoUtil.encodeReservedCharacteres;


import com.mongodb.DBObject; import com.mongodb.DBObject;
import com.mongodb.util.JSON;


import org.kaaproject.kaa.common.dto.logs.LogEventDto; import org.kaaproject.kaa.common.dto.logs.LogEventDto;
import org.kaaproject.kaa.server.common.log.shared.appender.data.ProfileInfo; import org.kaaproject.kaa.server.common.log.shared.appender.data.ProfileInfo;
import org.kaaproject.kaa.server.common.nosql.mongo.dao.model.MongoDaoUtil;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;


Expand All @@ -47,6 +44,14 @@ public LogEvent() {


} }


/**
* Create new instance of <code>LogEvent</code>.
*
* @param dto data transfer object, that contain id, header and event. use these data to
* assign on appropriate field
* @param clientProfile the client profile info
* @param serverProfile the server profile info
*/
public LogEvent(LogEventDto dto, ProfileInfo clientProfile, ProfileInfo serverProfile) { public LogEvent(LogEventDto dto, ProfileInfo clientProfile, ProfileInfo serverProfile) {
this.id = dto.getId(); this.id = dto.getId();
this.header = encodeReservedCharacteres((DBObject) parse(dto.getHeader())); this.header = encodeReservedCharacteres((DBObject) parse(dto.getHeader()));
Expand Down
Expand Up @@ -25,7 +25,8 @@ public interface LogEventDao {


void createCollection(String collectionName); void createCollection(String collectionName);


List<LogEvent> save(List<LogEventDto> logEventDtos, ProfileInfo clientProfile, ProfileInfo serverProfile, String collectionName); List<LogEvent> save(List<LogEventDto> logEventDtos, ProfileInfo clientProfile,
ProfileInfo serverProfile, String collectionName);


void removeAll(String collectionName); void removeAll(String collectionName);


Expand Down
Expand Up @@ -47,6 +47,13 @@ public class LogEventMongoDao implements LogEventDao {
private MongoClient mongoClient; private MongoClient mongoClient;
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;


/**
* Create new instance of <code>LogEventMongoDao</code> using configuration instance of
* <code>MongoDbConfig</code>.
*
* @param configuration the configuration of log event mongo dao, it contain server size,
* credentials, max wait time, etc.
*/
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public LogEventMongoDao(MongoDbConfig configuration) throws Exception { public LogEventMongoDao(MongoDbConfig configuration) throws Exception {


Expand Down
Expand Up @@ -58,7 +58,7 @@
import org.kaaproject.kaa.common.dto.credentials.CredentialsStatus; import org.kaaproject.kaa.common.dto.credentials.CredentialsStatus;
import org.kaaproject.kaa.common.dto.ctl.CTLSchemaDto; import org.kaaproject.kaa.common.dto.ctl.CTLSchemaDto;
import org.kaaproject.kaa.common.dto.ctl.CTLSchemaExportMethod; import org.kaaproject.kaa.common.dto.ctl.CTLSchemaExportMethod;
import org.kaaproject.kaa.common.dto.ctl.CTLSchemaMetaInfoDto; import org.kaaproject.kaa.common.dto.ctl.CtlSchemaMetaInfoDto;
import org.kaaproject.kaa.common.dto.event.AefMapInfoDto; import org.kaaproject.kaa.common.dto.event.AefMapInfoDto;
import org.kaaproject.kaa.common.dto.event.ApplicationEventFamilyMapDto; import org.kaaproject.kaa.common.dto.event.ApplicationEventFamilyMapDto;
import org.kaaproject.kaa.common.dto.event.EcfInfoDto; import org.kaaproject.kaa.common.dto.event.EcfInfoDto;
Expand Down Expand Up @@ -97,7 +97,6 @@
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
Expand Down Expand Up @@ -1042,39 +1041,39 @@ public boolean checkFqnExistsWithAppToken(String fqn, String tenantId,
} }
} }


public CTLSchemaMetaInfoDto promoteScopeToTenant(String applicationId, String fqn) { public CtlSchemaMetaInfoDto promoteScopeToTenant(String applicationId, String fqn) {
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("applicationId", applicationId); params.add("applicationId", applicationId);
params.add("fqn", fqn); params.add("fqn", fqn);
return restTemplate.postForObject(restTemplate.getUrl() + "CTL/promoteScopeToTenant", return restTemplate.postForObject(restTemplate.getUrl() + "CTL/promoteScopeToTenant",
params, CTLSchemaMetaInfoDto.class); params, CtlSchemaMetaInfoDto.class);
} }


//CHECKSTYLE:OFF //CHECKSTYLE:OFF
public List<CTLSchemaMetaInfoDto> getSystemLevelCTLSchemas() { public List<CtlSchemaMetaInfoDto> getSystemLevelCTLSchemas() {
//CHECKSTYLE:ON //CHECKSTYLE:ON
ResponseEntity<List<CTLSchemaMetaInfoDto>> entity = restTemplate.exchange( ResponseEntity<List<CtlSchemaMetaInfoDto>> entity = restTemplate.exchange(
restTemplate.getUrl() + "CTL/getSystemSchemas", restTemplate.getUrl() + "CTL/getSystemSchemas",
HttpMethod.GET, null, new ParameterizedTypeReference<List<CTLSchemaMetaInfoDto>>() {}); HttpMethod.GET, null, new ParameterizedTypeReference<List<CtlSchemaMetaInfoDto>>() {});
return entity.getBody(); return entity.getBody();
} }


//CHECKSTYLE:OFF //CHECKSTYLE:OFF
public List<CTLSchemaMetaInfoDto> getTenantLevelCTLSchemas() { public List<CtlSchemaMetaInfoDto> getTenantLevelCTLSchemas() {
//CHECKSTYLE:ON //CHECKSTYLE:ON
ResponseEntity<List<CTLSchemaMetaInfoDto>> entity = restTemplate.exchange( ResponseEntity<List<CtlSchemaMetaInfoDto>> entity = restTemplate.exchange(
restTemplate.getUrl() + "CTL/getTenantSchemas", restTemplate.getUrl() + "CTL/getTenantSchemas",
HttpMethod.GET, null, new ParameterizedTypeReference<List<CTLSchemaMetaInfoDto>>() {}); HttpMethod.GET, null, new ParameterizedTypeReference<List<CtlSchemaMetaInfoDto>>() {});
return entity.getBody(); return entity.getBody();
} }


//CHECKSTYLE:OFF //CHECKSTYLE:OFF
public List<CTLSchemaMetaInfoDto> getApplicationLevelCTLSchemasByAppToken( public List<CtlSchemaMetaInfoDto> getApplicationLevelCTLSchemasByAppToken(
String applicationToken) { String applicationToken) {
//CHECKSTYLE:ON //CHECKSTYLE:ON
ResponseEntity<List<CTLSchemaMetaInfoDto>> entity = restTemplate.exchange( ResponseEntity<List<CtlSchemaMetaInfoDto>> entity = restTemplate.exchange(
restTemplate.getUrl() + "CTL/getApplicationSchemas/" + applicationToken, restTemplate.getUrl() + "CTL/getApplicationSchemas/" + applicationToken,
HttpMethod.GET, null, new ParameterizedTypeReference<List<CTLSchemaMetaInfoDto>>() {}); HttpMethod.GET, null, new ParameterizedTypeReference<List<CtlSchemaMetaInfoDto>>() {});
return entity.getBody(); return entity.getBody();
} }


Expand Down
Expand Up @@ -53,6 +53,11 @@ public class HttpComponentsRequestFactoryBasicAuth extends HttpComponentsClientH
private HttpHost host; private HttpHost host;
private CredentialsProvider credsProvider; private CredentialsProvider credsProvider;


/**
* Create new instance of <code>HttpComponentsRequestFactoryBasicAuth</code>.
*
* @param host the http host
*/
public HttpComponentsRequestFactoryBasicAuth(HttpHost host) { public HttpComponentsRequestFactoryBasicAuth(HttpHost host) {
super(createHttpClient()); super(createHttpClient());
this.host = host; this.host = host;
Expand Down Expand Up @@ -89,6 +94,12 @@ public CredentialsProvider getCredentialsProvider() {
return credsProvider; return credsProvider;
} }


/**
* Set credentials to field <code>credsProvider</code>.
*
* @param username the username, part of credentials
* @param password the password, part of credentials
*/
public void setCredentials(String username, String password) { public void setCredentials(String username, String password) {
credsProvider.setCredentials( credsProvider.setCredentials(
new AuthScope(host.getHostName(), host.getPort(), AuthScope.ANY_REALM), new AuthScope(host.getHostName(), host.getPort(), AuthScope.ANY_REALM),
Expand Down
Expand Up @@ -18,7 +18,7 @@


import org.apache.avro.Schema; import org.apache.avro.Schema;
import org.kaaproject.kaa.common.dto.ctl.CTLSchemaDto; import org.kaaproject.kaa.common.dto.ctl.CTLSchemaDto;
import org.kaaproject.kaa.common.dto.ctl.CTLSchemaMetaInfoDto; import org.kaaproject.kaa.common.dto.ctl.CtlSchemaMetaInfoDto;
import org.kaaproject.kaa.common.dto.file.FileData; import org.kaaproject.kaa.common.dto.file.FileData;


import java.util.List; import java.util.List;
Expand Down Expand Up @@ -52,9 +52,9 @@ public interface CtlService {
* Update existing CTL schema meta info scope by the given CTL schema meta info object. * Update existing CTL schema meta info scope by the given CTL schema meta info object.
* *
* @param ctlSchemaMetaInfo the CTL schema meta info object. * @param ctlSchemaMetaInfo the CTL schema meta info object.
* @return CTLSchemaMetaInfoDto the updated CTL schema meta info object. * @return CtlSchemaMetaInfoDto the updated CTL schema meta info object.
*/ */
CTLSchemaMetaInfoDto updateCtlSchemaMetaInfoScope(CTLSchemaMetaInfoDto ctlSchemaMetaInfo); CtlSchemaMetaInfoDto updateCtlSchemaMetaInfoScope(CtlSchemaMetaInfoDto ctlSchemaMetaInfo);


/** /**
* Find CTL schema meta infos which are the application level siblings to the CTL * Find CTL schema meta infos which are the application level siblings to the CTL
Expand All @@ -65,7 +65,7 @@ public interface CtlService {
* @param applicationId the application identifier. * @param applicationId the application identifier.
* @return the CTL schema meta information objects which are the siblings to the given CTL. * @return the CTL schema meta information objects which are the siblings to the given CTL.
*/ */
List<CTLSchemaMetaInfoDto> findSiblingsByFqnTenantIdAndApplicationId( List<CtlSchemaMetaInfoDto> findSiblingsByFqnTenantIdAndApplicationId(
String fqn, String tenantId, String applicationId); String fqn, String tenantId, String applicationId);


/** /**
Expand Down Expand Up @@ -143,7 +143,7 @@ CTLSchemaDto findAnyCtlSchemaByFqnAndVerAndTenantIdAndApplicationId(
* *
* @return the list of available system CTL schemas meta info in the database. * @return the list of available system CTL schemas meta info in the database.
*/ */
List<CTLSchemaMetaInfoDto> findSystemCtlSchemasMetaInfo(); List<CtlSchemaMetaInfoDto> findSystemCtlSchemasMetaInfo();


/** /**
* Find available CTL schemas meta info for tenant(include * Find available CTL schemas meta info for tenant(include
Expand All @@ -152,7 +152,7 @@ CTLSchemaDto findAnyCtlSchemaByFqnAndVerAndTenantIdAndApplicationId(
* @param tenantId the tenant identifier. * @param tenantId the tenant identifier.
* @return the list of available CTL schemas meta info for tenant with given identifier. * @return the list of available CTL schemas meta info for tenant with given identifier.
*/ */
List<CTLSchemaMetaInfoDto> findAvailableCtlSchemasMetaInfoForTenant(String tenantId); List<CtlSchemaMetaInfoDto> findAvailableCtlSchemasMetaInfoForTenant(String tenantId);


/** /**
* Find available CTL schemas meta info for application(include * Find available CTL schemas meta info for application(include
Expand All @@ -162,7 +162,7 @@ CTLSchemaDto findAnyCtlSchemaByFqnAndVerAndTenantIdAndApplicationId(
* @param applicationId the application identifier. * @param applicationId the application identifier.
* @return the list of available CTL schemas meta info for application with given identifier. * @return the list of available CTL schemas meta info for application with given identifier.
*/ */
List<CTLSchemaMetaInfoDto> findAvailableCtlSchemasMetaInfoForApplication( List<CtlSchemaMetaInfoDto> findAvailableCtlSchemasMetaInfoForApplication(
String tenantId, String applicationId); String tenantId, String applicationId);


/** /**
Expand Down

0 comments on commit 5ecf69b

Please sign in to comment.