[ 
https://issues.apache.org/jira/browse/KNOX-2053?focusedWorklogId=328431&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-328431
 ]

ASF GitHub Bot logged work on KNOX-2053:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Oct/19 09:19
            Start Date: 15/Oct/19 09:19
    Worklog Time Spent: 10m 
      Work Description: risdenk commented on pull request #164: KNOX-2053 - New 
REST API to create/read/update/delete service definitions
URL: https://github.com/apache/knox/pull/164#discussion_r334833529
 
 

 ##########
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/registry/impl/DefaultServiceDefinitionRegistry.java
 ##########
 @@ -17,46 +17,91 @@
  */
 package org.apache.knox.gateway.services.registry.impl;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.nio.file.Files.newBufferedWriter;
+import static 
org.apache.knox.gateway.deploy.impl.ApplicationDeploymentContributor.REWRITE_RULES_FILE_NAME;
+import static 
org.apache.knox.gateway.deploy.impl.ApplicationDeploymentContributor.SERVICE_DEFINITION_FILE_NAME;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.stream.Collectors;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
 import org.apache.knox.gateway.GatewayMessages;
 import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
+import 
org.apache.knox.gateway.filter.rewrite.impl.xml.XmlUrlRewriteRulesExporter;
 import org.apache.knox.gateway.i18n.messages.MessagesFactory;
 import org.apache.knox.gateway.service.definition.Route;
 import org.apache.knox.gateway.service.definition.ServiceDefinition;
+import 
org.apache.knox.gateway.service.definition.ServiceDefinitionChangeListener;
+import org.apache.knox.gateway.service.definition.ServiceDefinitionPair;
 import org.apache.knox.gateway.services.Service;
 import org.apache.knox.gateway.services.ServiceLifecycleException;
 import org.apache.knox.gateway.services.registry.ServiceDefEntry;
 import org.apache.knox.gateway.services.registry.ServiceDefinitionRegistry;
+import 
org.apache.knox.gateway.services.registry.ServiceDefinitionRegistryException;
 import org.apache.knox.gateway.util.ServiceDefinitionsLoader;
 import org.apache.knox.gateway.util.urltemplate.Matcher;
 import org.apache.knox.gateway.util.urltemplate.Parser;
 import org.apache.knox.gateway.util.urltemplate.Template;
 
-import java.io.File;
-import java.net.URISyntaxException;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 public class DefaultServiceDefinitionRegistry implements 
ServiceDefinitionRegistry, Service {
 
-  private static GatewayMessages LOG = MessagesFactory.get( 
GatewayMessages.class );
+  private static GatewayMessages LOG = 
MessagesFactory.get(GatewayMessages.class);
+
+  private final ReadWriteLock lock = new ReentrantReadWriteLock();
+  private final Lock writeLock = lock.writeLock();
 
 Review comment:
   What are we trying to lock here?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 328431)
    Time Spent: 0.5h  (was: 20m)

> Add Service Definition Management to Admin API
> ----------------------------------------------
>
>                 Key: KNOX-2053
>                 URL: https://issues.apache.org/jira/browse/KNOX-2053
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>            Reporter: Larry McCay
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.4.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently, the Admin API allows management and access to topologies, 
> descriptors, provider config, etc but does not provide access to the Service 
> Definitions for the proxied services.
> Let's expand the API the include to include service defs and allow for 
> customization through the API. Changes made via the API will typically 
> require a restart and touch of an topology file that is referencing the 
> change service def. This may require a separate Jira and effort to address. 
> In the meantime, we should be able to change, add and delete service 
> definitions including both service and rewrite XML files.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to