Results 1 to 3 of 3
  1. #1
    RDReavis is offline Member
    Join Date
    Jan 2010
    Posts
    3
    Rep Power
    0

    Default Send selective objects in a class over network

    Hello,

    I'm working on a server program that will store a user object (username, password, etc.). This object will be saved to the server HD, but I also want to be able to send the object over the network to clients. However, I don't want to send the password hash to the clients. Is there a clever way of choosing which variables are included when serialized or sent over the network? I was thinking about externalizing the objects instead of serializing, but that would mean that the method of serializing the object would be identical for saving to the server HD and sending over the network to client. Thus, the password would be lost on the server on user load.

    Thanks,
    Richard D. Reavis

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,658
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by RDReavis View Post
    Hello,

    I'm working on a server program that will store a user object (username, password, etc.). This object will be saved to the server HD, but I also want to be able to send the object over the network to clients. However, I don't want to send the password hash to the clients. Is there a clever way of choosing which variables are included when serialized or sent over the network? I was thinking about externalizing the objects instead of serializing, but that would mean that the method of serializing the object would be identical for saving to the server HD and sending over the network to client. Thus, the password would be lost on the server on user load.

    Thanks,
    Richard D. Reavis
    I don't understand your last remark but you can mark the members of the object you don't want to serialize as 'transient'; it's a keyword.

    kind regards,

    Jos

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,096
    Rep Power
    20

    Default

    Does your general user object actually need the password in it in the first place? I'm guessing it's mainly an object that defines user privilegese (maybe?), in which case the password is irrelevant. It doesn't even need to be retrieved from the server. Indeed, it shouldn't.

Similar Threads

  1. Replies: 1
    Last Post: 01-03-2010, 09:48 PM
  2. how to send data to network printer
    By santhosh_el in forum AWT / Swing
    Replies: 3
    Last Post: 10-06-2009, 01:21 PM
  3. problem data send from network
    By MS_Dark in forum Networking
    Replies: 1
    Last Post: 06-30-2009, 08:32 AM
  4. Go-back-N & Selective repeat protocol
    By Engineera in forum Networking
    Replies: 3
    Last Post: 01-14-2009, 11:18 PM
  5. Getting objects of a class
    By ravian in forum New To Java
    Replies: 1
    Last Post: 12-04-2007, 12:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •