Commit db51e9db authored by Andre Freyssinet's avatar Andre Freyssinet

Javadoc enhancements and fixes.

parent 849a46a1
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2012 ScalAgent Distributed Technologies
* Copyright (C) 2012 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2012 Universite Joseph Fourier
*
* This library is free software; you can redistribute it and/or
......@@ -37,10 +37,9 @@ public class AddRemoteDestination extends DestinationAdminRequest {
/**
* Adds a destination to a cluster.
* <p>
*
* @param clusteredDest Destination part of the cluster.
* @param addedDest Destination joining the cluster.
* @param queueId the destination identifier.
* @param newId the identifier of destination to add.
*/
public AddRemoteDestination(String queueId, String newId) {
super(queueId);
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2010 ScalAgent Distributed Technologies
* Copyright (C) 2010 - 2020 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -30,7 +30,6 @@ import java.util.Properties;
import fr.dyade.aaa.common.stream.StreamUtil;
public class AdminCommandRequest extends AdminRequest {
/** the string identifier of the target. */
private String targetId;
/** the command. */
......@@ -66,7 +65,10 @@ public class AdminCommandRequest extends AdminRequest {
return prop;
}
/** Returns the string identifier of the target. */
/**
* Returns the string identifier of the target.
* @return the string identifier of the target.
*/
public String getTargetId() {
return targetId;
}
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2011 ScalAgent Distributed Technologies
* Copyright (C) 2004 France Telecom R&D
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* An <code>AdminReply</code> is a reply sent by a
* <code>org.objectweb.joram.mom.dest.AdminTopic</code> topic and containing data or
* information destinated to a client administrator.
*/
public class AdminReply extends AbstractAdminMessage {
/** Define serialVersionUID for interoperability. */
private static final long serialVersionUID = 1L;
public final static int NAME_ALREADY_USED = 0;
public final static int START_FAILURE = 1;
public final static int SERVER_ID_ALREADY_USED = 2;
public final static int UNKNOWN_SERVER = 3;
public final static int PERMISSION_DENIED = 4;
public final static int UNKNOWN_REQUEST = 5;
public final static int NAME_UNKNOWN = 6;
public final static int BAD_CLUSTER_REQUEST = 7;
public final static int UNKNOWN_DESTINATION = 8;
public final static int ILLEGAL_STATE = 9;
/** <code>true</code> if this reply replies to a successful request. */
private boolean success = false;
/** Information. */
private String info;
/** Code d'erreur */
private int errorCode = -1;
/**
* Constructs an <code>AdminReply</code> instance.
*
* @param success <code>true</code> if this reply replies to a successful
* request.
* @param info Information to carry.
*/
public AdminReply(boolean success, String info) {
this.success = success;
this.info = info;
}
/**
* Constructs an <code>AdminReply</code> instance for simple error cases.
*
* @param success <code>true</code> if this reply replies to a successful
* request.
* @param errorCode error code defining the type of the error
* @param info Information to carry.
* @param replyObj Object to carry.
*/
public AdminReply(int errorCode, String info) {
this.success = false;
this.errorCode = errorCode;
this.info = info;
}
public AdminReply() { }
/**
* Returns <code>true</code> if this reply replies to a successful request.
*/
public final boolean succeeded() {
return success;
}
/** Returns the carried info. */
public final String getInfo() {
return info;
}
/** Returns the error code. */
public final int getErrorCode() {
return errorCode;
}
public String toString() {
return '(' + super.toString() + ",success=" + success + ",info=" + info + ",errorCode=" + errorCode + ')';
}
protected int getClassId() {
return ADMIN_REPLY;
}
/* ***** ***** ***** ***** *****
* Streamable interface
* ***** ***** ***** ***** ***** */
public void writeTo(OutputStream os) throws IOException {
StreamUtil.writeTo(success, os);
StreamUtil.writeTo(info, os);
StreamUtil.writeTo(errorCode, os);
}
public void readFrom(InputStream is) throws IOException {
success = StreamUtil.readBooleanFrom(is);
info = StreamUtil.readStringFrom(is);
errorCode = StreamUtil.readIntFrom(is);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2004 France Telecom R&D
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* An <code>AdminReply</code> is a reply sent by a
* <code>org.objectweb.joram.mom.dest.AdminTopic</code> topic and containing data or
* information destinated to a client administrator.
*/
public class AdminReply extends AbstractAdminMessage {
/** Define serialVersionUID for interoperability. */
private static final long serialVersionUID = 1L;
public final static int NAME_ALREADY_USED = 0;
public final static int START_FAILURE = 1;
public final static int SERVER_ID_ALREADY_USED = 2;
public final static int UNKNOWN_SERVER = 3;
public final static int PERMISSION_DENIED = 4;
public final static int UNKNOWN_REQUEST = 5;
public final static int NAME_UNKNOWN = 6;
public final static int BAD_CLUSTER_REQUEST = 7;
public final static int UNKNOWN_DESTINATION = 8;
public final static int ILLEGAL_STATE = 9;
/** <code>true</code> if this reply replies to a successful request. */
private boolean success = false;
/** Information. */
private String info;
/** Code d'erreur */
private int errorCode = -1;
/**
* Constructs an <code>AdminReply</code> instance.
*
* @param success <code>true</code> if this reply replies to a successful
* request.
* @param info Information to carry.
*/
public AdminReply(boolean success, String info) {
this.success = success;
this.info = info;
}
/**
* Constructs an <code>AdminReply</code> instance for simple error cases.
*
* @param success <code>true</code> if this reply replies to a successful
* request.
* @param errorCode error code defining the type of the error
* @param info Information to carry.
*/
public AdminReply(int errorCode, String info) {
this.success = false;
this.errorCode = errorCode;
this.info = info;
}
public AdminReply() { }
/**
* Returns <code>true</code> if this reply replies to a successful request.
* @return true if this reply replies to a successful request.
*/
public final boolean succeeded() {
return success;
}
/**
* Returns the carried info.
* @return the carried info.
*/
public final String getInfo() {
return info;
}
/**
* Returns the error code.
* @return the error code.
*/
public final int getErrorCode() {
return errorCode;
}
public String toString() {
return '(' + super.toString() + ",success=" + success + ",info=" + info + ",errorCode=" + errorCode + ')';
}
protected int getClassId() {
return ADMIN_REPLY;
}
/* ***** ***** ***** ***** *****
* Streamable interface
* ***** ***** ***** ***** ***** */
public void writeTo(OutputStream os) throws IOException {
StreamUtil.writeTo(success, os);
StreamUtil.writeTo(info, os);
StreamUtil.writeTo(errorCode, os);
}
public void readFrom(InputStream is) throws IOException {
success = StreamUtil.readBooleanFrom(is);
info = StreamUtil.readStringFrom(is);
errorCode = StreamUtil.readIntFrom(is);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* A <code>ClusterListReply</code> instance holds the identifiers of a cluster's
* destinations.
*/
public class ClusterListReply extends AdminReply {
private static final long serialVersionUID = 1L;
/** Identifiers of the cluster's topics. */
private List clusteredDest;
/**
* Constructs a <code>Monitor_GetClusterRep</code> instance.
*
* @param clusteredDest Identifiers of the cluster's destinations.
*/
public ClusterListReply(List clusteredDest) {
super(true, null);
this.clusteredDest = clusteredDest;
}
/** Returns the identifiers of the cluster's topics. */
public List getDestinations() {
return clusteredDest;
}
public ClusterListReply() {
}
protected int getClassId() {
return LIST_CLUSTER_DEST_REP;
}
public void readFrom(InputStream is) throws IOException {
super.readFrom(is);
clusteredDest = StreamUtil.readArrayListOfStringFrom(is);
}
public void writeTo(OutputStream os) throws IOException {
super.writeTo(os);
StreamUtil.writeListOfStringTo(clusteredDest, os);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2003 - 2020 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* A <code>ClusterListReply</code> instance holds the identifiers of a cluster's
* destinations.
*/
public class ClusterListReply extends AdminReply {
/** define serialVersionUID for interoperability */
private static final long serialVersionUID = 1L;
/** Identifiers of the cluster's topics. */
private List clusteredDest;
/**
* Constructs a <code>Monitor_GetClusterRep</code> instance.
*
* @param clusteredDest Identifiers of the cluster's destinations.
*/
public ClusterListReply(List clusteredDest) {
super(true, null);
this.clusteredDest = clusteredDest;
}
/**
* Returns the list of identifiers of the cluster's topics.
* @return the list of identifiers of the cluster's topics.
*/
public List getDestinations() {
return clusteredDest;
}
public ClusterListReply() {
}
protected int getClassId() {
return LIST_CLUSTER_DEST_REP;
}
public void readFrom(InputStream is) throws IOException {
super.readFrom(is);
clusteredDest = StreamUtil.readArrayListOfStringFrom(is);
}
public void writeTo(OutputStream os) throws IOException {
super.writeTo(os);
StreamUtil.writeListOfStringTo(clusteredDest, os);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2007 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* A <code>CreateDestinationReply</code> instance replies to a
* destination creation request, produced by the AdminTopic.
*/
public class CreateDestinationReply extends AdminReply {
private static final long serialVersionUID = 1L;
/** Identifier of the created destination. */
private String id;
private String name;
// TODO (AF): No longer needed, the destination type is specified in the request,
// it must be the same in the reply otherwise an error must be returned !!
// private byte type;
/**
* Constructs a <code>CreateDestinationReply</code> instance.
*
* @param id The id of the created destination.
* @param info Related information.
*/
public CreateDestinationReply(String id, String name, String info) {
super(true, info);
this.id = id;
this.name = name;
}
public CreateDestinationReply() { }
/** Returns the id of the created queue. */
public final String getId() {
return id;
}
public final String getName() {
return name;
}
// public final byte getType() {
// return type;
// }
public String toString() {
return '(' + super.toString() + ",id=" + id + ",name=" + name + ')';
}
protected int getClassId() {
return CREATE_DESTINATION_REPLY;
}
public void readFrom(InputStream is) throws IOException {
super.readFrom(is);
id = StreamUtil.readStringFrom(is);
name = StreamUtil.readStringFrom(is);
// type = StreamUtil.readByteFrom(is);
}
public void writeTo(OutputStream os) throws IOException {
super.writeTo(os);
StreamUtil.writeTo(id, os);
StreamUtil.writeTo(name, os);
// StreamUtil.writeTo(type, os);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.admin;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* A <code>CreateDestinationReply</code> instance replies to a
* destination creation request, produced by the AdminTopic.
*/
public class CreateDestinationReply extends AdminReply {
/** define serialVersionUID for interoperability */
private static final long serialVersionUID = 1L;
/** Identifier of the created destination. */
private String id;
private String name;
// TODO (AF): No longer needed, the destination type is specified in the request,
// it must be the same in the reply otherwise an error must be returned !!
// private byte type;
/**
* Constructs a <code>CreateDestinationReply</code> instance.
*
* @param id The id of the created destination.
* @param name the name of the created destination.
* @param info Related information.
*/
public CreateDestinationReply(String id, String name, String info) {
super(true, info);
this.id = id;
this.name = name;
}
public CreateDestinationReply() { }
/**
* Returns the id of the created queue.
* @return the id of the created queue.
*/
public final String getId() {
return id;
}
public final String getName() {
return name;
}
// public final byte getType() {
// return type;
// }
public String toString() {
return '(' + super.toString() + ",id=" + id + ",name=" + name + ')';
}
protected int getClassId() {
return CREATE_DESTINATION_REPLY;
}
public void readFrom(InputStream is) throws IOException {
super.readFrom(is);
id = StreamUtil.readStringFrom(is);
name = StreamUtil.readStringFrom(is);
// type = StreamUtil.readByteFrom(is);
}
public void writeTo(OutputStream os) throws IOException {
super.writeTo(os);
StreamUtil.writeTo(id, os);
StreamUtil.writeTo(name, os);
// StreamUtil.writeTo(type, os);