Skip to content

Commit 18fed31

Browse files
committed
finished adding javadoc
1 parent eb0f98d commit 18fed31

File tree

20 files changed

+336
-101
lines changed

20 files changed

+336
-101
lines changed

service/licensing-service/src/java/com/thoughtmechanix/licenses/hystrix/ThreadLocalAwareStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ public <T> Callable<T> wrapCallable(Callable<T> callable) {
8282
.wrapCallable(new DelegatingUserContextCallable<T>(callable, UserContextHolder.getContext())) // Inject your Callable implementation that will set the UserContext
8383
: super.wrapCallable(new DelegatingUserContextCallable<T>(callable, UserContextHolder.getContext()));
8484
}
85-
}
85+
}

service/licensing-service/src/java/com/thoughtmechanix/licenses/model/Organization.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
* @version 1.0
2626
* @since 1.0
2727
*/
28-
public class Organization implements Serializable {
29-
private static final long serialVersionUID = 1L;
30-
28+
public class Organization implements Serializable {
29+
// Don't add serialVersionUID, it will cause an error when deserialize the organization record from redis.
3130
String id;
3231
String name;
3332
String contactName;

service/licensing-service/src/java/com/thoughtmechanix/licenses/repository/LicenseRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.List;
2424

2525
/**
26-
* The interface for customizing queries to license table
26+
* The interface for customizing queries to license table.
2727
*
2828
* <p>This interface is extending {@code CrudRepository}, so you MUST NOT
2929
* implement the methods in this interface. The Spring JPA repository will

service/organization-service/src/java/com/thoughtmechanix/organization/Application.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
2424
import org.springframework.cloud.stream.annotation.EnableBinding;
2525
import org.springframework.cloud.stream.messaging.Source;
26-
//import org.springframework.cloud.stream.annotation.EnableBinding;
27-
//import org.springframework.cloud.stream.messaging.Source;
2826
import org.springframework.context.annotation.Bean;
29-
//import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
3027
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
3128

3229
import javax.servlet.Filter;
@@ -35,7 +32,7 @@
3532
* The bootstrap class for the organization service.
3633
*
3734
* @author Wuyi Chen
38-
* @date 04/08/2019
35+
* @date 06/10/2019
3936
* @version 1.0
4037
* @since 1.0
4138
*/

service/organization-service/src/java/com/thoughtmechanix/organization/repository/OrganizationRepository.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@
1919
import org.springframework.data.repository.CrudRepository;
2020
import org.springframework.stereotype.Repository;
2121

22+
/**
23+
* The interface for customizing queries to organization table.
24+
*
25+
* <p>This interface is extending {@code CrudRepository}, so you MUST NOT
26+
* implement the methods in this interface. The Spring JPA repository will
27+
* automatically implement the basic functions (save, delete, findOne, etc.)
28+
* in the parent {@code CrudRepository} interface and also implements your
29+
* customized query functions defined in this interface based on the method
30+
* names.
31+
*
32+
* @see <a href="http://docs.spring.io/spring-data/data-jpa/docs/current/reference/html/#jpa.query-methods.query-creation">QueryCreation</a>
33+
*
34+
* @author Wuyi Chen
35+
* @date 06/10/2019
36+
* @version 1.0
37+
* @since 1.0
38+
*/
2239
@Repository
2340
public interface OrganizationRepository extends CrudRepository<Organization,String> {
2441
public Organization findById(String organizationId);

service/organization-service/src/java/com/thoughtmechanix/organization/security/ResourceServerConfiguration.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@
3030
*/
3131
@Configuration
3232
public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {
33-
3433
@Override
3534
public void configure(HttpSecurity http) throws Exception{
3635
http
37-
.authorizeRequests()
38-
// .antMatchers(HttpMethod.DELETE, "/v1/organizations/**")
39-
// .hasRole("ADMIN")
40-
.anyRequest()
41-
.authenticated();
36+
.authorizeRequests()
37+
.anyRequest()
38+
.authenticated();
4239
}
4340
}

service/organization-service/src/java/com/thoughtmechanix/organization/services/OrganizationService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class OrganizationService {
3939
private OrganizationRepository orgRepository; // for database operations
4040

4141
@Autowired
42-
private Tracer tracer; // for sending custom span to zipkin server
42+
private Tracer tracer; // for sending custom span to zipkin server
4343

4444
@Autowired
4545
private SimpleSourceBean simpleSourceBean; // for publishing organization change event to the message queue

service/specialroutes-service/src/java/com/thoughtmechanix/specialroutes/Application.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,23 @@
2424

2525
import javax.servlet.Filter;
2626

27+
/**
28+
* The bootstrap class for the specialroutes service.
29+
*
30+
* @author Wuyi Chen
31+
* @date 04/08/2019
32+
* @version 1.0
33+
* @since 1.0
34+
*/
2735
@SpringBootApplication
2836
@EnableEurekaClient
2937
@EnableCircuitBreaker
3038
public class Application {
39+
/**
40+
* Get a {@code UserContextFilter}.
41+
*
42+
* @return The object of {@code UserContextFilter}.
43+
*/
3144
@Bean
3245
public Filter userContextFilter() {
3346
UserContextFilter userContextFilter = new UserContextFilter();

service/specialroutes-service/src/java/com/thoughtmechanix/specialroutes/controllers/SpecialRoutesServiceController.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,31 @@
2323
import org.springframework.web.bind.annotation.RequestMethod;
2424
import org.springframework.web.bind.annotation.PathVariable;
2525

26+
/**
27+
* The controller class for defining available calls to the API endpoint of
28+
* specialroutes service.
29+
*
30+
* @author Wuyi Chen
31+
* @date 06/10/2019
32+
* @version 1.0
33+
* @since 1.0
34+
*/
2635
@RestController
2736
@RequestMapping(value="v1/route/")
2837
public class SpecialRoutesServiceController {
2938
@Autowired
3039
AbTestingRouteService routeService;
3140

41+
/**
42+
* Provide an alternate endpoint of a service.
43+
*
44+
* @param serviceName
45+
* The name of the service.
46+
*
47+
* @return The alternate endpoint of the service.
48+
*/
3249
@RequestMapping(value = "abtesting/{serviceName}", method = RequestMethod.GET)
3350
public AbTestingRoute abstestings(@PathVariable("serviceName") String serviceName) {
3451
return routeService.getRoute( serviceName);
3552
}
36-
3753
}

service/specialroutes-service/src/java/com/thoughtmechanix/specialroutes/exception/NoRouteFound.java renamed to service/specialroutes-service/src/java/com/thoughtmechanix/specialroutes/exception/NoRouteFoundException.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@
1818
import org.springframework.http.HttpStatus;
1919
import org.springframework.web.bind.annotation.ResponseStatus;
2020

21+
/**
22+
* The exception of not finding the route for a certain service.
23+
*
24+
* @author Wuyi Chen
25+
* @date 06/10/2019
26+
* @version 1.0
27+
* @since 1.0
28+
*/
2129
@ResponseStatus(HttpStatus.NOT_FOUND)
22-
public class NoRouteFound extends RuntimeException{
30+
public class NoRouteFoundException extends RuntimeException{
2331
private static final long serialVersionUID = 1L;
2432
}

0 commit comments

Comments
 (0)