00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 package org.objectweb.joram.shared.admin;
00025
00026 import java.io.IOException;
00027 import java.io.InputStream;
00028 import java.io.OutputStream;
00029
00030 import org.objectweb.joram.shared.stream.StreamUtil;
00031
00032 public class AddDomainRequest extends AdminRequest {
00033 private static final long serialVersionUID = 1L;
00034 private String domainName;
00035 private String network;
00036 private int serverId;
00037 private int port;
00038
00039 public AddDomainRequest(String domainName,
00040 String network,
00041 int serverId,
00042 int port) {
00043 this.domainName = domainName;
00044 this.network = network;
00045 this.serverId = serverId;
00046 this.port = port;
00047 }
00048
00049 public AddDomainRequest(String domainName,
00050 int serverId,
00051 int port) {
00052 this.domainName = domainName;
00053 this.network = null;
00054 this.serverId = serverId;
00055 this.port = port;
00056 }
00057
00058 public AddDomainRequest() { }
00059
00060 public final String getDomainName() {
00061 return domainName;
00062 }
00063
00064 public final String getNetwork() {
00065 if (network == null)
00066 return "fr.dyade.aaa.agent.SimpleNetwork";
00067 return network;
00068 }
00069
00070 public final int getServerId() {
00071 return serverId;
00072 }
00073
00074 public final int getPort() {
00075 return port;
00076 }
00077
00078 protected int getClassId() {
00079 return ADD_DOMAIN_REQUEST;
00080 }
00081
00082 public void readFrom(InputStream is) throws IOException {
00083 domainName = StreamUtil.readStringFrom(is);
00084 network = StreamUtil.readStringFrom(is);
00085 serverId = StreamUtil.readIntFrom(is);
00086 port = StreamUtil.readIntFrom(is);
00087 }
00088
00089 public void writeTo(OutputStream os) throws IOException {
00090 StreamUtil.writeTo(domainName, os);
00091 StreamUtil.writeTo(network, os);
00092 StreamUtil.writeTo(serverId, os);
00093 StreamUtil.writeTo(port, os);
00094 }
00095 }