Need to send object instances over the network

I found no other way to implement a switch case to cast objects on both sides to solve my problem.
Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
converted in base64, overall encoding of XML is utf-8.
Let's suppose in my network there are 2 peers connected via socket.
I have multiple instances of different types on both peers but I want to keep these instances
synchronized. If something changes on side A, side B must receive that instance and replace
it in the correct place (just one way, from A to B).
When I receive such instance on B I want to cast it to it's proper instance
of it's proper type and I am scratching my head on how could I implement this without some
sort of unique ID table and switch case.
If I had 1 instance per type could it be done easily?
But I need to keep in synch many instances per type.
Is there any dynamic casting that I can trigger based on some type/instanceID information
I could send along the object?

I found no other way to implement a switch case to cast objects on both sides to solve my problem.
Basically I need to send objects over a network protocol based on XML, the object is sent inside XML
converted in base64, overall encoding of XML is utf-8.
Let's suppose in my network there are 2 peers connected via socket.
I have multiple instances of different types on both peers but I want to keep these instances
synchronized. If something changes on side A, side B must receive that instance and replace
it in the correct place (just one way, from A to B).
When I receive such instance on B I want to cast it to it's proper instance
of it's proper type and I am scratching my head on how could I implement this without some
sort of unique ID table and switch case.
If I had 1 instance per type could it be done easily?
But I need to keep in synch many instances per type.
Is there any dynamic casting that I can trigger based on some type/instanceID information
I could send along the object?

Similar Messages

  • Can object transfer over the network without serialization?

    Hi all,
    Can we send the objects over the network (from clent to server)
    without seraializing it?
    Thanks in advance

    Yes. By sending its values by any other means, like as XML.

  • App imitates sending out a virus over the network

    The last time I ran the Classic App called "Farallon Ping" which came with my old Farallon NC I bought years ago was back in 2003 or 2004 and I was told by IS of the University I was attending not to run it again as the app makes it appear to be sending out viruses over the network. The app is useful as it tells me my IP address and the IP address of every computer in my domain and offers many other features some of which that are lacking in the built in OSX utilities.
    I am at a much larger University these days and I was wanting to run this app for the features but not sure if I should.
    Is this post appropriate for this group and if so what do you say?
    Thanks

    Know nothing about Farallon Ping. Would MacPing at http://74.125.93.104/translate_c?hl=en&sl=nl&u=http://dartware.com/downloads/leg acy.html do the same thing?
     Cheers, Tom

  • Send wav files over a network

    Hi folks,
    I need to send sound files over a network. The files I'm wanting to send are wav files. I kinda have the mechanism that sends a file, but I am not sure how to convert wav files into something that I can easily send. Do I need to convert them into bytes, serialize them...etc I don't know.
    Can anyone please point me in the right direction? An example would be very much appreciated.
    Thank you,
    E

    hi
    this is very simple
    convert voice to bytearray
    just create one server socket and client socket then connect a sockets and transmit
    download sample from
    http://javasolution.blogspot.com/2007/04/voice-chat-using-java.html

  • Sending Connection Object over the Network using RMI

    Hi,
    How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and connot be marshalled and failing. Please explain, if there is another way using JDK 1.4
    Sudheer

    I think that what you want to do is connect to the database on the RMI server object, then use the server object from your remote clients to execute the processes you require to rrun.

  • Sending Connection object over the network

    Hi,
    How can a Connection object be sent over the network and run on another JVM. I need to hold connection object to execute processes one after other, that require Oracle connection without ever connecting again. I do not have J2EE container or webserver setup to hold connection/connectionpool,but need to run the process on command line. I am using RMI infrastructure to pass parameters/return values but connection object is not serializable and cannot be marshalled and failing. Please explain, if there is another way using JDK 1.4
    Sudheer

    I don't believe this is possible. A connection object has a number of associated structures on the operating system, which generally makes it impossible to move. From a fundamental networking level, you also cannot, in general, cause a connection to machine1 to start communicating with machine2-- that would introduce all manner of security problems.
    Why don't you want to just create another connection on the other machine?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • I need to copy files over the network PSSession . ( Firewall / DMZ / Etc. )

    Hello
    I need to copy files over the network PSSession . ( Firewall / DMZ / Etc. )
    I have a script where I copy from my local server ( server1) to the remote server ( server2 ), but I can´t not make script that will copy from the remote server to my local by my session. From server2 to server1
    Script is as below ...:-)
    HELP : ....
    winrm s winrm/config/client '@{TrustedHosts="SERVER2"}'
        $Source = "D:\test\ok.log"
        $Destination = "D:\test\ok.log"
        $session = New-PSSession -ComputerName SERVER2
    Set-StrictMode -Version Latest
    ## Get the source file, and then get its content
    $sourcePath = (Resolve-Path $source).Path
    $sourceBytes = [IO.File]::ReadAllBytes($sourcePath)
    $streamChunks = @()
    ## Now break it into chunks to stream
    Write-Progress -Activity "Sending $Source" -Status "Preparing file"
    $streamSize = 1MB
    for($position = 0; $position -lt $sourceBytes.Length;
        $position += $streamSize)
        $remaining = $sourceBytes.Length - $position
        $remaining = [Math]::Min($remaining, $streamSize)
        $nextChunk = New-Object byte[] $remaining
        [Array]::Copy($sourcebytes, $position, $nextChunk, 0, $remaining)
        $streamChunks += ,$nextChunk
    $remoteScript = {
        param($destination, $length)
        ## Convert the destination path to a full filesytem path (to support
        ## relative paths)
        $Destination = $executionContext.SessionState.`
            Path.GetUnresolvedProviderPathFromPSPath($Destination)
        ## Create a new array to hold the file content
        $destBytes = New-Object byte[] $length
        $position = 0
        ## Go through the input, and fill in the new array of file content
        foreach($chunk in $input)
            Write-Progress -Activity "Writing $Destination" `
                -Status "Sending file" `
                -PercentComplete ($position / $length * 100)
            [GC]::Collect()
            [Array]::Copy($chunk, 0, $destBytes, $position, $chunk.Length)
            $position += $chunk.Length
        ## Write the content to the new file
        [IO.File]::WriteAllBytes($destination, $destBytes)
        ## Show the result
        Get-Item $destination
        [GC]::Collect()
    ## Stream the chunks into the remote script
    $streamChunks | Invoke-Command -Session $session $remoteScript `
        -ArgumentList $destination,$sourceBytes.Length
        Remove-PSSession -Session $session

    But have will the script look,  if i need to copy from
    From server2 to server1.
    My script copy from server1 to server2 and working, but I need server2
    to server1.

  • Send BufferedImage over the network

    I have already successfully setup a client/server connection. The issue, is when I send the BufferedImage over the network, it says:
    "Caused by: java.io.NotSerializableException: java.awt.image.BufferedImage"
    Can someone please tell me how to fix this?

    Like the exception say, BufferedImage is not serializable. You cannot serialize it. The problem will go away if you don't try to serialize it. Of course, that doesn't answer the question you really meant to ask... which I'll leave for somebody else.

  • TS4268 When I send an imessage with wifi it send it from the original number I got with the phone before I ported my number over.  When I send an imessage on the network it comes from my own ported number.  How do I change this?

    When I send an imessage with wifi it sends it from the original number I got with the phone before I ported my number over.  When I send an imessage on the network it comes from my own ported number.  How do I change the imessage so that it comes from my own ported number?

    Yeah send it from your phone.
    Your computer has no knowledge of your phones phone number, it is not a phone.

  • Make a voice transmitter over the network?

    Hi i have read that it is possible in javax.sound to send or transmit live audio over the network or simply make a VoIP phone using the javax.sound api. I would like to ask if how can I be able to send the sound of the network. I have this step by step instruction about capturing and sending the voice in the network:
    • Use TargetDataLine for streaming capture
    • The TargetDataLine is wrapped in an AudioInputStream so that it can be converted to the network format with AudioSystem
    • a capture thread reads from the converted AudioInputStream and writes it to the network connection's OutputStream.
    Here is my code:
         audioFormat = getAudioFormat();
            DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, audioFormat);
         targetDataLine = (TargetDataLine)AudioSystem.getLine(dataLineInfo);
         audioInputStream = new AudioInputStream(targetDataLine);I am not sure about this code but I am sure that there must be a targetDataLine associated in sending the voice. Please help me with this. Thank you.

    TargetDataLines are for reading from, SourceDataLines are for writing to, and AudioInputStreams are for loading/saving from a file.
    That said, there will be a TargetDataLine you can read from that's associated with your microphone. You create an AudioInputStream to read from the TargetDataLine (which is just an argument in the constructor), and then you can do...
    AudioSystem.write
    Give it the AIS associated with hte TDL, and you can either have it write it to a file or to an output stream. If that output stream was, say...an IP socket stream...then you could send it over the network to the other side...where you'd then need to construct an AudioInputStream to read it from the IP socket stream, and then to play it, you'd read some data from the AIS and write it to a SourceDataLine.
    Here are some resources to help you with the JavaSound stuff.
    JavaSound Example code (take a look at SimpleAudioPlayer & SimpleAudioRecorder in the Audio Playback and Recording section)
    [http://www.jsresources.org/examples/]
    Programmer's guide
    [http://java.sun.com/j2se/1.5.0/docs/guide/sound/programmer_guide/contents.html]
    And then just the normal Java SE6 API
    [http://java.sun.com/javase/6/docs/api/]

  • What does it mean if I get blank text messages from someone but they are not coming from number they appear and disappear they are not coming over the network also emails have been moved around, has my phone been hacked?

    I Have been getting blank texts from a number, but the person who owns the niumber is not sending them, they appear then disappear, they are not coming over the network, they come even though number has been black listed, also emails have been moved, I believe by someone who is cyberstalking me but don't know how to prove it, what can I do ?

    Hi,
    When a Mac is "registered" for iMessages account with an Apple ID the Serial Number of the Mac is used to create an Auth Token as it is called for the Messages app that allows that Mac to work.
    I would guess a similar process of linking the Number of the iPhone to a Hardware fact about the device is also in place.
    I would contact Apple Support and check with them.  (you might need to speak to a Level 2 person as Level 1 people are script led and try to fit everything into Software or Hardware categories where as sorting and Apple ID (which the Number is in this case) is normally Free).
    I did find this iOS: Troubleshooting Messages - Apple Support
    It starts off about sorting SMS that is not working.
    This one has a bit on Unlinking an iPhone Number (with or without the iPhone) iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support
    7:55 pm      Tuesday; January 6, 2015
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • HP Laserjet M1132 MFP is too slow over the network!

    Hi,
    My HP Laserjet M1132 MFP is too slow over the network!
    I have connect the printer to a windows XP 32bit SP3 using UBS port. The printer works fine on the local computer but when sharing it over the network it works too slow, for example with print test page it takes about 45 seconds to print and for other documents it takes much longer time.
    I have installed the latest driver form HP website and upgrade the firmware it the latest version.
    It happens on other Windows XP machines as well.
    I connected the printer to my laptop (Windows 7 64bit) and it works fine (No delays over the network) and it seems that this problem have some relations with the windows XP Driver.
    I have used local port trick on remote machines (instead of regular method) like this:
    ''add a local printer;
    'new port'
    'localport'
    \\XPcomputer\HPPrinterName as port name
    but still nothing!
    There is nothing wrong with the network, we use to use a Samsung printer on the same machines over the network with no problem.
    I Really appreciate your HELP!
    This question was solved.
    View Solution.

    BEHZAD_T, how is the printer connected to the network (wireless or Ethernet)? If it is slow wirelessly, I would suggest trying to connect the printer to your router with the Ethernet cord and install it to the networked computer that way.
    Another question is, relatively speaking, how close to your router are the Samsung printer and the HP printer? Depending on the distance (and what stands between the devices) there can be a lag between sending a print job and it being received by the printer.
    Let me know!

  • Fax over the network with HP LaserJet 400 ColorMFP M475dw

    Hi there, I was trying to send fax over the network with  HP LaserJet 400 ColorMFP M475dw, I have connected the printer/scan/fax on a wired network, just have 3 computers on it, all of them  can scan or print. But I can't find any option to just FAX from Microsoft Word or Adobe Acrobat Reader, going to File ---> Print ---> and select M475dw "FAx", I installed the lasted version of the drivers downloaded from hp.com and there's no way to install this multifunction printer as a FAX.
    So I can't see the FAX on Printers in the control panel of windows.
    I have never got an error message from any computer during the installation process either.
    Does anyone has an idea of what to do here?
    Thanks ahead.

    Thanks for your quick answer, I really appreciate it. But unfortunately, it didn't resolve my problem  
    Actually any of the workstations after complete the installation (with the last version of drivers downloaded just now from hp.com) can't recognize the HP LaserJet Pro 400 Color MFP M475dw, as a fax. I can print and scan over the network, or connecting the printer with a usb cable. I just can't see the icon "HP LaserJet Pro 400 Color MFP M475dw FAX" in Control Panel ---> Devices and Printers.   I did a full installation when I were asked during the installation process... I did then I custom installation and neither of them seems to work to me  
    This is very strange, it never happened to me with any other models of all-in-on (printer/fax/scanner)

  • HP photosmart C4700 cannot be connected over the network.

    my printer was recently unplugged and refuses to print. i have reinstalled all drivers and software but still cannot connect over the network. please help soon as i desperatley need to print off college work. this has happened before but reinstalling the drivers worked.

    Hi..
     try this one....
    Uninstall any remaining Hp printer program from your system..
    1. Click windows logo or start button- on the search box or run - type in %temp%, press enter
    2. look for the 7z folder on the TEmp folders.
    3. Open &z folder and look for util- open util look for ccc folder- open ccc folder loofk for uninstall3.
    4. Procedd to Uninstall level 3- restart the computer -go back to %temP% trhen delete tye 1st 7z folder-- to the same process for the remaining 7z folders- open util-ccc-uninstallL3- restart Pc and delete te 7z folder
    5. Once your'e done- go to add or remove programs or programs and features to uninstall remaining Hp printer software.. then restart you pc again..
    Follow these steps before re-installing the printer:
    Click Start , and then click Run . The Run dialog box opens.
    In the Run dialog box, type msconfig , and then press Enter .
    If the User Account Control window opens with the message 'Windows needs your permission to continue ,' click Continue to close the window.
    In the System Configuration window, click the Startup tab, and then click Disable All .
    Click the Services tab, click the Hide all Microsoft services checkbox, and then click Disable All .
    Click Apply , and then click OK .
    When prompted to restart the computer, click Restart later .
     Restart the network devicesFollow these steps to restart all the devices on the network.
    These steps include turning off the computer. Consider bookmarking this page for ease of reference.
    Press the Power button to turn off the product.
    Click Star,  click Shut Down , and then click Shut Down from the drop-down list.
    Turn on the wireless access point (router).
    Press the Power button  to turn on the product.
    Press the power button on the computer to turn it on.
    When the computer turns on, a System Configuration Utility message opens on the computer. Select the Do not show this message again check box, and then click OK .
    proceed to the installation.......then prove functionality...if successful continue these steps
    Re-enable startup programs and services
    Click Start ( ), and then click Run . The Run dialog box opens.
    In the Run dialog box, type msconfig , and then press Enter .
    If the User Account Control window opens with the message 'Windows needs your permission to continue ,' click Continue to close the window.
    In the System Configuration window, click the Startup tab, and then select the check box next to each program that should run when you turn on the computer. If a program should not run when the computer is turned on, leave the check box clear.
    CAUTION:Do not disable any Microsoft services.
    If no changes should be made to startup programs or services, click the General tab, and then select the Normal Startup checkbox.
    Click Apply , and then click OK .
    When prompted to restart the computer, click Restart .
    Although I am working on behalf of HP, I am speaking for myself and not for HP.
    Love Kudos! If you feel my post has helped you please click the White Kudos! Star just below my name : )
    If you feel my answer has fixed your problem please click 'Mark As Solution' and make it easier for others to find help quickly : )
    Happy Troubleshooting : )

  • Time Machine over the Network: Terribly Slow

    Hello,
    I've been using Time Machine for over 3 years now with no issues over the network; the destination being a 2TB external Seagate connected to another iMac connected through gigabit ethernet. Everything has been working flawlessly: Every hour Time Machine would MOUNT the sparseimage it created on the disk, BACKUP the data and UNMOUNT the disk image when finished.
    Until I upgraded to Lion. The above process is still working per se, however it is PAINFULLY slow! A 50MB backup can take up to AN HOUR! Searching around on the net, advised that there could be an issue with Spotlight as well, however this is not the case for me, since Spotlight finished a new index in under 30 mins. Followed every tutorial I could find on the issue, to no avail..
    I then upgraded to Mountain Lion with the hope that the issue will clear itself. Cleared my old backups, resetted Time Machine by erasing its .plist file, restarted my iMac just to make sure and connected Time Machine to the network share anew, creating a "sharing only" account on the host iMac, i.e. the one that has the external HD connected through USB. Still no luck.
    I painfully realize that I still have the same issue. While backing up, network traffic is under 100KB, and activity monitor does not show any backupd or mds or any similar processes taking anything over 3% of CPU time.
    What could be wrong?

    Hello again,
    Tries on the other iMac (also running 10.8.2) and things are exactly the same: Image creation takes almost half an hour, and copying crawls at under 1MB/min. While time machine image is mounted and Time Machine is "backing up", accessing ANY disk on the host Mac is VERY slow. Seems like something hogs up appleshare when Time Machine is in use. Mind you, there is insignificant network traffic as seen by Activity Monitor, as well as insignificant CPU usage while backing up.
    Stopping backup and using tmutil to set the Time Machine destination to the mounted image as mounted by Finder, solves the issue again, revving up Time Machine throughput to over 20MB/sec! There is also no issues acessing the other Mac as well, under this scenario.
    Up to this point, the only way I have managed to use Time Machine over a networked external HD is through the NAS server. Both configurations where I am using a Mac running 10.8.2 as a server of the external disk have failed with very low throughput while backing up. Something must be wrong in 10.8.2's afp when Time Machine is mounting the image by itself.
    I may need to remind you that I have been successfully backing up to the external HD for 4 years now; something broke a few months after the client iMac was upgraded to Lion and at the time when the host iMac was upgraded to Mountain Lion. Will try to locate a Mac running some later OS X version to do some more testing.
    Also reminding that I have used two distinctive iMacs and two external HD drives for my tests so far. The client iMac has remained the same, however 10.8.2 has been reinstalled on it a couple of times. Have also used an afp-enabled NAS server which worked fine with Time Machine.

Maybe you are looking for

  • Open images in Express from a mac?

    How do I open images from a mac?   Do they need to be in the "Camera Roll" folder on the Ipad Air (7)? Thanks, Qwerky

  • Macbook Pro model 4,1: can it connect to hi res monitor?

    I have a macbook pro, model 4,1. no mini display port. I am looking at a high resolution monitor dell 2713. Will I be wasting my money to buy resolution higher than 1080 if I don't have a port on the Macbook to deliver it?

  • Why have I made a further payment?

    I've been charged today for a 3 month subscription which I'm extremely happy about because I'm pretty sure I didn't do it. Other questions: Why can I not have Live Chat.. only for "premium"users. So you can charge more, for correcting a fault!? XD I

  • Updating master data from WEB UI

    Hi experts, Is it possible to change the partner attributes such as e-mail, box no, phone, etc from CRM WEB UI? I am planning to create an admin to where he can change the partner details in WEB UI. My assumption is the master data/attributes of part

  • Client isolation and the Bonjour gateway on WLC 7.4.1

    Hi, I am considering upgrading our 5508 WLCs to version 7.4.1 to take advantage of the Bonjour gateway. What I want to do is allow clients on our guest wireless network to access things like the Apple TV in our conference rooms. My intention would be