Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Fixed javadocs #283

Merged
merged 2 commits into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nb-configuration.xml
/.idea
*.iml
.classpath
Expand Down
24 changes: 18 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,25 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<tags>
<tag>
<name>todo</name>
<placement>X</placement>
</tag>
<tag>
<name>checkstyle</name>
<placement>X</placement>
</tag>
</tags>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/amihaiemil/charles/aws/AmazonElasticSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public AmazonElasticSearch(final String indexName) {
/**
* ctor.
* @param indexName Name of the Es index where the pages will be exported.
* @param accessKey Aws access key.
* @param accesskey Aws access key.
* @param secretKey Aws secret key.
* @param reg AWS ElasticSearch region.
* @param es ElasticSearch URL.
Expand Down Expand Up @@ -175,11 +175,6 @@ public void export(List<WebPage> pages) throws DataExportException {
}
}

/**
* Make a HEAD request and check if the elasticsearch
* index exists.
* @return True if the index exists, false otherwise.
*/
@Override
public boolean exists() {
final AwsHttpRequest<Boolean> head =
Expand All @@ -206,10 +201,7 @@ public boolean exists() {
}
return exists;
}
/**
* Delete the elasticsearch index.
* @param name Name of the index.
*/

@Override
public void delete() {
final AwsHttpRequest<HttpResponse> deleteIndex =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public interface ElasticSearch extends Repository {
* Delete a single document from this index.
* @param type Type withing index.
* @param id Id of the document.
* @see https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-delete.html
* @see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-delete.html">ElasticSearch API</a>
*/
void delete(final String type, final String id);

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/amihaiemil/charles/aws/EsBulkJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class EsBulkJson {
* @param pages Given web pages.
*/
public EsBulkJson(String index, List<WebPage> pages) {
if(pages == null || pages.size() == 0) {
if(pages == null || pages.isEmpty()) {
throw new IllegalArgumentException("There must be at least 1 page!");
}
this.pages = pages;
Expand All @@ -67,7 +67,6 @@ public EsBulkJson(String index, List<WebPage> pages) {

/**
* Pepare the json structure for bulk indexing.
* @param docs The json documents to be indexed.
* @return The json structure as a String.
* @throws IOException If something goes wrong while parsing.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/amihaiemil/charles/aws/SearchQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public SearchQuery() {
}
/**
* Ctor.
* @param content
* @param category
* @param index
* @param nr
* @param content Keywords.
* @param category Category.
* @param index Index to start at.
* @param nr Number of results per page.
*/
public SearchQuery(String content, String category, int index, int nr) {
this.content = content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public final class AwsHead<T> extends AwsHttpRequest<T> {
/**
* Ctor.
* @param req Base AwsHttpRequest.
* @param content InputStream containing this request's content.
*/
public AwsHead(AwsHttpRequest<T> req) {
this.base = req;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
* @author Mihai Andronache ([email protected])
* @version $Id$
* @since 1.0.0
*
*/
public abstract class AwsHttpRequest<T> {

/**
* Perform this request.
* @return T type of response.
*/
public abstract T perform();

Expand All @@ -58,13 +58,13 @@ public abstract class AwsHttpRequest<T> {
*/
static class FakeAwsHttpRequest extends AwsHttpRequest<String>{

private Request<Void> fakeRq;
private final Request<Void> fakeRq;

public FakeAwsHttpRequest() {
this.fakeRq = new DefaultRequest<>("fake");
this.fakeRq.setEndpoint(
URI.create("http://localhost:8080/test")
);
this.fakeRq = new DefaultRequest<>("fake");
this.fakeRq.setEndpoint(
URI.create("http://localhost:8080/test")
);
}
@Override
public String perform() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public final class EsHttpRequest<T> extends AwsHttpRequest<T> {
* @param esEdp ElasticSearch URL.
* @param uri REST path to the desired ElasticSearch endpoint.
* @param respHandler Response handler.
* @param errHandle Error handler.
* @param errHandler Error handler.
*/
public EsHttpRequest(
EsEndPoint esEdp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class SignedRequest<T> extends AwsHttpRequest<T> {
/**
* Ctor.
* @param req Request to sign.
* @param accesskey Key to sign with.
* @param secretKey Secret to sign with.
* @param reg Request to sign.
*/
public SignedRequest(
final AwsHttpRequest<T> req,
Expand Down Expand Up @@ -106,12 +109,12 @@ private static class AwsCredentialsFromSystem implements AWSCredentials {
/**
* AWS access key.
*/
private AccessKeyId accesskey;
private final AccessKeyId accesskey;

/**
* Aws secret key;
*/
private SecretKey secretKey;
private final SecretKey secretKey;

private AwsCredentialsFromSystem(final AccessKeyId accesskey, final SecretKey secret) {
this.accesskey = accesskey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public AuthorOwnerCheck(final Step onTrue, final Step onFalse) {

/**
* Check that the author of a command is owner of the repo.
* @return true if the check is successful, false otherwise
*/
@Override
public void perform(Command command, Logger logger) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public boolean isOwnedByOrganization() throws IOException {
/**
* The charles.yml file contained in the repo.
* @return {@link CharlesYml}
* @throws IOException
* @throws IOException If something goes wrong while reading .charles.yml.
*/
public CharlesYml charlesYml() throws IOException {
if(this.yml == null) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/amihaiemil/charles/github/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public JsonObject json() {

/**
* Specify the comment json of this command.
* @param com
* @param com Json comment.
*/
protected void comment(JsonObject com) {
this.comment = com;
Expand All @@ -113,7 +113,7 @@ public Issue issue() {
/**
* Username of the Github agent.
* @return Github agent's String username.
* @throws IOException
* @throws IOException If something goes wrong.
*/
public String agentLogin() throws IOException {
return this.issue.repo()
Expand All @@ -140,10 +140,10 @@ public String authorLogin() {
public String authorEmail() throws IOException {
String email = "";
User author = this.issue
.repo()
.github()
.users()
.get(this.authorLogin());
.repo()
.github()
.users()
.get(this.authorLogin());
for(final String address : author.emails().iterate()) {
email = address;
}
Expand All @@ -155,7 +155,7 @@ public String authorEmail() throws IOException {
* @return Json membership as described
* <a href="https://developer.github.com/v3/orgs/members/#get-organization-membership">here</a>
* or an empty Json object if the repo owner is not an organization.
* @throws IOException
* @throws IOException If something goes wrong.
*/
public JsonObject authorOrgMembership() throws IOException {
if(this.repo().isOwnedByOrganization()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public final class IndexExistsCheck extends PreconditionCheckStep {

/**
* Constructor.
* @param index Index name.
* @param onTrue The step to perform on successful check.
* @param onFalse the step to perform in unsuccessful check.
*/
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/amihaiemil/charles/github/IndexSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ public void perform(Command command, Logger logger) throws IOException {

/**
* Builds a retriable graph crawl.
* @return RetriableWebCrawl
* @throws IOException
* @param command Initial command given by the user.
* @param logger The action's Logger.
* @return RetriableWebCrawl a WebCrawl which will retry a few times if
* something goes wrong.
* @throws IOException If something goes wrong.
*/
public WebCrawl graphCrawl(Command command, Logger logger) throws IOException {
String repoName = command.repo().name();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amihaiemil/charles/github/IndexStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected WebDriver chromeDriver() {

/**
* Use firefox to fetch web content.
* @return
* @return Webdriver.
*/
protected WebDriver firefoxDriver() {
return new FirefoxDriver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
package com.amihaiemil.charles.github;

/**
* LogsLocation which will return the address of an Action's log file.
* @see https://github.com/amihaiemil/charles-github-ejb/issues/36
* LogsLocation which will return the address of an Action's log file.
* @author Mihai Andronache ([email protected])
* @version $Id$
* @since 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ public RepoForkCheck(final Step onTrue, final Step onFalse) {
super(onTrue, onFalse);
}

/**
* Check whether the repo is a fork or not.
* @returns true if the repo is NOT a fork, false otherwise.
*/

@Override
public void perform(Command command, Logger logger) throws IOException {
logger.info("Checking whether the repository is a fork...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ public RepoNameCheck(final Step onTrue, final Step onFalse) {
super(onTrue, onFalse);
}

/**
* Check that the repo's name respects the format owner.github.io
* @return true if the check is successful, false otherwise
*/
@Override
public void perform(Command command, Logger logger) throws IOException {
logger.info("Checking repository name... ");
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/amihaiemil/charles/github/StarRepo.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ public class StarRepo extends IntermediaryStep {
public StarRepo(final Step next) {
super(next);
}

/**
* Star the repository.
* @return Always returns true, since it's not a critical step.
*/

@Override
public void perform(Command command, Logger logger) throws IOException {
try {
logger.info("Starring repository...");
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/amihaiemil/charles/github/Step.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
*/
public interface Step {

/**
* Perform this step.
* @param command Command that triggered the action.
* @param logger The Action's logger.
/**
* Perform this step.
* @param command Command that triggered the action.
* @param logger The Action's logger.
* @throws IOException If there is anything wrong in the communication
* with Github.
*/
*/
void perform(Command command, Logger logger) throws IOException;

/**
Expand All @@ -69,13 +69,13 @@ public FinalStep() {

/**
* Ctor.
* @param logger Logger.
* @param message Message to log at the end of the action.
*/
public FinalStep(String message) {
this.message = message;
}

@Override
public void perform(Command command, Logger logger) {
logger.info(message);
}
Expand All @@ -89,7 +89,7 @@ public final static class Fake implements Step {
/**
* Should this step's perform pass or throw an exception?
*/
private boolean pass;
private final boolean pass;

/**
* Ctor.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/amihaiemil/charles/github/Steps.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
*/
public interface Steps {

/**
* Perform this step.
* @param Action logger.
/**
* Perform this step.
* @param logger Action logger.
* @throws IOException If there is anything wrong in the communication
* with Github.
*/
*/
void perform(Logger logger) throws IOException;
}
2 changes: 1 addition & 1 deletion src/main/java/com/amihaiemil/charles/github/StepsTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public StepsTree(Step steps, Command command, LogsLocation logs) {
* Constructor.
* @param steps Given steps.
* @param command Command which triggered the action.
* @param logs Logs' location.
* @param fm Failure message.
*/
public StepsTree(Step steps, Command command, SendReply fm) {
Expand All @@ -92,6 +91,7 @@ public StepsTree(Step steps, Command command, SendReply fm) {
/**
* Perform all the given steps.
* @param logger Action logger.
* @throws IOException If something goes wrong.
*/
@Override
public void perform(Logger logger) throws IOException {
Expand Down
Loading