Revision: 16014
Author: oleg.kulikoff
Date: Wed Dec 22 04:16:02 2010
Log: Issue 1921: Command constructor
http://code.google.com/p/mobicents/source/detail?r=16014
Added:
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Command.java
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Parameter.java
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Value.java
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Command.java
Wed Dec 22 04:16:02 2010
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright XXXX, Red Hat Middleware LLC, and individual contributors as
indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but
WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.mobicents.protocols.ss7.management.shell;
+
+import javolution.util.FastList;
+
+/**
+ *
+ * @author kulikov
+ */
+public class Command {
+ private String name;
+ private FastList<Parameter> parameters = new FastList();
+
+ public Command(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void add(Parameter p) {
+ parameters.add(p);
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(name);
+
+ for (Parameter p : parameters) {
+ buffer.append(" ");
+ buffer.append(p.toString());
+ }
+
+ return buffer.toString();
+ }
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Parameter.java
Wed Dec 22 04:16:02 2010
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright XXXX, Red Hat Middleware LLC, and individual contributors as
indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but
WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.mobicents.protocols.ss7.management.shell;
+
+/**
+ *
+ * @author kulikov
+ */
+public class Parameter {
+ private String name;
+ private Value[] values;
+
+ public Parameter(String name) {
+ this.name = name;
+ }
+
+ public Parameter(String name, Value[] values) {
+ this.name = name;
+ this.values = values;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(name);
+
+ if (values == null) {
+ buffer.append(" ");
+ buffer.append("<value>");
+ } else {
+ buffer.append(" ");
+ buffer.append("{");
+ for (int i = 0; i < values.length -1; i++) {
+ buffer.append(values[i].toString());
+ buffer.append("|");
+ }
+
+ buffer.append(values[values.length - 1].toString());
+ buffer.append("}");
+ }
+
+ return buffer.toString();
+ }
+}
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/protocols/ss7/management/shell/Value.java
Wed Dec 22 04:16:02 2010
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright XXXX, Red Hat Middleware LLC, and individual contributors as
indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but
WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+package org.mobicents.protocols.ss7.management.shell;
+
+import javolution.util.FastList;
+
+/**
+ *
+ * @author kulikov
+ */
+public class Value {
+
+ private String value;
+ private FastList<Parameter> parameters = new FastList();
+
+ public Value(String value) {
+ this.value = value;
+ }
+
+ public void add(Parameter p) {
+ parameters.add(p);
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(value);
+
+
+ for (Parameter p : parameters) {
+ buffer.append(" ");
+ buffer.append(p.toString());
+ }
+
+ return buffer.toString();
+ }
+
+}