Author: elvisisking
Date: 2009-07-14 08:59:48 -0400 (Tue, 14 Jul 2009)
New Revision: 1111
Added:
branches/eclipse/dna-web-jcr-rest-client/.classpath
branches/eclipse/dna-web-jcr-rest-client/.project
branches/eclipse/dna-web-jcr-rest-client/pom.xml
branches/eclipse/dna-web-jcr-rest-client/src/
branches/eclipse/dna-web-jcr-rest-client/src/main/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IConstants.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.java
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.java
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
branches/eclipse/dna-web-jcr-rest-client/src/test/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/
branches/eclipse/dna-web-jcr-rest-client/src/test/java/org/jboss/dna/web/jcr/rest/client/
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/log4j.properties
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/org/
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/target/
branches/eclipse/dna-web-jcr-rest-client/target/classes/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IConstants.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Logger.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Messages.properties
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerManager.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent$Type.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status$Severity.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Utils.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Repository.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Server.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Workspace.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest$Method.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand$1.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.class
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.class
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-test-sources.jar
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-tests.jar
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT.jar
branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/
branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/pom.properties
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/log4j.properties
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/dna/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/dna/web/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/dna/web/jcr/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/dna/web/jcr/rest/
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/org/jboss/dna/web/jcr/rest/client/
Log:
Initial check-in of incomplet non-UI related code.
Added: branches/eclipse/dna-web-jcr-rest-client/.classpath
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/.classpath (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/.classpath 2009-07-14 12:59:48 UTC (rev
1111)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes"
path="src/test/java"/>
+ <classpathentry kind="src" output="target/test-classes"
path="src/test/resources"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Property changes on: branches/eclipse/dna-web-jcr-rest-client/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/eclipse/dna-web-jcr-rest-client/.project
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/.project (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/.project 2009-07-14 12:59:48 UTC (rev 1111)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>dna-web-jcr-rest-client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Property changes on: branches/eclipse/dna-web-jcr-rest-client/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/eclipse/dna-web-jcr-rest-client/pom.xml
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/pom.xml (rev 0)
+++ branches/eclipse/dna-web-jcr-rest-client/pom.xml 2009-07-14 12:59:48 UTC (rev 1111)
@@ -0,0 +1,76 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna</artifactId>
+ <version>0.6-SNAPSHOT</version>
+ </parent>
+ <!-- The groupId and version values are inherited from parent -->
+ <artifactId>dna-web-jcr-rest-client</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss DNA JCR REST Client</name>
+ <description>JBoss DNA JCR REST client resource publishing</description>
+ <
url>http://labs.jboss.org/dna</url>
+ <!--
+ Define the dependencies. Note that all version and scopes default to those
+ defined in the dependencyManagement section of the parent pom.
+ -->
+ <dependencies>
+ <!--
+ Testing (note the scope)
+ -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!--
+ Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for
testing)
+ -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <!--
+ Java Concurrency in Practice annotations
+ -->
+ <dependency>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>1.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxb-provider</artifactId>
+ <version>1.1.GA</version>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Property changes on: branches/eclipse/dna-web-jcr-rest-client/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IConstants.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IConstants.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IConstants.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,76 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+import java.util.ResourceBundle;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public interface IConstants {
+
+ ResourceBundle MESSAGES =
ResourceBundle.getBundle(IConstants.class.getPackage().getName() + ".Messages");
//$NON-NLS-1$
+
+ String ErrorDeletingServerRegistryFile = "ErrorDeletingServerRegistryFile";
//$NON-NLS-1$
+
+ String ErrorRestoringServerRegistry = "ErrorRestoringServerRegistry";
//$NON-NLS-1$
+
+ String ErrorSavingServerRegistry = "ErrorSavingServerRegistry";
//$NON-NLS-1$
+
+ String RepositoryEmptyNameMsg = "RepositoryEmptyNameMsg"; //$NON-NLS-1$
+
+ String RepositoryNullServerMsg = "RepositoryNullServerMsg"; //$NON-NLS-1$
+
+ String RepositoryShortDescription = "RepositoryShortDescription";
//$NON-NLS-1$
+
+ String ServerEmptyUrlMsg = "ServerEmptyUrlMsg"; //$NON-NLS-1$
+
+ String ServerInvalidUrlMsg = "ServerInvalidUrlMsg"; //$NON-NLS-1$
+
+ String ServerEmptyUserMsg = "ServerEmptyUserMsg"; //$NON-NLS-1$
+
+ String ServerExistsMsg = "ServerExistsMsg"; //$NON-NLS-1$
+
+ String ServerManagerRegistryAddUnexpectedError =
"ServerManagerRegistryAddUnexpectedError"; //$NON-NLS-1$
+
+ String ServerManagerRegistryListenerError =
"ServerManagerRegistryListenerError"; //$NON-NLS-1$
+
+ String ServerManagerRegistryListenerErrorsOccurred =
"ServerManagerRegistryListenerErrorsOccurred"; //$NON-NLS-1$
+
+ String ServerManagerRegistryRemoveUnexpectedError =
"ServerManagerRegistryRemoveUnexpectedError"; //$NON-NLS-1$
+
+ String ServerManagerRegistryUpdateAddError =
"ServerManagerRegistryUpdateAddError"; //$NON-NLS-1$
+
+ String ServerManagerRegistryUpdateRemoveError =
"ServerManagerRegistryUpdateRemoveError"; //$NON-NLS-1$
+
+ String ServerShortDescription = "ServerShortDescription"; //$NON-NLS-1$
+
+ String WorkspaceEmptyNameMsg = "WorkspaceEmptyNameMsg"; //$NON-NLS-1$
+
+ String WorkspaceNullRepositoryMsg = "WorkspaceNullRepositoryMsg";
//$NON-NLS-1$
+
+ String WorkspaceShortDescription = "WorkspaceShortDescription";
//$NON-NLS-1$
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,39 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public interface IServerRegistryListener {
+
+ /**
+ * @param event the event being processed
+ * @return any errors caught during the processing or <code>null</code>
+ * @since 0.6
+ */
+ Exception[] serverRegistryChanged( ServerRegistryEvent event );
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,148 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+import java.text.MessageFormat;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class Logger {
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param status the status whose message is a {@link MessageFormat} pattern.
+ * @param arguments the arguments being inserted into the pattern
+ * @return the message
+ * @since 0.6
+ */
+ private static String getMessage( Status status,
+ Object... arguments ) {
+ return MessageFormat.format(status.getMessage(), arguments);
+ }
+
+ /**
+ * @param clazz the class whose logger will be used
+ * @param status the status being logged
+ * @since 0.6
+ */
+ public static void log( Class<?> clazz,
+ Status status ) {
+ org.slf4j.Logger delegate = LoggerFactory.getLogger(clazz);
+
+ if (status.isError() && delegate.isErrorEnabled()) {
+ if (status.getException() == null) {
+ delegate.error(status.getMessage());
+ } else {
+ delegate.error(status.getMessage(), status.getException());
+ }
+ } else if (status.isWarning() && delegate.isWarnEnabled()) {
+ if (status.getException() == null) {
+ delegate.warn(status.getMessage());
+ } else {
+ delegate.warn(status.getMessage(), status.getException());
+ }
+ } else if (status.isInfo() && delegate.isInfoEnabled()) {
+ if (status.getException() == null) {
+ delegate.info(status.getMessage());
+ } else {
+ delegate.info(status.getMessage(), status.getException());
+ }
+ } else {
+ if (delegate.isTraceEnabled()) {
+ if (status.getException() == null) {
+ delegate.info(status.getMessage());
+ } else {
+ delegate.info(status.getMessage(), status.getException());
+ }
+ }
+ }
+ }
+
+ /**
+ * @param clazz the class whose logger will be used
+ * @param status the status being logged (status message is a {@link MessageFormat}
pattern)
+ * @param arguments the arguments to be inserted into the pattern
+ * @since 0.6
+ */
+ public static void log( Class<?> clazz,
+ Status status,
+ Object... arguments ) {
+ org.slf4j.Logger delegate = LoggerFactory.getLogger(clazz);
+
+ if (status.isError() && delegate.isErrorEnabled()) {
+ String msg = getMessage(status, arguments);
+
+ if (status.getException() == null) {
+ delegate.error(msg);
+ } else {
+ delegate.error(msg);
+ }
+ } else if (status.isWarning() && delegate.isWarnEnabled()) {
+ String msg = getMessage(status, arguments);
+
+ if (status.getException() == null) {
+ delegate.warn(msg);
+ } else {
+ delegate.warn(msg, status.getException());
+ }
+ } else if (status.isInfo() && delegate.isInfoEnabled()) {
+ String msg = getMessage(status, arguments);
+
+ if (status.getException() == null) {
+ delegate.info(msg);
+ } else {
+ delegate.info(msg, status.getException());
+ }
+ } else {
+ if (delegate.isTraceEnabled()) {
+ String msg = getMessage(status, arguments);
+
+ if (status.getException() == null) {
+ delegate.info(msg);
+ } else {
+ delegate.info(msg, status.getException());
+ }
+ }
+ }
+ }
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Don't allow construction.
+ *
+ * @since 0.6
+ */
+ private Logger() {
+ // nothing to do
+ }
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,543 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import net.jcip.annotations.GuardedBy;
+import net.jcip.annotations.ThreadSafe;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * The Server Manager class managers the creation, deletion, and editing of servers.
+ *
+ * @author Dan Florian
+ * @since 0.6
+ */
+@ThreadSafe
+public final class ServerManager implements IConstants {
+
+ //
===========================================================================================================================
+ // Constants
+ //
===========================================================================================================================
+
+ /**
+ * The tag used to persist a server's login password.
+ *
+ * @since 0.6
+ */
+ private static final String PASSWORD_TAG = "password"; //$NON-NLS-1$
+
+ /**
+ * The file name used when persisting the server registry.
+ *
+ * @since 0.6
+ */
+ private static final String REGISTRY_FILE = "serverRegistry.xml";
//$NON-NLS-1$
+
+ /**
+ * The tag used when persisting a server.
+ *
+ * @since 0.6
+ */
+ private static final String SERVER_TAG = "server"; //$NON-NLS-1$
+
+ /**
+ * The server collection tag used when persisting the server registry.
+ *
+ * @since 0.6
+ */
+ private static final String SERVERS_TAG = "servers"; //$NON-NLS-1$
+
+ /**
+ * The tag used to persist a server's URL.
+ *
+ * @since 0.6
+ */
+ private static final String URL_TAG = "url"; //$NON-NLS-1$
+
+ /**
+ * The tag used to persist a server's login user.
+ *
+ * @since 0.6
+ */
+ private static final String USER_TAG = "user"; //$NON-NLS-1$
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The listeners registered to receive {@link ServerRegistryEvent server registry
events}.
+ *
+ * @since 0.6
+ */
+ private final CopyOnWriteArrayList<IServerRegistryListener> listeners;
+
+ /**
+ * The path where the server registry is persisted or <code>null</code>
if not persisted.
+ *
+ * @since 0.6
+ */
+ private final String stateLocationPath;
+
+ /**
+ * The server registry.
+ *
+ * @since 0.6
+ */
+ @GuardedBy( "serverLock" )
+ private final List<Server> servers;
+
+ /**
+ * Lock used for when accessing the server registry.
+ *
+ * @since 0.6
+ */
+ private final ReadWriteLock serverLock = new ReentrantReadWriteLock();
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param stateLocationPath the directory where the {@link Server} registry} is
persisted (may be <code>null</code> if
+ * persistence is not desired)
+ * @since 0.6
+ */
+ public ServerManager( String stateLocationPath ) {
+ this.servers = new ArrayList<Server>();
+ this.stateLocationPath = stateLocationPath;
+ this.listeners = new CopyOnWriteArrayList<IServerRegistryListener>();
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * Listeners already registered will not be added again.
+ *
+ * @param listener the listener being register to receive events
+ * @return <code>true</code> if listener was added
+ * @since 0.6
+ */
+ public boolean addRegistryListener( IServerRegistryListener listener ) {
+ return this.listeners.addIfAbsent(listener);
+ }
+
+ /**
+ * Registers the specified <code>Server</code>.
+ *
+ * @param server the server being added
+ * @return a status indicating if the server was added to the registry
+ * @since 0.6
+ */
+ public Status addServer( Server server ) {
+ return internalAddServer(server, true);
+ }
+
+ /**
+ * @return an unmodifiable collection of registered servers (never
<code>null</code>)
+ * @since 0.6
+ */
+ public Collection<Server> getServers() {
+ try {
+ this.serverLock.readLock().lock();
+ return Collections.unmodifiableCollection(new
ArrayList<Server>(this.servers));
+ } finally {
+ this.serverLock.readLock().unlock();
+ }
+ }
+
+ /**
+ * @return the name of the state file that the server registry is persisted to or
<code>null</code>
+ * @since 0.6
+ */
+ private String getStateFileName() {
+ String name = this.stateLocationPath;
+
+ if (this.stateLocationPath != null) {
+ name += File.separatorChar + REGISTRY_FILE;
+ }
+
+ return name;
+ }
+
+ /**
+ * @param server the server whose repositories are being requested
+ * @return the server repositories (never <code>null</code>)
+ * @since 0.6
+ */
+ public Collection<Repository> getRepositories( Server server ) {
+ try {
+ this.serverLock.readLock().lock();
+ // TODO implement getRepositories()
+ return Collections.unmodifiableCollection(new ArrayList<Repository>(/*
repositories */));
+ } finally {
+ this.serverLock.readLock().unlock();
+ }
+ }
+
+ /**
+ * @param repository the repository whose workspaces are being requested
+ * @return the DNA repository workspaces (never <code>null</code>)
+ * @since 0.6
+ */
+ public Collection<Workspace> getWorkspaces( Repository repository ) {
+ try {
+ this.serverLock.readLock().lock();
+ // TODO implement getWorkspaces()
+ return Collections.unmodifiableCollection(new ArrayList<Workspace>(/*
workspaces */));
+ } finally {
+ this.serverLock.readLock().unlock();
+ }
+ }
+
+ /**
+ * Registers the specified <code>Server</code>.
+ *
+ * @param server the server being added
+ * @param notifyListeners indicates if registry listeners should be notified
+ * @return a status indicating if the server was added to the registry
+ * @since 0.6
+ */
+ private Status internalAddServer( Server server,
+ boolean notifyListeners ) {
+ boolean added = false;
+
+ try {
+ this.serverLock.writeLock().lock();
+
+ if (!this.servers.contains(server)) {
+ added = this.servers.add(server);
+ }
+ } finally {
+ this.serverLock.writeLock().unlock();
+ }
+
+ if (added) {
+ if (notifyListeners) {
+ Exception[] errors =
notifyRegistryListeners(ServerRegistryEvent.createNewEvent(server));
+ return processRegistryListenerErrors(errors);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ // server already exists
+ String pattern = MESSAGES.getString(ServerExistsMsg);
+ String msg = MessageFormat.format(pattern, server.getShortDescription());
+ Status status = new Status(Severity.ERROR, msg, null);
+ return status;
+ }
+
+ /**
+ * @param server the server being removed
+ * @param notifyListeners indicates if registry listeners should be notified
+ * @return a status indicating if the specified server was removed from the registry
+ * @since 0.6
+ */
+ private Status internalRemoveServer( Server server,
+ boolean notifyListeners ) {
+ boolean removed = false;
+
+ try {
+ this.serverLock.writeLock().lock();
+ removed = this.servers.remove(server);
+ } finally {
+ this.serverLock.writeLock().unlock();
+ }
+
+ if (removed) {
+ if (notifyListeners) {
+ Exception[] errors =
notifyRegistryListeners(ServerRegistryEvent.createNewEvent(server));
+ return processRegistryListenerErrors(errors);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ // server could not be removed
+ String pattern = MESSAGES.getString(ServerManagerRegistryRemoveUnexpectedError);
+ String msg = MessageFormat.format(pattern, server.getShortDescription());
+ Status status = new Status(Severity.ERROR, msg, null);
+ return status;
+ }
+
+ /**
+ * @param server the server being tested
+ * @return <code>true</code> if the server has been registered
+ * @since 0.6
+ */
+ public boolean isRegistered( Server server ) {
+ try {
+ this.serverLock.readLock().lock();
+ return this.servers.contains(server);
+ } finally {
+ this.serverLock.readLock().unlock();
+ }
+ }
+
+ /**
+ * @param event the event the registry listeners are to process
+ * @return any errors thrown by or found by the listeners or
<code>null</code> (never empty)
+ * @since 0.6
+ */
+ private Exception[] notifyRegistryListeners( ServerRegistryEvent event ) {
+ Collection<Exception> errors = null;
+
+ for (IServerRegistryListener l : this.listeners) {
+ try {
+ Exception[] problems = l.serverRegistryChanged(event);
+
+ if ((problems != null) && (problems.length != 0)) {
+ if (errors == null) {
+ errors = new ArrayList<Exception>();
+ }
+
+ errors.addAll(Arrays.asList(problems));
+ }
+ } catch (Exception e) {
+ if (errors == null) {
+ errors = new ArrayList<Exception>();
+ }
+
+ errors.add(e);
+ }
+ }
+
+ if ((errors != null) && !errors.isEmpty()) {
+ return errors.toArray(new Exception[errors.size()]);
+ }
+
+ return null;
+ }
+
+ /**
+ * @param errors the errors reported by the registry listeners
+ * @return a status indicating if registry listeners reported any errors
+ * @since 0.6
+ */
+ private Status processRegistryListenerErrors( Exception[] errors ) {
+ if (errors == null) {
+ return Status.OK_STATUS;
+ }
+
+ for (Exception error : errors) {
+ Logger.log(getClass(), new Status(Severity.ERROR,
ServerManagerRegistryListenerError, error));
+ }
+
+ return new Status(Severity.WARNING, ServerManagerRegistryListenerErrorsOccurred,
null);
+ }
+
+ /**
+ * @param listener the listener being unregistered and will no longer receive events
+ * @return <code>true</code> if listener was removed
+ * @since 0.6
+ */
+ public boolean removeRegistryListener( IServerRegistryListener listener ) {
+ return this.listeners.remove(listener);
+ }
+
+ /**
+ * @param server the server being removed
+ * @return a status indicating if the specified server was removed from the registry
+ * @since 0.6
+ */
+ public Status removeServer( Server server ) {
+ return internalRemoveServer(server, true);
+ }
+
+ /**
+ * @return a status indicating if the previous session state was restored
successfully
+ * @since 0.6
+ */
+ public Status restoreState() {
+ if (this.stateLocationPath != null) {
+ if (stateFileExists()) {
+ try {
+ DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = factory.newDocumentBuilder();
+ Document doc = docBuilder.parse(new File(getStateFileName()));
+ Node root = doc.getDocumentElement();
+ NodeList servers = root.getChildNodes();
+
+ for (int size = servers.getLength(), i = 0; i < size; ++i) {
+ Node server = servers.item(i);
+
+ if (server.getNodeType() != Node.TEXT_NODE) {
+ NamedNodeMap attributeMap = server.getAttributes();
+
+ if (attributeMap == null) continue;
+
+ Node urlNode = attributeMap.getNamedItem(URL_TAG);
+ Node userNode = attributeMap.getNamedItem(USER_TAG);
+ Node passwordNode = attributeMap.getNamedItem(PASSWORD_TAG);
+ String pswd = ((passwordNode == null) ? null :
(String)passwordNode.getNodeValue());
+
+ // add server to registry
+ addServer(new Server(urlNode.getNodeValue(),
userNode.getNodeValue(), pswd, (pswd != null)));
+ }
+ }
+ } catch (Exception e) {
+ String pattern = MESSAGES.getString(ErrorRestoringServerRegistry);
+ return new Status(Severity.ERROR, MessageFormat.format(pattern,
getStateFileName()), e);
+ }
+ }
+ }
+
+ // do nothing of there is no save location or state file does not exist
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * Saves the {@link Server} registry to the file system.
+ *
+ * @return a status indicating if the registry was successfully saved
+ * @since 0.6
+ */
+ public Status saveState() {
+ if ((this.stateLocationPath != null) && !getServers().isEmpty()) {
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = factory.newDocumentBuilder();
+ Document doc = docBuilder.newDocument();
+
+ // create root element
+ Element root = doc.createElement(SERVERS_TAG);
+ doc.appendChild(root);
+
+ for (Server server : getServers()) {
+ Element serverElement = doc.createElement(SERVER_TAG);
+ root.appendChild(serverElement);
+
+ serverElement.setAttribute(URL_TAG, server.getUrl());
+ serverElement.setAttribute(USER_TAG, server.getUser());
+
+ if (server.isPasswordBeingPersisted()) {
+ serverElement.setAttribute(PASSWORD_TAG, server.getPassword());
+ }
+ }
+
+ DOMSource source = new DOMSource(doc);
+ StreamResult resultXML = new StreamResult(new
FileOutputStream(getStateFileName()));
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = transFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
//$NON-NLS-1$
+
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-am...;,
"2"); //$NON-NLS-1$ //$NON-NLS-2$
+ transformer.transform(source, resultXML);
+ } catch (Exception e) {
+ String pattern = MESSAGES.getString(ErrorSavingServerRegistry);
+ return new Status(Severity.ERROR, MessageFormat.format(pattern,
getStateFileName()), e);
+ }
+ } else if ((this.stateLocationPath != null) && stateFileExists()) {
+ // delete current registry file since all servers have been deleted
+ try {
+ new File(getStateFileName()).delete();
+ } catch (Exception e) {
+ String pattern = MESSAGES.getString(ErrorDeletingServerRegistryFile);
+ return new Status(Severity.ERROR, MessageFormat.format(pattern,
getStateFileName()), e);
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @return <code>true</code> if the state file already exists
+ * @since 0.6
+ */
+ private boolean stateFileExists() {
+ return new File(getStateFileName()).exists();
+ }
+
+ /**
+ * Updates the server registry with a new version of a server.
+ *
+ * @param previousServerVersion the version of the server being replaced
+ * @param newServerVersion the new version of the server being put in the server
registry
+ * @return a status indicating if the server was updated in the registry
+ * @since 0.6
+ */
+ public Status updateServer( Server previousServerVersion,
+ Server newServerVersion ) {
+ Status status = null;
+
+ try {
+ this.serverLock.writeLock().lock();
+ status = internalRemoveServer(previousServerVersion, false);
+
+ if (status.isOk()) {
+ status = internalAddServer(newServerVersion, false);
+
+ if (status.isOk()) {
+ // all good so notify listeners
+ Exception[] errors =
notifyRegistryListeners(ServerRegistryEvent.createUpdateEvent(previousServerVersion,
+
newServerVersion));
+ return processRegistryListenerErrors(errors);
+ }
+
+ // unexpected problem adding new version of server to registry
+ String pattern =
MESSAGES.getString(ServerManagerRegistryUpdateAddError);
+ String msg = MessageFormat.format(pattern, status.getMessage());
+ status = new Status(Severity.ERROR, msg, status.getException());
+ return status;
+ }
+ } finally {
+ this.serverLock.writeLock().unlock();
+ }
+
+ // unexpected problem removing server from registry
+ String pattern = MESSAGES.getString(ServerManagerRegistryUpdateRemoveError);
+ String msg = MessageFormat.format(pattern, status.getMessage());
+ status = new Status(Severity.ERROR, msg, status.getException());
+ return status;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,197 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class ServerRegistryEvent {
+
+ //
===========================================================================================================================
+ // Constants
+ //
===========================================================================================================================
+
+ /**
+ * The status severity levels.
+ *
+ * @since 0.6
+ */
+ public enum Type {
+ /**
+ * Indicates that a new server was added to the server registry.
+ *
+ * @since 0.6
+ */
+ NEW,
+
+ /**
+ * Indicates that a server was removed from the server registry.
+ *
+ * @since 0.6
+ */
+ REMOVE,
+
+ /**
+ * Indicates that properties of an existing server in the registry has been
changed.
+ *
+ * @since 0.6
+ */
+ UPDATE
+ }
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param newServer the server that was added to the server registry
+ * @return the event
+ * @see Type#NEW
+ * @since 0.6
+ */
+ public static ServerRegistryEvent createNewEvent( Server newServer ) {
+ return new ServerRegistryEvent(Type.NEW, newServer);
+ }
+
+ /**
+ * @param removedServer the server removed from the server registry
+ * @return the event
+ * @see Type#REMOVE
+ * @since 0.6
+ */
+ public static ServerRegistryEvent createRemoveEvent( Server removedServer ) {
+ return new ServerRegistryEvent(Type.REMOVE, removedServer);
+ }
+
+ /**
+ * @param previousServerVersion the server being updated (this instance is no longer
found in the server registry)
+ * @param newServerVersion the updated version of the server (this is now contained
in the server registry)
+ * @return the event
+ * @see Type#UPDATE
+ * @since 0.6
+ */
+ public static ServerRegistryEvent createUpdateEvent( Server previousServerVersion,
+ Server newServerVersion ) {
+ ServerRegistryEvent event = new ServerRegistryEvent(Type.UPDATE,
previousServerVersion);
+ event.updatedServer = newServerVersion;
+ return event;
+ }
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The server being added, removed, or updated.
+ *
+ * @since 0.6
+ */
+ private final Server server;
+
+ /**
+ * The event type.
+ *
+ * @since 0.6
+ */
+ private final Type type;
+
+ /**
+ * The server that is replacing an existing server. Will be
<code>null</code> for all types except {@link Type#UPDATE update}.
+ *
+ * @since 0.6
+ */
+ private Server updatedServer;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param type the event type
+ * @param server the server being added, removed, or updated
+ * @since 0.6
+ */
+ private ServerRegistryEvent( Type type,
+ Server server ) {
+ this.type = type;
+ this.server = server;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * @return the added, removed, or the old version of the server that has been
updated
+ * @since 0.6
+ */
+ public Server getServer() {
+ return this.server;
+ }
+
+ /**
+ * @return the new version of an existing server that has been updated
+ * @throws UnsupportedOperationException if method is called when the type is not an
update
+ * @see Type#UPDATE
+ * @since 0.6
+ */
+ public Server getUpdatedServer() {
+ if (this.type != Type.UPDATE) {
+ throw new UnsupportedOperationException();
+ }
+
+ return this.updatedServer;
+ }
+
+ /**
+ * @return <code>true</code> if the event is adding a new server to the
registry
+ * @see Type#NEW
+ * @since 0.6
+ */
+ public boolean isNew() {
+ return (this.type == Type.NEW);
+ }
+
+ /**
+ * @return <code>true</code> if the event is removing a server from the
registry
+ * @see Type#REMOVE
+ * @since 0.6
+ */
+ public boolean isRemove() {
+ return (this.type == Type.REMOVE);
+ }
+
+ /**
+ * @return <code>true</code> if the event is updating properties of an
existing server in the registry
+ * @see Type#UPDATE
+ * @since 0.6
+ */
+ public boolean isUpdate() {
+ return (this.type == Type.UPDATE);
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,209 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+import net.jcip.annotations.Immutable;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+@Immutable
+public class Status {
+
+ //
===========================================================================================================================
+ // Constants
+ //
===========================================================================================================================
+
+ /**
+ * The status severity levels.
+ *
+ * @since 0.6
+ */
+ public enum Severity {
+ /**
+ * Indicates an error status.
+ *
+ * @since 0.6
+ */
+ ERROR,
+
+ /**
+ * Indicates an informational status.
+ *
+ * @since 0.6
+ */
+ INFO,
+
+ /**
+ * Indicates an OK status.
+ *
+ * @since 0.6
+ */
+ OK,
+
+ /**
+ * Indicates an unknown status. This is automatically assigned if status is
constructed with a <code>null</code> severity.
+ *
+ * @since 0.6
+ */
+ UNKNOWN,
+
+ /**
+ * Indicates a warning status.
+ *
+ * @since 0.6
+ */
+ WARNING
+ }
+
+ /**
+ * A status with an OK severity and no message and no exception.
+ *
+ * @see Severity#OK
+ * @since 0.6
+ */
+ public static final Status OK_STATUS = new Status(Severity.OK, null, null);
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The exception of this status or <code>null</code>.
+ *
+ * @since 0.6
+ */
+ protected final Throwable exception;
+
+ /**
+ * The localized message of this status (can be <code>null</code>).
+ *
+ * @since 0.6
+ */
+ protected final String message;
+
+ /**
+ * The severity level of this status.
+ *
+ * @since 0.6
+ */
+ protected final Severity severity;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param severity the status severity (if <code>null</code> it will be
converted to {@link Severity#UNKNOWN}.
+ * @param message the status message (if <code>null</code> it will be
returned as an empty string)
+ * @param exception the status exception or <code>null</code>
+ * @since 0.6
+ */
+ public Status( Severity severity,
+ String message,
+ Throwable exception ) {
+ this.severity = ((severity == null) ? Severity.UNKNOWN : severity);
+ this.message = message;
+ this.exception = exception;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * @return the status exception (may be <code>null</code>)
+ * @since 0.6
+ */
+ public Throwable getException() {
+ return this.exception;
+ }
+
+ /**
+ * @return the status message (never <code>null</code> but can be empty)
+ * @since 0.6
+ */
+ public String getMessage() {
+ return ((this.message == null) ? "" : this.message); //$NON-NLS-1$
+ }
+
+ /**
+ * @return severity the status severity
+ * @since 0.6
+ */
+ public Severity getSeverity() {
+ return severity;
+ }
+
+ /**
+ * @return <code>true</code> if the status is an error
+ * @see Severity#ERROR
+ * @since 0.6
+ */
+ public boolean isError() {
+ return (this.severity == Severity.ERROR);
+ }
+
+ /**
+ * @return <code>true</code> if the status is an info
+ * @see Severity#INFO
+ * @since 0.6
+ */
+ public boolean isInfo() {
+ return (this.severity == Severity.INFO);
+ }
+
+ /**
+ * @return <code>true</code> if the status is OK
+ * @see Severity#OK
+ * @since 0.6
+ */
+ public boolean isOk() {
+ return (this.severity == Severity.OK);
+ }
+
+ /**
+ * @return <code>true</code> if the status is a warning
+ * @see Severity#WARNING
+ * @since 0.6
+ */
+ public boolean isWarning() {
+ return (this.severity == Severity.WARNING);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ * @since 0.6
+ */
+ @Override
+ public String toString() {
+ StringBuilder txt = new StringBuilder("Status "); //$NON-NLS-1$
+ txt.append(this.severity.toString()).append(":
").append(getMessage()).append(": ").append(getException()); //$NON-NLS-1$
//$NON-NLS-2$
+ return txt.toString();
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Status.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,66 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class Utils {
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param thisObj an object being compared
+ * @param thatObj the other object being compared
+ * @return <code>true</code> if both objects are null or both are not
null and equal
+ * @since 0.6
+ */
+ public static boolean equivalent( Object thisObj,
+ Object thatObj ) {
+ // true if both objects are null
+ if (thisObj == null) {
+ return (thatObj == null);
+ }
+
+ if (thatObj == null) return false;
+ return thisObj.equals(thatObj);
+ }
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Don't allow construction.
+ *
+ * @since 0.6
+ */
+ public Utils() {
+ // nothing to do
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/Utils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,46 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain;
+
+/**
+ * The IDnaObject class defines a business object.
+ *
+ * @author Dan Florian
+ * @since 0.6
+ */
+public interface IDnaObject {
+
+ /**
+ * @return the object name (never <code>null</code>)
+ * @since 0.6
+ */
+ String getName();
+
+ /**
+ * @return a description suitable for use in a tooltip (never
<code>null</code>)
+ * @since 0.6
+ */
+ String getShortDescription();
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,151 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain;
+
+import java.text.MessageFormat;
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.validation.RepositoryValidator;
+
+/**
+ * The Repository class is the business object for a DNA repository.
+ *
+ * @author Dan Florian
+ * @since 0.6
+ */
+@Immutable
+public final class Repository implements IConstants, IDnaObject {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The repository name.
+ *
+ * @since 0.6
+ */
+ private final String name;
+
+ /**
+ * The server where this repository resides.
+ *
+ * @since 0.6
+ */
+ private final Server server;
+
+ // TODO root publishing path
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Constructs a new <code>Repository</code>.
+ *
+ * @param name the repository name
+ * @param server the server where this repository resides
+ * @see RepositoryValidator
+ * @throws RuntimeException if any of the input parameters are invalid
+ * @since 0.6
+ */
+ public Repository( String name,
+ Server server ) {
+ // validate inputs
+ Status status = RepositoryValidator.isValid(name, server);
+
+ if (status.isError()) {
+ throw new RuntimeException(status.getMessage(), status.getException());
+ }
+
+ // valid so construct
+ this.name = name;
+ this.server = server;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ * @since 0.6
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) return true;
+ if ((obj == null) || (getClass() != obj.getClass())) return false;
+
+ // must have another server
+ Repository otherRepository = (Repository)obj;
+ return (this.name.equals(otherRepository.name) &&
this.server.equals(otherRepository.server));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getName()
+ * @since 0.6
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the server where this repository is located (never
<code>null</code>)
+ * @since 0.6
+ */
+ public Server getServer() {
+ return this.server;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getShortDescription()
+ * @since 0.6
+ */
+ public String getShortDescription() {
+ String pattern = MESSAGES.getString(RepositoryShortDescription);
+ return MessageFormat.format(pattern, this.name,
this.server.getShortDescription());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ * @since 0.6
+ */
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 31 * hash + this.name.hashCode();
+ hash = 31 * hash + this.server.hashCode();
+ return hash;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Repository.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,207 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain;
+
+import java.text.MessageFormat;
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Utils;
+import org.jboss.dna.web.jcr.rest.client.domain.validation.RepositoryValidator;
+import org.jboss.dna.web.jcr.rest.client.domain.validation.ServerValidator;
+
+/**
+ * The Server class is the business object for a server that is hosting one or more DNA
repositories.
+ *
+ * @author Dan Florian
+ * @since 0.6
+ */
+@Immutable
+public final class Server implements IConstants, IDnaObject {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The password to use when logging on to the server.
+ *
+ * @since 0.6
+ */
+ private final String password;
+
+ /**
+ * Indicates if the password should be stored locally when the server is persisted.
+ *
+ * @since 0.6
+ */
+ private final boolean persistPassword;
+
+ /**
+ * The server URL.
+ *
+ * @since 0.6
+ */
+ private final String url;
+
+ /**
+ * The user name to use when logging on to the server.
+ *
+ * @since 0.6
+ */
+ private final String user;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Constructs on new <code>Server</code>.
+ *
+ * @param url the server URL
+ * @param user the server user
+ * @param password the server password
+ * @param persistPassword <code>true</code> if the password should be
stored
+ * @see RepositoryValidator
+ * @throws RuntimeException if any of the input parameters are invalid
+ * @since 0.6
+ */
+ public Server( String url,
+ String user,
+ String password,
+ boolean persistPassword ) {
+ // valid inputs
+ Status status = ServerValidator.isValid(url, user, password, persistPassword);
+
+ if (status.isError()) {
+ throw new RuntimeException(status.getMessage(), status.getException());
+ }
+
+ // valid so construct
+ this.url = url;
+ this.user = user;
+ this.password = password;
+ this.persistPassword = persistPassword;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ * @since 0.6
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) return true;
+ if ((obj == null) || (getClass() != obj.getClass())) return false;
+
+ // must have another server
+ Server otherServer = (Server)obj;
+ return Utils.equivalent(this.url, otherServer.url) &&
Utils.equivalent(this.user, otherServer.user)
+ && Utils.equivalent(this.password, otherServer.password)
+ && Utils.equivalent(this.persistPassword,
otherServer.persistPassword);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getName()
+ * @since 0.6
+ */
+ public String getName() {
+ return getUrl();
+ }
+
+ /**
+ * @return the server authentication password
+ * @since 0.6
+ */
+ public String getPassword() {
+ return this.password;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getShortDescription()
+ * @since 0.6
+ */
+ public String getShortDescription() {
+ String pattern = MESSAGES.getString(ServerShortDescription);
+ return MessageFormat.format(pattern, this.url, this.user);
+ }
+
+ /**
+ * @return the server URL
+ * @since 0.6
+ */
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * @return the server authentication user
+ * @since 0.6
+ */
+ public String getUser() {
+ return this.user;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ * @since 0.6
+ */
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 31 * hash + this.url.hashCode();
+
+ if (this.user != null) {
+ hash = 31 * hash + this.user.hashCode();
+ }
+
+ if (this.password != null) {
+ hash = 31 * hash + this.password.hashCode();
+ }
+
+ hash = 31 * hash + Boolean.valueOf(this.persistPassword).hashCode();
+
+ return hash;
+ }
+
+ /**
+ * @return persistPassword <code>true</code> if the password is being
persisted
+ * @since 0.6
+ */
+ public boolean isPasswordBeingPersisted() {
+ return this.persistPassword;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Server.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,157 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain;
+
+import java.text.MessageFormat;
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.validation.WorkspaceValidator;
+
+/**
+ * The Workspace class is the business object for a DNA repository workspace.
+ *
+ * @author Dan Florian
+ * @since 0.6
+ */
+@Immutable
+public final class Workspace implements IConstants, IDnaObject {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The workspace name.
+ *
+ * @since 0.6
+ */
+ private final String name;
+
+ /**
+ * The repository where this workspace resides.
+ *
+ * @since 0.6
+ */
+ private final Repository repository;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Constructs a new <code>Workspace</code>.
+ *
+ * @param name the workspace name
+ * @param repository the repository where this workspace resides
+ * @see WorkspaceValidator
+ * @throws RuntimeException if any of the input parameters are invalid
+ * @since 0.6
+ */
+ public Workspace( String name,
+ Repository repository ) {
+ // validate inputs
+ Status status = WorkspaceValidator.isValid(name, repository);
+
+ if (status.isError()) {
+ throw new RuntimeException(status.getMessage(), status.getException());
+ }
+
+ // valid so construct
+ this.name = name;
+ this.repository = repository;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ * @since 0.6
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) return true;
+ if ((obj == null) || (getClass() != obj.getClass())) return false;
+
+ // must have another server
+ Workspace otherWorkspace = (Workspace)obj;
+ return (this.name.equals(otherWorkspace.name) &&
this.repository.equals(otherWorkspace.repository));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getName()
+ * @since 0.6
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @return the repository where this workspace is located (never
<code>null</code>)
+ * @since 0.6
+ */
+ public Repository getRepository() {
+ return this.repository;
+ }
+
+ /**
+ * @return the server where this workspace is located (never
<code>null</code>)
+ * @since 0.6
+ */
+ public Server getServer() {
+ return this.repository.getServer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.domain.IDnaObject#getShortDescription()
+ * @since 0.6
+ */
+ public String getShortDescription() {
+ String pattern = MESSAGES.getString(WorkspaceShortDescription);
+ return MessageFormat.format(pattern, this.name,
this.repository.getShortDescription());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ * @since 0.6
+ */
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 31 * hash + this.name.hashCode();
+ hash = 31 * hash + this.repository.hashCode();
+ return hash;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/Workspace.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,97 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain.validation;
+
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class RepositoryValidator implements IConstants {
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param name the name being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isNameValid( String name ) {
+ if ((name == null) || (name.length() == 0)) {
+ return new Status(Severity.ERROR, MESSAGES.getString(RepositoryEmptyNameMsg),
null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param server the server being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isServerValid( Server server ) {
+ if (server == null) {
+ return new Status(Severity.ERROR,
MESSAGES.getString(RepositoryNullServerMsg), null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param name the name being validated
+ * @param server the server being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isValid( String name,
+ Server server ) {
+ Status status = isNameValid(name);
+
+ if (!status.isError()) {
+ status = isServerValid(server);
+ }
+
+ return status;
+ }
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Disallow construction.
+ *
+ * @since 0.6
+ */
+ private RepositoryValidator() {
+ // nothing to do
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,161 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain.validation;
+
+import java.net.URL;
+import java.text.MessageFormat;
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.ServerManager;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class ServerValidator implements IConstants {
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param password the password being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isPasswordValid( String password ) {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param url the URL being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isUrlValid( String url ) {
+ if ((url == null) || (url.length() == 0)) {
+ return new Status(Severity.ERROR, MESSAGES.getString(ServerEmptyUrlMsg),
null);
+ }
+
+ try {
+ new URL(url);
+ } catch (Exception e) {
+ String pattern = MESSAGES.getString(ServerInvalidUrlMsg);
+ String msg = MessageFormat.format(pattern, url);
+ return new Status(Severity.ERROR, msg, null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param user the user being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isUserValid( String user ) {
+ if ((user == null) || (user.length() == 0)) {
+ return new Status(Severity.ERROR, MESSAGES.getString(ServerEmptyUserMsg),
null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * This does not verify that a server with the same primary field values doesn't
already exist.
+ *
+ * @param url the URL being validated
+ * @param user the user being validated
+ * @param password the password being validated
+ * @param persistPassword <code>true</code> if the password should be
persisted
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isValid( String url,
+ String user,
+ String password,
+ boolean persistPassword ) {
+ Status status = isUrlValid(url);
+
+ if (!status.isError()) {
+ status = isUserValid(user);
+
+ if (!status.isError()) {
+ status = isPasswordValid(password);
+ }
+ }
+
+ return status;
+ }
+
+ /**
+ * Validates the server properties and makes sure no other exists in the server
registry that also has the same primary field
+ * values.
+ *
+ * @param url the URL being validated
+ * @param user the user being validated
+ * @param password the password being validated
+ * @param persistPassword <code>true</code> if the password should be
persisted
+ * @param serverManager the server manager controlling the server registry (may not
be <code>null</code>)
+ * @return a validation status (never <code>null</code>)
+ * @see #isValid(String, String, String, boolean)
+ * @since 0.6
+ */
+ public static Status isValid( String url,
+ String user,
+ String password,
+ boolean persistPassword,
+ ServerManager serverManager ) {
+ Status status = isValid(url, user, password, persistPassword);
+
+ // make sure a server with the same properties does not exist
+ if (!status.isError()) {
+ Server newServer = new Server(url, user, password, persistPassword);
+
+ if (serverManager.isRegistered(newServer)) {
+ String pattern = MESSAGES.getString(ServerExistsMsg);
+ String msg = MessageFormat.format(pattern,
newServer.getShortDescription());
+ status = new Status(Severity.ERROR, msg, null);
+ }
+ }
+
+ return status;
+ }
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Disallow construction.
+ *
+ * @since 0.6
+ */
+ private ServerValidator() {
+ // nothing to do
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,97 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.domain.validation;
+
+import org.jboss.dna.web.jcr.rest.client.IConstants;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.Status.Severity;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class WorkspaceValidator implements IConstants {
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param name the name being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isNameValid( String name ) {
+ if ((name == null) || (name.length() == 0)) {
+ return new Status(Severity.ERROR, MESSAGES.getString(WorkspaceEmptyNameMsg),
null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param repository the repository being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isRepositoryValid( Repository repository ) {
+ if (repository == null) {
+ return new Status(Severity.ERROR,
MESSAGES.getString(WorkspaceNullRepositoryMsg), null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @param name the name being validated
+ * @param repository the repository being validated
+ * @return a validation status (never <code>null</code>)
+ * @since 0.6
+ */
+ public static Status isValid( String name,
+ Repository repository ) {
+ Status status = isNameValid(name);
+
+ if (!status.isError()) {
+ status = isRepositoryValid(repository);
+ }
+
+ return status;
+ }
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * Disallow construction.
+ *
+ * @since 0.6
+ */
+ private WorkspaceValidator() {
+ // nothing to do
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,85 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.net.URL;
+import org.codehaus.jettison.json.JSONObject;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class GetRepositoriesRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ private final Server server;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param server the server where the request will be made
+ * @since 0.6
+ */
+ public GetRepositoriesRequest( Server server ) {
+ super(Method.GET);
+ this.server = server;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ JSONObject body = getObjectFromConnectionInputStream();
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,76 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.net.URL;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class GetWorkspacesRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param repository the repository whose workspaces are being requested
+ * @since 0.6
+ */
+ protected GetWorkspacesRequest( Repository repository ) {
+ super(Method.GET);
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,99 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.File;
+import java.net.URL;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class IsPublishedRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The file being checked.
+ *
+ * @since 0.6
+ */
+ private final File file;
+
+ /**
+ * The workspace being checked.
+ *
+ * @since 0.6
+ */
+ private final Workspace workspace;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param workspace
+ * @param file
+ * @since 0.6
+ */
+ public IsPublishedRequest( Workspace workspace,
+ File file ) {
+ super(Method.GET);
+ this.workspace = workspace;
+ this.file = file;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,88 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.net.URL;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class IsServerAliveRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The server being checked.
+ *
+ * @since 0.6
+ */
+ private final Server server;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param server the server being checked
+ * @since 0.6
+ */
+ protected IsServerAliveRequest( Server server ) {
+ super(Method.GET);
+ this.server = server;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,109 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.File;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestRequest;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class JsonRequestFactory implements IRestRequestFactory {
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createGetRepositoriesRequest(org.jboss.dna.web.jcr.rest.client.domain.Server)
+ * @since 0.6
+ */
+ public IRestRequest createGetRepositoriesRequest( Server server ) throws Exception {
+ return new GetRepositoriesRequest(server);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createGetWorkspacesRequest(org.jboss.dna.web.jcr.rest.client.domain.Repository)
+ * @since 0.6
+ */
+ public IRestRequest createGetWorkspacesRequest( Repository repository ) throws
Exception {
+ return new GetWorkspacesRequest(repository);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createIsPublishedRequest(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
+ * java.io.File)
+ * @since 0.6
+ */
+ public IRestRequest createIsPublishedRequest( Workspace workspace,
+ File file ) throws Exception {
+ return new IsPublishedRequest(workspace, file);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createIsServerAliveRequest(org.jboss.dna.web.jcr.rest.client.domain.Server)
+ * @since 0.6
+ */
+ public IRestRequest createIsServerAliveRequest( Server server ) throws Exception {
+ return new IsServerAliveRequest(server);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createPublishRequest(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
+ * java.io.File)
+ * @since 0.6
+ */
+ public IRestRequest createPublishRequest( Workspace workspace,
+ File file ) throws Exception {
+ return new PublishRequest(workspace, file);
+ }
+
+ /**
+ * {@inheritDoc}dan
+ *
+ * @see
org.jboss.dna.web.jcr.rest.client.publish.IRestRequestFactory#createUnpublishRequest(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
+ * java.io.File)
+ * @since 0.6
+ */
+ public IRestRequest createUnpublishRequest( Workspace workspace,
+ File file ) throws Exception {
+ return new UnpublishRequest(workspace, file);
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,169 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import javax.ws.rs.core.MediaType;
+import org.codehaus.jettison.json.JSONObject;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestRequest;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public abstract class JsonRestRequest implements IRestRequest {
+
+ /**
+ * The HTTP method to use in the request.
+ *
+ * @since 0.6
+ */
+ protected enum Method {
+ /**
+ * @since 0.6
+ */
+ DELETE,
+
+ /**
+ * @since 0.6
+ */
+ GET,
+
+ /**
+ * @since 0.6
+ */
+ POST,
+
+ /**
+ * @since 0.6
+ */
+ PUT
+ }
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The connection to the URL or <code>null</code> if {@link #execute()}
has not been called.
+ *
+ * @since 0.6
+ */
+ private HttpURLConnection connection;
+
+ /**
+ * The HTTP method.
+ *
+ * @since 0.6
+ */
+ private final Method method;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param method the request method
+ * @since 0.6
+ */
+ protected JsonRestRequest( Method method ) {
+ this.method = method;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * @return the response
+ * @throws Exception if there is a problem creating the response
+ * @since 0.6
+ */
+ protected abstract IRestResponse createResponse() throws Exception;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.publish.IRestRequest#execute()
+ * @throws Exception if connection cannot be established or there is a problem
executing the request
+ * @since 0.6
+ */
+ public final IRestResponse execute() throws Exception {
+ URL url = getUrl();
+ this.connection = (HttpURLConnection)url.openConnection();
+ this.connection.setDoOutput(true);
+ this.connection.setRequestMethod(this.method.toString());
+ this.connection.setRequestProperty("Content-Type",
MediaType.APPLICATION_JSON);
+
+ IRestResponse response = createResponse();
+ this.connection.disconnect();
+
+ return response;
+ }
+
+ /**
+ * @return the open connection or <code>null</code> if {@link #execute()}
has not been called
+ * @since 0.6
+ */
+ protected HttpURLConnection getConnection() {
+ return this.connection;
+ }
+
+ /**
+ * @return the URL where the request will be made (may not be
<code>null</code>)
+ * @since 0.6
+ */
+ protected abstract URL getUrl();
+
+ /**
+ * @return the object representing the stream
+ * @throws Exception if connection is <code>null</code> or if a problem
reading the stream
+ * @since 0.6
+ */
+ protected JSONObject getObjectFromConnectionInputStream() throws Exception {
+ return new JSONObject(getStringFromConnectionInputStream());
+ }
+
+ /**
+ * @return the connection input stream read as a string
+ * @throws Exception if connection is <code>null</code> or if a problem
reading the stream
+ * @since 0.6
+ */
+ protected String getStringFromConnectionInputStream() throws Exception {
+ StringBuffer buff = new StringBuffer();
+ InputStream stream = this.connection.getInputStream();
+ int bytesRead;
+ byte[] bytes = new byte[1024];
+
+ while (-1 != (bytesRead = stream.read(bytes, 0, 1024))) {
+ buff.append(new String(bytes, 0, bytesRead));
+ }
+
+ return buff.toString();
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,109 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.File;
+import java.net.Authenticator;
+import java.net.HttpURLConnection;
+import java.net.PasswordAuthentication;
+import org.jboss.dna.web.jcr.rest.client.Status;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public class PublishCommand {
+
+ //
===========================================================================================================================
+ // Constants
+ //
===========================================================================================================================
+
+ // private static final String SERVER_CONTEXT = "/resources";
//$NON-NLS-1$
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ private static void setAuthenticator( final Server server ) {
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(server.getUser(),
server.getPassword().toCharArray());
+ }
+ });
+ }
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The workspace where the publishing or unpublishing will take place.
+ *
+ * @since 0.6
+ */
+ private final Workspace workspace;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param workspace the workspace to use when publishing or unpublishing
+ * @since 0.6
+ */
+ public PublishCommand( Workspace workspace ) {
+ this.workspace = workspace;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param file the file being published
+ * @return a status indicating if the publishing was successful
+ * @since 0.6
+ */
+ public Status publish( File file ) {
+ // TODO implement publish(File)
+ Server server = workspace.getServer();
+ setAuthenticator(server);
+
+ return null;
+ }
+
+ /**
+ * @param file the file being unpublished
+ * @return a status indicating if the unpublishing was successful
+ * @since 0.6
+ */
+ public Status unpublish( File file ) {
+ // TODO implement unpublish(File)
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,99 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.File;
+import java.net.URL;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class PublishRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The workspace where the file is being published.
+ *
+ * @since 0.6
+ */
+ private final Workspace workspace;
+
+ /**
+ * The file being published.
+ *
+ * @since 0.6
+ */
+ private final File file;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param workspace the workspace where the file is being published
+ * @param file the file being published
+ * @since 0.6
+ */
+ protected PublishRequest( Workspace workspace,
+ File file ) {
+ super(Method.PUT);
+ this.workspace = workspace;
+ this.file = file;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,99 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.json;
+
+import java.io.File;
+import java.net.URL;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+import org.jboss.dna.web.jcr.rest.client.publish.IRestResponse;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public final class UnpublishRequest extends JsonRestRequest {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The workspace where the file is being published.
+ *
+ * @since 0.6
+ */
+ private final Workspace workspace;
+
+ /**
+ * The file being published.
+ *
+ * @since 0.6
+ */
+ private final File file;
+
+ //
===========================================================================================================================
+ // Constructors
+ //
===========================================================================================================================
+
+ /**
+ * @param workspace the workspace where the file is being published
+ * @param file the file being published
+ * @since 0.6
+ */
+ protected UnpublishRequest( Workspace workspace,
+ File file ) {
+ super(Method.DELETE);
+ this.workspace = workspace;
+ this.file = file;
+ }
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#createResponse()
+ * @since 0.6
+ */
+ @Override
+ protected IRestResponse createResponse() throws Exception {
+ // TODO implement createResponse()
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.web.jcr.rest.client.json.JsonRestRequest#getUrl()
+ * @since 0.6
+ */
+ @Override
+ protected URL getUrl() {
+ // TODO implement getUrl()
+ return null;
+ }
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,34 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.publish;
+
+/**
+ * @author dan
+ *
+ */
+public interface IRestRequest {
+
+ IRestResponse execute() throws Exception;
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,91 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.publish;
+
+import java.io.File;
+import org.jboss.dna.web.jcr.rest.client.domain.Repository;
+import org.jboss.dna.web.jcr.rest.client.domain.Server;
+import org.jboss.dna.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * @author Dan Florian
+ * @since 0.6
+ */
+public interface IRestRequestFactory {
+
+ /**
+ * @param server the server whose repositories are being requested
+ * @return the request
+ * @throws Exception if a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createGetRepositoriesRequest( Server server ) throws Exception;
+
+ /**
+ * @param repository the repository whose workspaces are being requested
+ * @return the request
+ * @throws Exception if a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createGetWorkspacesRequest( Repository repository ) throws Exception;
+
+ /**
+ * @param server the server to use when creating the request
+ * @return the request
+ * @throws Exception if there is a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createIsServerAliveRequest( Server server ) throws Exception;
+
+ /**
+ * @param workspace the workspace being checked
+ * @param file the file being checked
+ * @return the request
+ * @throws Exception if there is a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createIsPublishedRequest( Workspace workspace,
+ File file ) throws Exception;
+
+ /**
+ * @param workspace the workspace being checked
+ * @param file the file being published
+ * @return the request
+ * @throws Exception if there is a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createPublishRequest( Workspace workspace,
+ File file ) throws Exception;
+
+ /**
+ * @param workspace the workspace being checked
+ * @param file the file being unpublished
+ * @return the request
+ * @throws Exception if there is a problem creating the request
+ * @since 0.6
+ */
+ IRestRequest createUnpublishRequest( Workspace workspace,
+ File file ) throws Exception;
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.java
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.java
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.java 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,34 @@
+/*
+ * JBoss DNA (
http://www.jboss.org/dna)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ *
+ * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+ * is licensed to you under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * JBoss DNA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.web.jcr.rest.client.publish;
+
+/**
+ * @author dan
+ *
+ */
+public interface IRestResponse {
+
+ int getResponseCode();
+
+}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/java/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,47 @@
+#
+# JBoss DNA (
http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+#
+ErrorDeletingServerRegistryFile = There was a problem deleting server registry file
"{0}"
+ErrorRestoringServerRegistry = Error trying to restore the server registry from file
"{0}"
+ErrorSavingServerRegistry = Error trying to save the server registry to "{0}"
+
+RepositoryEmptyNameMsg = A repository name cannot be empty
+RepositoryNullServerMsg = A repository server cannot be null
+RepositoryShortDescription = DNA Repository: Name: {0}, {1}
+
+ServerEmptyUserMsg = The user cannot be empty
+ServerEmptyUrlMsg = A server URL cannot be empty
+ServerExistsMsg = {0} already exists so it cannot be added
+ServerInvalidUrlMsg = The value "{0}" is not a valid server URL
+ServerShortDescription = DNA Server: URL={0} User={1}
+
+ServerManagerRegistryAddUnexpectedError = Unexpected error adding server to registry
+ServerManagerRegistryListenerError = This error was reported by an
IServerRegistryListener
+ServerManagerRegistryListenerErrorsOccurred = Errors occurred processing a server
registry event. Check error log for more details.
+ServerManagerRegistryRemoveUnexpectedError = {0} cannot be removed as it has not been
registered
+ServerManagerRegistryUpdateAddError = There was an unexpected error updating the server
in the registry. The old version of the server was successfully removed. However, the new
version was not updated. Detail: {0}
+ServerManagerRegistryUpdateRemoveError = There was an unexpected error updating the
server in the registry. The server has not been updated in the server registry. Detail:
{0}
+
+WorkspaceEmptyNameMsg = A workspace name cannot be empty
+WorkspaceNullRepositoryMsg = A workspace repository cannot be null
+WorkspaceShortDescription = DNA Repository Workspace: Name: {0}, {1}
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/main/resources/org/jboss/dna/web/jcr/rest/client/Messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/eclipse/dna-web-jcr-rest-client/src/test/resources/log4j.properties
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/src/test/resources/log4j.properties
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/log4j.properties 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,28 @@
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
+
+# Direct log messages to a file
+log4j.appender.testlog=org.apache.log4j.FileAppender
+log4j.appender.testlog.File=target/logs/test/org.jboss.dna.web.jcr.rest.client.Test.log
+log4j.appender.testlog.layout=org.apache.log4j.PatternLayout
+log4j.appender.testlog.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
+
+# Direct log messages to a file and use Mapped Diagnostic Contexts (MDC)
+log4j.appender.testlog-mdc=org.apache.log4j.FileAppender
+log4j.appender.testlog-mdc.File=target/logs/test/org.jboss.dna.web.jcr.rest.client.Test.log
+log4j.appender.testlog-mdc.layout=org.apache.log4j.PatternLayout
+log4j.appender.testlog-mdc.layout.ConversionPattern=%d{ABSOLUTE} %5p [%X{username}] %m%n
+
+# Root logger option
+log4j.rootLogger=INFO, stdout, testlog, testlog-mdc
+
+# Set up the default logging to be INFO level, then override specific units
+log4j.logger.org.jboss.dna=INFO
+
+# Set up the logging for the LoggerTest test cases (which need this to be explicitly set
rather than inherited)
+log4j.logger.org.jboss.dna.common.util.LoggerTest=INFO
+
+
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/src/test/resources/log4j.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IConstants.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IConstants.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/IServerRegistryListener.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Logger.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Logger.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Messages.properties
===================================================================
---
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Messages.properties
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Messages.properties 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,47 @@
+#
+# JBoss DNA (
http://www.jboss.org/dna)
+# See the COPYRIGHT.txt file distributed with this work for information
+# regarding copyright ownership. Some portions may be licensed
+# to Red Hat, Inc. under one or more contributor license agreements.
+# See the AUTHORS.txt file in the distribution for a full listing of
+# individual contributors.
+#
+# JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
+# is licensed to you under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# JBoss DNA is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+#
+ErrorDeletingServerRegistryFile = There was a problem deleting server registry file
"{0}"
+ErrorRestoringServerRegistry = Error trying to restore the server registry from file
"{0}"
+ErrorSavingServerRegistry = Error trying to save the server registry to "{0}"
+
+RepositoryEmptyNameMsg = A repository name cannot be empty
+RepositoryNullServerMsg = A repository server cannot be null
+RepositoryShortDescription = DNA Repository: Name: {0}, {1}
+
+ServerEmptyUserMsg = The user cannot be empty
+ServerEmptyUrlMsg = A server URL cannot be empty
+ServerExistsMsg = {0} already exists so it cannot be added
+ServerInvalidUrlMsg = The value "{0}" is not a valid server URL
+ServerShortDescription = DNA Server: URL={0} User={1}
+
+ServerManagerRegistryAddUnexpectedError = Unexpected error adding server to registry
+ServerManagerRegistryListenerError = This error was reported by an
IServerRegistryListener
+ServerManagerRegistryListenerErrorsOccurred = Errors occurred processing a server
registry event. Check error log for more details.
+ServerManagerRegistryRemoveUnexpectedError = {0} cannot be removed as it has not been
registered
+ServerManagerRegistryUpdateAddError = There was an unexpected error updating the server
in the registry. The old version of the server was successfully removed. However, the new
version was not updated. Detail: {0}
+ServerManagerRegistryUpdateRemoveError = There was an unexpected error updating the
server in the registry. The server has not been updated in the server registry. Detail:
{0}
+
+WorkspaceEmptyNameMsg = A workspace name cannot be empty
+WorkspaceNullRepositoryMsg = A workspace repository cannot be null
+WorkspaceShortDescription = DNA Repository Workspace: Name: {0}, {1}
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerManager.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerManager.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent$Type.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent$Type.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/ServerRegistryEvent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status$Severity.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status$Severity.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Status.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Utils.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/Utils.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/IDnaObject.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Repository.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Repository.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Server.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Server.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Workspace.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/Workspace.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/RepositoryValidator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/ServerValidator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/domain/validation/WorkspaceValidator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetRepositoriesRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/GetWorkspacesRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsPublishedRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/IsServerAliveRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRequestFactory.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest$Method.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest$Method.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/JsonRestRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand$1.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishCommand.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/PublishRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/json/UnpublishRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestRequestFactory.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.class
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/classes/org/jboss/dna/web/jcr/rest/client/publish/IRestResponse.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-test-sources.jar
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-test-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-tests.jar
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT-tests.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT.jar
===================================================================
(Binary files differ)
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/dna-web-jcr-rest-client-0.6-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/pom.properties
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/pom.properties
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/pom.properties 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Thu Jul 09 09:17:20 CDT 2009
+version=0.6-SNAPSHOT
+groupId=org.jboss.dna
+artifactId=dna-web-jcr-rest-client
Property changes on:
branches/eclipse/dna-web-jcr-rest-client/target/maven-archiver/pom.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/eclipse/dna-web-jcr-rest-client/target/test-classes/log4j.properties
===================================================================
--- branches/eclipse/dna-web-jcr-rest-client/target/test-classes/log4j.properties
(rev 0)
+++
branches/eclipse/dna-web-jcr-rest-client/target/test-classes/log4j.properties 2009-07-14
12:59:48 UTC (rev 1111)
@@ -0,0 +1,28 @@
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
+
+# Direct log messages to a file
+log4j.appender.testlog=org.apache.log4j.FileAppender
+log4j.appender.testlog.File=target/logs/test/org.jboss.dna.web.jcr.rest.client.Test.log
+log4j.appender.testlog.layout=org.apache.log4j.PatternLayout
+log4j.appender.testlog.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
+
+# Direct log messages to a file and use Mapped Diagnostic Contexts (MDC)
+log4j.appender.testlog-mdc=org.apache.log4j.FileAppender
+log4j.appender.testlog-mdc.File=target/logs/test/org.jboss.dna.web.jcr.rest.client.Test.log
+log4j.appender.testlog-mdc.layout=org.apache.log4j.PatternLayout
+log4j.appender.testlog-mdc.layout.ConversionPattern=%d{ABSOLUTE} %5p [%X{username}] %m%n
+
+# Root logger option
+log4j.rootLogger=INFO, stdout, testlog, testlog-mdc
+
+# Set up the default logging to be INFO level, then override specific units
+log4j.logger.org.jboss.dna=INFO
+
+# Set up the logging for the LoggerTest test cases (which need this to be explicitly set
rather than inherited)
+log4j.logger.org.jboss.dna.common.util.LoggerTest=INFO
+
+