diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-04 16:08:49 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-04 16:08:49 +0200 |
| commit | 379ed8a0e133bee650e0acb24f6b743f657a50d0 (patch) | |
| tree | bdcac37cabe3f2f3d40715519b830469dc9e63ad /source/com/c2kernel/entity | |
| parent | 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (diff) | |
Last bit of cleanup honest
New castor and dependent commons libs
Diffstat (limited to 'source/com/c2kernel/entity')
5 files changed, 8 insertions, 53 deletions
diff --git a/source/com/c2kernel/entity/proxy/AgentProxy.java b/source/com/c2kernel/entity/proxy/AgentProxy.java index f2e8283..72ed088 100644 --- a/source/com/c2kernel/entity/proxy/AgentProxy.java +++ b/source/com/c2kernel/entity/proxy/AgentProxy.java @@ -272,14 +272,14 @@ public class AgentProxy extends EntityProxy /** Let scripts resolve items */
public ItemProxy searchItem(String name) throws ObjectNotFoundException {
- Enumeration<?> results = Gateway.getLDAPLookup().search(new DomainPath(""),name);
+ Enumeration<Path> results = Gateway.getLDAPLookup().search(new DomainPath(""),name);
Path returnPath = null;
if (!results.hasMoreElements())
throw new ObjectNotFoundException(name, "");
while(results.hasMoreElements()) {
- Path nextMatch = (Path)results.nextElement();
+ Path nextMatch = results.nextElement();
if (returnPath != null && nextMatch.getSysKey() != -1 && returnPath.getSysKey() != nextMatch.getSysKey())
throw new ObjectNotFoundException("Too many items with that name");
returnPath = nextMatch;
diff --git a/source/com/c2kernel/entity/proxy/EntityProxyManager.java b/source/com/c2kernel/entity/proxy/EntityProxyManager.java index 8ad4576..192a984 100644 --- a/source/com/c2kernel/entity/proxy/EntityProxyManager.java +++ b/source/com/c2kernel/entity/proxy/EntityProxyManager.java @@ -47,9 +47,9 @@ public class EntityProxyManager {
Logger.msg(5, "EntityProxyManager - Starting.....");
- Enumeration<?> servers = Gateway.getLDAPLookup().searchEntities(new DomainPath("/servers"));
+ Enumeration<Path> servers = Gateway.getLDAPLookup().searchEntities(new DomainPath("/servers"));
while(servers.hasMoreElements()) {
- Path thisServerPath = (Path)servers.nextElement();
+ Path thisServerPath = servers.nextElement();
try {
int syskey = thisServerPath.getSysKey();
String remoteServer = ((Property)Gateway.getStorage().get(syskey, ClusterStorage.PROPERTY+"/Name", null)).getValue();
diff --git a/source/com/c2kernel/entity/proxy/ProxyMessage.java b/source/com/c2kernel/entity/proxy/ProxyMessage.java index b312a44..62866eb 100644 --- a/source/com/c2kernel/entity/proxy/ProxyMessage.java +++ b/source/com/c2kernel/entity/proxy/ProxyMessage.java @@ -2,7 +2,6 @@ package com.c2kernel.entity.proxy; import java.io.IOException;
import java.net.DatagramPacket;
-import java.net.InetAddress;
import java.util.StringTokenizer;
import com.c2kernel.common.InvalidDataException;
@@ -92,14 +91,6 @@ public class ProxyMessage { public String toString() {
return sysKey+":"+(state?"-":"")+path;
}
- public DatagramPacket getPacket(ProxySubscriber host) {
- return getPacket(host.getHost(), host.getPort());
- }
-
- public DatagramPacket getPacket(InetAddress host, int port) {
- byte[] packetString = toString().getBytes();
- return new DatagramPacket(packetString, packetString.length, host, port);
- }
public String getServer() {
return server;
diff --git a/source/com/c2kernel/entity/proxy/ProxySubscriber.java b/source/com/c2kernel/entity/proxy/ProxySubscriber.java deleted file mode 100644 index 8cb85fa..0000000 --- a/source/com/c2kernel/entity/proxy/ProxySubscriber.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.c2kernel.entity.proxy;
-
-import java.net.DatagramPacket;
-import java.net.InetAddress;
-import java.util.ArrayList;
-
-import com.c2kernel.common.InvalidDataException;
-
-/**************************************************************************
- *
- * $Revision: 1.1 $
- * $Date: 2003/04/24 10:12:40 $
- *
- * Copyright (C) 2003 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-public class ProxySubscriber {
-
- private InetAddress host;
- private int port;
- public ArrayList<?> sysKeys = new ArrayList<Object>();
-
- public ProxySubscriber(DatagramPacket packet) throws InvalidDataException {
- host = packet.getAddress();
- port = packet.getPort();
- }
-
- public InetAddress getHost() {
- return host;
- }
-
- public int getPort() {
- return port;
- }
-}
diff --git a/source/com/c2kernel/entity/transfer/TransferItem.java b/source/com/c2kernel/entity/transfer/TransferItem.java index 9234650..0e3b764 100644 --- a/source/com/c2kernel/entity/transfer/TransferItem.java +++ b/source/com/c2kernel/entity/transfer/TransferItem.java @@ -10,6 +10,7 @@ import com.c2kernel.entity.TraceableEntity; import com.c2kernel.lifecycle.instance.Workflow;
import com.c2kernel.lookup.DomainPath;
import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.Path;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.outcome.Outcome;
import com.c2kernel.process.Gateway;
@@ -37,7 +38,7 @@ public class TransferItem { this.sysKey = sysKey;
domainPaths = new ArrayList<String>();
Property name = (Property)Gateway.getStorage().get(sysKey, ClusterStorage.PROPERTY + "/Name", null);
- Enumeration<?> paths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue());
+ Enumeration<Path> paths = Gateway.getLDAPLookup().search(new DomainPath(), name.getValue());
while (paths.hasMoreElements()) {
DomainPath thisPath = (DomainPath)paths.nextElement();
domainPaths.add(thisPath.toString());
@@ -73,10 +74,9 @@ public class TransferItem { }
// retrieve objects
- ArrayList<?> objectFiles = FileStringUtility.listDir(dir.getCanonicalPath(), false, true);
+ ArrayList<String> objectFiles = FileStringUtility.listDir(dir.getCanonicalPath(), false, true);
ArrayList<C2KLocalObject> objects = new ArrayList<C2KLocalObject>();
- for (Object name : objectFiles) {
- String element = (String)name;
+ for (String element : objectFiles) {
String xmlFile = FileStringUtility.file2String(element);
C2KLocalObject newObj;
String choppedPath = element.substring(dir.getCanonicalPath().length()+1, element.length()-4);
|
