You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/07/13 20:26:36 UTC

svn commit: r1690788 - in /sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime: ./ dto/

Author: cziegeler
Date: Mon Jul 13 18:26:35 2015
New Revision: 1690788

URL: http://svn.apache.org/r1690788
Log:
SLING-4770 : Create DTOs for state inspection

Added:
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java   (with props)
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java   (with props)

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime;
+
+import org.apache.sling.api.resource.runtime.dto.RuntimeDTO;
+
+import aQute.bnd.annotation.ProviderType;
+
+@ProviderType
+public interface RuntimeService {
+
+    RuntimeDTO getRuntimeDTO();
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/RuntimeService.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime.dto;
+
+/**
+ * Enumeration for the auth type of a resource provider.
+ */
+public enum AuthType {
+
+    no,
+    lazy,
+    required
+
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/AuthType.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime.dto;
+
+/**
+ * Failure reason for a failed resource provider.
+ */
+public enum FailureReason {
+
+    invalid,             // invalid configuration
+    shadowed,            // shadowed by another provider
+    service_not_gettable // service not gettable from service registry
+
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/FailureReason.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime.dto;
+
+/**
+ * Represents a {@code org.apache.sling.spi.resource.provider.ResourceProvider}.
+ */
+public class ResourceProviderDTO {
+
+    /**
+	 * The name of the resource provider.
+	 * Optional might be null.
+	 */
+	public String name;
+
+    /**
+     * The path of the resource provider.
+     */
+    public String path;
+
+    /**
+     * Whether resource access security should be used.
+     */
+    public boolean useResourceAccessSecurity;
+
+    /**
+     * The auth handling for this provider.
+     */
+    public AuthType authType;
+
+    /**
+     * Whether the resource provider supports modifications.
+     */
+    public boolean modifiable;
+
+    /**
+     * The service id from the service registry.
+     */
+    public int serviceId;
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderDTO.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime.dto;
+
+/**
+ * Represents a failed {@code org.apache.sling.spi.resource.provider.ResourceProvider}.
+ * If the provider is failed, some of the properties of the {@link ResourceProviderDTO}
+ * might be missing or invalid.
+ */
+public class ResourceProviderFailureDTO extends ResourceProviderDTO {
+
+    /**
+     * The reason for the failure.
+     */
+	public FailureReason reason;
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/ResourceProviderFailureDTO.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.runtime.dto;
+
+/**
+ * Represents the resource resolver runtime
+ */
+public class RuntimeDTO {
+
+    /**
+     * DTOs for all active providers.
+     * If there is none, the array is empty.
+     */
+    public ResourceProviderDTO[] providers;
+
+    /**
+     * DTOs for all inactive/failed providers.
+     * If there is none, the array is empty.
+     */
+    public ResourceProviderFailureDTO[] failedProviders;
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/RuntimeDTO.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.api.resource.runtime.dto;
+
+import aQute.bnd.annotation.Version;
+

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/dto/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java?rev=1690788&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java (added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java Mon Jul 13 18:26:35 2015
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@Version("1.0.0")
+package org.apache.sling.api.resource.runtime;
+
+import aQute.bnd.annotation.Version;
+

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/runtime/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url