Repository: marmotta Updated Branches: refs/heads/develop 1b1e6f53c -> 377077856
http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/MarmottaResourceService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/MarmottaResourceService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/MarmottaResourceService.java index d2a5d0b..3442a5b 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/MarmottaResourceService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/MarmottaResourceService.java @@ -38,7 +38,7 @@ public interface MarmottaResourceService { * @param relativeURL a URL relative to the web application root of this web application * @return the resource identified by the relative URL, or null if it does not exist */ - public ResourceEntry getResource(String relativeURL); + ResourceEntry getResource(String relativeURL); /** @@ -48,5 +48,5 @@ public interface MarmottaResourceService { * @param relativeURL a URL relative to the web application root of this web application * @return the file system URL of the resource, regardless whether it actually exists or not */ - public URL resolveResource(String relativeURL); + URL resolveResource(String relativeURL); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java index b4324de..8d43f29 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/modules/ModuleService.java @@ -17,7 +17,6 @@ */ package org.apache.marmotta.platform.core.api.modules; -import org.apache.commons.configuration.Configuration; import org.apache.marmotta.platform.core.model.module.ModuleConfiguration; import javax.enterprise.inject.spi.InjectionPoint; @@ -37,7 +36,7 @@ public interface ModuleService { * List the names of all currently active modules * @return */ - public Collection<String> listModules(); + Collection<String> listModules(); /** * Return the configuration for the module identified by the name given as argument. Returns an @@ -46,7 +45,7 @@ public interface ModuleService { * @param moduleName * @return */ - public ModuleConfiguration getModuleConfiguration(String moduleName); + ModuleConfiguration getModuleConfiguration(String moduleName); /** @@ -54,14 +53,14 @@ public interface ModuleService { * of the module containing the service. * */ - public ModuleConfiguration getModuleConfiguration(InjectionPoint injectionPoint); + ModuleConfiguration getModuleConfiguration(InjectionPoint injectionPoint); /** * Provide the current module configuration for the given class, i.e. the configuration of the * module containing the class. * */ - public ModuleConfiguration getModuleConfiguration(Class<?> cls); + ModuleConfiguration getModuleConfiguration(Class<?> cls); /** * Get the URL of the JAR file of the module whose name is given as argument. @@ -69,7 +68,7 @@ public interface ModuleService { * @param moduleName * @return */ - public URL getModuleJar(String moduleName); + URL getModuleJar(String moduleName); /** * Get the path relative to the LMF base URL where the web contents of this URL can be found @@ -77,7 +76,7 @@ public interface ModuleService { * @param moduleName * @return */ - public String getModuleWeb(String moduleName); + String getModuleWeb(String moduleName); /** @@ -87,7 +86,7 @@ public interface ModuleService { * @param moduleName * @return */ - public Collection<String> getEntities(String moduleName); + Collection<String> getEntities(String moduleName); /** * Return a list of webservices used by this module. Each entry is a fully-qualified classname @@ -96,7 +95,7 @@ public interface ModuleService { * @param moduleName * @return */ - public Collection<String> getWebservices(String moduleName); + Collection<String> getWebservices(String moduleName); /** @@ -106,14 +105,14 @@ public interface ModuleService { * @param moduleName * @return */ - public Collection<String> getFilters(String moduleName); + Collection<String> getFilters(String moduleName); /** * Return a list of admin pages (paths) * @param moduleName * @return */ - public List<String> getAdminPages(String moduleName); + List<String> getAdminPages(String moduleName); /** * Weight is used to sort modules in UI. @@ -129,33 +128,33 @@ public interface ModuleService { * @param moduleName * @return the weight (default == 50) */ - public int getWeight(String moduleName); + int getWeight(String moduleName); /** * returns more complex admin page description * @param moduleName * @return */ - public List<HashMap<String,String>> getAdminPageObjects(String moduleName); + List<HashMap<String,String>> getAdminPageObjects(String moduleName); /** * returns the icon (if set), null otherwise * @param moduleName * @return */ - public String getIcon(String moduleName); + String getIcon(String moduleName); /** * list modules for container sorted on weight * @param container * @return */ - public List<String> listSortedModules(String container); + List<String> listSortedModules(String container); /** * list containers sorted on weight * @return */ - public List<String> listSortedContainers(); + List<String> listSortedContainers(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ssl/SSLService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ssl/SSLService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ssl/SSLService.java index 13b0331..7089435 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ssl/SSLService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ssl/SSLService.java @@ -31,6 +31,6 @@ public interface SSLService { * * @param e the event fired by the ConfigurationService */ - public void configurationServiceInitialised(ConfigurationServiceInitEvent e); + void configurationServiceInitialised(ConfigurationServiceInitEvent e); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsModule.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsModule.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsModule.java index 360c9a5..a917b76 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsModule.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsModule.java @@ -31,36 +31,36 @@ public interface StatisticsModule { /** * Enable this module. Depending on the type of information, this may involve additional runtime overhead. */ - public void enable(); + void enable(); /** * Disable this module. */ - public void disable(); + void disable(); /** * Return true if the module is enabled. * @return */ - public boolean isEnabled(); + boolean isEnabled(); /** * Return all names of properties supported by this module. * @return */ - public List<String> getPropertyNames(); + List<String> getPropertyNames(); /** * Return the statistics as a map from key to value * @return */ - public Map<String,String> getStatistics(); + Map<String,String> getStatistics(); /** * Return the display name of the statistics module. * @return */ - public String getName(); + String getName(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsService.java index c71f680..17d4de6 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/statistics/StatisticsService.java @@ -34,54 +34,54 @@ public interface StatisticsService { * Turn on collection of statistical information for all modules. May introduce additional * overhead. */ - public void enableAll(); + void enableAll(); /** * Turn off collection of statistical information for all modules. */ - public void disableAll(); + void disableAll(); /** * Return true if statistics gathering is enabled. * * @return */ - public boolean isEnabled(); + boolean isEnabled(); /** * Enable collection of statistical information for the specified module; * * @param modName */ - public void enableModule(String modName); + void enableModule(String modName); /** * Disable collection of statistical information for the specified module; * * @param modName */ - public void disableModule(String modName); + void disableModule(String modName); /** * Register the statistics module given as argument with the statistics service * * @param mod */ - public void registerModule(String modName, StatisticsModule mod); + void registerModule(String modName, StatisticsModule mod); /** * Unregister the statistics module given as argument. * * @param mod */ - public void unregisterModule(StatisticsModule mod); + void unregisterModule(StatisticsModule mod); /** * Unregister the statistics module with the moduleName given as argument. * * @param modName */ - public void unregisterModule(String modName); + void unregisterModule(String modName); /** * Return the statistics module identified by the name passed as parameter. @@ -89,13 +89,13 @@ public interface StatisticsService { * @param modName * @return */ - public StatisticsModule getModule(String modName); + StatisticsModule getModule(String modName); /** * Return all statistics modules associated with the statistics service. * * @return */ - public List<String> listModules(); + List<String> listModules(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/task/TaskManagerService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/task/TaskManagerService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/task/TaskManagerService.java index 5b5a24f..c9a87ce 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/task/TaskManagerService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/task/TaskManagerService.java @@ -24,22 +24,22 @@ import java.util.Stack; public interface TaskManagerService { - public Task createTask(String name); + Task createTask(String name); - public Task createTask(String name, String group); + Task createTask(String name, String group); - public Task createSubTask(String name); + Task createSubTask(String name); - public Task createSubTask(String name, String group); + Task createSubTask(String name, String group); - public Task getTask(); + Task getTask(); - public void endTask(TaskInfo task); + void endTask(TaskInfo task); - public List<TaskInfo> getTasks(); + List<TaskInfo> getTasks(); - public Map<String, List<TaskInfo>> getTasksByGroup(); + Map<String, List<TaskInfo>> getTasksByGroup(); - public Map<WeakReference<Thread>, Stack<TaskInfo>> getTasksByThread(); + Map<WeakReference<Thread>, Stack<TaskInfo>> getTasksByThread(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/AdminInterfaceService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/AdminInterfaceService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/AdminInterfaceService.java index 7a7efaa..dfabd78 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/AdminInterfaceService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/AdminInterfaceService.java @@ -28,20 +28,20 @@ import javax.servlet.ServletContext; */ public interface AdminInterfaceService { - public final static String PATH = "/templates/"; + String PATH = "/templates/"; /** * inits a freebase template service with a servlet context * @param context */ - public void init(ServletContext context) throws TemplatingException; + void init(ServletContext context) throws TemplatingException; /** * this method wraps a file with a default template * @param bytes * @return */ - public byte[] process(byte[] bytes, String path) throws TemplatingException; + byte[] process(byte[] bytes, String path) throws TemplatingException; /** * Check whether the templating service considers the resource passed in the path as a menu entry it is http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java index a89024a..4a862b4 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java @@ -17,14 +17,14 @@ */ package org.apache.marmotta.platform.core.api.templating; -import java.io.IOException; -import java.io.Writer; -import java.util.Map; - import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.TemplateException; +import java.io.IOException; +import java.io.Writer; +import java.util.Map; + /** * Templating Service * @@ -32,26 +32,26 @@ import freemarker.template.TemplateException; */ public interface TemplatingService { - final static String PATH = "/templates/"; + String PATH = "/templates/"; - public final static String DEFAULT_REST_PATH = "/doc/rest/"; + String DEFAULT_REST_PATH = "/doc/rest/"; - public final static String DEFAULT_REST_FILE = "overview-index.html"; + String DEFAULT_REST_FILE = "overview-index.html"; - final static String ADMIN_TPL = "admin.ftl"; + String ADMIN_TPL = "admin.ftl"; @Deprecated - final static String ERROR_404_TPL = "404.ftl"; + String ERROR_404_TPL = "404.ftl"; - final static String ERROR_TPL = "error.ftl"; + String ERROR_TPL = "error.ftl"; - final static String RDF_HTML_TPL = "rdfhtml.ftl"; + String RDF_HTML_TPL = "rdfhtml.ftl"; - static final String DEFAULT_PROJECT = "marmotta"; + String DEFAULT_PROJECT = "marmotta"; - static final String DEFAULT_STYLE = "blue"; + String DEFAULT_STYLE = "blue"; - final static String DEFAULT_WEBSERVICE_TITLE = "Webservice"; + String DEFAULT_WEBSERVICE_TITLE = "Webservice"; void initDataModel(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/ContextService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/ContextService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/ContextService.java index 8d8105b..e91680f 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/ContextService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/ContextService.java @@ -17,13 +17,13 @@ */ package org.apache.marmotta.platform.core.api.triplestore; +import org.openrdf.model.URI; + import java.io.InputStream; import java.net.URISyntaxException; import java.util.List; import java.util.Set; -import org.openrdf.model.URI; - /** * The context (named graphs in LMF, formerly "knowledge space" in KiWi) service offers convenience * functions for working with LMF Contexts. Low level manipulation of contexts is offered by @@ -47,7 +47,7 @@ import org.openrdf.model.URI; */ public interface ContextService { - static final String DEFAULT_PREFIX = "context"; + String DEFAULT_PREFIX = "context"; //**************************************** // get/create default, inferred http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java index 344042e..5c0570f 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java @@ -33,5 +33,5 @@ public interface GarbageCollectionProvider { * * @param sail */ - public void garbageCollect(Sail sail) throws SailException; + void garbageCollect(Sail sail) throws SailException; } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/NotifyingSailProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/NotifyingSailProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/NotifyingSailProvider.java index 325b8de..6f1b0df 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/NotifyingSailProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/NotifyingSailProvider.java @@ -34,5 +34,5 @@ public interface NotifyingSailProvider extends SailProvider { * @param parent the parent sail to wrap by the provider * @return the wrapped sail */ - public NotifyingSailWrapper createSail(NotifyingSail parent); + NotifyingSailWrapper createSail(NotifyingSail parent); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SailProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SailProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SailProvider.java index b515f87..5bc9580 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SailProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/SailProvider.java @@ -29,12 +29,12 @@ public interface SailProvider { * Return the name of the provider. Used e.g. for displaying status information or logging. * @return */ - public String getName(); + String getName(); /** * Return true if this sail provider is enabled in the configuration. * @return */ - public boolean isEnabled(); + boolean isEnabled(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StandardSailProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StandardSailProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StandardSailProvider.java index adece27..e929ad5 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StandardSailProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StandardSailProvider.java @@ -33,6 +33,6 @@ public interface StandardSailProvider extends SailProvider { * @param parent the parent sail to wrap by the provider * @return the wrapped sail */ - public SailWrapper createSail(Sail parent); + SailWrapper createSail(Sail parent); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StoreProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StoreProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StoreProvider.java index 0aee216..581e680 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StoreProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/StoreProvider.java @@ -34,7 +34,7 @@ public interface StoreProvider extends SailProvider { * * @return a new instance of the store */ - public NotifyingSail createStore(); + NotifyingSail createStore(); /** @@ -44,6 +44,6 @@ public interface StoreProvider extends SailProvider { * @param sail * @return */ - public SailRepository createRepository(Sail sail); + SailRepository createRepository(Sail sail); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/TransactionalSailProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/TransactionalSailProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/TransactionalSailProvider.java index f907013..2018cbc 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/TransactionalSailProvider.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/TransactionalSailProvider.java @@ -33,6 +33,6 @@ public interface TransactionalSailProvider extends SailProvider { * @param parent the parent sail to wrap by the provider * @return the wrapped sail */ - public TransactionalSailWrapper createSail(TransactionalSail parent); + TransactionalSailWrapper createSail(TransactionalSail parent); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ui/MarmottaSystrayLink.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ui/MarmottaSystrayLink.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ui/MarmottaSystrayLink.java index b76a1b8..fc07478 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ui/MarmottaSystrayLink.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/ui/MarmottaSystrayLink.java @@ -26,7 +26,7 @@ package org.apache.marmotta.platform.core.api.ui; */ public interface MarmottaSystrayLink { - public enum Section { + enum Section { ADMIN, DEMO } @@ -34,18 +34,18 @@ public interface MarmottaSystrayLink { * Get the label of the systray entry for displaying in the menu. * @return */ - public String getLabel(); + String getLabel(); /** * Get the link to point the browser to when the user selects the menu entry. * @return */ - public String getLink(); + String getLink(); /** * Get the section where to add the systray link in the menu (currently either ADMIN or DEMO). * @return */ - public Section getSection(); + Section getSection(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserService.java index e8e51e5..6817d0e 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserService.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserService.java @@ -46,7 +46,7 @@ public interface UserService { * * @return the resource for the current user. */ - public URI getCurrentUser(); + URI getCurrentUser(); /** * Check whether the given resource is the anonyous user resource @@ -56,7 +56,7 @@ public interface UserService { * @return <code>true</code> if the given resource equals the anonymous user resource. * @see #getAnonymousUser() */ - public boolean isAnonymous(URI user); + boolean isAnonymous(URI user); /** * Set the current user to the user passed as argument. The current user should be associated @@ -65,7 +65,7 @@ public interface UserService { * * @param user */ - public void setCurrentUser(URI user); + void setCurrentUser(URI user); /** * Clear a current user setting for the current thread. Clears the thread local variable set for @@ -74,7 +74,7 @@ public interface UserService { * This will revert the the current user to the state as it had never been set, i.e. inheriting * from the parent thread. */ - public void clearCurrentUser(); + void clearCurrentUser(); /* User Token Management */ @@ -86,7 +86,7 @@ public interface UserService { * @param login login of the user to create * @return the newly created user. */ - public URI createUser(String login) throws UserExistsException; + URI createUser(String login) throws UserExistsException; /** * Create a new user with the provided login, first name and last name. The method first @@ -98,7 +98,7 @@ public interface UserService { * @param lastName last name of the user to create * @return the newly created user. */ - public URI createUser(final String login, final String firstName, final String lastName) throws UserExistsException; + URI createUser(final String login, final String firstName, final String lastName) throws UserExistsException; /** * Return the anonymous user. If it does not exist yet, it is created in the database and @@ -106,7 +106,7 @@ public interface UserService { * * @return the {@link org.apache.marmotta.kiwi.model.rdf.KiWiUriResource} representing the anonymous user. */ - public URI getAnonymousUser(); + URI getAnonymousUser(); /** * Return the (default) admin user. If it does not exist yet, it is created in the database and @@ -114,7 +114,7 @@ public interface UserService { * * @return the {@link org.apache.marmotta.kiwi.model.rdf.KiWiUriResource} representing the user "admin". */ - public URI getAdminUser(); + URI getAdminUser(); /** * Return a user by login. The user is looked up in the database and returned. In case @@ -124,7 +124,7 @@ public interface UserService { * @param login the login to look for * @return the user with the given login, or null if no such user exists */ - public URI getUser(String login); + URI getUser(String login); /** * Check whether the user with the given login name already exists. @@ -132,11 +132,11 @@ public interface UserService { * @param login the username to check * @return true if it exists. */ - public boolean userExists(String login); + boolean userExists(String login); /** * Create the default users (namely "admin" and "anonymous"). */ - public void createDefaultUsers(); + void createDefaultUsers(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/content/MediaContentItem.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/content/MediaContentItem.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/content/MediaContentItem.java index 11296c3..e7124cc 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/content/MediaContentItem.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/content/MediaContentItem.java @@ -34,24 +34,24 @@ public interface MediaContentItem extends Facade { * @return */ @RDF(Namespaces.NS_KIWI_CORE+"hasContentPath") - public String getContentPath(); + String getContentPath(); /** * Set the file system path of this content. * @param path */ - public void setContentPath(String path); + void setContentPath(String path); /** * Return the URI location of the content for this resource * @return */ @RDF(Namespaces.NS_KIWI_CORE+"hasContentLocation") - public String getContentLocation(); + String getContentLocation(); /** * Set the URI location of the content for this resource * @return */ - public void setContentLocation(String location); + void setContentLocation(String location); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/logging/LoggingOutput.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/logging/LoggingOutput.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/logging/LoggingOutput.java index 34c3b8a..3029b51 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/logging/LoggingOutput.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/logging/LoggingOutput.java @@ -109,9 +109,8 @@ public abstract class LoggingOutput { LoggingOutput that = (LoggingOutput) o; - if (!id.equals(that.id)) return false; + return id.equals(that.id); - return true; } @Override http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/MarmottaUser.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/MarmottaUser.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/MarmottaUser.java index ea0cb79..72beb06 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/MarmottaUser.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/MarmottaUser.java @@ -35,33 +35,33 @@ import java.util.Set; public interface MarmottaUser extends Facade { @RDF(Namespaces.NS_FOAF + "nick") - public String getNick(); - public void setNick(String nick); + String getNick(); + void setNick(String nick); /** * The first name of the user; mapped to the foaf:firstName RDF property */ @RDF(Namespaces.NS_FOAF + "firstName") - public String getFirstName(); - public void setFirstName(String firstName); + String getFirstName(); + void setFirstName(String firstName); /** * The last name of the user; mapped to the foaf:lastName RDF property */ @RDF(Namespaces.NS_FOAF + "lastName") - public String getLastName(); - public void setLastName(String lastName); + String getLastName(); + void setLastName(String lastName); @RDF(Namespaces.NS_FOAF + "mbox") - public String getMbox(); - public void setMbox(String mbox); + String getMbox(); + void setMbox(String mbox); @RDF(Namespaces.NS_FOAF + "depiction") - public URI getDepiciton(); - public void setDepiction(URI depiction); + URI getDepiciton(); + void setDepiction(URI depiction); @RDF(Namespaces.NS_FOAF + "account") - public Set<OnlineAccount> getOnlineAccounts(); - public void setOnlineAccounts(Set<OnlineAccount> onlineAccounts); + Set<OnlineAccount> getOnlineAccounts(); + void setOnlineAccounts(Set<OnlineAccount> onlineAccounts); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/OnlineAccount.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/OnlineAccount.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/OnlineAccount.java index 545166d..433e84a 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/OnlineAccount.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/model/user/OnlineAccount.java @@ -32,10 +32,10 @@ import org.apache.marmotta.commons.sesame.model.Namespaces; public interface OnlineAccount extends Facade { @RDF(Namespaces.NS_FOAF + "accountServiceHomepage") - public String getAccountServiceHomepage(); - public void setAccountServiceHomepage(String accountServiceHomepage); + String getAccountServiceHomepage(); + void setAccountServiceHomepage(String accountServiceHomepage); @RDF(Namespaces.NS_FOAF + "accountName") - public String getAccountName(); - public void setAccountName(String accountName); + String getAccountName(); + void setAccountName(String accountName); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/qualifiers/cache/MarmottaCache.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/qualifiers/cache/MarmottaCache.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/qualifiers/cache/MarmottaCache.java index b02208d..7b70d03 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/qualifiers/cache/MarmottaCache.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/qualifiers/cache/MarmottaCache.java @@ -39,5 +39,5 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface MarmottaCache { - @Nonbinding public String value(); + @Nonbinding String value(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/http/HttpClientServiceImpl.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/http/HttpClientServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/http/HttpClientServiceImpl.java index 61bba76..dc40248 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/http/HttpClientServiceImpl.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/http/HttpClientServiceImpl.java @@ -894,14 +894,14 @@ public class HttpClientServiceImpl implements HttpClientService { if (existingEntry == null) { putEntry(key, updatedEntry); return; - } else { - // Attempt to do a CAS replace, if we fail then retry - // While this operation should work fine within this instance, multiple instances - // could trample each others' data - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - serializer.writeTo(updatedEntry, bos); - cache.replace(key, oldData, bos.toByteArray()); } + + // Attempt to do a CAS replace, if we fail then retry + // While this operation should work fine within this instance, multiple instances + // could trample each others' data + final ByteArrayOutputStream bos = new ByteArrayOutputStream(); + serializer.writeTo(updatedEntry, bos); + cache.replace(key, oldData, bos.toByteArray()); } } } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java index 854a381..38f762f 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java @@ -54,7 +54,7 @@ public class ResourceSubjectMetadata extends RepositoryConnectionInterceptorAdap denyAdd = true; } return denyAdd; - }; + } @Override public boolean remove(RepositoryConnection conn, Resource s, org.openrdf.model.URI p, Value o, Resource... contexts) { http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/api/LdpService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/api/LdpService.java b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/api/LdpService.java index 44c8d07..201be66 100644 --- a/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/api/LdpService.java +++ b/platform/marmotta-ldp/src/main/java/org/apache/marmotta/platform/ldp/api/LdpService.java @@ -49,14 +49,14 @@ import java.util.*; */ public interface LdpService { - public static final Set<URI> SERVER_MANAGED_PROPERTIES = new HashSet<>(Arrays.asList( + Set<URI> SERVER_MANAGED_PROPERTIES = new HashSet<>(Arrays.asList( LDP.contains, DCTERMS.CREATED, DCTERMS.MODIFIED )); - public static final List<RDFFormat> SERVER_PREFERED_RDF_FORMATS = Arrays.asList( + List<RDFFormat> SERVER_PREFERED_RDF_FORMATS = Arrays.asList( RDFFormat.TURTLE, RDFFormat.JSONLD, RDFFormat.RDFXML, RDFFormat.N3 ); - public static enum InteractionModel { + enum InteractionModel { LDPR(LDP.Resource), LDPC(LDP.Container); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/api/LDPathService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/api/LDPathService.java b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/api/LDPathService.java index e0e2adf..180f22a 100644 --- a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/api/LDPathService.java +++ b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/api/LDPathService.java @@ -24,7 +24,6 @@ import org.apache.marmotta.ldpath.exception.LDPathParseException; import org.openrdf.model.Value; import java.util.Collection; -import java.util.List; import java.util.Map; import java.util.Set; @@ -41,13 +40,13 @@ public interface LDPathService { * * @param function {@link SelectorFunction} to register. */ - public void registerFunction(SelectorFunction<Value> function); + void registerFunction(SelectorFunction<Value> function); /** * List all selector functions that are currently registered with LDPath. */ - public Set<SelectorFunction<Value>> getFunctions(); + Set<SelectorFunction<Value>> getFunctions(); /** * Run a path query starting from the given context node and return the result as a collection of KiWiNodes. The @@ -60,7 +59,7 @@ public interface LDPathService { * @return a collection of KiWiNodes * @throws LDPathParseException when the path passed as argument could not be parsed */ - public Collection<Value> pathQuery(Value context, String path, Map<String, String> namespaces) throws LDPathParseException; + Collection<Value> pathQuery(Value context, String path, Map<String, String> namespaces) throws LDPathParseException; /** * Run a path program starting from the given context node and return the result as a collection of KiWiNodes for @@ -71,7 +70,7 @@ public interface LDPathService { * @return a map mapping from field names to the resulting collection of KiWiNodes for the field * @throws org.apache.marmotta.ldpath.exception.LDPathParseException when the path passed as argument could not be parsed */ - public Map<String, Collection<?>> programQuery(Value context, String program) throws LDPathParseException; + Map<String, Collection<?>> programQuery(Value context, String program) throws LDPathParseException; /** @@ -83,7 +82,7 @@ public interface LDPathService { * @return * @throws LDPathParseException */ - public Map<Value,Map<String,Collection<?>>> programQuery(String program) throws LDPathParseException; + Map<Value,Map<String,Collection<?>>> programQuery(String program) throws LDPathParseException; /** * Register a result transformer for a type URI. Use this method in your own projects @@ -93,10 +92,10 @@ public interface LDPathService { * in path programs * @param transformer instance of a node transformer */ - public void registerTransformer(String typeUri, NodeTransformer<?, Value> transformer); + void registerTransformer(String typeUri, NodeTransformer<?, Value> transformer); /** * List all types that have a transformer registered. */ - public Set<String> getTransformableTypes(); + Set<String> getTransformableTypes(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathUtilWebService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathUtilWebService.java b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathUtilWebService.java index add2b7f..2253525 100644 --- a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathUtilWebService.java +++ b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathUtilWebService.java @@ -17,26 +17,19 @@ */ package org.apache.marmotta.platform.ldpath.webservices; -import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException; -import static org.apache.marmotta.commons.sesame.repository.ResourceUtils.listOutgoing; -import static org.apache.marmotta.commons.sesame.repository.ResourceUtils.listResourcesByPrefix; -import static org.apache.marmotta.commons.sesame.repository.ResultUtils.iterable; - -import org.apache.marmotta.platform.ldpath.api.LDPathService; -import org.apache.marmotta.commons.sesame.model.Namespaces; -import org.apache.marmotta.commons.sesame.repository.ResourceUtils; - import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; - -import org.apache.marmotta.platform.core.api.prefix.PrefixService; -import org.apache.marmotta.platform.core.api.triplestore.SesameService; -import org.apache.marmotta.platform.core.services.prefix.PrefixCC; import org.apache.commons.lang3.StringUtils; import org.apache.marmotta.commons.http.UriUtil; +import org.apache.marmotta.commons.sesame.model.Namespaces; +import org.apache.marmotta.commons.sesame.repository.ResourceUtils; import org.apache.marmotta.ldpath.api.functions.SelectorFunction; import org.apache.marmotta.ldpath.backend.sesame.SesameConnectionBackend; import org.apache.marmotta.ldpath.exception.LDPathParseException; +import org.apache.marmotta.platform.core.api.prefix.PrefixService; +import org.apache.marmotta.platform.core.api.triplestore.SesameService; +import org.apache.marmotta.platform.core.services.prefix.PrefixCC; +import org.apache.marmotta.platform.ldpath.api.LDPathService; import org.openrdf.model.*; import org.openrdf.repository.RepositoryConnection; import org.openrdf.repository.RepositoryException; @@ -46,12 +39,16 @@ import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.UriInfo; - import java.net.URISyntaxException; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException; +import static org.apache.marmotta.commons.sesame.repository.ResourceUtils.listOutgoing; +import static org.apache.marmotta.commons.sesame.repository.ResourceUtils.listResourcesByPrefix; +import static org.apache.marmotta.commons.sesame.repository.ResultUtils.iterable; + @Path("/ldpath/util") public class LDPathUtilWebService { @@ -253,12 +250,8 @@ public class LDPathUtilWebService { // Merge the contexts HashSet<String> context = new HashSet<String>(); - for (String c : ctx) { - context.add(c); - } - for (String c : ctx2) { - context.add(c); - } + Collections.addAll(context, ctx); + Collections.addAll(context, ctx2); // Clean the path String path = partialPath.replaceAll("/.*", "").trim(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/api/SecurityService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/api/SecurityService.java b/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/api/SecurityService.java index 4bfa549..d0019d2 100644 --- a/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/api/SecurityService.java +++ b/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/api/SecurityService.java @@ -37,7 +37,7 @@ public interface SecurityService { * @param request * @return true in case the active security constraints grant access, false otherwise */ - public boolean grantAccess(HttpServletRequest request); + boolean grantAccess(HttpServletRequest request); /** * Load a pre-configured security profile from the classpath. When calling this method, the service will @@ -45,18 +45,18 @@ public interface SecurityService { * the new security constraints. * @param profile */ - public void loadSecurityProfile(String profile); + void loadSecurityProfile(String profile); /** * List all security constraints, ordered by priority. * @return */ - public List<SecurityConstraint> listSecurityConstraints(); + List<SecurityConstraint> listSecurityConstraints(); /** * Does nothing, just ensures the security service is properly initialised. * TODO: this is a workaround and should be fixed differently. */ - public void ping(); + void ping(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/model/SecurityConstraint.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/model/SecurityConstraint.java b/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/model/SecurityConstraint.java index d1fc002..afa0eb9 100644 --- a/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/model/SecurityConstraint.java +++ b/platform/marmotta-security/src/main/java/org/apache/marmotta/platform/security/model/SecurityConstraint.java @@ -37,7 +37,7 @@ import java.util.Set; */ public class SecurityConstraint implements Comparable<SecurityConstraint> { - public enum Type { PERMISSION, RESTRICTION }; + public enum Type { PERMISSION, RESTRICTION } private static Logger log = LoggerFactory.getLogger(SecurityConstraint.class); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/QueryType.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/QueryType.java b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/QueryType.java index 0f7b4a9..2df9033 100644 --- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/QueryType.java +++ b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/QueryType.java @@ -29,6 +29,6 @@ public enum QueryType { GRAPH, - BOOL; + BOOL } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/SparqlService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/SparqlService.java b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/SparqlService.java index 60c1f54..0436e36 100644 --- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/SparqlService.java +++ b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/api/sparql/SparqlService.java @@ -17,20 +17,11 @@ */ package org.apache.marmotta.platform.sparql.api.sparql; -import java.io.OutputStream; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeoutException; - import org.apache.marmotta.platform.core.exception.InvalidArgumentException; import org.apache.marmotta.platform.core.exception.MarmottaException; import org.apache.marmotta.platform.sparql.services.sparqlio.rdf.SPARQLGraphResultWriter; import org.openrdf.model.Value; -import org.openrdf.query.MalformedQueryException; -import org.openrdf.query.Query; -import org.openrdf.query.QueryEvaluationException; -import org.openrdf.query.QueryLanguage; -import org.openrdf.query.UpdateExecutionException; +import org.openrdf.query.*; import org.openrdf.query.resultio.BooleanQueryResultWriter; import org.openrdf.query.resultio.QueryResultWriter; import org.openrdf.query.resultio.TupleQueryResultWriter; @@ -38,6 +29,11 @@ import org.openrdf.repository.RepositoryException; import org.openrdf.rio.RDFHandlerException; import org.openrdf.rio.RDFWriter; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeoutException; + /** * Add file description here! * <p/> @@ -99,7 +95,7 @@ public interface SparqlService { * @param queryLanguage the query language to use * @param query the SPARQL query to evaluate in SPARQL 1.1 syntax */ - public List<Map<String,Value>> query(QueryLanguage queryLanguage, String query) throws MarmottaException; + List<Map<String,Value>> query(QueryLanguage queryLanguage, String query) throws MarmottaException; /** * Execute a SPARQL update on the KiWi TripleStore. Throws a KiWiException in case the update execution fails. http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/AuthenticationService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/AuthenticationService.java b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/AuthenticationService.java index fd29cfb..bdaaf23 100644 --- a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/AuthenticationService.java +++ b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/AuthenticationService.java @@ -37,7 +37,7 @@ public interface AuthenticationService { * @param password password of the user to authenticate * @return true on success, false if the user does not exist or the passwords do not match. */ - public boolean authenticateUser(String login, String password); + boolean authenticateUser(String login, String password); /** @@ -48,7 +48,7 @@ public interface AuthenticationService { * @param password * @return */ - public void setUserPassword(String login, String password); + void setUserPassword(String login, String password); /** @@ -57,7 +57,7 @@ public interface AuthenticationService { * @param login login name of the user for whom to return the roles * @return a list of strings with the role names currently assigned to the user */ - public Set<String> listUserRoles(String login); + Set<String> listUserRoles(String login); /** @@ -66,7 +66,7 @@ public interface AuthenticationService { * @param login the login name of the user with whom to associate roles * @param role the role name to associate with the user */ - public void addUserRole(String login, String role); + void addUserRole(String login, String role); /** * Remove the role with the given name from the user with the given login. @@ -74,10 +74,10 @@ public interface AuthenticationService { * @param login the login name of the user from whom to remove the role * @param role the role name to remove from the list of roles of the user */ - public void removeUserRole(String login, String role); + void removeUserRole(String login, String role); /** * Returns a list of available {@link AuthenticationProvider} names. */ - public Set<String> listAuthProviderNames(); + Set<String> listAuthProviderNames(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/UserConfigurationService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/UserConfigurationService.java b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/UserConfigurationService.java index edc3b09..9f1d79e 100644 --- a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/UserConfigurationService.java +++ b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/api/UserConfigurationService.java @@ -36,7 +36,7 @@ public interface UserConfigurationService { * @param key * @return */ - public boolean isUserConfigurationSet(UserAccount user, String key); + boolean isUserConfigurationSet(UserAccount user, String key); /** * Get the configuration for the given user and key. If there is no such configuration, a new one is @@ -46,7 +46,7 @@ public interface UserConfigurationService { * @param key unique configuration key for lookup * @return a configuration object with either the configured value or null as value */ - public String getUserConfiguration(UserAccount user, String key); + String getUserConfiguration(UserAccount user, String key); /** * Get the configuration for the given user and key. If there is no such configuration, a new one is @@ -57,7 +57,7 @@ public interface UserConfigurationService { * @param defaultValue default value if configuration not found * @return a configuration object with either the configured value or defaultValue */ - public String getUserConfiguration(UserAccount user, String key, String defaultValue); + String getUserConfiguration(UserAccount user, String key, String defaultValue); /** @@ -65,14 +65,14 @@ public interface UserConfigurationService { * @param key * @param value */ - public void setUserConfiguration(UserAccount user, String key, String value); + void setUserConfiguration(UserAccount user, String key, String value); /** * Set the configuration "key" to the string value "value". * @param key * @param values */ - public void setUserListConfiguration(UserAccount user, String key, List<String> values); + void setUserListConfiguration(UserAccount user, String key, List<String> values); /** @@ -81,7 +81,7 @@ public interface UserConfigurationService { * * @param user */ - public List<Object> getUserListConfiguration(UserAccount user, String key); + List<Object> getUserListConfiguration(UserAccount user, String key); /** * Return the list configuration value of the given key for the given user. Returns the @@ -89,13 +89,13 @@ public interface UserConfigurationService { * * @param user */ - public List<Object> getUserListConfiguration(UserAccount user, String key, List<Object> defaultValue); + List<Object> getUserListConfiguration(UserAccount user, String key, List<Object> defaultValue); /** * Remove the user configuration identified by "key" from the database. * @param key */ - public void removeUserConfiguration(UserAccount user, String key); + void removeUserConfiguration(UserAccount user, String key); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/model/UserAccount.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/model/UserAccount.java b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/model/UserAccount.java index 12f6f6b..600a744 100644 --- a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/model/UserAccount.java +++ b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/model/UserAccount.java @@ -17,14 +17,14 @@ */ package org.apache.marmotta.platform.user.model; +import org.apache.marmotta.commons.util.HashUtils; + import java.io.Serializable; import java.util.HashSet; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.marmotta.commons.util.HashUtils; - /** * User: Stephanie Stroka * Date: 18.05.2011 @@ -40,7 +40,7 @@ public class UserAccount implements Serializable { * @author Jakob Frank <[email protected]> * */ - public static enum PasswordHash { + public enum PasswordHash { PLAIN { @Override protected String hash(String in) { http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/webservices/UserManagementWebService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/webservices/UserManagementWebService.java b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/webservices/UserManagementWebService.java index a079f2a..ef22891 100644 --- a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/webservices/UserManagementWebService.java +++ b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/webservices/UserManagementWebService.java @@ -17,13 +17,13 @@ */ package org.apache.marmotta.platform.user.webservices; -import org.apache.marmotta.platform.user.api.AccountService; -import org.apache.marmotta.platform.user.model.UserAccount; +import org.apache.commons.lang3.StringUtils; import org.apache.marmotta.commons.sesame.model.Namespaces; import org.apache.marmotta.commons.sesame.repository.ResourceUtils; import org.apache.marmotta.platform.core.api.config.ConfigurationService; import org.apache.marmotta.platform.core.api.triplestore.SesameService; -import org.apache.commons.lang3.StringUtils; +import org.apache.marmotta.platform.user.api.AccountService; +import org.apache.marmotta.platform.user.model.UserAccount; import org.openrdf.model.Literal; import org.openrdf.model.Statement; import org.openrdf.model.URI; @@ -35,15 +35,7 @@ import org.slf4j.Logger; import javax.annotation.PostConstruct; import javax.inject.Inject; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; @@ -205,7 +197,7 @@ public class UserManagementWebService { } accountService.deleteAccount(account); - return Response.status(Status.OK).entity(String.format("login removed")).build(); + return Response.status(Status.OK).entity("login removed").build(); } finally { conn.commit(); conn.close(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/MementoService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/MementoService.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/MementoService.java index 6edc12e..229313a 100644 --- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/MementoService.java +++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/MementoService.java @@ -42,7 +42,7 @@ public interface MementoService { * @return the version with respect to the date * @throws MementoException */ - public Version getVersion(Resource resource, Date date) throws MementoException; + Version getVersion(Resource resource, Date date) throws MementoException; //public Version getLastVersion(Resource resource) throws MementoException; //public Version getFirstVersion(Resource resource) throws MementoException; @@ -56,6 +56,6 @@ public interface MementoService { * @throws MementoException * @see MementoVersionSet */ - public MementoVersionSet getVersionSet(Resource resource, Date date) throws MementoException; + MementoVersionSet getVersionSet(Resource resource, Date date) throws MementoException; } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/VersionSerializerService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/VersionSerializerService.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/VersionSerializerService.java index 510290f..f19c6da 100644 --- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/VersionSerializerService.java +++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/api/VersionSerializerService.java @@ -35,6 +35,6 @@ public interface VersionSerializerService { * @param type a list of mimetype (from Accept header) * @return a serializer */ - public VersionSerializer getSerializer(List<ContentType> type) throws IOException; + VersionSerializer getSerializer(List<ContentType> type) throws IOException; } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/io/VersionSerializer.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/io/VersionSerializer.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/io/VersionSerializer.java index 0c1c878..7c5223f 100644 --- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/io/VersionSerializer.java +++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/io/VersionSerializer.java @@ -37,13 +37,13 @@ public interface VersionSerializer { * returns a list of supported content types * @return */ - public List<ContentType> getContentTypes(); + List<ContentType> getContentTypes(); /** * return the content type that will be produced * @return */ - public ContentType getContentType(); + ContentType getContentType(); /** * writes serialized version list to output stream @@ -51,6 +51,6 @@ public interface VersionSerializer { * @param versions a list of versions in ascending order * @param out an output stream */ - public void write(Resource original, RepositoryResult<Version> versions, OutputStream out) throws IOException; + void write(Resource original, RepositoryResult<Version> versions, OutputStream out) throws IOException; } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/services/VersioningSailProvider.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/services/VersioningSailProvider.java b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/services/VersioningSailProvider.java index 68bf728..8804239 100644 --- a/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/services/VersioningSailProvider.java +++ b/platform/marmotta-versioning-kiwi/src/main/java/org/apache/marmotta/platform/versioning/services/VersioningSailProvider.java @@ -17,17 +17,6 @@ */ package org.apache.marmotta.platform.versioning.services; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.inject.Named; - import org.apache.marmotta.commons.sesame.filter.AllOfFilter; import org.apache.marmotta.commons.sesame.filter.SesameFilter; import org.apache.marmotta.commons.sesame.filter.statement.StatementFilter; @@ -47,6 +36,16 @@ import org.openrdf.repository.RepositoryResult; import org.openrdf.sail.SailException; import org.slf4j.Logger; +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.event.Observes; +import javax.enterprise.inject.Instance; +import javax.inject.Inject; +import javax.inject.Named; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + /** * A SAIL provider wrapping a versioning component around the repository * <p/> @@ -112,9 +111,7 @@ public class VersioningSailProvider implements TransactionalSailProvider { StatementFilter filterCached = new StatementFilter() { @Override public boolean accept(Statement object) { - if(object.getContext() != null && configurationService.getCacheContext().equals(object.getContext().stringValue())) return false; - else - return true; + return !(object.getContext() != null && configurationService.getCacheContext().equals(object.getContext().stringValue())); } }; sFilters.add(filterCached); @@ -122,9 +119,7 @@ public class VersioningSailProvider implements TransactionalSailProvider { StatementFilter filterInferred = new StatementFilter() { @Override public boolean accept(Statement object) { - if(object.getContext() != null && configurationService.getInferredContext().equals(object.getContext().stringValue())) return false; - else - return true; + return !(object.getContext() != null && configurationService.getInferredContext().equals(object.getContext().stringValue())); } }; sFilters.add(filterInferred); @@ -132,9 +127,7 @@ public class VersioningSailProvider implements TransactionalSailProvider { StatementFilter filterEnhancing = new StatementFilter() { @Override public boolean accept(Statement object) { - if(object.getContext() != null && configurationService.getEnhancerContex().equals(object.getContext().stringValue())) return false; - else - return true; + return !(object.getContext() != null && configurationService.getEnhancerContex().equals(object.getContext().stringValue())); } }; sFilters.add(filterEnhancing); http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/api/ZookeeperService.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/api/ZookeeperService.java b/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/api/ZookeeperService.java index b28b14e..e361048 100644 --- a/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/api/ZookeeperService.java +++ b/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/api/ZookeeperService.java @@ -24,10 +24,10 @@ package org.apache.marmotta.platform.zookeeper.api; */ public interface ZookeeperService { - public static final String ZK_SERVER = "zookeeper.server"; - public static final String ZK_TIMEOUT = "zookeeper.timeout"; - public static final String ZK_INSTANCE = "zookeeper.instance"; - public static final String ZK_CLUSTER = "zookeeper.cluster"; + String ZK_SERVER = "zookeeper.server"; + String ZK_TIMEOUT = "zookeeper.timeout"; + String ZK_INSTANCE = "zookeeper.instance"; + String ZK_CLUSTER = "zookeeper.cluster"; } http://git-wip-us.apache.org/repos/asf/marmotta/blob/37707785/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/services/ZookeeperServiceImpl.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/services/ZookeeperServiceImpl.java b/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/services/ZookeeperServiceImpl.java index a4dcf30..6423b07 100644 --- a/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/services/ZookeeperServiceImpl.java +++ b/platform/marmotta-zookeeper/src/main/java/org/apache/marmotta/platform/zookeeper/services/ZookeeperServiceImpl.java @@ -194,7 +194,7 @@ public class ZookeeperServiceImpl implements ZookeeperService { // TODO: check that the datacenter id is not yet occupied // configure datacenter id using a sequential ephemeral node - datacenterIdPath = nodeKeeper.getZooKeeper().create(String.format("/marmotta/clusters/%s/snowflake/id-", cluster),new String("creator:"+uuid).getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); + datacenterIdPath = nodeKeeper.getZooKeeper().create(String.format("/marmotta/clusters/%s/snowflake/id-", cluster), ("creator:" + uuid).getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); int datacenterId = Integer.parseInt(datacenterIdPath.substring(datacenterIdPath.lastIndexOf("id-")+3)) % 4096; log.info("ZOOKEEPER: generated datacenter ID {}", datacenterId); @@ -209,7 +209,7 @@ public class ZookeeperServiceImpl implements ZookeeperService { if (nodeKeeper.getZooKeeper().exists(path,false) == null) { String uuid = configurationService.getStringConfiguration(ZK_INSTANCE, UUID.randomUUID().toString()); - nodeKeeper.getZooKeeper().create(path,new String("creator:"+uuid).getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); + nodeKeeper.getZooKeeper().create(path, ("creator:" + uuid).getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } }
