You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2016/03/15 00:20:09 UTC
[4/5] karaf git commit: KARAF-4392 - Upgrade to maven-javadoc-plugin
2.10.3 and clean javadoc comments
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index e5bb14e..b85b68c 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -989,6 +989,12 @@ public class FeaturesServiceImpl implements FeaturesService, Deployer.DeployCall
* The reason is that if the console is refreshed, the current thread which is running
* the command may be interrupted while waiting for the refresh to be done, leading
* to bundles not being started after the refresh.
+ *
+ * @param requirements the provided requirements to match.
+ * @param stateChanges the current features state.
+ * @param state the current provisioning state.
+ * @param options the provisioning options.
+ * @throws Exception in case of provisioning failure.
*/
public void doProvisionInThread(final Map<String, Set<String>> requirements,
final Map<String, Map<String, FeatureState>> stateChanges,
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java
index 4e171e1..c703fd0 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/Overrides.java
@@ -50,23 +50,24 @@ public final class Overrides {
}
/**
- * Compute a list of bundles to install, taking into account overrides.
- * <p/>
- * The file containing the overrides will be loaded from the given url.
+ * <p>Compute a list of bundles to install, taking into account overrides</p>.
+ *
+ * <p>The file containing the overrides will be loaded from the given url.
* Blank lines and lines starting with a '#' will be ignored, all other lines
- * are considered as urls to override bundles.
- * <p/>
- * The list of resources to resolve will be scanned and for each bundle,
- * if a bundle override matches that resource, it will be used instead.
- * <p/>
- * Matching is done on bundle symbolic name (they have to be the same)
+ * are considered as urls to override bundles.</p>
+ *
+ * <p>The list of resources to resolve will be scanned and for each bundle,
+ * if a bundle override matches that resource, it will be used instead.</p>
+ *
+ * <p>Matching is done on bundle symbolic name (they have to be the same)
* and version (the bundle override version needs to be greater than the
* resource to be resolved, and less than the next minor version. A range
* directive can be added to the override url in which case, the matching
- * will succeed if the resource to be resolved is within the given range.
+ * will succeed if the resource to be resolved is within the given range.</p>
*
* @param resources the list of resources to resolve
* @param overrides list of bundle overrides
+ * @param <T> the resource type.
*/
public static <T extends Resource> void override(Map<String, T> resources, Collection<String> overrides) {
// Do override replacement
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/features/core/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
index 99cb12f..7f32943 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
@@ -35,7 +35,11 @@ public final class RequirementSort<T extends Resource> {
}
/**
- * Sorts {@link Resource} based on their {@link Requirement}s and {@link Capability}s.
+ * Sort {@link Resource} based on their {@link Requirement}s and {@link Capability}s.
+ *
+ * @param resources the resource to sort.
+ * @param <T> the resources type.
+ * @return sorted collection of resources.
*/
public static <T extends Resource> Collection<T> sort(Collection<T> resources) {
Set<String> namespaces = new HashSet<String>();
@@ -58,7 +62,6 @@ public final class RequirementSort<T extends Resource> {
return sorted;
}
-
private static <T extends Resource> void visit(T resource, Set<T> visited, Set<T> sorted, CapabilitySet capSet) {
if (!visited.add(resource)) {
return;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/features/core/src/main/java/org/apache/karaf/features/internal/util/ChecksumUtils.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/util/ChecksumUtils.java b/features/core/src/main/java/org/apache/karaf/features/internal/util/ChecksumUtils.java
index 931d5dd..bcd3ca5 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/util/ChecksumUtils.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/util/ChecksumUtils.java
@@ -32,6 +32,7 @@ public final class ChecksumUtils {
*
* @param is the input stream
* @return a checksum identifying any change
+ * @throws IOException in case of checksum failure.
*/
public static long checksum(InputStream is) throws IOException {
CRC32 crc = new CRC32();
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java
----------------------------------------------------------------------
diff --git a/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java b/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java
index bebbd29..eddc647 100644
--- a/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java
+++ b/http/src/main/java/org/apache/karaf/http/core/HttpMBean.java
@@ -27,8 +27,8 @@ public interface HttpMBean {
/**
* List details for servlets.
*
- * @return a tabular view of the servlets information.
- * @throws Exception
+ * @return A {@link TabularData} containing the servlets information.
+ * @throws MBeanException In case of MBean failure.
*/
TabularData getServlets() throws MBeanException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/instance/src/main/java/org/apache/karaf/jpm/Process.java
----------------------------------------------------------------------
diff --git a/instance/src/main/java/org/apache/karaf/jpm/Process.java b/instance/src/main/java/org/apache/karaf/jpm/Process.java
index 2bd3b36..4f04d1a 100644
--- a/instance/src/main/java/org/apache/karaf/jpm/Process.java
+++ b/instance/src/main/java/org/apache/karaf/jpm/Process.java
@@ -40,7 +40,7 @@ public interface Process extends Serializable {
/**
* Destroy the process.
*
- * @throws IOException
+ * @throws IOException If an error occurs.
*/
void destroy() throws IOException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/instance/src/main/java/org/apache/karaf/jpm/ProcessBuilder.java
----------------------------------------------------------------------
diff --git a/instance/src/main/java/org/apache/karaf/jpm/ProcessBuilder.java b/instance/src/main/java/org/apache/karaf/jpm/ProcessBuilder.java
index 2b6c612..7b81bf2 100644
--- a/instance/src/main/java/org/apache/karaf/jpm/ProcessBuilder.java
+++ b/instance/src/main/java/org/apache/karaf/jpm/ProcessBuilder.java
@@ -25,34 +25,35 @@ import java.io.IOException;
public interface ProcessBuilder {
/**
- * Specified the current directory to run the command from
+ * Specify the current directory to run the command from.
*
- * @param dir the directory to run the command from
- * @return the ProcessBuilder instance
+ * @param dir The directory to run the command from.
+ * @return The {@link ProcessBuilder} instance.
*/
ProcessBuilder directory(File dir);
/**
- * Set the command to execute
+ * Set the command to execute.
*
- * @param command the command to execute
- * @return the ProcessBuilder instance
+ * @param command The command to execute.
+ * @return The {@link ProcessBuilder} instance.
*/
ProcessBuilder command(String command);
/**
- * Create and start the process
+ * Create and start the process.
*
- * @return the process that has been started
- * @throws IOException if the process can not be created
+ * @return The process that has been started.
+ * @throws IOException If the process can not be created.
*/
org.apache.karaf.jpm.Process start() throws IOException;
/**
- * Attach to an existing process
+ * Attach to an existing process.
*
- * @return the process that has been attached
- * @throws IOException if the process can not be attached to
+ * @param pid The process PID to attach.
+ * @return The process that has been attached.
+ * @throws IOException if the process can not be attached to.
*/
org.apache.karaf.jpm.Process attach(int pid) throws IOException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
index f943be9..e5ad405 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
@@ -30,13 +30,6 @@ public class RoleAddCommand extends JaasCommandSupport {
@Argument(index = 1, name = "role", description = "Role", required = true, multiValued = false)
private String role;
- /**
- * Execute the RoleAddCommand in the given Excecution Context.
- *
- * @param engine
- * @return
- * @throws Exception
- */
@Override
protected Object doExecute(BackingEngine engine) throws Exception {
engine.addRole(username, role);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
index 8a9d223..845ef37 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
@@ -30,13 +30,6 @@ public class RoleDeleteCommand extends JaasCommandSupport {
@Argument(index = 1, name = "role", description = "Role", required = true, multiValued = false)
private String role;
- /**
- * Execute the RoleDeleteCommand in the given Excecution Context.
- *
- * @param engine
- * @return
- * @throws Exception
- */
@Override
protected Object doExecute(BackingEngine engine) throws Exception {
engine.deleteRole(username, role);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
index 3854f1d..0a0898c 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
@@ -30,13 +30,6 @@ public class UserAddCommand extends JaasCommandSupport {
@Argument(index = 1, name = "password", description = "Password", required = true, multiValued = false)
private String password;
- /**
- * Execute the RoleAddCommand in the given Excecution Context.
- *
- * @param engine
- * @return
- * @throws Exception
- */
@Override
protected Object doExecute(BackingEngine engine) throws Exception {
engine.addUser(username, password);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
index ba4631f..7bd8a92 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
@@ -27,13 +27,6 @@ public class UserDeleteCommand extends JaasCommandSupport {
@Argument(index = 0, name = "username", description = "User Name", required = true, multiValued = false)
private String username;
- /**
- * Execute the RoleAddCommand in the given Excecution Context.
- *
- * @param engine
- * @return
- * @throws Exception
- */
@Override
protected Object doExecute(BackingEngine engine) throws Exception {
engine.deleteUser(username);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/config/src/main/java/org/apache/karaf/jaas/config/KeystoreManager.java
----------------------------------------------------------------------
diff --git a/jaas/config/src/main/java/org/apache/karaf/jaas/config/KeystoreManager.java b/jaas/config/src/main/java/org/apache/karaf/jaas/config/KeystoreManager.java
index 4086663..9742d8d 100644
--- a/jaas/config/src/main/java/org/apache/karaf/jaas/config/KeystoreManager.java
+++ b/jaas/config/src/main/java/org/apache/karaf/jaas/config/KeystoreManager.java
@@ -32,20 +32,21 @@ public interface KeystoreManager {
KeystoreInstance getKeystore(String name);
/**
- * Gets a SSLContext using one Keystore to access the private key
+ * Get a SSLContext using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
- * @param provider
- * @param protocol The SSL protocol to use
- * @param algorithm The SSL algorithm to use
- * @param keyStore The key keystore name as provided by listKeystores. The
+ *
+ * @param provider the SSL provider to use.
+ * @param protocol the SSL protocol to use.
+ * @param algorithm the SSL algorithm to use.
+ * @param keyStore the key keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must be unlocked.
- * @param keyAlias The name of the private key in the keystore. The
+ * @param keyAlias the name of the private key in the keystore. The
* KeystoreInstance for this keystore must have unlocked
* this key.
* @param trustStore The trust keystore name as provided by listKeystores.
* The KeystoreInstance for this keystore must have
* unlocked this key.
- *
+ * @return the SSLContext.
* @throws KeystoreIsLocked Occurs when the requested key keystore cannot
* be used because it has not been unlocked.
* @throws KeyIsLocked Occurs when the requested private key in the key
@@ -57,9 +58,10 @@ public interface KeystoreManager {
String keyAlias, String trustStore) throws GeneralSecurityException;
/**
- * Gets a SSLContext using one Keystore to access the private key
+ * Get a SSLContext using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
- * @param provider
+ *
+ * @param provider the SSL provider to use.
* @param protocol The SSL protocol to use
* @param algorithm The SSL algorithm to use
* @param keyStore The key keystore name as provided by listKeystores. The
@@ -71,12 +73,8 @@ public interface KeystoreManager {
* The KeystoreInstance for this keystore must have
* unlocked this key.
* @param timeout Amount of time waiting for the keyStore and keyAlias to be available.
- *
- * @throws KeystoreIsLocked Occurs when the requested key keystore cannot
- * be used because it has not been unlocked.
- * @throws KeyIsLocked Occurs when the requested private key in the key
- * keystore cannot be used because it has not been
- * unlocked.
+ * @return the SSLContext.
+ * @throws GeneralSecurityException General security failure.
*/
SSLContext createSSLContext(String provider, String protocol,
String algorithm, String keyStore,
@@ -84,36 +82,32 @@ public interface KeystoreManager {
long timeout) throws GeneralSecurityException;
/**
- * Gets a ServerSocketFactory using one Keystore to access the private key
+ * Get a ServerSocketFactory using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
- * @param provider
- * @param protocol The SSL protocol to use
- * @param algorithm The SSL algorithm to use
- * @param keyStore The key keystore name as provided by listKeystores. The
+ * @param provider the SSL provider to use.
+ * @param protocol The SSL protocol to use.
+ * @param algorithm The SSL algorithm to use.
+ * @param keyStore The key keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must be unlocked.
- * @param keyAlias The name of the private key in the keystore. The
+ * @param keyAlias The name of the private key in the keystore. The
* KeystoreInstance for this keystore must have unlocked
* this key.
* @param trustStore The trust keystore name as provided by listKeystores.
* The KeystoreInstance for this keystore must have
* unlocked this key.
- *
- * @throws KeystoreIsLocked Occurs when the requested key keystore cannot
- * be used because it has not been unlocked.
- * @throws KeyIsLocked Occurs when the requested private key in the key
- * keystore cannot be used because it has not been
- * unlocked.
+ * @return the SSLServerSocketFactory.
+ * @throws GeneralSecurityException General security failure.
*/
SSLServerSocketFactory createSSLServerFactory(String provider, String protocol,
String algorithm, String keyStore,
String keyAlias, String trustStore) throws GeneralSecurityException;
/**
- * Gets a ServerSocketFactory using one Keystore to access the private key
+ * Get a ServerSocketFactory using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
- * @param provider
- * @param protocol The SSL protocol to use
- * @param algorithm The SSL algorithm to use
+ * @param provider the SSL provider to use.
+ * @param protocol The SSL protocol to use.
+ * @param algorithm The SSL algorithm to use.
* @param keyStore The key keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must be unlocked.
* @param keyAlias The name of the private key in the keystore. The
@@ -123,12 +117,8 @@ public interface KeystoreManager {
* The KeystoreInstance for this keystore must have
* unlocked this key.
* @param timeout Amount of time to wait for keyStore and keyAlias to be available.
- *
- * @throws KeystoreIsLocked Occurs when the requested key keystore cannot
- * be used because it has not been unlocked.
- * @throws KeyIsLocked Occurs when the requested private key in the key
- * keystore cannot be used because it has not been
- * unlocked.
+ * @return the SSLServerSocketFactory.
+ * @throws GeneralSecurityException General security failure.
*/
SSLServerSocketFactory createSSLServerFactory(String provider, String protocol,
String algorithm, String keyStore,
@@ -136,33 +126,34 @@ public interface KeystoreManager {
long timeout) throws GeneralSecurityException;
/**
- * Gets a SocketFactory using one Keystore to access the private key
+ * Get a SocketFactory using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
- * @param provider The SSL provider to use, or null for the default
- * @param protocol The SSL protocol to use
- * @param algorithm The SSL algorithm to use
- * @param keyStore The key keystore name as provided by listKeystores. The
+ *
+ * @param provider the SSL provider to use, or null for the default.
+ * @param protocol the SSL protocol to use.
+ * @param algorithm the SSL algorithm to use.
+ * @param keyStore the key keystore name as provided by listKeystores. The
* KeystoreInstance for this keystore must be unlocked.
- * @param keyAlias The name of the private key in the keystore. The
+ * @param keyAlias the name of the private key in the keystore. The
* KeystoreInstance for this keystore must have unlocked
* this key.
- * @param trustStore The trust keystore name as provided by listKeystores.
+ * @param trustStore the trust keystore name as provided by listKeystores.
* The KeystoreInstance for this keystore must have
* unlocked this key.
- *
+ * @return the SSLSocketFactory.
* @throws KeystoreIsLocked Occurs when the requested key keystore cannot
* be used because it has not been unlocked.
* @throws KeyIsLocked Occurs when the requested private key in the key
* keystore cannot be used because it has not been
* unlocked.
- * @throws GeneralSecurityException
+ * @throws GeneralSecurityException General security failure.
*/
SSLSocketFactory createSSLFactory(String provider, String protocol,
String algorithm, String keyStore,
String keyAlias, String trustStore) throws GeneralSecurityException;
/**
- * Gets a SocketFactory using one Keystore to access the private key
+ * Get a SocketFactory using one Keystore to access the private key
* and another to provide the list of trusted certificate authorities.
* @param provider The SSL provider to use, or null for the default
* @param protocol The SSL protocol to use
@@ -176,13 +167,13 @@ public interface KeystoreManager {
* The KeystoreInstance for this keystore must have
* unlocked this key.
* @param timeout Amount of time to wait for keyStore and keyAlias to be available.
- *
+ * @return the SSLSocketFactory.
* @throws KeystoreIsLocked Occurs when the requested key keystore cannot
* be used because it has not been unlocked.
* @throws KeyIsLocked Occurs when the requested private key in the key
* keystore cannot be used because it has not been
* unlocked.
- * @throws GeneralSecurityException
+ * @throws GeneralSecurityException General security failure.
*/
SSLSocketFactory createSSLFactory(String provider, String protocol,
String algorithm, String keyStore,
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/ResourceKeystoreInstance.java
----------------------------------------------------------------------
diff --git a/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/ResourceKeystoreInstance.java b/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/ResourceKeystoreInstance.java
index 9ced5fa..3c6223c 100644
--- a/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/ResourceKeystoreInstance.java
+++ b/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/ResourceKeystoreInstance.java
@@ -46,9 +46,6 @@ import org.apache.karaf.jaas.config.KeystoreIsLocked;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- */
public class ResourceKeystoreInstance implements KeystoreInstance {
private final Logger logger = LoggerFactory.getLogger(ResourceKeystoreInstance.class);
@@ -104,7 +101,8 @@ public class ResourceKeystoreInstance implements KeystoreInstance {
}
/**
- * @param keystorePath the keystorePath to set
+ * @param keystorePath the keystorePath to set.
+ * @throws IOException in case of failure while setting the path.
*/
public void setPath(URL keystorePath) throws IOException {
this.path = keystorePath;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
index 01ab8b0..f0aa084 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngine.java
@@ -27,99 +27,103 @@ public interface BackingEngine {
static final String GROUP_PREFIX = "_g_:";
/**
- * Create a new User.
+ * Create a new user.
*
- * @param username
- * @param password
+ * @param username the user name.
+ * @param password the user password.
*/
void addUser(String username, String password);
/**
- * Delete User
+ * Delete an user.
*
- * @param username
+ * @param username the user name.
*/
void deleteUser(String username);
/**
- * List Users
+ * List all users.
+ *
+ * @return the list of {@link UserPrincipal}.
*/
List<UserPrincipal> listUsers();
/**
- * List groups that a user is in.
+ * List groups that a user is member of.
*
- * @param user
- * @return
+ * @param user the {@link UserPrincipal}.
+ * @return the list of {@link GroupPrincipal}.
*/
List<GroupPrincipal> listGroups(UserPrincipal user);
/**
- * List groups in a certain realm
- * @return the groups in a certain realm
+ * List all groups.
+ *
+ * @return the groups.
*/
Map<GroupPrincipal, String> listGroups();
/**
- * Add a user to a group.
+ * Add a user into a given group.
*
- * @param username
- * @param group
+ * @param username the user name.
+ * @param group the group.
*/
void addGroup(String username, String group);
/**
* Create a group
- * @param group
+ *
+ * @param group the group.
*/
void createGroup(String group);
/**
* Remove a user from a group.
*
- * @param username
- * @param group
+ * @param username the user name.
+ * @param group the group.
*/
void deleteGroup(String username, String group);
/**
- * List Roles for {@param principal}. This could either be a
+ * List Roles for <code>principal</code>. This could either be a
* {@link UserPrincipal} or a {@link GroupPrincipal}.
*
- * @param principal
- * @return
+ * @param principal the principal.
+ * @return the list of roles.
*/
List<RolePrincipal> listRoles(Principal principal);
/**
- * Add a role to the user
+ * Add a role to the user.
*
- * @param username
- * @param role
+ * @param username the user name.
+ * @param role the role.
*/
void addRole(String username, String role);
/**
* Remove a role from a user.
*
- * @param username
- * @param role
+ * @param username the user name.
+ * @param role the role.
*/
void deleteRole(String username, String role);
/**
* Add a role in a group.
*
- * @param group
- * @param role
+ * @param group the group.
+ * @param role the role.
*/
void addGroupRole(String group, String role);
/**
* Remove a role from a group.
*
- * @param group
- * @param role
+ * @param group the group.
+ * @param role the role.
*/
void deleteGroupRole(String group, String role);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngineFactory.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngineFactory.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngineFactory.java
index c7bb2cf..b398361 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngineFactory.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/BackingEngineFactory.java
@@ -20,13 +20,18 @@ import java.util.Map;
public interface BackingEngineFactory {
/**
- * Returns the corresponding module class.
+ * Get the module class.
+ *
+ * @return the module class.
*/
String getModuleClass();
/**
* Backing engine factory method.
+ *
+ * @param options the factory options.
+ * @return the built backing engine.
*/
BackingEngine build(Map<String,?> options);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/EncryptionService.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/EncryptionService.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/EncryptionService.java
index 1a5d3e9..b82dc56 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/EncryptionService.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/EncryptionService.java
@@ -37,9 +37,9 @@ public interface EncryptionService {
* If the parameters are not supported, a <code>null</code> should
* be returned or an IllegalArgumentException thrown.
*
- * @param params
- * @return
- * @throws IllegalArgumentException
+ * @param params define the encryption configuration.
+ * @return the {@link Encryption}.
+ * @throws IllegalArgumentException if the {@link Encryption} can't be created.
*/
Encryption createEncryption(Map<String,String> params) throws IllegalArgumentException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/encryption/BasicEncryption.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/encryption/BasicEncryption.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/encryption/BasicEncryption.java
index c431db4..d66a42e 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/encryption/BasicEncryption.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/encryption/BasicEncryption.java
@@ -100,8 +100,9 @@ public class BasicEncryption implements Encryption {
}
/**
- * encode the input data producing a base 64 encoded byte array.
+ * Encode the input data producing a base 64 encoded byte array.
*
+ * @param input the String to encore as an array of byte.
* @return a byte array containing the base 64 encoded data.
*/
public static String base64Encode(byte[] input) {
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
index 81a1c06..db0a8e8 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
@@ -51,9 +51,6 @@ public class JDBCBackingEngine implements BackingEngine {
private String selectUsersQuery = "SELECT USERNAME FROM USERS";
private String selectRolesQuery = "SELECT ROLE FROM ROLES WHERE USERNAME=?";
- /**
- * Constructor
- */
public JDBCBackingEngine(DataSource dataSource) {
this.dataSource = dataSource;
}
@@ -64,7 +61,10 @@ public class JDBCBackingEngine implements BackingEngine {
}
/**
- * Adds a new user.
+ * Add a new user.
+ *
+ * @param username the user name.
+ * @param password the user password.
*/
public void addUser(String username, String password) {
if (username.startsWith(GROUP_PREFIX)) {
@@ -91,6 +91,8 @@ public class JDBCBackingEngine implements BackingEngine {
/**
* Delete user by username.
+ *
+ * @param username the user name.
*/
public void deleteUser(String username) {
try {
@@ -107,7 +109,9 @@ public class JDBCBackingEngine implements BackingEngine {
}
/**
- * List all Users
+ * List all users.
+ *
+ * @return the list of {@link UserPrincipal}.
*/
public List<UserPrincipal> listUsers() {
try {
@@ -126,7 +130,10 @@ public class JDBCBackingEngine implements BackingEngine {
}
/**
- * List the roles of the {@param principal}.
+ * List the roles of the <code>principal</code>.
+ *
+ * @param principal the principal (user or group).
+ * @return the list of {@link RolePrincipal}.
*/
public List<RolePrincipal> listRoles(Principal principal) {
try {
@@ -156,6 +163,9 @@ public class JDBCBackingEngine implements BackingEngine {
/**
* Add a role to a user.
+ *
+ * @param username the user name.
+ * @param role the role.
*/
public void addRole(String username, String role) {
try {
@@ -172,6 +182,9 @@ public class JDBCBackingEngine implements BackingEngine {
/**
* Remove role from user.
+ *
+ * @param username the user name.
+ * @param role the role to remove.
*/
public void deleteRole(String username, String role) {
try {
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
index c782abe..6459a50 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCUtils.java
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.karaf.jaas.modules.jdbc;
import java.sql.Connection;
@@ -36,12 +35,15 @@ public final class JDBCUtils {
public static final String JNDI = "jndi:";
public static final String OSGI = "osgi:";
- private JDBCUtils() {
-
- }
+ private JDBCUtils() { }
/**
- * Looks up a datasource from the url. The datasource can be passed either as jndi name or bundles ldap filter.
+ * Look up a datasource from the url. The datasource can be passed either as jndi name or bundles ldap filter.
+ *
+ * @param bc the bundle context.
+ * @param url the datasource URL.
+ * @return the {@link DataSource} object.
+ * @throws Exception in case of datasource creation failure.
*/
public static DataSource createDatasource(BundleContext bc, String url) throws Exception {
Object ds = doCreateDatasource(bc, url);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
index 98e916a..77e9e2e 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
@@ -30,20 +30,13 @@ import org.apache.karaf.jaas.modules.encryption.EncryptionSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
public class PropertiesBackingEngine implements BackingEngine {
private static final transient Logger LOGGER = LoggerFactory.getLogger(PropertiesBackingEngine.class);
-
private Properties users;
private EncryptionSupport encryptionSupport;
- /**
- * Constructor
- *
- * @param users
- */
public PropertiesBackingEngine(Properties users) {
this.users = users;
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
index e9a9181..cc5c079 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngine.java
@@ -34,21 +34,12 @@ public class PublickeyBackingEngine implements BackingEngine {
private static final transient Logger LOGGER = LoggerFactory.getLogger(PublickeyBackingEngine.class);
-
private Properties users;
-
- /**
- * Constructor
- *
- * @param users
- */
public PublickeyBackingEngine(Properties users) {
this.users = users;
}
-
-
@Override
public void addUser(String username, String publickey) {
if (username.startsWith(GROUP_PREFIX))
@@ -257,8 +248,6 @@ public class PublickeyBackingEngine implements BackingEngine {
deleteRole(GROUP_PREFIX + group, role);
}
-
-
public Map<GroupPrincipal, String> listGroups() {
Map<GroupPrincipal, String> result = new HashMap<GroupPrincipal, String>();
for (String name : users.keySet()) {
@@ -269,8 +258,6 @@ public class PublickeyBackingEngine implements BackingEngine {
return result;
}
-
-
public void createGroup(String group) {
String groupName = GROUP_PREFIX + group;
if (users.get(groupName) == null) {
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java
----------------------------------------------------------------------
diff --git a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java
index 7ad70a1..990965a 100644
--- a/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java
+++ b/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/publickey/PublickeyBackingEngineFactory.java
@@ -31,12 +31,6 @@ public class PublickeyBackingEngineFactory implements BackingEngineFactory {
private static final String USER_FILE = "users";
- /**
- * Builds the Backing Engine
- *
- * @param options
- * @return
- */
public BackingEngine build(Map options) {
PublickeyBackingEngine engine = null;
String usersFile = (String) options.get(USER_FILE);
@@ -53,12 +47,8 @@ public class PublickeyBackingEngineFactory implements BackingEngineFactory {
}
}
- /**
- * Returns the login module class, that this factory can build.
- *
- * @return
- */
public String getModuleClass() {
return PublickeyLoginModule.class.getName();
}
+
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java b/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
index 35a48cb..19c1226 100644
--- a/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
+++ b/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcMBean.java
@@ -29,39 +29,39 @@ public interface JdbcMBean {
/**
* Get the list of JDBC datasources.
*
- * @return a tabular data containing the list of JDBC datasources.
- * @throws MBeanException
+ * @return A {@link TabularData} containing the list of JDBC datasources.
+ * @throws MBeanException In case of MBean failure.
*/
TabularData getDatasources() throws MBeanException;
/**
* Create a JDBC datasource.
*
- * @param name the JDBC datasource name
- * @param driverName org.osgi.driver.name of the DataSourceFactory to use
- * @param driverClass org.osgi.driver.class of the DataSourceFactory to use
- * @param databaseName name of the database to access
- * @param url JDBC URL
- * @param user Database username
- * @param password Database password
- * @throws MBeanException
+ * @param name The JDBC datasource name.
+ * @param driverName The {@code org.osgi.driver.name} of the DataSourceFactory to use.
+ * @param driverClass The {@code org.osgi.driver.class} of the DataSourceFactory to use.
+ * @param databaseName The name of the database to access.
+ * @param url The JDBC URL.
+ * @param user The database username.
+ * @param password The database password.
+ * @throws MBeanException In case of MBean failure.
*/
void create(String name, String driverName, String driverClass, String databaseName, String url, String user, String password) throws MBeanException;
/**
* Delete a JDBC datasource.
*
- * @param name the JDBC datasource name (the one used at creation time).
- * @throws MBeanException
+ * @param name The JDBC datasource name (the one used at creation time).
+ * @throws MBeanException In case of MBean failure.
*/
void delete(String name) throws MBeanException;
/**
* Get details about a JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @return a map (property/value) containing JDBC datasource details.
- * @throws MBeanException
+ * @param datasource The JDBC datasource name.
+ * @return A {@link Map} (property/value) containing JDBC datasource details.
+ * @throws MBeanException In case of MBean failure.
*/
Map<String, String> info(String datasource) throws MBeanException;
@@ -69,27 +69,27 @@ public interface JdbcMBean {
* Get the tables available on a JDBC datasource.
*
* @param datasource the JDBC datasource name.
- * @return a tabular data containg datasource tables.
- * @throws MBeanException
+ * @return A {@link TabularData} containing the datasource tables.
+ * @throws MBeanException In case of MBean failure.
*/
TabularData tables(String datasource) throws MBeanException;
/**
* Execute a SQL command on a JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @param command the SQL command to execute.
- * @throws MBeanException
+ * @param datasource The JDBC datasource name.
+ * @param command The SQL command to execute.
+ * @throws MBeanException In case of MBean failure.
*/
void execute(String datasource, String command) throws MBeanException;
/**
* Execute a SQL query on a JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @param query the SQL query to execute.
- * @return a tabular data with the result of execute (columns/values).
- * @throws MBeanException
+ * @param datasource The JDBC datasource name.
+ * @param query The SQL query to execute.
+ * @return A {@link TabularData} with the result of execute (columns/values).
+ * @throws MBeanException In case of MBean failure.
*/
TabularData query(String datasource, String query) throws MBeanException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcService.java
----------------------------------------------------------------------
diff --git a/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcService.java b/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcService.java
index 1f4b27b..a3f1724 100644
--- a/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcService.java
+++ b/jdbc/src/main/java/org/apache/karaf/jdbc/JdbcService.java
@@ -27,12 +27,14 @@ public interface JdbcService {
/**
* Create a JDBC datasource configuration.
*
- * @param name Datasource name
- * @param driverName Backend database type (osgi.jdbc.driver.name of DataSourceFactory)
- * @param url JDBC URL
- * @param user Database user name
- * @param password Database password
- * @param password2
+ * @param name The datasource name.
+ * @param driverName The backend database type (osgi.jdbc.driver.name of DataSourceFactory).
+ * @param driverClass The JDBC driver class.
+ * @param databaseName The database name.
+ * @param url The JDBC URL.
+ * @param user The database user name.
+ * @param password The database password.
+ * @throws Exception If the service fails.
*/
void create(String name, String driverName, String driverClass, String databaseName, String url, String user, String password) throws Exception;
@@ -40,38 +42,43 @@ public interface JdbcService {
* Delete a JDBC datasource identified by a name. Works only
* for datasources that have a corresponding configuration
*
- * @param name Datasource name
+ * @param name The datasource name to delete.
+ * @throws Exception If the service fails.
*/
void delete(String name) throws Exception;
/**
* List the JDBC DataSourceFactories available.
*
- * @return a list of DataSourceFactory names
+ * @return a {@link List} of DataSourceFactory names.
+ * @throws Exception If the service fails.
*/
List<String> factoryNames() throws Exception;
/**
* List the JDBC datasources available.
*
- * @return a list of datasources names
+ * @return A {@link List} of datasources names.
+ * @throws Exception If the service fails.
*/
List<String> datasources() throws Exception;
/**
* Execute a SQL query on a given JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @param query the SQL query to execute.
- * @return the SQL query result (as a String).
+ * @param datasource The JDBC datasource name.
+ * @param query The SQL query to execute.
+ * @return The SQL query result (as a {@link Map}).
+ * @throws Exception If the service fails.
*/
Map<String, List<String>> query(String datasource, String query) throws Exception;
/**
* Execute a SQL command on a given JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @param command the SQL command to execute.
+ * @param datasource The JDBC datasource name.
+ * @param command The SQL command to execute.
+ * @throws Exception If the service fails.
*/
void execute(String datasource, String command) throws Exception;
@@ -79,15 +86,17 @@ public interface JdbcService {
* List the tables available on a given JDBC datasource.
*
* @param datasource the JDBC datasource name.
- * @return the list of table names.
+ * @return A {@link Map} containing the tables.
+ * @throws Exception If the service fails.
*/
Map<String, List<String>> tables(String datasource) throws Exception;
/**
* Get detailed info about a JDBC datasource.
*
- * @param datasource the JDBC datasource name.
- * @return a map of info (name/value).
+ * @param datasource The JDBC datasource name.
+ * @return A {@link Map} of info (name/value).
+ * @throws Exception If the service fails.
*/
Map<String, String> info(String datasource) throws Exception;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jms/src/main/java/org/apache/karaf/jms/JmsMBean.java
----------------------------------------------------------------------
diff --git a/jms/src/main/java/org/apache/karaf/jms/JmsMBean.java b/jms/src/main/java/org/apache/karaf/jms/JmsMBean.java
index 0e7a012..d62a9ba 100644
--- a/jms/src/main/java/org/apache/karaf/jms/JmsMBean.java
+++ b/jms/src/main/java/org/apache/karaf/jms/JmsMBean.java
@@ -29,136 +29,136 @@ public interface JmsMBean {
/**
* List the JMS connection factories.
*
- * @return the list of the JMS connection factories name.
- * @throws MBeanException
+ * @return The {@link List} of the JMS connection factories name.
+ * @throws MBeanException If the MBean fails.
*/
List<String> getConnectionfactories() throws MBeanException;
/**
* Create a JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @param type the JMS connection factory type (ActiveMQ or WebsphereMQ).
- * @param url the JMS connection factory URL. NB: when type is WebsphereMQ, the URL has the format host/port/queuemanager/channel.
- * @throws MBeanException
+ * @param name The JMS connection factory name.
+ * @param type The JMS connection factory type (ActiveMQ or WebsphereMQ).
+ * @param url The JMS connection factory URL. NB: when type is WebsphereMQ, the URL has the format host/port/queuemanager/channel.
+ * @throws MBeanException If the MBean fails.
*/
void create(String name, String type, String url) throws MBeanException;
/**
* Create a JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @param type the JMS connection factory type (ActiveMQ or WebsphereMQ).
- * @param url the JMS connection factory URL. NB: when type is WebsphereMQ, the URL has the format host/port/queuemanager/channel.
- * @param username the JMS connection factory authentication username.
- * @param password the JMS connection factory authentication password.
- * @throws MBeanException
+ * @param name The JMS connection factory name.
+ * @param type The JMS connection factory type (ActiveMQ or WebsphereMQ).
+ * @param url The JMS connection factory URL. NB: when type is WebsphereMQ, the URL has the format host/port/queuemanager/channel.
+ * @param username The JMS connection factory authentication username.
+ * @param password The JMS connection factory authentication password.
+ * @throws MBeanException If the MBean fails.
*/
void create(String name, String type, String url, String username, String password) throws MBeanException;
/**
* Delete a JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @throws MBeanException
+ * @param name The JMS connection factory name.
+ * @throws MBeanException If the MBean fails.
*/
void delete(String name) throws MBeanException;
/**
* Get details about a JMS connection factory.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return a map (property/value) containing details.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return A {@link Map} (property/value) containing details.
+ * @throws MBeanException If the MBean fails.
*/
Map<String, String> info(String connectionFactory, String username, String password) throws MBeanException;
/**
* Count the messages on a given JMS queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the JMS queue name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The JMS queue name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages in the queue.
+ * @throws MBeanException If the MBean fails.
*/
int count(String connectionFactory, String queue, String username, String password) throws MBeanException;
/**
* List the JMS queues.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the list of JMS queues.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The {@link List} of JMS queues.
+ * @throws MBeanException If the MBean fails.
*/
List<String> queues(String connectionFactory, String username, String password) throws MBeanException;
/**
* List the JMS topics.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the list of JMS topics.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The @link List} of JMS topics.
+ * @throws MBeanException If the MBean fails.
*/
List<String> topics(String connectionFactory, String username, String password) throws MBeanException;
/**
* Browse the messages in a JMS queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the JMS queue name.
- * @param selector a selector to use to browse only certain messages.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return a tabular data with messages details.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The JMS queue name.
+ * @param selector A selector to use to browse only certain messages.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return A {@link TabularData} containing messages details.
+ * @throws MBeanException If the MBean fails.
*/
TabularData browse(String connectionFactory, String queue, String selector, String username, String password) throws MBeanException;
/**
* Send a JMS message to given queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the JMS queue name.
- * @param content the message content.
- * @param replyTo the message ReplyTo.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The JMS queue name.
+ * @param content The message content.
+ * @param replyTo The message ReplyTo.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @throws MBeanException If the MBean fails.
*/
void send(String connectionFactory, String queue, String content, String replyTo, String username, String password) throws MBeanException;
/**
* Consume JMS messages from a given queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the JMS queue name.
- * @param selector a selector to use to consume only certain messages.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the number of messages consumed.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The JMS queue name.
+ * @param selector A selector to use to consume only certain messages.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages consumed.
+ * @throws MBeanException If the MBean fails.
*/
int consume(String connectionFactory, String queue, String selector, String username, String password) throws MBeanException;
/**
* Move JMS messages from one queue to another.
*
- * @param connectionFactory the JMS connection factory name.
- * @param source the source JMS queue name.
- * @param destination the destination JMS queue name.
- * @param selector a selector to move only certain messages.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the number of messages moved.
- * @throws MBeanException
+ * @param connectionFactory The JMS connection factory name.
+ * @param source The source JMS queue name.
+ * @param destination The destination JMS queue name.
+ * @param selector A selector to move only certain messages.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages moved.
+ * @throws MBeanException If the MBean fails.
*/
int move(String connectionFactory, String source, String destination, String selector, String username, String password) throws MBeanException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jms/src/main/java/org/apache/karaf/jms/JmsService.java
----------------------------------------------------------------------
diff --git a/jms/src/main/java/org/apache/karaf/jms/JmsService.java b/jms/src/main/java/org/apache/karaf/jms/JmsService.java
index 73d9521..0902e33 100644
--- a/jms/src/main/java/org/apache/karaf/jms/JmsService.java
+++ b/jms/src/main/java/org/apache/karaf/jms/JmsService.java
@@ -27,144 +27,144 @@ public interface JmsService {
/**
* List the JMS connection factories.
*
- * @return the list of JMS connection factory names.
- * @throws Exception
+ * @return The {@link List} of JMS connection factory names.
+ * @throws Exception If the service fails.
*/
List<String> connectionFactories() throws Exception;
/**
- * List the JMS connecion factories file names.
+ * List the JMS connection factories file names.
*
- * @return the list of JMS connection factory file names.
- * @throws Exception
+ * @return The {@link List} of JMS connection factory file names.
+ * @throws Exception If the service fails.
*/
List<String> connectionFactoryFileNames() throws Exception;
/**
* Create a new JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @param type the JMS connection factory type (ActiveMQ, WebsphereMQ, ...).
- * @param url the JMS URL to use.
- * @throws Exception
+ * @param name The JMS connection factory name.
+ * @param type The JMS connection factory type (ActiveMQ, WebsphereMQ, ...).
+ * @param url The JMS URL to use.
+ * @throws Exception If the service fails.
*/
void create(String name, String type, String url) throws Exception;
/**
* Create a new JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @param type the JMS connection factory type (ActiveMQ, WebsphereMQ, ...).
- * @param url the JMS URL to use.
- * @param username the username to use.
- * @param password the password to use.
- * @throws Exception
+ * @param name The JMS connection factory name.
+ * @param type The JMS connection factory type (ActiveMQ, WebsphereMQ, ...).
+ * @param url The JMS URL to use.
+ * @param username The username to use.
+ * @param password The password to use.
+ * @throws Exception If the service fails.
*/
void create(String name, String type, String url, String username, String password) throws Exception;
/**
* Delete a JMS connection factory.
*
- * @param name the JMS connection factory name.
- * @throws Exception
+ * @param name The JMS connection factory name.
+ * @throws Exception If the service fails.
*/
void delete(String name) throws Exception;
/**
* Get details about a given JMS connection factory.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return a map (property/value) containing details.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return A {@link Map} (property/value) containing details.
+ * @throws Exception If the service fails.
*/
Map<String, String> info(String connectionFactory, String username, String password) throws Exception;
/**
* Count the number of messages in a JMS queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the queue name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the number of messages in a JMS queue.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The queue name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages in a JMS queue.
+ * @throws Exception If the service fails.
*/
int count(String connectionFactory, String queue, String username, String password) throws Exception;
/**
* List the queues.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the list of queues.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The {@link List} of queues.
+ * @throws Exception If the service fails.
*/
List<String> queues(String connectionFactory, String username, String password) throws Exception;
/**
* List the topics.
*
- * @param connectionFactory the JMS connection factory name.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the list of topics.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The {@link List} of topics.
+ * @throws Exception If the service fails.
*/
List<String> topics(String connectionFactory, String username, String password) throws Exception;
/**
* Browse a destination.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the queue name.
- * @param selector the selector.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the list of messages.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The queue name.
+ * @param selector The selector.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The {@link List} of messages.
+ * @throws Exception If the service fails.
*/
List<JmsMessage> browse(String connectionFactory, String queue, String selector, String username, String password) throws Exception;
/**
* Send a message on the given queue.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the queue name.
- * @param body the message body.
- * @param replyTo the message replyTo header.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The queue name.
+ * @param body The message body.
+ * @param replyTo The message replyTo header.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @throws Exception If the service fails.
*/
void send(String connectionFactory, String queue, String body, String replyTo, String username, String password) throws Exception;
/**
* Consume messages from a given destination.
*
- * @param connectionFactory the JMS connection factory name.
- * @param queue the queue name.
- * @param selector the messages selector.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the number of messages consumed.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param queue The queue name.
+ * @param selector The messages selector.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages consumed.
+ * @throws Exception If the service fails.
*/
int consume(String connectionFactory, String queue, String selector, String username, String password) throws Exception;
/**
* Move messages from a destination to another.
*
- * @param connectionFactory the JMS connection factory name.
- * @param sourceQueue the source queue.
- * @param targetQueue the target queue.
- * @param selector the messages selector on the source queue.
- * @param username optional username to connect to the JMS broker.
- * @param password optional password to connect to the JMS broker.
- * @return the number of messages moved.
- * @throws Exception
+ * @param connectionFactory The JMS connection factory name.
+ * @param sourceQueue The source queue.
+ * @param targetQueue The target queue.
+ * @param selector The messages selector on the source queue.
+ * @param username The (optional) username to connect to the JMS broker.
+ * @param password The (optional) password to connect to the JMS broker.
+ * @return The number of messages moved.
+ * @throws Exception If the service fails.
*/
int move(String connectionFactory, String sourceQueue, String targetQueue, String selector, String username, String password) throws Exception;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jndi/src/main/java/org/apache/karaf/jndi/JndiMBean.java
----------------------------------------------------------------------
diff --git a/jndi/src/main/java/org/apache/karaf/jndi/JndiMBean.java b/jndi/src/main/java/org/apache/karaf/jndi/JndiMBean.java
index 0b2be41..2a4f4f9 100644
--- a/jndi/src/main/java/org/apache/karaf/jndi/JndiMBean.java
+++ b/jndi/src/main/java/org/apache/karaf/jndi/JndiMBean.java
@@ -28,76 +28,76 @@ public interface JndiMBean {
/**
* Get a map of JNDI names/class names (as attribute).
*
- * @return the MBean attribute containing the map of names/class names.
- * @throws MBeanException
+ * @return The MBean attribute containing the {@link Map} of names/class names.
+ * @throws MBeanException If the MBean fails.
*/
public Map<String, String> getNames() throws MBeanException;
/**
* Get a list of JNDI sub-contexts (as attribute).
*
- * @return the MBean attribute containing the list of sub-contexts.
- * @throws MBeanException
+ * @return The MBean attribute containing the {@link List} of sub-contexts.
+ * @throws MBeanException If the MBean fails.
*/
public List<String> getContexts() throws MBeanException;
/**
- * Get a map of JNDI names/class names children of a given base context.
+ * Get a {@link Map} of JNDI names/class names children of a given base context.
*
- * @param context the base context.
- * @return the map of names/class names.
- * @throws MBeanException
+ * @param context The base context.
+ * @return The {@link Map} of names/class names.
+ * @throws MBeanException If the MBean fails.
*/
public Map<String, String> getNames(String context) throws MBeanException;
/**
- * Get a list of JNDI sub-contexts children of a given base context.
+ * Get a {@link List} of JNDI sub-contexts children of a given base context.
*
- * @param context the base context.
- * @return the list of sub-contexts.
- * @throws MBeanException
+ * @param context The base context.
+ * @return The {@link List} of sub-contexts.
+ * @throws MBeanException If the MBean fails.
*/
public List<String> getContexts(String context) throws MBeanException;
/**
* Create a JNDI sub-context.
*
- * @param context the JNDI sub-context name.
- * @throws MBeanException
+ * @param context The JNDI sub-context name.
+ * @throws MBeanException If the MBean fails.
*/
public void create(String context) throws MBeanException;
/**
* Delete a JNDI sub-context.
*
- * @param context the JNDI sub-context name.
- * @throws MBeanException
+ * @param context The JNDI sub-context name.
+ * @throws MBeanException If the MBean fails.
*/
public void delete(String context) throws MBeanException;
/**
* Create another JNDI name (alias) for a given one.
*
- * @param name the "source" JNDI name.
- * @param alias the JNDI alias name.
- * @throws MBeanException
+ * @param name The "source" JNDI name.
+ * @param alias The JNDI alias name.
+ * @throws MBeanException If the MBean fails.
*/
public void alias(String name, String alias) throws MBeanException;
/**
* Bind an OSGi service with a JNDI name.
*
- * @param serviceId the OSGi service id (service.id property on the service, created by the framework).
- * @param name the JNDI name.
- * @throws MBeanException
+ * @param serviceId The OSGi service id (service.id property on the service, created by the framework).
+ * @param name The JNDI name.
+ * @throws MBeanException If the MBean fails.
*/
public void bind(Long serviceId, String name) throws MBeanException;
/**
* Unbind a given JNDI name.
*
- * @param name the JNDI name.
- * @throws MBeanException
+ * @param name The JNDI name.
+ * @throws MBeanException If the MBean fails.
*/
public void unbind(String name) throws MBeanException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jndi/src/main/java/org/apache/karaf/jndi/JndiService.java
----------------------------------------------------------------------
diff --git a/jndi/src/main/java/org/apache/karaf/jndi/JndiService.java b/jndi/src/main/java/org/apache/karaf/jndi/JndiService.java
index c9f9c57..365b189 100644
--- a/jndi/src/main/java/org/apache/karaf/jndi/JndiService.java
+++ b/jndi/src/main/java/org/apache/karaf/jndi/JndiService.java
@@ -27,76 +27,76 @@ public interface JndiService {
/**
* List the current JNDI names (with the bound class name).
*
- * @return the JNDI names.
- * @throws Exception
+ * @return The JNDI names.
+ * @throws Exception If the service fails.
*/
Map<String, String> names() throws Exception;
/**
* List the current JNDI names in the given context.
*
- * @param context the JNDI context.
- * @return the JNDI names in the context.
- * @throws Exception
+ * @param context The JNDI context.
+ * @return The JNDI names in the context.
+ * @throws Exception If the service fails.
*/
Map<String, String> names(String context) throws Exception;
/**
* List all JNDI sub-contexts.
*
- * @return a list containing the sub-context names.
- * @throws Exception
+ * @return A {@link List} containing the sub-context names.
+ * @throws Exception If the service fails.
*/
List<String> contexts() throws Exception;
/**
* List the JNDI sub-context from a given context.
*
- * @param context the base JNDI context.
- * @return a list containing the sub-context names.
- * @throws Exception
+ * @param context The base JNDI context.
+ * @return A {@link List} containing the sub-context names.
+ * @throws Exception If the service fails.
*/
List<String> contexts(String context) throws Exception;
/**
* Create a sub-context.
*
- * @param context the new sub-context name to create.
- * @throws Exception
+ * @param context The new sub-context name to create.
+ * @throws Exception If the service fails.
*/
void create(String context) throws Exception;
/**
* Delete a sub-context.
*
- * @param context the sub-context name to delete.
- * @throws Exception
+ * @param context The sub-context name to delete.
+ * @throws Exception If the service fails.
*/
void delete(String context) throws Exception;
/**
* Create an alias on a given JNDI name.
*
- * @param name the JNDI name.
- * @param alias the alias.
- * @throws Exception
+ * @param name The JNDI name.
+ * @param alias The alias.
+ * @throws Exception If the service fails.
*/
void alias(String name, String alias) throws Exception;
/**
* Bind a given OSGi service to a JNDI name.
*
- * @param serviceId the OSGi service ID.
- * @param name the JNDI name.
- * @throws Exception
+ * @param serviceId The OSGi service ID.
+ * @param name The JNDI name.
+ * @throws Exception If the service fails.
*/
void bind(long serviceId, String name) throws Exception;
/**
* Unbind an existing name.
*
- * @param name the JNDI name to unbind.
- * @throws Exception
+ * @param name The JNDI name to unbind.
+ * @throws Exception If the service fails.
*/
void unbind(String name) throws Exception;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/jpa/hibernate/src/main/java/org/apache/karaf/jpa/hibernate/impl/StatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/jpa/hibernate/src/main/java/org/apache/karaf/jpa/hibernate/impl/StatisticsPublisher.java b/jpa/hibernate/src/main/java/org/apache/karaf/jpa/hibernate/impl/StatisticsPublisher.java
index 5d2706f..e347539 100644
--- a/jpa/hibernate/src/main/java/org/apache/karaf/jpa/hibernate/impl/StatisticsPublisher.java
+++ b/jpa/hibernate/src/main/java/org/apache/karaf/jpa/hibernate/impl/StatisticsPublisher.java
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
/**
* Track EntityManagerFactory services for the persistence units.
* Manage on StatisticsMXBean for each persistence unit named like:
- * org.hibernate.statistics:unitName=<name of persistence unit>
+ * org.hibernate.statistics:unitName=<name of persistence unit>
*/
public class StatisticsPublisher implements ServiceTrackerCustomizer<EntityManagerFactory, EntityManagerFactory> {
private static Logger LOG = LoggerFactory.getLogger(StatisticsPublisher.class);
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/kar/src/main/java/org/apache/karaf/kar/KarService.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/KarService.java b/kar/src/main/java/org/apache/karaf/kar/KarService.java
index 60acb77..f2dbdc5 100644
--- a/kar/src/main/java/org/apache/karaf/kar/KarService.java
+++ b/kar/src/main/java/org/apache/karaf/kar/KarService.java
@@ -45,7 +45,7 @@ public interface KarService {
* @param karUri Uri of the kar to be installed
* @param repoDir destination for the repository contents of the kar
* @param resourceDir destination for the resource contents of the kar
- * @throws Exception
+ * @throws Exception in case of installation failure.
*/
void install(URI karUri, File repoDir, File resourceDir) throws Exception;
@@ -70,11 +70,10 @@ public interface KarService {
* Each named feature including all transitive deps will be added.
* For each named repo all features in the repo and their transitive deps will be added.
*
- * @param repoName
- * @param features
- * @param console
+ * @param repoName the feature repository to use to create the kar.
+ * @param features the list of features to include in the created kar.
+ * @param console the console stream where to print details.
*/
void create(String repoName, List<String> features, PrintStream console);
-
}
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/kar/src/main/java/org/apache/karaf/kar/KarsMBean.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/KarsMBean.java b/kar/src/main/java/org/apache/karaf/kar/KarsMBean.java
index b1a86c9..df8f3d9 100644
--- a/kar/src/main/java/org/apache/karaf/kar/KarsMBean.java
+++ b/kar/src/main/java/org/apache/karaf/kar/KarsMBean.java
@@ -25,7 +25,7 @@ public interface KarsMBean {
* List the installed KAR files.
*
* @return the list of KAR files.
- * @throws Exception in case of listing failure.
+ * @throws MBeanException in case of listing failure.
*/
List<String> getKars() throws MBeanException;
@@ -34,7 +34,6 @@ public interface KarsMBean {
*
* @param repoName the name of features repository
* @param features the features to include in the kar
- * @throws Exception in case of creation failure
*/
void create(String repoName, List<String> features);
@@ -42,7 +41,7 @@ public interface KarsMBean {
* Install a KAR file from the given URL.
*
* @param url the JAR URL.
- * @throws Exception in case of installation failure.
+ * @throws MBeanException in case of installation failure.
*/
void install(String url) throws MBeanException;
@@ -50,7 +49,7 @@ public interface KarsMBean {
* Uninstall a KAR file.
*
* @param name the name of the KAR file.
- * @throws Exception in case of uninstall failure.
+ * @throws MBeanException in case of uninstall failure.
*/
void uninstall(String name) throws MBeanException;
http://git-wip-us.apache.org/repos/asf/karaf/blob/8a1e7574/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternConverter.java
----------------------------------------------------------------------
diff --git a/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternConverter.java b/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternConverter.java
index 0d91e8c..984af9e 100644
--- a/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternConverter.java
+++ b/log/src/main/java/org/apache/karaf/log/core/internal/layout/PatternConverter.java
@@ -19,88 +19,92 @@ package org.apache.karaf.log.core.internal.layout;
import org.ops4j.pax.logging.spi.PaxLoggingEvent;
/**
- <p>PatternConverter is an abtract class that provides the
- formatting functionality that derived classes need.
-
- <p>Conversion specifiers in a conversion patterns are parsed to
- individual PatternConverters. Each of which is responsible for
- converting a logging event in a converter specific manner.
-
- @since 0.8.2
+ * <p>PatternConverter is an abtract class that provides the
+ * formatting functionality that derived classes need.</p>
+ *
+ * <p>Conversion specifiers in a conversion patterns are parsed to
+ * individual PatternConverters. Each of which is responsible for
+ * converting a logging event in a converter specific manner.</p>
+ *
+ * @since 0.8.2
*/
public abstract class PatternConverter {
- public PatternConverter next;
- int min = -1;
- int max = 0x7FFFFFFF;
- boolean leftAlign = false;
- protected
- PatternConverter() { }
+ public PatternConverter next;
+ int min = -1;
+ int max = 0x7FFFFFFF;
+ boolean leftAlign = false;
+
+ protected PatternConverter() {
+ }
- protected
- PatternConverter(FormattingInfo fi) {
- min = fi.min;
- max = fi.max;
- leftAlign = fi.leftAlign;
- }
+ protected PatternConverter(FormattingInfo fi) {
+ min = fi.min;
+ max = fi.max;
+ leftAlign = fi.leftAlign;
+ }
- /**
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the correct way.
- */
- abstract
- protected
- String convert(PaxLoggingEvent event);
+ /**
+ * Derived pattern converters must override this method in order to
+ * convert conversion specifiers in the correct way.
+ *
+ * @param event The {@link PaxLoggingEvent} to convert.
+ * @return The {@link String} representing the {@link PaxLoggingEvent}.
+ */
+ abstract protected String convert(PaxLoggingEvent event);
- /**
- A template method for formatting in a converter specific way.
- */
- public
- void format(StringBuffer sbuf, PaxLoggingEvent e) {
- String s = convert(e);
+ /**
+ * A template method for formatting in a converter specific way.
+ *
+ * @param sbuf The {@link StringBuffer} used for formatting the {@link PaxLoggingEvent}.
+ * @param e The {@link PaxLoggingEvent} to format.
+ */
+ public void format(StringBuffer sbuf, PaxLoggingEvent e) {
+ String s = convert(e);
- if(s == null) {
- if(0 < min)
- spacePad(sbuf, min);
- return;
- }
+ if (s == null) {
+ if (0 < min)
+ spacePad(sbuf, min);
+ return;
+ }
- int len = s.length();
+ int len = s.length();
- if(len > max)
- sbuf.append(s.substring(len-max));
- else if(len < min) {
- if(leftAlign) {
- sbuf.append(s);
- spacePad(sbuf, min-len);
- }
- else {
- spacePad(sbuf, min-len);
- sbuf.append(s);
- }
+ if (len > max)
+ sbuf.append(s.substring(len - max));
+ else if (len < min) {
+ if (leftAlign) {
+ sbuf.append(s);
+ spacePad(sbuf, min - len);
+ } else {
+ spacePad(sbuf, min - len);
+ sbuf.append(s);
+ }
+ } else
+ sbuf.append(s);
}
- else
- sbuf.append(s);
- }
- static String[] SPACES = {" ", " ", " ", " ", //1,2,4,8 spaces
- " ", // 16 spaces
- " " }; // 32 spaces
+ static String[] SPACES = {" ", " ", " ", " ", //1,2,4,8 spaces
+ " ", // 16 spaces
+ " "}; // 32 spaces
- /**
- Fast space padding method.
- */
- public
- void spacePad(StringBuffer sbuf, int length) {
- while(length >= 32) {
- sbuf.append(SPACES[5]);
- length -= 32;
- }
+ /**
+ * Fast space padding method.
+ *
+ * @param sbuf The {@link StringBuffer} used for space padding.
+ * @param length The padding length.
+ */
+ public void spacePad(StringBuffer sbuf, int length) {
+ while (length >= 32) {
+ sbuf.append(SPACES[5]);
+ length -= 32;
+ }
- for(int i = 4; i >= 0; i--) {
- if((length & (1<<i)) != 0) {
- sbuf.append(SPACES[i]);
- }
+ for (int i = 4; i >= 0; i--) {
+ if ((length & (1 << i)) != 0) {
+ sbuf.append(SPACES[i]);
+ }
+ }
}
- }
+
}