From 379ed8a0e133bee650e0acb24f6b743f657a50d0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 16:08:49 +0200 Subject: Last bit of cleanup honest New castor and dependent commons libs --- source/com/c2kernel/entity/proxy/AgentProxy.java | 4 +-- .../c2kernel/entity/proxy/EntityProxyManager.java | 4 +-- source/com/c2kernel/entity/proxy/ProxyMessage.java | 9 ------ .../com/c2kernel/entity/proxy/ProxySubscriber.java | 36 ---------------------- 4 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 source/com/c2kernel/entity/proxy/ProxySubscriber.java (limited to 'source/com/c2kernel/entity/proxy') 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 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 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(); - - public ProxySubscriber(DatagramPacket packet) throws InvalidDataException { - host = packet.getAddress(); - port = packet.getPort(); - } - - public InetAddress getHost() { - return host; - } - - public int getPort() { - return port; - } -} -- cgit v1.2.3