Skip to content

Commit

Permalink
add javadocs and remove the checkstyle suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 4, 2013
1 parent 00822be commit 98d583c
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 172 deletions.
7 changes: 0 additions & 7 deletions fcrepo-auth-oauth/checkstyle-suppressions.xml

This file was deleted.

8 changes: 0 additions & 8 deletions fcrepo-auth-oauth/pom.xml
Expand Up @@ -154,14 +154,6 @@
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<consoleOutput>true</consoleOutput>
<configLocation>fcrepo-checkstyle/checkstyle.xml</configLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
Expand Up @@ -32,6 +32,11 @@ public class Decision implements OAuthDecision {

private boolean isAuthorized;

/**
* Initialize the decision for a client and principal
* @param client
* @param principal
*/
public Decision(final String client, final String principal) {
this.oAuthClient = new OAuthClient() {

Expand Down Expand Up @@ -66,6 +71,10 @@ public boolean isAuthorized() {
return isAuthorized;
}

/**
* Set whether the principal is authorized
* @param isAuthorized
*/
public void setAuthorized(final boolean isAuthorized) {
this.isAuthorized = isAuthorized;
}
Expand Down
Expand Up @@ -86,6 +86,10 @@ public OAuthDecision validateRequest(final String rsId, final String token,
return null;
}

/**
* Test wiring, so w e can set the sessionFactory field without spring
* @param sessionFactory
*/
public void setSessionFactory(final SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
Expand Down
Expand Up @@ -76,9 +76,8 @@ public class AuthzEndpoint extends AbstractResource {
* @throws RepositoryException
*/
@GET
public Response getAuthorization(@Context
final HttpServletRequest request) throws URISyntaxException,
OAuthSystemException, RepositoryException {
public Response getAuthorization(@Context final HttpServletRequest request)
throws URISyntaxException, OAuthSystemException, RepositoryException {

OAuthAuthzRequest oauthRequest = null;

Expand Down
Expand Up @@ -86,9 +86,8 @@ public class TokenEndpoint extends AbstractResource {
@POST
@Consumes(APPLICATION_FORM_URLENCODED)
@Produces(APPLICATION_JSON)
public Response getToken(@Context
final HttpServletRequest request) throws OAuthSystemException,
RepositoryException {
public Response getToken(@Context final HttpServletRequest request) throws
OAuthSystemException, RepositoryException {
LOGGER.debug("Received request for token carried on request: {}",
request);
OAuthTokenRequest oauthRequest = null;
Expand Down Expand Up @@ -244,6 +243,10 @@ private boolean isNotValid() {
return false;
}

/**
* Create the OAuth workspace in JCR to store all our tokens
* @throws RepositoryException
*/
@PostConstruct
public void init() throws RepositoryException {
createOauthWorkspace(sessions);
Expand Down
Expand Up @@ -35,9 +35,8 @@ public class Util {
* @param sessionFactory
* @throws RepositoryException
*/
public static void
createOauthWorkspace(final SessionFactory sessionFactory)
throws RepositoryException {
public static void createOauthWorkspace(final SessionFactory sessionFactory)
throws RepositoryException {
final Session session = sessionFactory.getSession();
try {
if (!copyOf(session.getWorkspace().getAccessibleWorkspaceNames())
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -64,12 +64,20 @@ public class OAuthFilter implements Filter {

private Set<ParameterStyle> parameterStyles;

/**
* no-op
*/
@PostConstruct
public void init() {
LOGGER.debug("Initializing {}", getClass().getName());

}

/**
* no-op
* @param filterConfig
* @throws ServletException
*/
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
init();
Expand Down Expand Up @@ -131,6 +139,9 @@ public Principal getUserPrincipal() {

}

/**
* noop
*/
@Override
public void destroy() {

Expand Down Expand Up @@ -196,8 +207,7 @@ public void setProvider(final OAuthRSProvider provider) {
/**
* @param parameterStylesSet
*/
public void
setParameterStyles(final Set<ParameterStyle> parameterStylesSet) {
public void setParameterStyles(final Set<ParameterStyle> parameterStylesSet) {
this.parameterStyles = parameterStylesSet;
}

Expand Down
Expand Up @@ -47,6 +47,9 @@ public void init(final FilterConfig filterConfig) throws ServletException {
init();
}

/**
* no-op
*/
@PostConstruct
public void init() {
LOGGER.debug("Initialized {}", this.getClass().getName());
Expand Down

0 comments on commit 98d583c

Please sign in to comment.