[Registry-dev] svn commit r6681 - in
trunk/registry/java/modules/core/src: main/java/org/wso2/registry
main/java/org/wso2/registry/engine
main/java/org/wso2/registry/handlers
main/java/org/wso2/registry/handlers/global
main/java/org/wso2/registry/inmemory
main/java/org/wso2/registry/servlet
main/java/org/wso2/registry/servlet/actions
test/java/org/wso2/registry/engine
test/java/org/wso2/registry/inmemory
svn at wso2.org
svn at wso2.org
Wed Aug 29 03:57:32 PDT 2007
Author: deepal
Date: Wed Aug 29 03:56:53 2007
New Revision: 6681
Added:
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistrySessionContext.java
Removed:
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/Session.java
Modified:
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Constants.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Registry.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine2.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/ResourceHandler.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/global/ResourceAuthorizationHandler.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistryProvider.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/ActionProcessor.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/actions/GetResourceActionProcessor.java
trunk/registry/java/modules/core/src/test/java/org/wso2/registry/engine/RegistryEngineTest.java
trunk/registry/java/modules/core/src/test/java/org/wso2/registry/inmemory/InMemoryRegistryProviderTest.java
Log:
renaming session to RegistrySessionContext.java
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Constants.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Constants.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Constants.java Wed Aug 29 03:56:53 2007
@@ -29,4 +29,5 @@
public static final String REGISTRY_ENGINE = "RegistryEngine";
+ public static final String SESSION_PROPERTY = "SessionObject";
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Registry.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Registry.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/Registry.java Wed Aug 29 03:56:53 2007
@@ -21,7 +21,7 @@
import org.wso2.registry.resources.Resource;
import org.wso2.registry.comments.Comment;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
/**
* Primary interface for accessing the registry.
@@ -38,7 +38,7 @@
* @throws RegistryException ResourceNotFound exception is thrown if the resource is not in the
* registry
*/
- public Resource get(String path, Session session) throws RegistryException;
+ public Resource get(String path, RegistrySessionContext registrySessionContext) throws RegistryException;
/**
* Adds or updates resources in the registry. If there is no resource in the given path,
@@ -50,7 +50,7 @@
*
* @param resource Resource instance for the new resource
*/
- public void put(String path, Resource resource, Session session) throws RegistryException;
+ public void put(String path, Resource resource, RegistrySessionContext registrySessionContext) throws RegistryException;
/**
* Deletes the resource in the given path. If the path refers to a directory, all child
@@ -58,7 +58,7 @@
*
* @param path Path of the resource to be deleted.
*/
- public void delete(String path, Session session) throws RegistryException;
+ public void delete(String path, RegistrySessionContext registrySessionContext) throws RegistryException;
////////////////////////////////////////////////////////
// Tagging
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine2.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine2.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistryEngine2.java Wed Aug 29 03:56:53 2007
@@ -19,7 +19,6 @@
package org.wso2.registry.engine;
-import org.wso2.registry.Registry;
import org.wso2.registry.RegistryException;
import org.wso2.registry.RegistryProvider;
import org.wso2.registry.handlers.ResourceHandler;
@@ -34,34 +33,34 @@
this.registryProvider = registryProvider;
}
- public Resource get(String path, Session session) throws RegistryException {
+ public Resource get(String path, RegistrySessionContext registrySessionContext) throws RegistryException {
ResourceHandler[] handlers = registryProvider.getGlobalResourceHandlers();
for (int i = 0; i < handlers.length; i++) {
- handlers[i].get(path, session);
+ handlers[i].get(path, registrySessionContext);
}
- return registryProvider.get(path, session);
+ return registryProvider.get(path, registrySessionContext);
}
- public void put(String path, Resource resource, Session session) throws RegistryException {
+ public void put(String path, Resource resource, RegistrySessionContext registrySessionContext) throws RegistryException {
ResourceHandler[] handlers = registryProvider.getGlobalResourceHandlers();
for (int i = 0; i < handlers.length; i++) {
- handlers[i].put(path, resource, session);
+ handlers[i].put(path, resource, registrySessionContext);
}
- registryProvider.put(path, resource, session);
+ registryProvider.put(path, resource, registrySessionContext);
}
- public void delete(String path, Session session) throws RegistryException {
+ public void delete(String path, RegistrySessionContext registrySessionContext) throws RegistryException {
ResourceHandler[] handlers = registryProvider.getGlobalResourceHandlers();
for (int i = 0; i < handlers.length; i++) {
- handlers[i].delete(path, session);
+ handlers[i].delete(path, registrySessionContext);
}
- registryProvider.delete(path, session);
+ registryProvider.delete(path, registrySessionContext);
}
public void applyTag(String resourcePath, String tag) throws RegistryException {
Added: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistrySessionContext.java
==============================================================================
--- (empty file)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RegistrySessionContext.java Wed Aug 29 03:56:53 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.wso2.registry.engine;
+
+/**
+ * Stores user details for a individual users. Users are expected to keep an instance of this class
+ * and use it to fill the RequestContext whenever they invoke RegistryEngine.
+ */
+public class RegistrySessionContext {
+
+ private String userID;
+
+ public String getUserID() {
+ return userID;
+ }
+
+ public void setUserID(String userID) {
+ this.userID = userID;
+ }
+}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/engine/RequestContext.java Wed Aug 29 03:56:53 2007
@@ -25,19 +25,19 @@
public class RequestContext {
- private Session session;
+ private RegistrySessionContext registrySessionContext;
private String path;
private Resource resource;
private String action;
private Properties properties;
- public Session getSession() {
- return session;
+ public RegistrySessionContext getSession() {
+ return registrySessionContext;
}
- public void setSession(Session session) {
- this.session = session;
+ public void setSession(RegistrySessionContext registrySessionContext) {
+ this.registrySessionContext = registrySessionContext;
}
public String getPath() {
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/ResourceHandler.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/ResourceHandler.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/ResourceHandler.java Wed Aug 29 03:56:53 2007
@@ -19,8 +19,7 @@
package org.wso2.registry.handlers;
-import org.wso2.registry.engine.RequestContext;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import org.wso2.registry.RegistryException;
import org.wso2.registry.resources.Resource;
@@ -29,9 +28,9 @@
*/
public interface ResourceHandler {
- public Resource get(String path, Session session) throws RegistryException;
+ public Resource get(String path, RegistrySessionContext registrySessionContext) throws RegistryException;
- public void put(String path, Resource resource, Session session);
+ public void put(String path, Resource resource, RegistrySessionContext registrySessionContext);
- public void delete(String path, Session session);
+ public void delete(String path, RegistrySessionContext registrySessionContext);
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/global/ResourceAuthorizationHandler.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/global/ResourceAuthorizationHandler.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/handlers/global/ResourceAuthorizationHandler.java Wed Aug 29 03:56:53 2007
@@ -20,8 +20,7 @@
package org.wso2.registry.handlers.global;
import org.wso2.registry.handlers.ResourceHandler;
-import org.wso2.registry.engine.RequestContext;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import org.wso2.registry.RegistryException;
import org.wso2.registry.resources.Resource;
@@ -32,15 +31,15 @@
*/
public class ResourceAuthorizationHandler implements ResourceHandler {
- public Resource get(String path, Session session) throws RegistryException {
+ public Resource get(String path, RegistrySessionContext registrySessionContext) throws RegistryException {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
- public void put(String path, Resource resource, Session session) {
+ public void put(String path, Resource resource, RegistrySessionContext registrySessionContext) {
//To change body of implemented methods use File | Settings | File Templates.
}
- public void delete(String path, Session session) {
+ public void delete(String path, RegistrySessionContext registrySessionContext) {
//To change body of implemented methods use File | Settings | File Templates.
}
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistryProvider.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistryProvider.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/inmemory/InMemoryRegistryProvider.java Wed Aug 29 03:56:53 2007
@@ -20,7 +20,7 @@
package org.wso2.registry.inmemory;
import org.wso2.registry.*;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import org.wso2.registry.handlers.ResourceHandler;
import org.wso2.registry.handlers.global.ResourceAuthorizationHandler;
import org.wso2.registry.inmemory.tags.TagManager;
@@ -60,7 +60,7 @@
registry.put(Constants.ROOT_PATH, root);
}
- public Resource get(String path, Session session) throws RegistryException {
+ public Resource get(String path, RegistrySessionContext registrySessionContext) throws RegistryException {
Resource resource = (Resource) registry.get(path);
if (resource == null) {
@@ -80,7 +80,7 @@
* (resource containing content), a general directory or a special directory (e.g. synapse
* repository)
*/
- public synchronized void put(String path, Resource resource, Session session) {
+ public synchronized void put(String path, Resource resource, RegistrySessionContext registrySessionContext) {
resource.setPath(path);
resource.setLastModified(new Date());
@@ -154,7 +154,7 @@
*
* @param path Path of the resource to be deleted.
*/
- public synchronized void delete(String path, Session session) {
+ public synchronized void delete(String path, RegistrySessionContext registrySessionContext) {
Resource resource = (Resource) registry.get(path);
if (resource == null) {
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/ActionProcessor.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/ActionProcessor.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/ActionProcessor.java Wed Aug 29 03:56:53 2007
@@ -19,7 +19,7 @@
package org.wso2.registry.servlet;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
@@ -36,6 +36,6 @@
public interface ActionProcessor {
public boolean process(
- String action, String path, Session session,
+ String action, String path, RegistrySessionContext registrySessionContext,
HttpServletRequest request, HttpServletResponse response);
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/RegistryServlet.java Wed Aug 29 03:56:53 2007
@@ -24,11 +24,11 @@
import org.wso2.registry.Constants;
import org.wso2.registry.Registry;
import org.wso2.registry.RegistryProvider;
-import org.wso2.registry.servlet.actions.GetResourceActionProcessor;
import org.wso2.registry.engine.RegistryEngine2;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import org.wso2.registry.i18n.Messages;
import org.wso2.registry.inmemory.InMemoryRegistryProvider;
+import org.wso2.registry.servlet.actions.GetResourceActionProcessor;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@@ -38,7 +38,6 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
-import java.util.MissingResourceException;
/**
* Servlet for providing REST API for the registry.
@@ -57,12 +56,9 @@
RegistryProvider provider = new InMemoryRegistryProvider();
registry = new RegistryEngine2(provider);
config.getServletContext().setAttribute(Constants.REGISTRY_ENGINE, registry);
- try {
- log.info(Messages.getMessage("server.initalized"));
- } catch (MissingResourceException e) {
- e.printStackTrace();
- }
- System.out.println("*************************************Started*************************************");
+ log.info(Messages.getMessage("server.initalized"));
+
+ System.out.println("*************************************Started*************************************");
// we are initializing action processors in a hard coded manner. there is no need configure
// action processors dynamically
@@ -110,12 +106,12 @@
String action = (String) params.get("action");
// todo: get the session from the servlet session
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
for (int i = 0; i < actionProcessors.length; i++) {
boolean done = actionProcessors[i].
- process(action, path, session, request, response);
-
+ process(action, path, registrySessionContext, request, response);
+
if (done) {
break;
}
@@ -126,5 +122,17 @@
//TODO : need to log the correct message
log.debug(e.getMessage());
}
- }
+ }
+
+ public RegistrySessionContext getSession(HttpServletRequest request){
+
+ RegistrySessionContext registrySessionContextContext = (RegistrySessionContext) request.getSession(true).getAttribute(
+ Constants.SESSION_PROPERTY);
+ if (registrySessionContextContext == null) {
+ registrySessionContextContext = new RegistrySessionContext();
+ request.getSession().setAttribute(Constants.SESSION_PROPERTY,
+ registrySessionContextContext);
+ }
+ return registrySessionContextContext;
+ }
}
Modified: trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/actions/GetResourceActionProcessor.java
==============================================================================
--- trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/actions/GetResourceActionProcessor.java (original)
+++ trunk/registry/java/modules/core/src/main/java/org/wso2/registry/servlet/actions/GetResourceActionProcessor.java Wed Aug 29 03:56:53 2007
@@ -25,7 +25,7 @@
import org.wso2.registry.RegistryException;
import org.wso2.registry.resources.Resource;
import org.wso2.registry.resources.Directory;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
@@ -47,13 +47,13 @@
}
public boolean process(
- String action, String path, Session session,
+ String action, String path, RegistrySessionContext registrySessionContext,
HttpServletRequest request, HttpServletResponse response) {
if (action.equals(Actions.GET)) {
try {
- Resource resource = registry.get(path, session);
+ Resource resource = registry.get(path, registrySessionContext);
if (resource instanceof Directory) {
Modified: trunk/registry/java/modules/core/src/test/java/org/wso2/registry/engine/RegistryEngineTest.java
==============================================================================
--- trunk/registry/java/modules/core/src/test/java/org/wso2/registry/engine/RegistryEngineTest.java (original)
+++ trunk/registry/java/modules/core/src/test/java/org/wso2/registry/engine/RegistryEngineTest.java Wed Aug 29 03:56:53 2007
@@ -20,8 +20,6 @@
package org.wso2.registry.engine;
import junit.framework.TestCase;
-import org.wso2.registry.Registry;
-import org.wso2.registry.Actions;
import org.wso2.registry.RegistryException;
import org.wso2.registry.RegistryProvider;
import org.wso2.registry.resources.Resource;
@@ -33,7 +31,7 @@
RegistryProvider registryProvider = new InMemoryRegistryProvider();
RegistryEngine2 registryEngine2 = new RegistryEngine2(registryProvider);
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
// add a resource
@@ -47,7 +45,7 @@
//requestContext.setResource(r1);
try {
- registryEngine2.put("/d1/r1", r1, session);
+ registryEngine2.put("/d1/r1", r1, registrySessionContext);
} catch (RegistryException e) {
fail("Valid pur resource scenario failed.");
}
Modified: trunk/registry/java/modules/core/src/test/java/org/wso2/registry/inmemory/InMemoryRegistryProviderTest.java
==============================================================================
--- trunk/registry/java/modules/core/src/test/java/org/wso2/registry/inmemory/InMemoryRegistryProviderTest.java (original)
+++ trunk/registry/java/modules/core/src/test/java/org/wso2/registry/inmemory/InMemoryRegistryProviderTest.java Wed Aug 29 03:56:53 2007
@@ -23,7 +23,7 @@
import org.wso2.registry.RegistryException;
import org.wso2.registry.Registry;
import org.wso2.registry.ResourceNotFoundException;
-import org.wso2.registry.engine.Session;
+import org.wso2.registry.engine.RegistrySessionContext;
import org.wso2.registry.comments.Comment;
import org.wso2.registry.resources.Resource;
import org.wso2.registry.resources.Directory;
@@ -34,7 +34,7 @@
// create an in memory registry
Registry registry = new InMemoryRegistryProvider();
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
// create a content resource
Resource resource1 = new Resource();
@@ -44,7 +44,7 @@
// store it in a non existence path
String path1 = "/d1/d2/myresource";
- registry.put(path1, resource1, session);
+ registry.put(path1, resource1, registrySessionContext);
// store another content resource in the same path
Resource resource2 = new Resource();
@@ -53,7 +53,7 @@
resource2.setObject(content2);
String path2 = "/d1/d2/secondresource";
- registry.put(path2, resource2, session);
+ registry.put(path2, resource2, registrySessionContext);
// store the third resource in a path starting from previous path
Resource resource3 = new Resource();
@@ -62,35 +62,35 @@
resource3.setObject(content3);
String path3 = "/d1/d2/d3/thirdresource";
- registry.put(path3, resource3, session);
+ registry.put(path3, resource3, registrySessionContext);
// now we should have a directory /d1
- Resource d1 = registry.get("/d1", session);
+ Resource d1 = registry.get("/d1", registrySessionContext);
assertNotNull("/d1 does not exists", d1);
assertTrue("/d1 is not a directory", d1 instanceof Directory);
// there should be a directory /d1/d2
- Resource d2 = registry.get("/d1/d2", session);
+ Resource d2 = registry.get("/d1/d2", registrySessionContext);
assertNotNull("/d1/d2 does not exists", d2);
assertTrue("/d1/d2 is not a directory", d2 instanceof Directory);
// there should be a directory /d1/d2/d3
- Resource d3 = registry.get("/d1/d2/d3", session);
+ Resource d3 = registry.get("/d1/d2/d3", registrySessionContext);
assertNotNull("/d1/d2/d3 does not exists", d3);
assertTrue("/d1/d2/d3 is not a directory", d3 instanceof Directory);
// there should be a content resource /d1/d2/myresource
- Resource r1 = registry.get("/d1/d2/myresource", session);
+ Resource r1 = registry.get("/d1/d2/myresource", registrySessionContext);
assertNotNull("/d1/d2/myresource does not exists", r1);
assertTrue("/d1/d2/myresource is not a Resource", r1 instanceof Resource);
// there should be a content resource /d1/d2/secondresource
- Resource r2 = registry.get("/d1/d2/secondresource", session);
+ Resource r2 = registry.get("/d1/d2/secondresource", registrySessionContext);
assertNotNull("/d1/d2/secondresource does not exists", r2);
assertTrue("/d1/d2/secondresource is not a Resource", r2 instanceof Resource);
// there should be a content resource /d1/d2/d3/thirdresource
- Resource r3 = registry.get("/d1/d2/d3/thirdresource", session);
+ Resource r3 = registry.get("/d1/d2/d3/thirdresource", registrySessionContext);
assertNotNull("/d1/d2/d3/thirdresource does not exists", r3);
assertTrue(
"/d1/d2/d3/thirdresource is not a Resource", r3 instanceof Resource);
@@ -98,11 +98,11 @@
((InMemoryRegistryProvider) registry).dump();
// let's delete "/d1/d2"
- registry.delete("/d1/d2", session);
+ registry.delete("/d1/d2", registrySessionContext);
boolean gotError = false;
try {
- Resource dd1 = registry.get("/d1/d2", session);
+ Resource dd1 = registry.get("/d1/d2", registrySessionContext);
} catch (ResourceNotFoundException e) {
gotError = true;
}
@@ -116,7 +116,7 @@
public void testComments() {
Registry registry = new InMemoryRegistryProvider();
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
String resource1Path = "/d1/testresource";
Resource resource = new Resource();
@@ -124,7 +124,7 @@
resource.setDescription("This is a test resource.");
try {
- registry.put(resource1Path, resource, session);
+ registry.put(resource1Path, resource, registrySessionContext);
} catch (RegistryException e) {
fail("Valid put resource scenario failed.");
}
@@ -164,7 +164,7 @@
public void testTags() {
Registry registry = new InMemoryRegistryProvider();
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
String resource1Path = "/d1/testresource";
Resource resource1 = new Resource();
@@ -172,7 +172,7 @@
resource1.setDescription("This is a test resource.");
try {
- registry.put(resource1Path, resource1, session);
+ registry.put(resource1Path, resource1, registrySessionContext);
} catch (RegistryException e) {
fail("Valid put resource scenario failed.");
}
@@ -183,7 +183,7 @@
resource2.setDescription("Ferarri Enzo, best in Ferarri family.");
try {
- registry.put(resource2Path, resource2, session);
+ registry.put(resource2Path, resource2, registrySessionContext);
} catch (RegistryException e) {
fail("Valid put resource scenario failed.");
}
@@ -215,7 +215,7 @@
public void testRatings() {
Registry registry = new InMemoryRegistryProvider();
- Session session = new Session();
+ RegistrySessionContext registrySessionContext = new RegistrySessionContext();
String resource1Path = "/d1/testresource";
Resource resource1 = new Resource();
@@ -223,7 +223,7 @@
resource1.setDescription("This is a test resource.");
try {
- registry.put(resource1Path, resource1, session);
+ registry.put(resource1Path, resource1, registrySessionContext);
} catch (RegistryException e) {
fail("Valid put resource scenario failed.");
}
More information about the Registry-dev
mailing list