You can subscribe to this list here.
2005 |
Jan
|
Feb
(14) |
Mar
|
Apr
(4) |
May
(57) |
Jun
(14) |
Jul
(15) |
Aug
(5) |
Sep
(29) |
Oct
(13) |
Nov
(44) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(14) |
Feb
(78) |
Mar
(55) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(12) |
Dec
(9) |
2007 |
Jan
(21) |
Feb
(67) |
Mar
(39) |
Apr
(28) |
May
(7) |
Jun
|
Jul
(6) |
Aug
(2) |
Sep
(1) |
Oct
(18) |
Nov
(8) |
Dec
(11) |
2008 |
Jan
(16) |
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andreas W. <an...@us...> - 2005-11-14 13:38:09
|
Update of /cvsroot/magicmap/magicmapclient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27911 Modified Files: build.xml Log Message: positionfacade2 benutzt Index: build.xml =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build.xml 27 Sep 2005 15:52:30 -0000 1.6 --- build.xml 14 Nov 2005 13:38:02 -0000 1.7 *************** *** 58,61 **** --- 58,68 ---- url="inf/PositionFacade.wsdl" /> <axis-wsdl2java + output="${src.gen}" + testcase="false" + verbose="false" + noimports="true" + debug="false" + url="inf/PositionFacade2.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" |
From: Andreas W. <an...@us...> - 2005-11-14 13:37:42
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27855/src/net/sf/magicmap/client/delegate Modified Files: PositionDelegate.java Log Message: positionfacade2 benutzt Index: PositionDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PositionDelegate.java 8 Nov 2005 11:24:19 -0000 1.5 --- PositionDelegate.java 14 Nov 2005 13:37:33 -0000 1.6 *************** *** 6,12 **** import java.rmi.RemoteException; ! import localhost.magicmap.services.PositionFacade.PositionFacade; ! import localhost.magicmap.services.PositionFacade.PositionFacadeServiceLocator; ! import localhost.magicmap.services.PositionFacade.PositionFacadeSoapBindingStub; import net.sf.magicmap.client.delegate.exception.ExceptionHandler; import net.sf.magicmap.client.delegate.interfaces.PositionFacadeInterface; --- 6,12 ---- import java.rmi.RemoteException; ! import localhost.magicmap.services.PositionFacade2.PositionFacade2; ! import localhost.magicmap.services.PositionFacade2.PositionFacade2ServiceLocator; ! import localhost.magicmap.services.PositionFacade2.PositionFacade2SoapBindingStub; import net.sf.magicmap.client.delegate.exception.ExceptionHandler; import net.sf.magicmap.client.delegate.interfaces.PositionFacadeInterface; *************** *** 22,32 **** public class PositionDelegate implements PositionFacadeInterface { ! private static final String JWS = "PositionFacade"; ! private PositionFacade getBinding() throws RemoteException{ ! PositionFacadeSoapBindingStub bindingLocal = null; try{ ! bindingLocal = (PositionFacadeSoapBindingStub) new PositionFacadeServiceLocator().getPositionFacade(new URL( Settings.getServerURL() + JWS)); } catch (javax.xml.rpc.ServiceException jre){ --- 22,32 ---- public class PositionDelegate implements PositionFacadeInterface { ! private static final String JWS = "PositionFacade2"; ! private PositionFacade2 getBinding() throws RemoteException{ ! PositionFacade2SoapBindingStub bindingLocal = null; try{ ! bindingLocal = (PositionFacade2SoapBindingStub) new PositionFacade2ServiceLocator().getPositionFacade2(new URL( Settings.getServerURL() + JWS)); } catch (javax.xml.rpc.ServiceException jre){ *************** *** 42,46 **** } ! private PositionFacade binding; public PositionDelegate() throws RemoteException { --- 42,46 ---- } ! private PositionFacade2 binding; public PositionDelegate() throws RemoteException { |
From: Florian L. <fle...@us...> - 2005-11-08 13:42:47
|
Update of /cvsroot/magicmap/magicmapclient/inf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12423/inf Added Files: PositionFacade2.wsdl Log Message: added --- NEW FILE: PositionFacade2.wsdl --- <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://localhost:8080/magicmap/services/PositionFacade2" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/magicmap/services/PositionFacade2" xmlns:intf="http://localhost:8080/magicmap/services/PositionFacade2" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://exception.server.magicmap.sf.net" xmlns:tns2="urn:dto.server.magicmap.sf.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> <wsdl:types> <schema targetNamespace="http://exception.server.magicmap.sf.net" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="urn:dto.server.magicmap.sf.net" /> <import namespace="http://localhost:8080/magicmap/services/PositionFacade2" /> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="SessionException"> <sequence /> </complexType> <complexType name="MapException"> <sequence /> </complexType> </schema> <schema targetNamespace="urn:dto.server.magicmap.sf.net" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://exception.server.magicmap.sf.net" /> <import namespace="http://localhost:8080/magicmap/services/PositionFacade2" /> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="SimpleScanResultDTO"> <sequence> <element name="lastSeen" nillable="true" type="xsd:dateTime" /> <element name="macAP" nillable="true" type="soapenc:string" /> <element name="noise" nillable="true" type="soapenc:double" /> <element name="signalLevel" nillable="true" type="soapenc:double" /> <element name="ssid" nillable="true" type="soapenc:string" /> </sequence> </complexType> <complexType name="SignalCharacterDTO"> <sequence> <element name="simpleScanResults" nillable="true" type="impl:ArrayOf_tns2_SimpleScanResultDTO" /> </sequence> </complexType> <complexType name="AccessPointDTO"> <sequence> <element name="id" nillable="true" type="soapenc:long" /> <element name="mac" nillable="true" type="soapenc:string" /> <element name="ssid" nillable="true" type="soapenc:string" /> </sequence> </complexType> <complexType name="ClientDTO"> <sequence> <element name="id" nillable="true" type="soapenc:long" /> <element name="mac" nillable="true" type="soapenc:string" /> <element name="name" nillable="true" type="soapenc:string" /> </sequence> </complexType> <complexType name="PositionDTO"> <sequence> <element name="accessPoint" nillable="true" type="tns2:AccessPointDTO" /> <element name="character" nillable="true" type="tns2:SignalCharacterDTO" /> <element name="client" nillable="true" type="tns2:ClientDTO" /> <element name="deleted" type="xsd:boolean" /> <element name="fixed" type="xsd:boolean" /> <element name="id" nillable="true" type="soapenc:long" /> <element name="lastModified" nillable="true" type="soapenc:long" /> <element name="name" nillable="true" type="soapenc:string" /> <element name="posX" nillable="true" type="soapenc:int" /> <element name="posY" nillable="true" type="soapenc:int" /> </sequence> </complexType> </schema> <schema targetNamespace="http://localhost:8080/magicmap/services/PositionFacade2" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://exception.server.magicmap.sf.net" /> <import namespace="urn:dto.server.magicmap.sf.net" /> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="ArrayOf_tns2_SimpleScanResultDTO"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:SimpleScanResultDTO[]" /> </restriction> </complexContent> </complexType> <complexType name="ArrayOf_tns2_PositionDTO"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:PositionDTO[]" /> </restriction> </complexContent> </complexType> </schema> </wsdl:types> <wsdl:message name="getPositionsForMapSinceRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapName" type="soapenc:string" /> <wsdl:part name="timeStamp" type="xsd:long" /> </wsdl:message> <wsdl:message name="movePositionRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapname" type="soapenc:string" /> <wsdl:part name="positionId" type="xsd:long" /> <wsdl:part name="newPositionX" type="xsd:int" /> <wsdl:part name="newPositionY" type="xsd:int" /> <wsdl:part name="fixed" type="xsd:boolean" /> </wsdl:message> <wsdl:message name="createOrUpdateClientPositionRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapName" type="soapenc:string" /> <wsdl:part name="positionX" type="xsd:int" /> <wsdl:part name="positionY" type="xsd:int" /> <wsdl:part name="character" type="tns2:SignalCharacterDTO" /> <wsdl:part name="clientMac" type="soapenc:string" /> <wsdl:part name="fixed" type="xsd:boolean" /> </wsdl:message> <wsdl:message name="getPositionForClientOnMapRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapName" type="soapenc:string" /> <wsdl:part name="clientMac" type="soapenc:string" /> </wsdl:message> <wsdl:message name="createOrUpdateClientPositionResponse"> </wsdl:message> <wsdl:message name="createOrUpdatePositionResponse"> </wsdl:message> <wsdl:message name="getPositionsForMapSinceResponse"> <wsdl:part name="getPositionsForMapSinceReturn" type="impl:ArrayOf_tns2_PositionDTO" /> </wsdl:message> <wsdl:message name="createOrUpdateAccessPositionResponse"> </wsdl:message> <wsdl:message name="SessionException"> <wsdl:part name="fault" type="tns1:SessionException" /> </wsdl:message> <wsdl:message name="getPositionForClientOnMapResponse"> <wsdl:part name="getPositionForClientOnMapReturn" type="soapenc:string" /> </wsdl:message> <wsdl:message name="createOrUpdatePositionRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapName" type="soapenc:string" /> <wsdl:part name="positionX" type="xsd:int" /> <wsdl:part name="positionY" type="xsd:int" /> <wsdl:part name="character" type="tns2:SignalCharacterDTO" /> <wsdl:part name="positionName" type="soapenc:string" /> <wsdl:part name="fixed" type="xsd:boolean" /> </wsdl:message> <wsdl:message name="createOrUpdateAccessPositionRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapName" type="soapenc:string" /> <wsdl:part name="positionX" type="xsd:int" /> <wsdl:part name="positionY" type="xsd:int" /> <wsdl:part name="accessPointMac" type="soapenc:string" /> <wsdl:part name="fixed" type="xsd:boolean" /> </wsdl:message> <wsdl:message name="deletePositionRequest"> <wsdl:part name="sessionId" type="xsd:long" /> <wsdl:part name="mapname" type="soapenc:string" /> <wsdl:part name="positionId" type="xsd:long" /> </wsdl:message> <wsdl:message name="deletePositionResponse"> </wsdl:message> <wsdl:message name="movePositionResponse"> </wsdl:message> <wsdl:message name="MapException"> <wsdl:part name="fault" type="tns1:MapException" /> </wsdl:message> <wsdl:portType name="PositionFacade2"> <wsdl:operation name="movePosition" parameterOrder="sessionId mapname positionId newPositionX newPositionY fixed"> <wsdl:input message="impl:movePositionRequest" name="movePositionRequest" /> <wsdl:output message="impl:movePositionResponse" name="movePositionResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="createOrUpdatePosition" parameterOrder="sessionId mapName positionX positionY character positionName fixed"> <wsdl:input message="impl:createOrUpdatePositionRequest" name="createOrUpdatePositionRequest" /> <wsdl:output message="impl:createOrUpdatePositionResponse" name="createOrUpdatePositionResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="createOrUpdateClientPosition" parameterOrder="sessionId mapName positionX positionY character clientMac fixed"> <wsdl:input message="impl:createOrUpdateClientPositionRequest" name="createOrUpdateClientPositionRequest" /> <wsdl:output message="impl:createOrUpdateClientPositionResponse" name="createOrUpdateClientPositionResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="createOrUpdateAccessPosition" parameterOrder="sessionId mapName positionX positionY accessPointMac fixed"> <wsdl:input message="impl:createOrUpdateAccessPositionRequest" name="createOrUpdateAccessPositionRequest" /> <wsdl:output message="impl:createOrUpdateAccessPositionResponse" name="createOrUpdateAccessPositionResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="deletePosition" parameterOrder="sessionId mapname positionId"> <wsdl:input message="impl:deletePositionRequest" name="deletePositionRequest" /> <wsdl:output message="impl:deletePositionResponse" name="deletePositionResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="getPositionsForMapSince" parameterOrder="sessionId mapName timeStamp"> <wsdl:input message="impl:getPositionsForMapSinceRequest" name="getPositionsForMapSinceRequest" /> <wsdl:output message="impl:getPositionsForMapSinceResponse" name="getPositionsForMapSinceResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> <wsdl:operation name="getPositionForClientOnMap" parameterOrder="sessionId mapName clientMac"> <wsdl:input message="impl:getPositionForClientOnMapRequest" name="getPositionForClientOnMapRequest" /> <wsdl:output message="impl:getPositionForClientOnMapResponse" name="getPositionForClientOnMapResponse" /> <wsdl:fault message="impl:MapException" name="MapException" /> <wsdl:fault message="impl:SessionException" name="SessionException" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PositionFacade2SoapBinding" type="impl:PositionFacade2"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="movePosition"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="movePositionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="movePositionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="createOrUpdatePosition"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="createOrUpdatePositionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="createOrUpdatePositionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="createOrUpdateClientPosition"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="createOrUpdateClientPositionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="createOrUpdateClientPositionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="createOrUpdateAccessPosition"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="createOrUpdateAccessPositionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="createOrUpdateAccessPositionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="deletePosition"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="deletePositionRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="deletePositionResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="getPositionsForMapSince"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="getPositionsForMapSinceRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="getPositionsForMapSinceResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> <wsdl:operation name="getPositionForClientOnMap"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="getPositionForClientOnMapRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded" /> </wsdl:input> <wsdl:output name="getPositionForClientOnMapResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:output> <wsdl:fault name="MapException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> <wsdl:fault name="SessionException"> <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade2" use="encoded" /> </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:service name="PositionFacade2Service"> <wsdl:port binding="impl:PositionFacade2SoapBinding" name="PositionFacade2"> <wsdlsoap:address location="http://localhost:8080/magicmap/services/PositionFacade2" /> </wsdl:port> </wsdl:service> </wsdl:definitions> |
From: Florian L. <fle...@us...> - 2005-11-08 13:15:02
|
Update of /cvsroot/magicmap/magicmapserver/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4716/web/WEB-INF Modified Files: server-config.wsdd deploy.wsdd Log Message: anpassen der webservices an PositionCache Index: deploy.wsdd =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/web/WEB-INF/deploy.wsdd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deploy.wsdd 23 Sep 2005 14:31:04 -0000 1.3 --- deploy.wsdd 8 Nov 2005 13:14:50 -0000 1.4 *************** *** 16,19 **** --- 16,29 ---- <beanMapping qname="myNS:PositionDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.PositionDTO"/> </service> + <service name="PositionFacade2" provider="java:RPC"> + <parameter name="className" value="net.sf.magicmap.server.facade.PositionFacade2"/> + <parameter name="allowedMethods" value="*"/> + <beanMapping qname="myNS:SignalCharacterDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.SignalCharacterDTO"/> + <beanMapping qname="myNS:SimpleScanResultDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.SimpleScanResultDTO"/> + <beanMapping qname="myNS:SignalCharacterDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.SignalCharacterDTO"/> + <beanMapping qname="myNS:AccessPointDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.AccessPointDTO"/> + <beanMapping qname="myNS:ClientDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.ClientDTO"/> + <beanMapping qname="myNS:PositionDTO" xmlns:myNS="urn:dto.server.magicmap.sf.net" languageSpecificType="java:net.sf.magicmap.server.dto.PositionDTO"/> + </service> <service name="SessionFacade" provider="java:RPC"> <parameter name="className" value="net.sf.magicmap.server.facade.SessionFacade"/> Index: server-config.wsdd =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/web/WEB-INF/server-config.wsdd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** server-config.wsdd 11 May 2005 15:46:30 -0000 1.3 --- server-config.wsdd 8 Nov 2005 13:14:50 -0000 1.4 *************** *** 54,57 **** --- 54,67 ---- <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.ClientDTO" qname="ns8:ClientDTO" xmlns:ns8="urn:dto.server.magicmap.sf.net"/> </service> + <service name="PositionFacade2" provider="java:RPC"> + <parameter name="allowedMethods" value="*"/> + <parameter name="className" value="net.sf.magicmap.server.facade.PositionFacade2"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.SignalCharacterDTO" qname="ns3:SignalCharacterDTO" xmlns:ns3="urn:dto.server.magicmap.sf.net"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.SimpleScanResultDTO" qname="ns4:SimpleScanResultDTO" xmlns:ns4="urn:dto.server.magicmap.sf.net"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.PositionDTO" qname="ns5:PositionDTO" xmlns:ns5="urn:dto.server.magicmap.sf.net"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.SignalCharacterDTO" qname="ns6:SignalCharacterDTO" xmlns:ns6="urn:dto.server.magicmap.sf.net"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.AccessPointDTO" qname="ns7:AccessPointDTO" xmlns:ns7="urn:dto.server.magicmap.sf.net"/> + <beanMapping languageSpecificType="java:net.sf.magicmap.server.dto.ClientDTO" qname="ns8:ClientDTO" xmlns:ns8="urn:dto.server.magicmap.sf.net"/> + </service> <transport name="http"> <requestFlow> |
From: Florian L. <fle...@us...> - 2005-11-08 13:15:02
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4716/src/net/sf/magicmap/server/cache Modified Files: PositionCache.java Log Message: anpassen der webservices an PositionCache Index: PositionCache.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionCache.java 7 Nov 2005 15:22:33 -0000 1.3 --- PositionCache.java 8 Nov 2005 13:14:50 -0000 1.4 *************** *** 94,106 **** protected void addPosition(PositionDTO position){ ! Long id = getFirstFreeID(); position.setId(id); ! while(timeMap.containsKey(position.getLastModified())){ ! position.setLastModified(position.getLastModified() + 1); } timeMap.put(position.getLastModified(),position.getName()); idHash.put(id,position.getName()); ! positionHash.put(position.getName(),position); ! } --- 94,112 ---- protected void addPosition(PositionDTO position){ ! Long id = new Long(1); ! while(idHash.containsKey(id)){ ! ++id; ! } position.setId(id); ! ! Long time = System.currentTimeMillis(); ! while(timeMap.containsKey(time)){ ! ++time; } + position.setLastModified(time); + timeMap.put(position.getLastModified(),position.getName()); idHash.put(id,position.getName()); ! positionHash.put(position.getName(),position); } *************** *** 126,135 **** } - private Long getFirstFreeID() { - Long id = new Long(1); - while(idHash.containsKey(id)) - ++id; - return id; - } protected boolean existsPosition(String name){ --- 132,135 ---- |
From: Florian L. <fle...@us...> - 2005-11-08 13:15:02
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4716/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: anpassen der webservices an PositionCache Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PositionFacade2.java 8 Nov 2005 10:29:13 -0000 1.7 --- PositionFacade2.java 8 Nov 2005 13:14:50 -0000 1.8 *************** *** 95,126 **** pos.setPosX(positionX); pos.setPosY(positionY); - pos.setLastModified(System.currentTimeMillis()); - //pos.setId(); //brauchen wir wahrscheinlich nicht PositionCache.getPositionCache().createOrUpdatePosition(map,pos); } - /** - * @param character - * @param pm - * @param client - * @param pos - * @throws MapException - */ - private void setNewSignalCharacter(SignalCharacterDTO character, PersistenceManager pm, Client client, Position pos) - throws MapException{ - // alle Scanresults dieser Position löschen - pm.deletePersistentAll(pos.getScanResults()); - SimpleScanResultDTO[] dtos = character.getSimpleScanResults(); - if (dtos != null){ - for (int i = 0; i < dtos.length; i++){ - AccessPoint ap = findOrCreateAccessPoint(dtos[i].getMacAP(), pm); - //@TODO think about? ap.setSsid(dtos[i].getSsid()); - ScanResult sr = new ScanResult(client, ap, dtos[i].getSignalLevel(), dtos[i].getNoise(), new Timestamp(System - .currentTimeMillis())); //@TODO use lastSeen - pm.makePersistent(sr); - sr.setPosition(pos); - } - } - } /** --- 95,101 ---- *************** *** 154,177 **** } - /** - * @param positionName - * @param map - * @param pm - * @return - */ - private Position checkPosition(String positionName, Map map, PersistenceManager pm){ - Position result = null; - Collection results; - Extent e = pm.getExtent(Position.class, true); - Query query = pm.newQuery(e, "name == myName && map == myMap"); - query.declareParameters("java.lang.String myName, net.sf.magicmap.db.Map myMap"); - query.declareImports("import java.lang.String; import net.sf.magicmap.db.Map;"); - results = (Collection) query.execute(positionName, map); - if (results != null && !results.isEmpty()){ - result = (Position) results.iterator().next(); - } - return result; - - } /** --- 129,132 ---- *************** *** 243,306 **** * @throws SessionException */ - private Position checkPosition(long positionId, PersistenceManager pm) throws MapException{ - Position result = null; - Collection results; - Extent e = pm.getExtent(Position.class, true); - Query query = pm.newQuery(e, "id == myId"); - query.declareParameters("java.lang.Long myId"); - results = (Collection) query.execute(new Long(positionId)); - if (results != null && !results.isEmpty()){ - result = (Position) results.iterator().next(); - } else{ - pm.currentTransaction().rollback(); - throw new MapException("Position mit der id:" + positionId + " existiert nicht"); - } - return result; - - } - - /** - * @param client - * @param map - * @return - */ - private Position getPositionForClientAndMap(Client client, Map map, PersistenceManager pm){ - Position result = null; - Collection results; - Extent e = pm.getExtent(Position.class, true); - Query query = pm.newQuery(e, "client == myClient && map == myMap"); - query.declareParameters("net.sf.magicmap.db.Client myClient, net.sf.magicmap.db.Map myMap"); - query.declareImports("import net.sf.magicmap.db.Client; import net.sf.magicmap.db.Map;"); - results = (Collection) query.execute(client, map); - if (results != null && !results.isEmpty()){ - result = (Position) results.iterator().next(); - } - return result; - } - - /** - * @param client - * @param map - * @return - */ - private Position getPositionForApAndMap(AccessPoint ap, Map map, PersistenceManager pm){ - Position result = null; - Collection results; - Extent e = pm.getExtent(Position.class, true); - Query query = pm.newQuery(e, "accessPoint == myAp && map == myMap"); - query.declareParameters("net.sf.magicmap.db.AccessPoint myAp, net.sf.magicmap.db.Map myMap"); - query.declareImports("import net.sf.magicmap.db.AccessPoint; import net.sf.magicmap.db.Map;"); - results = (Collection) query.execute(ap, map); - if (results != null && !results.isEmpty()){ - result = (Position) results.iterator().next(); - } - return result; - } - - /** - * @param sessionId - * @param tx - * @throws SessionException - */ private Client checkClient(String mac, PersistenceManager pm) throws MapException{ if (mac == null || "".equals(mac)){ --- 198,201 ---- *************** *** 331,363 **** this.logger.info("createOrUpdateClientPosition()"); PersistenceManager pm = null; - Transaction tx = null; try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! int count = 0; ! while (count < 3){ ! try{ ! createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, character, clientMac, fixed, ! pm); ! break; ! } catch (javax.jdo.JDODataStoreException jdoEx){ ! if (tx.isActive()){ ! tx.rollback(); ! } ! count++; ! tx.begin(); ! } ! } ! if (count == 3){ ! if (tx.isActive()){ ! tx.rollback(); ! } ! System.out.println("createOrUpdateClientPosition - GAVE UP - repeated 3 times"); ! } ! if (tx.isActive()){ ! tx.commit(); ! } ! } catch (Exception e){ e.printStackTrace(); --- 226,232 ---- this.logger.info("createOrUpdateClientPosition()"); PersistenceManager pm = null; try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, character, clientMac, fixed, pm); } catch (Exception e){ e.printStackTrace(); *************** *** 369,375 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } --- 238,241 ---- *************** *** 395,411 **** Map map = checkMap(mapName, positionX, positionY, pm); Client client = checkClient(clientMac, pm); ! ! Position pos = getPositionForClientAndMap(client, map, pm); ! if (pos == null){ ! pos = new Position(map, positionX, positionY, client.getMac()); ! pm.makePersistent(pos); } ! pos.setClient(client); ! pos.setDeleted(false); ! pos.setName(client.getMac()); pos.setPosX(positionX); pos.setPosY(positionY); ! pos.setFixed(fixed); ! setNewSignalCharacter(character, pm, client, pos); } --- 261,278 ---- Map map = checkMap(mapName, positionX, positionY, pm); Client client = checkClient(clientMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (client != null){ ! ClientDTO clientDTO = new ClientDTO(); ! clientDTO.setMac(client.getMac()); ! clientDTO.setId(new Long(client.getId())); ! clientDTO.setName(client.getName()); ! pos.setClient(clientDTO); } ! pos.setCharacter(character); ! pos.setFixed(fixed); ! pos.setName(clientMac); pos.setPosX(positionX); pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); } *************** *** 417,442 **** this.logger.info("createOrUpdateAccessPosition()"); PersistenceManager pm = null; - Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, positionX, positionY, pm); AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); - Position pos = getPositionForApAndMap(ap, map, pm); - if (pos == null){ - pos = new Position(map, positionX, positionY, ap.getMac()); - pm.makePersistent(pos); - } - pos.setAccessPoint(ap); - pos.setDeleted(false); - pos.setName(ap.getMac()); - pos.setPosX(positionX); - pos.setPosY(positionY); - pos.setFixed(fixed); ! tx.commit(); } catch (Exception e){ e.printStackTrace(); --- 284,307 ---- this.logger.info("createOrUpdateAccessPosition()"); PersistenceManager pm = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); checkSession(sessionId, pm); Map map = checkMap(mapName, positionX, positionY, pm); AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (ap != null){ ! AccessPointDTO apDTO = new AccessPointDTO(); ! apDTO.setMac(ap.getMac()); ! apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen ! pos.setAccessPoint(apDTO); ! } ! pos.setFixed(fixed); ! pos.setName(accessPointMac); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); ! } catch (Exception e){ e.printStackTrace(); *************** *** 448,454 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } --- 313,316 ---- *************** *** 464,485 **** this.logger.info("movePosition()"); PersistenceManager pm = null; - Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); checkSession(sessionId, pm); ! Position pos = checkPosition(positionId, pm); ! Map map = pos.getMap(); ! if (newPositionX < 0 || newPositionY < 0 || newPositionX > (map.getImageWidth().intValue() - 1) ! || newPositionY > (map.getImageHeight().intValue() - 1)){ ! pm.currentTransaction().rollback(); ! throw new MapException("Position ist nicht auf der Karte"); ! } ! pos.setPosX(newPositionX); ! pos.setPosY(newPositionY); ! pos.setFixed(fixed); ! tx.commit(); ! } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ --- 326,336 ---- this.logger.info("movePosition()"); PersistenceManager pm = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); checkSession(sessionId, pm); ! Map map = checkMap(mapname, newPositionX, newPositionY, pm); ! PositionCache.getPositionCache().movePosition(map, positionId, newPositionX, newPositionY, fixed); ! } ! catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ *************** *** 490,496 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } --- 341,344 ---- *************** *** 505,517 **** this.logger.info("deletePosition()"); PersistenceManager pm = null; - Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); checkSession(sessionId, pm); ! Position pos = checkPosition(positionId, pm); ! pos.setDeleted(true); ! tx.commit(); } catch (Exception e){ e.printStackTrace(); --- 353,361 ---- this.logger.info("deletePosition()"); PersistenceManager pm = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); checkSession(sessionId, pm); ! Map map = checkMap(mapname, pm); ! PositionCache.getPositionCache().deletePosition(map,positionId); } catch (Exception e){ e.printStackTrace(); *************** *** 523,529 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } --- 367,370 ---- *************** *** 539,626 **** SessionException{ this.logger.info("getPositionsForMapSince() " + timeStamp); PersistenceManager pm = null; - Transaction tx = null; - ArrayList result = new ArrayList(); try{ pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); ! Extent e = pm.getExtent(Position.class, true); ! String filter = "map == myMap && lastModified > myLastModified"; ! if (timeStamp == -1){ ! filter += " && deleted == 0"; ! } ! Query query = pm.newQuery(e, filter); ! query.declareParameters("net.sf.magicmap.db.Map myMap, java.lang.Long myLastModified"); ! query.declareImports("import net.sf.magicmap.db.Map; import java.lang.Long;"); ! Collection results = null; ! results = (Collection) query.execute(map, new Long(timeStamp)); ! if (results != null){ ! Iterator it = results.iterator(); ! while (it.hasNext()){ ! Position pos = (Position) it.next(); ! // bei Timestamp -1 nur nicht gelöschte Positionen zurückliefern ! PositionDTO dto = new PositionDTO(); ! AccessPoint ap = pos.getAccessPoint(); ! if (ap != null){ ! AccessPointDTO apDTO = new AccessPointDTO(); ! apDTO.setMac(ap.getMac()); ! apDTO.setId(new Long(ap.getId())); ! apDTO.setSsid(ap.getSsid()); ! dto.setAccessPoint(apDTO); ! } ! Client client = pos.getClient(); ! if (client != null){ ! ClientDTO clientDTO = new ClientDTO(); ! clientDTO.setMac(client.getMac()); ! clientDTO.setId(new Long(client.getId())); ! clientDTO.setName(client.getName()); ! dto.setClient(clientDTO); ! } ! dto.setId(new Long(pos.getId())); ! dto.setDeleted(pos.isDeleted()); ! dto.setLastModified(new Long(pos.getLastModified())); ! dto.setPosX(new Integer(pos.getPosX())); ! dto.setPosY(new Integer(pos.getPosY())); ! dto.setFixed(pos.isFixed()); ! dto.setName(pos.getName()); ! dto.setCharacter(new SignalCharacterDTO()); ! // Scanresults holen ! Collection scanResults = pos.getScanResults(); ! if (scanResults != null){ ! Iterator scanIt = scanResults.iterator(); ! while (scanIt.hasNext()){ ! ScanResult sr = (ScanResult) scanIt.next(); ! ! Date lastSeen = null; ! if (sr.getScantime() != null){ ! lastSeen = new Date(sr.getScantime().getTime()); ! } ! ! SimpleScanResultDTO ssr = new SimpleScanResultDTO(); ! ! //ssr.setLastSeen(lastSeen); //TODO: last seen benutzen ! ssr.setMacAP(sr.getAccessPoint().getMac()); ! ssr.setNoise(sr.getNoiseLevel()); ! ssr.setSignalLevel(sr.getSignalLevel()); ! ssr.setSsid(sr.getAccessPoint().getSsid()); ! ! ArrayList list; ! if (dto.getCharacter().getSimpleScanResults() == null){ ! list = new ArrayList(); ! } else{ ! list = new ArrayList(Arrays.asList(dto.getCharacter().getSimpleScanResults())); ! } ! ! list.add(ssr); ! dto.getCharacter().setSimpleScanResults((SimpleScanResultDTO[]) list.toArray(new SimpleScanResultDTO[0])); ! } ! } ! result.add(dto); ! } ! } ! tx.commit(); } catch (Exception e){ e.printStackTrace(); --- 380,390 ---- SessionException{ this.logger.info("getPositionsForMapSince() " + timeStamp); + PositionDTO [] result = null; PersistenceManager pm = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); ! result = PositionCache.getPositionCache().getPositionsForMapSince(map,timeStamp); } catch (Exception e){ e.printStackTrace(); *************** *** 632,642 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } this.logger.info("getPositionsForMapSince() - done "); ! return (PositionDTO[]) result.toArray(new PositionDTO[0]); } --- 396,403 ---- } } finally{ JDOUtil.closePM(pm); } this.logger.info("getPositionsForMapSince() - done "); ! return result; } *************** *** 650,676 **** PersistenceManager pm = null; String positionResult = null; - Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); checkClient(clientMac, pm); ! Extent e = pm.getExtent(Position.class, true); ! String filter = "map == myMap && name == myName"; ! Query query = pm.newQuery(e, filter); ! query.declareParameters("net.sf.magicmap.db.Map myMap, java.lang.String myName"); ! query.declareImports("import net.sf.magicmap.db.Map; import java.lang.String;"); ! Collection results = null; ! results = (Collection) query.execute(map, clientMac); ! if (results != null){ ! Iterator it = results.iterator(); ! if(it.hasNext()){ ! Position pos = (Position) it.next(); ! positionResult = String.valueOf(pos.getPosX())+ "#" + String.valueOf(pos.getPosY()) + "#" + String.valueOf(pos.isFixed()); ! } ! } ! tx.commit(); } catch (Exception e){ e.printStackTrace(); --- 411,421 ---- PersistenceManager pm = null; String positionResult = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); checkClient(clientMac, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map,clientMac); ! positionResult = String.valueOf(pos.getPosX())+ "#" + String.valueOf(pos.getPosY()) + "#" + String.valueOf(pos.isFixed()); } catch (Exception e){ e.printStackTrace(); *************** *** 682,688 **** } } finally{ - if (tx.isActive()){ - tx.rollback(); - } JDOUtil.closePM(pm); } --- 427,430 ---- |
From: Andreas W. <an...@us...> - 2005-11-08 11:24:39
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/src/net/sf/magicmap/client/gui Modified Files: MapPanel.java Log Message: Aenderungen von DeletePosition und MovePosition wie im Server und wsdls angepasst. Index: MapPanel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MapPanel.java 7 Nov 2005 14:18:25 -0000 1.12 --- MapPanel.java 8 Nov 2005 11:24:19 -0000 1.13 *************** *** 247,251 **** if (selectedNode.getType() == NodeModel.NODETYPE_LOCATION){ // Referenzpunkt l�schen ! Controller.getInstance().deletePosition(selectedNode.getName(), this); return; } --- 247,251 ---- if (selectedNode.getType() == NodeModel.NODETYPE_LOCATION){ // Referenzpunkt l�schen ! Controller.getInstance().deletePosition(selectedNode.getName(), Controller.getInstance().getCurrentMap().name, this); return; } |
From: Andreas W. <an...@us...> - 2005-11-08 11:24:38
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/src/net/sf/magicmap/client/delegate/interfaces Modified Files: PositionFacadeInterface.java Log Message: Aenderungen von DeletePosition und MovePosition wie im Server und wsdls angepasst. Index: PositionFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PositionFacadeInterface.java 7 Nov 2005 14:18:25 -0000 1.4 --- PositionFacadeInterface.java 8 Nov 2005 11:24:19 -0000 1.5 *************** *** 89,93 **** * @throws MapException Fehlende Karte */ ! public abstract void deletePosition(long sessionId, long positionId) throws SessionException, MapException, RemoteException; --- 89,93 ---- * @throws MapException Fehlende Karte */ ! public abstract void deletePosition(long sessionId, String mapname,long positionId) throws SessionException, MapException, RemoteException; |
From: Andreas W. <an...@us...> - 2005-11-08 11:24:38
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/src/net/sf/magicmap/client/delegate Modified Files: PositionDelegate.java Log Message: Aenderungen von DeletePosition und MovePosition wie im Server und wsdls angepasst. Index: PositionDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PositionDelegate.java 7 Nov 2005 14:18:25 -0000 1.4 --- PositionDelegate.java 8 Nov 2005 11:24:19 -0000 1.5 *************** *** 101,107 **** * @see com.saugstation.pacw.generated.PositionFacade#deletePosition(long, long) */ ! public void deletePosition(long sessionId, long positionId) throws RemoteException, MapException, SessionException{ try{ ! this.binding.deletePosition(sessionId, positionId); } catch (Exception e){ throw ExceptionHandler.checkException(e); --- 101,107 ---- * @see com.saugstation.pacw.generated.PositionFacade#deletePosition(long, long) */ ! public void deletePosition(long sessionId, String mapname, long positionId) throws RemoteException, MapException, SessionException{ try{ ! this.binding.deletePosition(sessionId, mapname, positionId); } catch (Exception e){ throw ExceptionHandler.checkException(e); |
From: Andreas W. <an...@us...> - 2005-11-08 11:24:38
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/src/net/sf/magicmap/client/controller Modified Files: VirtualServerManager.java Controller.java ServerManager.java SOAPServerManager.java Log Message: Aenderungen von DeletePosition und MovePosition wie im Server und wsdls angepasst. Index: VirtualServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VirtualServerManager.java 7 Nov 2005 14:18:25 -0000 1.3 --- VirtualServerManager.java 8 Nov 2005 11:24:19 -0000 1.4 *************** *** 236,240 **** * net.sf.magicmap.client.interfaces.DeletePositionCallback) */ ! public void deletePosition(final long positionId, final DeletePositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { --- 236,240 ---- * net.sf.magicmap.client.interfaces.DeletePositionCallback) */ ! public void deletePosition(final long positionId, final String mapname, final DeletePositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { *************** *** 244,248 **** try{ ! positionFacade.deletePosition(sessionId, positionId); System.out.println("PositionID " + positionId + " deleted."); // TODO: Zusätzliche Parameter zur Position --- 244,248 ---- try{ ! positionFacade.deletePosition(sessionId, mapname, positionId); System.out.println("PositionID " + positionId + " deleted."); // TODO: Zusätzliche Parameter zur Position Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Controller.java 7 Nov 2005 14:18:25 -0000 1.6 --- Controller.java 8 Nov 2005 11:24:19 -0000 1.7 *************** *** 352,360 **** * @param node */ ! public void deletePosition(String name, DeletePositionCallback callback){ Node node = nodeModel.findNode(name); if (node != null){ if (node.getId() != -1){ ! serverManager.deletePosition(node.getId(), callback); } else{ System.out.println("Node has no positionId, so its position cannot be deleted."); --- 352,360 ---- * @param node */ ! public void deletePosition(String name, String mapname, DeletePositionCallback callback){ Node node = nodeModel.findNode(name); if (node != null){ if (node.getId() != -1){ ! serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); } else{ System.out.println("Node has no positionId, so its position cannot be deleted."); Index: ServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ServerManager.java 7 Nov 2005 14:18:25 -0000 1.7 --- ServerManager.java 8 Nov 2005 11:24:19 -0000 1.8 *************** *** 148,152 **** * @param callback */ ! public abstract void deletePosition(final long positionId, final DeletePositionCallback callback); /** --- 148,152 ---- * @param callback */ ! public abstract void deletePosition(final long positionId, final String mapname, final DeletePositionCallback callback); /** Index: SOAPServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SOAPServerManager.java 7 Nov 2005 14:18:25 -0000 1.3 --- SOAPServerManager.java 8 Nov 2005 11:24:19 -0000 1.4 *************** *** 230,234 **** * @param callback */ ! public void deletePosition(final long positionId, final DeletePositionCallback callback){ if (isConnected()){ Thread deletePositionThread = new Thread() { --- 230,234 ---- * @param callback */ ! public void deletePosition(final long positionId, final String mapname, final DeletePositionCallback callback){ if (isConnected()){ Thread deletePositionThread = new Thread() { *************** *** 237,241 **** synchronized (mutex){ try{ ! SOAPServerManager.this.positionDelgate.deletePosition(sessionId, positionId); System.out.println("PositionID " + positionId + " deleted."); // TODO: Zusätzliche Parameter zur Position --- 237,241 ---- synchronized (mutex){ try{ ! SOAPServerManager.this.positionDelgate.deletePosition(sessionId, mapname, positionId); System.out.println("PositionID " + positionId + " deleted."); // TODO: Zusätzliche Parameter zur Position |
From: Andreas W. <an...@us...> - 2005-11-08 11:24:37
|
Update of /cvsroot/magicmap/magicmapclient/inf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28675/inf Modified Files: PositionFacade.wsdl Log Message: Aenderungen von DeletePosition und MovePosition wie im Server und wsdls angepasst. Index: PositionFacade.wsdl =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/inf/PositionFacade.wsdl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PositionFacade.wsdl 11 May 2005 15:42:47 -0000 1.1 --- PositionFacade.wsdl 8 Nov 2005 11:24:18 -0000 1.2 *************** *** 83,102 **** </wsdl:types> - <wsdl:message name="createOrUpdateAccessPositionResponse"> - - </wsdl:message> - - <wsdl:message name="getPositionsForMapSinceResponse"> - - <wsdl:part name="getPositionsForMapSinceReturn" type="impl:ArrayOf_tns2_PositionDTO"/> - - </wsdl:message> - - <wsdl:message name="SessionException"> - - <wsdl:part name="fault" type="tns1:SessionException"/> - - </wsdl:message> - <wsdl:message name="createOrUpdatePositionRequest"> --- 83,86 ---- *************** *** 117,141 **** </wsdl:message> ! <wsdl:message name="createOrUpdateClientPositionResponse"> </wsdl:message> ! <wsdl:message name="createOrUpdateAccessPositionRequest"> ! <wsdl:part name="sessionId" type="xsd:long"/> ! <wsdl:part name="mapName" type="soapenc:string"/> ! <wsdl:part name="positionX" type="xsd:int"/> ! <wsdl:part name="positionY" type="xsd:int"/> ! <wsdl:part name="accessPointMac" type="soapenc:string"/> ! <wsdl:part name="fixed" type="xsd:boolean"/> </wsdl:message> ! <wsdl:message name="deletePositionResponse"> </wsdl:message> --- 101,137 ---- </wsdl:message> ! <wsdl:message name="createOrUpdatePositionResponse"> </wsdl:message> ! <wsdl:message name="movePositionResponse"> ! </wsdl:message> ! <wsdl:message name="getPositionsForMapSinceResponse"> ! <wsdl:part name="getPositionsForMapSinceReturn" type="impl:ArrayOf_tns2_PositionDTO"/> ! </wsdl:message> ! <wsdl:message name="MapException"> ! <wsdl:part name="fault" type="tns1:MapException"/> </wsdl:message> ! <wsdl:message name="createOrUpdateClientPositionResponse"> ! ! </wsdl:message> ! ! <wsdl:message name="SessionException"> ! ! <wsdl:part name="fault" type="tns1:SessionException"/> ! ! </wsdl:message> ! ! <wsdl:message name="getPositionForClientOnMapResponse"> ! ! <wsdl:part name="getPositionForClientOnMapReturn" type="soapenc:string"/> </wsdl:message> *************** *** 145,148 **** --- 141,146 ---- <wsdl:part name="sessionId" type="xsd:long"/> + <wsdl:part name="mapname" type="soapenc:string"/> + <wsdl:part name="positionId" type="xsd:long"/> *************** *** 155,162 **** --- 153,180 ---- </wsdl:message> + <wsdl:message name="createOrUpdateClientPositionRequest"> + + <wsdl:part name="sessionId" type="xsd:long"/> + + <wsdl:part name="mapName" type="soapenc:string"/> + + <wsdl:part name="positionX" type="xsd:int"/> + + <wsdl:part name="positionY" type="xsd:int"/> + + <wsdl:part name="character" type="tns2:SignalCharacterDTO"/> + + <wsdl:part name="clientMac" type="soapenc:string"/> + + <wsdl:part name="fixed" type="xsd:boolean"/> + + </wsdl:message> + <wsdl:message name="deletePositionRequest"> <wsdl:part name="sessionId" type="xsd:long"/> + <wsdl:part name="mapname" type="soapenc:string"/> + <wsdl:part name="positionId" type="xsd:long"/> *************** *** 173,177 **** </wsdl:message> ! <wsdl:message name="createOrUpdateClientPositionRequest"> <wsdl:part name="sessionId" type="xsd:long"/> --- 191,199 ---- </wsdl:message> ! <wsdl:message name="deletePositionResponse"> ! ! </wsdl:message> ! ! <wsdl:message name="getPositionForClientOnMapRequest"> <wsdl:part name="sessionId" type="xsd:long"/> *************** *** 179,205 **** <wsdl:part name="mapName" type="soapenc:string"/> ! <wsdl:part name="positionX" type="xsd:int"/> ! ! <wsdl:part name="positionY" type="xsd:int"/> ! <wsdl:part name="character" type="tns2:SignalCharacterDTO"/> ! <wsdl:part name="clientMac" type="soapenc:string"/> ! <wsdl:part name="fixed" type="xsd:boolean"/> ! </wsdl:message> ! <wsdl:message name="createOrUpdatePositionResponse"> ! </wsdl:message> ! <wsdl:message name="MapException"> ! <wsdl:part name="fault" type="tns1:MapException"/> </wsdl:message> ! <wsdl:message name="movePositionResponse"> </wsdl:message> --- 201,225 ---- <wsdl:part name="mapName" type="soapenc:string"/> ! <wsdl:part name="clientMac" type="soapenc:string"/> ! </wsdl:message> ! <wsdl:message name="createOrUpdateAccessPositionRequest"> ! <wsdl:part name="sessionId" type="xsd:long"/> ! <wsdl:part name="mapName" type="soapenc:string"/> ! <wsdl:part name="positionX" type="xsd:int"/> ! <wsdl:part name="positionY" type="xsd:int"/> ! <wsdl:part name="accessPointMac" type="soapenc:string"/> ! <wsdl:part name="fixed" type="xsd:boolean"/> </wsdl:message> ! <wsdl:message name="createOrUpdateAccessPositionResponse"> </wsdl:message> *************** *** 207,211 **** <wsdl:portType name="PositionFacade"> ! <wsdl:operation name="movePosition" parameterOrder="sessionId positionId newPositionX newPositionY fixed"> <wsdl:input message="impl:movePositionRequest" name="movePositionRequest"/> --- 227,231 ---- <wsdl:portType name="PositionFacade"> ! <wsdl:operation name="movePosition" parameterOrder="sessionId mapname positionId newPositionX newPositionY fixed"> <wsdl:input message="impl:movePositionRequest" name="movePositionRequest"/> *************** *** 255,259 **** </wsdl:operation> ! <wsdl:operation name="deletePosition" parameterOrder="sessionId positionId"> <wsdl:input message="impl:deletePositionRequest" name="deletePositionRequest"/> --- 275,279 ---- </wsdl:operation> ! <wsdl:operation name="deletePosition" parameterOrder="sessionId mapname positionId"> <wsdl:input message="impl:deletePositionRequest" name="deletePositionRequest"/> *************** *** 279,282 **** --- 299,314 ---- </wsdl:operation> + <wsdl:operation name="getPositionForClientOnMap" parameterOrder="sessionId mapName clientMac"> + + <wsdl:input message="impl:getPositionForClientOnMapRequest" name="getPositionForClientOnMapRequest"/> + + <wsdl:output message="impl:getPositionForClientOnMapResponse" name="getPositionForClientOnMapResponse"/> + + <wsdl:fault message="impl:MapException" name="MapException"/> + + <wsdl:fault message="impl:SessionException" name="SessionException"/> + + </wsdl:operation> + </wsdl:portType> *************** *** 465,468 **** --- 497,530 ---- </wsdl:operation> + <wsdl:operation name="getPositionForClientOnMap"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getPositionForClientOnMapRequest"> + + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded"/> + + </wsdl:input> + + <wsdl:output name="getPositionForClientOnMapResponse"> + + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/PositionFacade" use="encoded"/> + + </wsdl:output> + + <wsdl:fault name="MapException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/PositionFacade" use="encoded"/> + + </wsdl:fault> + + <wsdl:fault name="SessionException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/PositionFacade" use="encoded"/> + + </wsdl:fault> + + </wsdl:operation> + </wsdl:binding> |
From: Andreas W. <an...@us...> - 2005-11-08 10:29:21
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15162/src/net/sf/magicmap/server/interfaces Modified Files: PositionFacadeInterface.java Log Message: deletePosition um den MapName erweitert. Index: PositionFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionFacadeInterface.java 7 Nov 2005 14:19:40 -0000 1.3 --- PositionFacadeInterface.java 8 Nov 2005 10:29:13 -0000 1.4 *************** *** 91,95 **** * @throws MapException Fehlende Karte */ ! public abstract void deletePosition(long sessionId, long positionId) throws SessionException, MapException, RemoteException; --- 91,95 ---- * @throws MapException Fehlende Karte */ ! public abstract void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException, RemoteException; |
From: Andreas W. <an...@us...> - 2005-11-08 10:29:21
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15162/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java PositionFacade.java Log Message: deletePosition um den MapName erweitert. Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PositionFacade2.java 7 Nov 2005 14:19:40 -0000 1.6 --- PositionFacade2.java 8 Nov 2005 10:29:13 -0000 1.7 *************** *** 502,506 **** * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) */ ! public void deletePosition(long sessionId, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); PersistenceManager pm = null; --- 502,506 ---- * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) */ ! public void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); PersistenceManager pm = null; Index: PositionFacade.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PositionFacade.java 7 Nov 2005 14:19:40 -0000 1.10 --- PositionFacade.java 8 Nov 2005 10:29:13 -0000 1.11 *************** *** 549,553 **** * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) */ ! public void deletePosition(long sessionId, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); PersistenceManager pm = null; --- 549,553 ---- * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) */ ! public void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); PersistenceManager pm = null; |
From: Florian L. <fle...@us...> - 2005-11-07 15:22:41
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4072/src/net/sf/magicmap/server/cache Modified Files: PositionCache.java Log Message: update Index: PositionCache.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PositionCache.java 7 Nov 2005 12:46:04 -0000 1.2 --- PositionCache.java 7 Nov 2005 15:22:33 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; *************** *** 14,20 **** public class PositionCache extends Hashtable<Map,PositionCacheEntry>{ - private static SortedMap timeMap; - private static HashSet idHash; - // Sigleton Hashtable private static PositionCache single_positionCache = null; --- 15,18 ---- *************** *** 63,66 **** --- 61,83 ---- } + + public void movePosition (Map map, Long id, int x, int y, boolean fixed){ + if(existsMapHashtable(map)){ + getMapHashtable(map).movePosition(id, x, y, fixed); + } + } + + public void deletePosition (Map map, Long id){ + if(existsMapHashtable(map)){ + getMapHashtable(map).removePosition(id); + } + } + + public void deletePosition (Map map, String name){ + if(existsMapHashtable(map)){ + getMapHashtable(map).removePosition(name); + } + } + } *************** *** 68,94 **** private Hashtable<String,PositionDTO> positionHash; private TreeMap<Long ,String> timeMap; protected PositionCacheEntry (){ ! positionHash = new Hashtable<String,PositionDTO>(40); timeMap = new TreeMap<Long ,String>(); } protected void addPosition(PositionDTO position){ ! positionHash.put(position.getName(),position); timeMap.put(position.getLastModified(),position.getName()); } protected boolean existsPosition(String name){ return positionHash.containsKey(name); } protected PositionDTO getPosition(String name){ return positionHash.get(name); } protected void removePosition(String name){ timeMap.remove(positionHash.get(name).getLastModified()); positionHash.remove(name); } protected PositionDTO[] getPositionsSince(Long time){ Collection<String> newPositions = timeMap.tailMap(time).values(); --- 85,160 ---- private Hashtable<String,PositionDTO> positionHash; private TreeMap<Long ,String> timeMap; + private Hashtable<Long, String> idHash; protected PositionCacheEntry (){ ! positionHash = new Hashtable<String,PositionDTO>(60); timeMap = new TreeMap<Long ,String>(); + idHash = new Hashtable<Long, String>(60); } protected void addPosition(PositionDTO position){ ! Long id = getFirstFreeID(); ! position.setId(id); ! while(timeMap.containsKey(position.getLastModified())){ ! position.setLastModified(position.getLastModified() + 1); ! } timeMap.put(position.getLastModified(),position.getName()); + idHash.put(id,position.getName()); + positionHash.put(position.getName(),position); + + } + + protected void movePosition(Long id, int x, int y, boolean fixed){ + if(!idHash.containsKey(id)){ + return; + } + PositionDTO pos = getPosition(id); + pos.setPosX(x); + pos.setPosY(y); + pos.setFixed(fixed); + Long time = System.currentTimeMillis(); + while(timeMap.containsKey(time)){ + ++time; + } + updateTime(pos.getLastModified(), time); + pos.setLastModified(time); } + private void updateTime(Long oldTime, Long time){ + timeMap.put(time, timeMap.get(oldTime)); + timeMap.remove(oldTime); + } + + private Long getFirstFreeID() { + Long id = new Long(1); + while(idHash.containsKey(id)) + ++id; + return id; + } + protected boolean existsPosition(String name){ return positionHash.containsKey(name); } + protected PositionDTO getPosition(String name){ return positionHash.get(name); } + protected PositionDTO getPosition(Long id){ + return positionHash.get(idHash.get(id)); + } + protected void removePosition(String name){ timeMap.remove(positionHash.get(name).getLastModified()); + idHash.remove(positionHash.get(name).getId()); positionHash.remove(name); } + protected void removePosition(Long id){ + timeMap.remove(idHash.get(id)); + positionHash.remove(idHash.get(id)); + idHash.remove(id); + } + protected PositionDTO[] getPositionsSince(Long time){ Collection<String> newPositions = timeMap.tailMap(time).values(); |
From: Andreas W. <an...@us...> - 2005-11-07 14:20:00
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23043/src/net/sf/magicmap/server/interfaces Modified Files: PositionFacadeInterface.java Log Message: movePosition um den MapName erweitert. Index: PositionFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PositionFacadeInterface.java 23 Sep 2005 14:31:04 -0000 1.2 --- PositionFacadeInterface.java 7 Nov 2005 14:19:40 -0000 1.3 *************** *** 79,83 **** * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ ! public abstract void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException, RemoteException; --- 79,83 ---- * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ ! public abstract void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException, RemoteException; |
From: Andreas W. <an...@us...> - 2005-11-07 14:20:00
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23043/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java PositionFacade.java Log Message: movePosition um den MapName erweitert. Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PositionFacade2.java 7 Nov 2005 12:46:04 -0000 1.5 --- PositionFacade2.java 7 Nov 2005 14:19:40 -0000 1.6 *************** *** 460,464 **** * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException{ this.logger.info("movePosition()"); --- 460,464 ---- * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException{ this.logger.info("movePosition()"); Index: PositionFacade.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PositionFacade.java 23 Sep 2005 14:31:04 -0000 1.9 --- PositionFacade.java 7 Nov 2005 14:19:40 -0000 1.10 *************** *** 507,511 **** * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException{ this.logger.info("movePosition()"); --- 507,511 ---- * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException{ this.logger.info("movePosition()"); |
From: Andreas W. <an...@us...> - 2005-11-07 14:18:38
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22817/src/net/sf/magicmap/client/delegate Modified Files: PositionDelegate.java Log Message: movePosition um den MapName erweitert. Index: PositionDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionDelegate.java 11 May 2005 10:51:28 -0000 1.3 --- PositionDelegate.java 7 Nov 2005 14:18:25 -0000 1.4 *************** *** 89,96 **** * @see com.saugstation.pacw.generated.PositionFacade#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws RemoteException, MapException, SessionException{ try{ ! this.binding.movePosition(sessionId, positionId, newPositionX, newPositionY, fixed); } catch (Exception e){ throw ExceptionHandler.checkException(e); --- 89,96 ---- * @see com.saugstation.pacw.generated.PositionFacade#movePosition(long, long, int, int) */ ! public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, boolean fixed) throws RemoteException, MapException, SessionException{ try{ ! this.binding.movePosition(sessionId, mapname, positionId, newPositionX, newPositionY, fixed); } catch (Exception e){ throw ExceptionHandler.checkException(e); |
From: Andreas W. <an...@us...> - 2005-11-07 14:18:37
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22817/src/net/sf/magicmap/client/delegate/interfaces Modified Files: PositionFacadeInterface.java Log Message: movePosition um den MapName erweitert. Index: PositionFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionFacadeInterface.java 21 Apr 2005 10:53:26 -0000 1.3 --- PositionFacadeInterface.java 7 Nov 2005 14:18:25 -0000 1.4 *************** *** 77,81 **** * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ ! public abstract void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException, RemoteException; --- 77,81 ---- * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ ! public abstract void movePosition(long sessionId, String mapname,long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException, RemoteException; |
From: Andreas W. <an...@us...> - 2005-11-07 14:18:37
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22817/src/net/sf/magicmap/client/gui Modified Files: MapPanel.java Log Message: movePosition um den MapName erweitert. Index: MapPanel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MapPanel.java 31 Aug 2005 12:40:15 -0000 1.11 --- MapPanel.java 7 Nov 2005 14:18:25 -0000 1.12 *************** *** 281,285 **** ((AccessPointNode) selectedNode).getMacAddress(), this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), selectedNode.getX(), selectedNode.getY(), true, this); } --- 281,285 ---- ((AccessPointNode) selectedNode).getMacAddress(), this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), Controller.getInstance().getCurrentMap().name , selectedNode.getX(), selectedNode.getY(), true, this); } *************** *** 289,293 **** ((ClientNode) selectedNode).getMacAddress(), this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), selectedNode.getX(), selectedNode.getY(), true, this); } --- 289,293 ---- ((ClientNode) selectedNode).getMacAddress(), this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), Controller.getInstance().getCurrentMap().name, selectedNode.getX(), selectedNode.getY(), true, this); } *************** *** 297,301 **** true, this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), selectedNode.getX(), selectedNode.getY(), true, this); } --- 297,301 ---- true, this); } else{ ! Controller.getInstance().movePosition(selectedNode.getId(), Controller.getInstance().getCurrentMap().name, selectedNode.getX(), selectedNode.getY(), true, this); } *************** *** 306,310 **** // Knoten unfixieren if (selectedNode.getId() != -1){ ! Controller.getInstance().movePosition(selectedNode.getId(), selectedNode.getX(), selectedNode.getY(), false, this); } else{ --- 306,310 ---- // Knoten unfixieren if (selectedNode.getId() != -1){ ! Controller.getInstance().movePosition(selectedNode.getId(),Controller.getInstance().getCurrentMap().name, selectedNode.getX(), selectedNode.getY(), false, this); } else{ |
From: Andreas W. <an...@us...> - 2005-11-07 14:18:37
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22817/src/net/sf/magicmap/client/controller Modified Files: VirtualServerManager.java Controller.java ServerManager.java SOAPServerManager.java Log Message: movePosition um den MapName erweitert. Index: VirtualServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VirtualServerManager.java 11 May 2005 15:45:01 -0000 1.2 --- VirtualServerManager.java 7 Nov 2005 14:18:25 -0000 1.3 *************** *** 264,268 **** * net.sf.magicmap.client.interfaces.MovePositionCallback) */ ! public void movePosition(final long positionId, final int x, final int y, final boolean fixed, final MovePositionCallback callback){ if (!isConnected()) return; --- 264,268 ---- * net.sf.magicmap.client.interfaces.MovePositionCallback) */ ! public void movePosition(final long positionId, final String mapname, final int x, final int y, final boolean fixed, final MovePositionCallback callback){ if (!isConnected()) return; *************** *** 273,277 **** try{ ! positionFacade.movePosition(sessionId, positionId, x, y, fixed); // TODO: Zusätzliche Parameter zur Position callback.positionMoved(positionId); --- 273,277 ---- try{ ! positionFacade.movePosition(sessionId, mapname, positionId, x, y, fixed); // TODO: Zusätzliche Parameter zur Position callback.positionMoved(positionId); Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Controller.java 8 Oct 2005 23:18:09 -0000 1.5 --- Controller.java 7 Nov 2005 14:18:25 -0000 1.6 *************** *** 373,379 **** } ! public void movePosition(final long positionId, final int x, final int y, boolean fixed, final MovePositionCallback callback){ ! serverManager.movePosition(positionId, x, y, fixed, callback); } --- 373,379 ---- } ! public void movePosition(final long positionId, final String mapname, final int x, final int y, boolean fixed, final MovePositionCallback callback){ ! serverManager.movePosition(positionId, mapname,x, y, fixed, callback); } Index: ServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ServerManager.java 11 May 2005 10:51:27 -0000 1.6 --- ServerManager.java 7 Nov 2005 14:18:25 -0000 1.7 *************** *** 156,160 **** * @param callback */ ! public abstract void movePosition(final long positionId, final int x, final int y, final boolean fixed, final MovePositionCallback callback); --- 156,160 ---- * @param callback */ ! public abstract void movePosition(final long positionId,final String mapname, final int x, final int y, final boolean fixed, final MovePositionCallback callback); Index: SOAPServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SOAPServerManager.java 15 Jul 2005 17:54:32 -0000 1.2 --- SOAPServerManager.java 7 Nov 2005 14:18:25 -0000 1.3 *************** *** 257,261 **** * @param callback */ ! public void movePosition(final long positionId, final int x, final int y, final boolean fixed, final MovePositionCallback callback){ if (isConnected()){ --- 257,261 ---- * @param callback */ ! public void movePosition(final long positionId,final String mapname, final int x, final int y, final boolean fixed, final MovePositionCallback callback){ if (isConnected()){ *************** *** 265,269 **** synchronized (mutex){ try{ ! SOAPServerManager.this.positionDelgate.movePosition(sessionId, positionId, x, y, fixed); // TODO: Zusätzliche Parameter zur Position callback.positionMoved(positionId); --- 265,269 ---- synchronized (mutex){ try{ ! SOAPServerManager.this.positionDelgate.movePosition(sessionId, mapname, positionId, x, y, fixed); // TODO: Zusätzliche Parameter zur Position callback.positionMoved(positionId); |
From: Florian L. <fle...@us...> - 2005-11-07 12:46:18
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28280/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: update Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PositionFacade2.java 4 Nov 2005 13:54:58 -0000 1.4 --- PositionFacade2.java 7 Nov 2005 12:46:04 -0000 1.5 *************** *** 95,99 **** pos.setPosX(positionX); pos.setPosY(positionY); ! pos.setLastModified(character.getSimpleScanResults()[1].getLastSeen()); //pos.setId(); //brauchen wir wahrscheinlich nicht PositionCache.getPositionCache().createOrUpdatePosition(map,pos); --- 95,99 ---- pos.setPosX(positionX); pos.setPosY(positionY); ! pos.setLastModified(System.currentTimeMillis()); //pos.setId(); //brauchen wir wahrscheinlich nicht PositionCache.getPositionCache().createOrUpdatePosition(map,pos); |
From: Florian L. <fle...@us...> - 2005-11-07 12:46:18
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28280/src/net/sf/magicmap/server/cache Modified Files: PositionCache.java Log Message: update Index: PositionCache.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PositionCache.java 1 Nov 2005 15:53:09 -0000 1.1 --- PositionCache.java 7 Nov 2005 12:46:04 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- import java.util.Collection; + import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; *************** *** 14,17 **** --- 15,19 ---- private static SortedMap timeMap; + private static HashSet idHash; // Sigleton Hashtable |
From: Andreas W. <an...@us...> - 2005-11-04 13:55:07
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30522/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PositionFacade2.java 4 Nov 2005 12:06:40 -0000 1.3 --- PositionFacade2.java 4 Nov 2005 13:54:58 -0000 1.4 *************** *** 92,96 **** pos.setCharacter(character); pos.setFixed(fixed); ! pos.setId(); PositionCache.getPositionCache().createOrUpdatePosition(map,pos); } --- 92,100 ---- pos.setCharacter(character); pos.setFixed(fixed); ! pos.setName(positionName); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! pos.setLastModified(character.getSimpleScanResults()[1].getLastSeen()); ! //pos.setId(); //brauchen wir wahrscheinlich nicht PositionCache.getPositionCache().createOrUpdatePosition(map,pos); } |
From: Florian L. <fle...@us...> - 2005-11-04 12:07:05
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4218/src/net/sf/magicmap/server/facade Added Files: PositionFacade2.java Log Message: --- NEW FILE: PositionFacade2.java --- package net.sf.magicmap.server.facade; import java.rmi.RemoteException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.Iterator; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; import javax.jdo.Transaction; import net.sf.magicmap.db.AccessPoint; import net.sf.magicmap.db.Client; import net.sf.magicmap.db.Map; import net.sf.magicmap.db.Position; import net.sf.magicmap.db.ScanResult; import net.sf.magicmap.db.Session; import net.sf.magicmap.server.cache.PositionCache; import net.sf.magicmap.server.dto.AccessPointDTO; import net.sf.magicmap.server.dto.ClientDTO; import net.sf.magicmap.server.dto.PositionDTO; import net.sf.magicmap.server.dto.SignalCharacterDTO; import net.sf.magicmap.server.dto.SimpleScanResultDTO; import net.sf.magicmap.server.exception.MapException; import net.sf.magicmap.server.exception.SessionException; import net.sf.magicmap.server.interfaces.PositionFacadeInterface; import net.sf.magicmap.server.utils.JDOUtil; import org.apache.log4j.Category; public class PositionFacade2 implements PositionFacadeInterface { protected transient Category logger = Category.getInstance(this.getClass()); /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) */ public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, MapException{ this.logger.info("createOrUpdatePosition()"); PersistenceManager pm = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, character, positionName, fixed, pm); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ JDOUtil.closePM(pm); } this.logger.info("createOrUpdatePosition() - done"); } /** * @param sessionId * @param mapName * @param positionX * @param positionY * @param character * @param positionName * @param pm * @throws SessionException * @throws MapException */ private void createOrUpdatePositionInternal(long sessionId, String mapName, int positionX, int positionY, SignalCharacterDTO character, String positionName, boolean fixed, PersistenceManager pm) throws SessionException, MapException{ Session session = checkSession(sessionId, pm); Client client = session.getClient(); if (client == null){ throw new SessionException("Ungültige Session"); } if (character == null || character.getSimpleScanResults() == null || character.getSimpleScanResults().length == 0){ throw new MapException("Signalcharacter enthält keine Daten"); } if (positionName == null || "".equals(positionName)){ throw new MapException("Name der Position darf nicht leer sein"); } Map map = checkMap(mapName, positionX, positionY, pm); PositionDTO pos = new PositionDTO(); pos.setCharacter(character); pos.setFixed(fixed); pos.setId(); PositionCache.getPositionCache().createOrUpdatePosition(map,pos); } /** * @param character * @param pm * @param client * @param pos * @throws MapException */ private void setNewSignalCharacter(SignalCharacterDTO character, PersistenceManager pm, Client client, Position pos) throws MapException{ // alle Scanresults dieser Position löschen pm.deletePersistentAll(pos.getScanResults()); SimpleScanResultDTO[] dtos = character.getSimpleScanResults(); if (dtos != null){ for (int i = 0; i < dtos.length; i++){ AccessPoint ap = findOrCreateAccessPoint(dtos[i].getMacAP(), pm); //@TODO think about? ap.setSsid(dtos[i].getSsid()); ScanResult sr = new ScanResult(client, ap, dtos[i].getSignalLevel(), dtos[i].getNoise(), new Timestamp(System .currentTimeMillis())); //@TODO use lastSeen pm.makePersistent(sr); sr.setPosition(pos); } } } /** * @param macAP * @param pm * @return * @throws MapException * @throws s */ private AccessPoint findOrCreateAccessPoint(String macAP, PersistenceManager pm) throws MapException{ try{ AccessPoint result = null; Collection results; Extent e = pm.getExtent(AccessPoint.class, true); Query query = pm.newQuery(e, "mac == myMac"); query.declareParameters("java.lang.String myMac"); query.declareImports("import java.lang.String;"); results = (Collection) query.execute(macAP); if (results != null && !results.isEmpty()){ result = (AccessPoint) results.iterator().next(); } else{ result = new AccessPoint(macAP); pm.makePersistent(result); } return result; } catch (Exception e){ pm.currentTransaction().rollback(); throw new MapException("", e); } } /** * @param positionName * @param map * @param pm * @return */ private Position checkPosition(String positionName, Map map, PersistenceManager pm){ Position result = null; Collection results; Extent e = pm.getExtent(Position.class, true); Query query = pm.newQuery(e, "name == myName && map == myMap"); query.declareParameters("java.lang.String myName, net.sf.magicmap.db.Map myMap"); query.declareImports("import java.lang.String; import net.sf.magicmap.db.Map;"); results = (Collection) query.execute(positionName, map); if (results != null && !results.isEmpty()){ result = (Position) results.iterator().next(); } return result; } /** * @param mapName * @param positionX * @param positionY * @param pm * @return * @throws MapException */ private Map checkMap(String mapName, int positionX, int positionY, PersistenceManager pm) throws MapException{ Map result = checkMap(mapName, pm); if (positionX < 0 || positionY < 0 || positionX > (result.getImageWidth().intValue() - 1) || positionY > (result.getImageHeight().intValue() - 1)){ pm.currentTransaction().rollback(); throw new MapException("Position ist nicht auf der Karte"); } return result; } /** * @param mapName * @param pm * @return * @throws MapException */ private Map checkMap(String mapName, PersistenceManager pm) throws MapException{ Map result = null; Collection results; Extent e = pm.getExtent(Map.class, true); Query query = pm.newQuery(e, "name == myName"); query.declareParameters("java.lang.String myName"); results = (Collection) query.execute(mapName); if (results != null && !results.isEmpty()){ result = (Map) results.iterator().next(); } else{ throw new MapException("Karte mit dem namen:" + mapName + " existiert nicht"); } return result; } /** * @param sessionId * @param tx * @throws SessionException */ private Session checkSession(long sessionId, PersistenceManager pm) throws SessionException{ Session result = null; Collection results; Extent e = pm.getExtent(Session.class, true); Query query = pm.newQuery(e, "id == myId"); query.declareParameters("java.lang.Long myId"); results = (Collection) query.execute(new Long(sessionId)); if (results != null && !results.isEmpty()){ result = (Session) results.iterator().next(); } else{ pm.currentTransaction().rollback(); throw new SessionException("Session mit der id:" + sessionId + " existiert nicht"); } return result; } /** * @param sessionId * @param tx * @throws SessionException */ private Position checkPosition(long positionId, PersistenceManager pm) throws MapException{ Position result = null; Collection results; Extent e = pm.getExtent(Position.class, true); Query query = pm.newQuery(e, "id == myId"); query.declareParameters("java.lang.Long myId"); results = (Collection) query.execute(new Long(positionId)); if (results != null && !results.isEmpty()){ result = (Position) results.iterator().next(); } else{ pm.currentTransaction().rollback(); throw new MapException("Position mit der id:" + positionId + " existiert nicht"); } return result; } /** * @param client * @param map * @return */ private Position getPositionForClientAndMap(Client client, Map map, PersistenceManager pm){ Position result = null; Collection results; Extent e = pm.getExtent(Position.class, true); Query query = pm.newQuery(e, "client == myClient && map == myMap"); query.declareParameters("net.sf.magicmap.db.Client myClient, net.sf.magicmap.db.Map myMap"); query.declareImports("import net.sf.magicmap.db.Client; import net.sf.magicmap.db.Map;"); results = (Collection) query.execute(client, map); if (results != null && !results.isEmpty()){ result = (Position) results.iterator().next(); } return result; } /** * @param client * @param map * @return */ private Position getPositionForApAndMap(AccessPoint ap, Map map, PersistenceManager pm){ Position result = null; Collection results; Extent e = pm.getExtent(Position.class, true); Query query = pm.newQuery(e, "accessPoint == myAp && map == myMap"); query.declareParameters("net.sf.magicmap.db.AccessPoint myAp, net.sf.magicmap.db.Map myMap"); query.declareImports("import net.sf.magicmap.db.AccessPoint; import net.sf.magicmap.db.Map;"); results = (Collection) query.execute(ap, map); if (results != null && !results.isEmpty()){ result = (Position) results.iterator().next(); } return result; } /** * @param sessionId * @param tx * @throws SessionException */ private Client checkClient(String mac, PersistenceManager pm) throws MapException{ if (mac == null || "".equals(mac)){ pm.currentTransaction().rollback(); throw new MapException("Client mac darf nicht leer sein"); } Client result = null; Collection results; Extent e = pm.getExtent(Client.class, true); Query query = pm.newQuery(e, "mac == myMac"); query.declareParameters("java.lang.String myMac"); results = (Collection) query.execute(mac); if (results != null && !results.isEmpty()){ result = (Client) results.iterator().next(); } else{ pm.currentTransaction().rollback(); throw new MapException("Client mit der mac-adresse:" + mac + " existiert nicht"); } return result; } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateClientPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) */ public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, MapException{ this.logger.info("createOrUpdateClientPosition()"); PersistenceManager pm = null; Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); int count = 0; while (count < 3){ try{ createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, character, clientMac, fixed, pm); break; } catch (javax.jdo.JDODataStoreException jdoEx){ if (tx.isActive()){ tx.rollback(); } count++; tx.begin(); } } if (count == 3){ if (tx.isActive()){ tx.rollback(); } System.out.println("createOrUpdateClientPosition - GAVE UP - repeated 3 times"); } if (tx.isActive()){ tx.commit(); } } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("createOrUpdateClientPosition() - done"); } /** * @param sessionId * @param mapName * @param positionX * @param positionY * @param character * @param clientMac * @param pm * @throws SessionException * @throws MapException */ private void createOrUpdateClientPositionInternal(long sessionId, String mapName, int positionX, int positionY, SignalCharacterDTO character, String clientMac, boolean fixed, PersistenceManager pm) throws SessionException, MapException{ checkSession(sessionId, pm); Map map = checkMap(mapName, positionX, positionY, pm); Client client = checkClient(clientMac, pm); Position pos = getPositionForClientAndMap(client, map, pm); if (pos == null){ pos = new Position(map, positionX, positionY, client.getMac()); pm.makePersistent(pos); } pos.setClient(client); pos.setDeleted(false); pos.setName(client.getMac()); pos.setPosX(positionX); pos.setPosY(positionY); pos.setFixed(fixed); setNewSignalCharacter(character, pm, client, pos); } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateAccessPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) */ public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, String accessPointMac, boolean fixed) throws SessionException, MapException{ this.logger.info("createOrUpdateAccessPosition()"); PersistenceManager pm = null; Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, positionX, positionY, pm); AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); Position pos = getPositionForApAndMap(ap, map, pm); if (pos == null){ pos = new Position(map, positionX, positionY, ap.getMac()); pm.makePersistent(pos); } pos.setAccessPoint(ap); pos.setDeleted(false); pos.setName(ap.getMac()); pos.setPosX(positionX); pos.setPosY(positionY); pos.setFixed(fixed); tx.commit(); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("createOrUpdateAccessPosition() - done"); } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) */ public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY, boolean fixed) throws SessionException, MapException{ this.logger.info("movePosition()"); PersistenceManager pm = null; Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); checkSession(sessionId, pm); Position pos = checkPosition(positionId, pm); Map map = pos.getMap(); if (newPositionX < 0 || newPositionY < 0 || newPositionX > (map.getImageWidth().intValue() - 1) || newPositionY > (map.getImageHeight().intValue() - 1)){ pm.currentTransaction().rollback(); throw new MapException("Position ist nicht auf der Karte"); } pos.setPosX(newPositionX); pos.setPosY(newPositionY); pos.setFixed(fixed); tx.commit(); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("movePosition() - done"); } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) */ public void deletePosition(long sessionId, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); PersistenceManager pm = null; Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); checkSession(sessionId, pm); Position pos = checkPosition(positionId, pm); pos.setDeleted(true); tx.commit(); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("deletePosition() - done"); } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForMapSince(long, java.lang.String, long) */ public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp) throws MapException, SessionException{ this.logger.info("getPositionsForMapSince() " + timeStamp); PersistenceManager pm = null; Transaction tx = null; ArrayList result = new ArrayList(); try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); Extent e = pm.getExtent(Position.class, true); String filter = "map == myMap && lastModified > myLastModified"; if (timeStamp == -1){ filter += " && deleted == 0"; } Query query = pm.newQuery(e, filter); query.declareParameters("net.sf.magicmap.db.Map myMap, java.lang.Long myLastModified"); query.declareImports("import net.sf.magicmap.db.Map; import java.lang.Long;"); Collection results = null; results = (Collection) query.execute(map, new Long(timeStamp)); if (results != null){ Iterator it = results.iterator(); while (it.hasNext()){ Position pos = (Position) it.next(); // bei Timestamp -1 nur nicht gelöschte Positionen zurückliefern PositionDTO dto = new PositionDTO(); AccessPoint ap = pos.getAccessPoint(); if (ap != null){ AccessPointDTO apDTO = new AccessPointDTO(); apDTO.setMac(ap.getMac()); apDTO.setId(new Long(ap.getId())); apDTO.setSsid(ap.getSsid()); dto.setAccessPoint(apDTO); } Client client = pos.getClient(); if (client != null){ ClientDTO clientDTO = new ClientDTO(); clientDTO.setMac(client.getMac()); clientDTO.setId(new Long(client.getId())); clientDTO.setName(client.getName()); dto.setClient(clientDTO); } dto.setId(new Long(pos.getId())); dto.setDeleted(pos.isDeleted()); dto.setLastModified(new Long(pos.getLastModified())); dto.setPosX(new Integer(pos.getPosX())); dto.setPosY(new Integer(pos.getPosY())); dto.setFixed(pos.isFixed()); dto.setName(pos.getName()); dto.setCharacter(new SignalCharacterDTO()); // Scanresults holen Collection scanResults = pos.getScanResults(); if (scanResults != null){ Iterator scanIt = scanResults.iterator(); while (scanIt.hasNext()){ ScanResult sr = (ScanResult) scanIt.next(); Date lastSeen = null; if (sr.getScantime() != null){ lastSeen = new Date(sr.getScantime().getTime()); } SimpleScanResultDTO ssr = new SimpleScanResultDTO(); //ssr.setLastSeen(lastSeen); //TODO: last seen benutzen ssr.setMacAP(sr.getAccessPoint().getMac()); ssr.setNoise(sr.getNoiseLevel()); ssr.setSignalLevel(sr.getSignalLevel()); ssr.setSsid(sr.getAccessPoint().getSsid()); ArrayList list; if (dto.getCharacter().getSimpleScanResults() == null){ list = new ArrayList(); } else{ list = new ArrayList(Arrays.asList(dto.getCharacter().getSimpleScanResults())); } list.add(ssr); dto.getCharacter().setSimpleScanResults((SimpleScanResultDTO[]) list.toArray(new SimpleScanResultDTO[0])); } } result.add(dto); } } tx.commit(); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("getPositionsForMapSince() - done "); return (PositionDTO[]) result.toArray(new PositionDTO[0]); } /* (non-Javadoc) * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForClientOnMap(long, java.lang.String, java.lang.String) */ public String getPositionForClientOnMap(long sessionId, String mapName, String clientMac) throws MapException, SessionException, RemoteException { this.logger.info("getPositionsForClientOnMap() "); PersistenceManager pm = null; String positionResult = null; Transaction tx = null; try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); checkSession(sessionId, pm); Map map = checkMap(mapName, pm); checkClient(clientMac, pm); Extent e = pm.getExtent(Position.class, true); String filter = "map == myMap && name == myName"; Query query = pm.newQuery(e, filter); query.declareParameters("net.sf.magicmap.db.Map myMap, java.lang.String myName"); query.declareImports("import net.sf.magicmap.db.Map; import java.lang.String;"); Collection results = null; results = (Collection) query.execute(map, clientMac); if (results != null){ Iterator it = results.iterator(); if(it.hasNext()){ Position pos = (Position) it.next(); positionResult = String.valueOf(pos.getPosX())+ "#" + String.valueOf(pos.getPosY()) + "#" + String.valueOf(pos.isFixed()); } } tx.commit(); } catch (Exception e){ e.printStackTrace(); if (e instanceof MapException){ throw (MapException) e; } if (e instanceof SessionException){ throw (SessionException) e; } } finally{ if (tx.isActive()){ tx.rollback(); } JDOUtil.closePM(pm); } this.logger.info("getPositionsForClientOnMap() - done "); return positionResult; } } |
From: Florian L. <fle...@us...> - 2005-11-02 14:43:01
|
Update of /cvsroot/magicmap/magicmapserver/.settings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18751/.settings Added Files: org.eclipse.jdt.core.prefs Log Message: eclipse settings --- NEW FILE: org.eclipse.jdt.core.prefs --- #Mon Oct 31 16:07:26 CET 2005 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.source=1.5 |