Minor javadoc fixes
Signed-off-by: Kevin Risden <krisden@apache.org>
diff --git a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/cm/ClouderaManagerAPIServiceModelGenerator.java b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/cm/ClouderaManagerAPIServiceModelGenerator.java
index 0978362..49559f0 100644
--- a/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/cm/ClouderaManagerAPIServiceModelGenerator.java
+++ b/gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/cm/ClouderaManagerAPIServiceModelGenerator.java
@@ -62,12 +62,12 @@
* discovery client and uses the CM url used by the driver (which was
* populated by the descriptor).
*
- * @param service
- * @param serviceConfig
- * @param role
- * @param roleConfig
- * @return
- * @throws ApiException
+ * @param service Service.
+ * @param serviceConfig Service config.
+ * @param role Role.
+ * @param roleConfig Role config.
+ * @return ServiceModel for given service and role.
+ * @throws ApiException Exception interacting with CM.
*/
@Override
public ServiceModel generateService(ApiService service,
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java b/gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
index aad7b99..575213c 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/DefaultTokenStateService.java
@@ -26,13 +26,13 @@
import org.apache.knox.gateway.services.security.token.impl.JWTToken;
import java.time.Instant;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
/**
* In-Memory authentication token state management implementation.
@@ -311,6 +311,7 @@
* Method that checks if a token's state is a candidate for eviction.
*
* @param tokenId A unique token identifier
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return true, if the associated token state can be evicted; Otherwise, false.
*/
@@ -325,10 +326,9 @@
/**
* Get a list of tokens
*
- * @return
+ * @return List of tokens
*/
protected List<String> getTokens() {
- return tokenExpirations.keySet().stream().collect(Collectors.toList());
+ return new ArrayList<>(tokenExpirations.keySet());
}
-
}
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java b/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
index 852d937..3166901 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/util/TopologyToDescriptor.java
@@ -118,6 +118,9 @@
/**
* Validate topology
+ *
+ * @throws IOException Exception on validating file.
+ * @throws SAXException Exception on parsing XML.
*/
public void validate() throws IOException, SAXException {
validateTopology(SCHEMA_FILE, topologyPath);
@@ -125,6 +128,10 @@
/**
* Convert topology to provider and descriptor
+ *
+ * @throws IOException Exception on validating file.
+ * @throws JAXBException Exception on parsing XML.
+ * @throws SAXException Exception on parsing XML.
*/
public void convert() throws IOException, JAXBException, SAXException {
final Topology topology = parseTopology(SCHEMA_FILE, topologyPath);
diff --git a/gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java b/gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java
index 7b9a82e..e10459b 100644
--- a/gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java
+++ b/gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java
@@ -158,9 +158,7 @@
assertTrue(authority.verifyToken(parsedToken));
}
- /**
- * KNOX-2266
- */
+ // KNOX-2266
@Test
public void testConcurrentGetToken() throws Exception {
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenStateService.java b/gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenStateService.java
index 533cf9d..d89607c 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenStateService.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenStateService.java
@@ -66,8 +66,10 @@
void addToken(String tokenId, long issueTime, long expiration, long maxLifetimeDuration);
/**
+ * Checks if the token is expired.
*
* @param token The token.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return true, if the token has expired; Otherwise, false.
*/
@@ -77,6 +79,7 @@
* Disable any subsequent use of the specified token.
*
* @param token The token.
+ * @throws UnknownTokenException Exception if token is not found.
*/
void revokeToken(JWTToken token) throws UnknownTokenException;
@@ -84,6 +87,7 @@
* Disable any subsequent use of the specified token.
*
* @param tokenId The token unique identifier.
+ * @throws UnknownTokenException Exception if token is not found.
*/
void revokeToken(String tokenId) throws UnknownTokenException;
@@ -91,6 +95,7 @@
* Extend the lifetime of the specified token by the default amount of time.
*
* @param token The token.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's updated expiration time in milliseconds.
*/
@@ -101,6 +106,7 @@
*
* @param token The token.
* @param renewInterval The amount of time that should be added to the token's lifetime.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's updated expiration time in milliseconds.
*/
@@ -110,6 +116,7 @@
* Extend the lifetime of the specified token by the default amount of time.
*
* @param tokenId The token unique identifier.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's updated expiration time in milliseconds.
*/
@@ -120,25 +127,29 @@
*
* @param tokenId The token unique identifier.
* @param renewInterval The amount of time that should be added to the token's lifetime.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's updated expiration time in milliseconds.
*/
long renewToken(String tokenId, long renewInterval) throws UnknownTokenException;
/**
+ * Get the token expiration.
*
* @param token The token.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's expiration time in milliseconds.
*/
long getTokenExpiration(JWT token) throws UnknownTokenException;
/**
+ * Get the token expiration.
*
* @param tokenId The token unique identifier.
+ * @throws UnknownTokenException Exception if token is not found.
*
* @return The token's expiration time in milliseconds.
*/
long getTokenExpiration(String tokenId) throws UnknownTokenException;
-
}
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/services/topology/TopologyService.java b/gateway-spi/src/main/java/org/apache/knox/gateway/services/topology/TopologyService.java
index c700014..12c3220 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/services/topology/TopologyService.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/services/topology/TopologyService.java
@@ -73,8 +73,8 @@
*
* @return A Topology object based on the specified content.
*
- * @throws IOException
- * @throws SAXException
+ * @throws IOException Exception thrown parsing input stream.
+ * @throws SAXException Exception thrown parsing xml.
*/
Topology parse(InputStream content) throws IOException, SAXException;