From b086f57f56bf0eb9dab9cf321a0f69aaaae84347 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 30 May 2012 08:37:45 +0200 Subject: Initial Maven Conversion --- source/com/c2kernel/persistency/ProxyLoader.java | 133 ----------------------- 1 file changed, 133 deletions(-) delete mode 100644 source/com/c2kernel/persistency/ProxyLoader.java (limited to 'source/com/c2kernel/persistency/ProxyLoader.java') diff --git a/source/com/c2kernel/persistency/ProxyLoader.java b/source/com/c2kernel/persistency/ProxyLoader.java deleted file mode 100644 index e614b0d..0000000 --- a/source/com/c2kernel/persistency/ProxyLoader.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.c2kernel.persistency; -import java.util.HashMap; -import java.util.StringTokenizer; - -import com.c2kernel.entity.AgentHelper; -import com.c2kernel.entity.C2KLocalObject; -import com.c2kernel.entity.ItemHelper; -import com.c2kernel.entity.ManageableEntity; -import com.c2kernel.lookup.EntityPath; -import com.c2kernel.lookup.LDAPLookup; -import com.c2kernel.persistency.outcome.Outcome; -import com.c2kernel.process.Gateway; -import com.c2kernel.utils.CastorXMLUtility; -import com.c2kernel.utils.Logger; - -/** Used by proxies to load clusters by queryData from the Entity. -* Last client storage - only used if not cached elsewhere -*/ - -public class ProxyLoader extends ClusterStorage { - HashMap entities = new HashMap(); - LDAPLookup lookup; - - @Override - public void open() throws ClusterStorageException { - lookup = Gateway.getLDAPLookup(); - } - - @Override - public void close() throws ClusterStorageException { - } - // introspection - @Override - public short queryClusterSupport(String clusterType) { - return READ; - } - - @Override - public String getName() { - return "Proxy Cluster Loader"; - } - - @Override - public String getId() { - return "CORBA"; - } - - // retrieve object by path - @Override - public C2KLocalObject get(Integer sysKey, String path) throws ClusterStorageException { - try { - ManageableEntity thisEntity = getIOR(sysKey); - String type = getClusterType(path); - - // fetch the xml from the item - String queryData = thisEntity.queryData(path); - - if (queryData != null) { - if (type.equals(OUTCOME)) - return new Outcome(path, queryData); - else - return (C2KLocalObject)CastorXMLUtility.unmarshall(queryData); - } - } catch (Exception e) { - //Logger.error(e); - throw new ClusterStorageException(e.getMessage()); - } - return null; - } - - // store object by path - @Override - public void put(Integer sysKey, C2KLocalObject obj) throws ClusterStorageException { - // not supported - throw new ClusterStorageException("Cannot write to items through the ProxyLoader"); - } - // delete cluster - @Override - public void delete(Integer sysKey, String path) throws ClusterStorageException { - // not supported - throw new ClusterStorageException("Cannot write to items through the ProxyLoader"); - } - - /* navigation */ - - // directory listing - @Override - public String[] getClusterContents(Integer sysKey, String path) throws ClusterStorageException { - try { - ManageableEntity thisEntity = getIOR(sysKey); - String contents = thisEntity.queryData(path+"/all"); - StringTokenizer tok = new StringTokenizer(contents, ","); - String[] result = new String[tok.countTokens()]; - for (int i=0; i