Commit 7788c500 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

build: remove rpc code and use it as maven dependency

parent 2f133931
......@@ -201,11 +201,6 @@
EXTERNAL DEPENDENCIES
-->
<dependencies>
<dependency>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-framework</artifactId>
<version>1.9.19</version>
</dependency>
<dependency>
<groupId>com.jolbox</groupId>
<artifactId>bonecp</artifactId>
......@@ -257,6 +252,11 @@
<artifactId>liquibase-core</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.dcache</groupId>
<artifactId>nio-jrpc</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!--
LOCAL JARS
-->
......@@ -265,16 +265,6 @@
<artifactId>chimera-core</artifactId>
<version>0.0.12-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.dcache.common</groupId>
<artifactId>dcache-auth</artifactId>
<version>0.0.10-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
<version>3.0.9</version>
</dependency>
</dependencies>
<!--
......
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenConst.java,v 1.1.1.1 2003/08/13 12:03:45 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
/**
* The <code>JrpcgenConst</code> class represents a single constant defined
* in an rpcgen "x"-file.
*
* @version $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:45 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public class JrpcgenConst {
/**
* Constant identifier.
*/
public String identifier;
/**
* Contains value (or identifier refering to another constant) of constant.
*/
public String value;
/**
* Specifies the enclosure (scope) within the identifier must be
* addressed for a constant defined by an enumumeration.
*/
public String enclosure;
/**
* Returns value as integer literal (and thus resolving identifiers
* recursively, if necessary). This is only possible for simple
* subsitutions, that is A is defined as B, B as C, and C as 42, thus
* A is eventually defined as 42.
*
* <p>This simple kind of resolving is necessary when defining a particular
* version of an ONC/RPC protocol. We need to be able to resolve the
* version to an integer literal because we need to append the version
* number to any remote procedure defined to avoid identifier clashes if
* the same remote procedure is defined for several versions.
*
* @return integer literal as <code>String</code> or <code>null</code>,
* if the identifier could not be resolved to an integer literal.
*/
public String resolveValue() {
if ( value.length() > 0 ) {
//
// If the value is an integer literal, then we just have to
// return it. That's it.
//
if ( Character.isDigit(value.charAt(0))
|| (value.charAt(0) == '-') ) {
return value;
}
//
// It's an identifier, which we now have to resolve. First,
// look it up in the list of global identifiers. Then recursively
// resolve the value.
//
Object id = jrpcgen.globalIdentifiers.get(identifier);
if ( (id != null)
&& (id instanceof JrpcgenConst) ) {
return ((JrpcgenConst) id).resolveValue();
}
}
return null;
}
/**
* Constructs a <code>JrpcgenConst</code> and sets the identifier and
* the associated value.
*
* @param identifier Constant identifier to define.
* @param value Value assigned to constant.
*/
public JrpcgenConst(String identifier, String value) {
this(identifier, value, null);
}
/**
* Constructs a <code>JrpcgenConst</code> and sets the identifier and
* the associated value of an enumeration etc.
*
* @param identifier Constant identifier to define.
* @param value Value assigned to constant.
* @param enclosure Name of enclosing enumeration, etc.
*/
public JrpcgenConst(String identifier, String value, String enclosure) {
this.identifier = identifier;
this.value = value;
this.enclosure = enclosure;
}
/**
* Returns the identifier this constant depends on or <code>null</code>,
* if no dependency exists.
*
* @return dependency identifier or <code>null</code>.
*/
public String getDependencyIdentifier() {
int len = value.length();
int idx = 0;
char c;
//
// Check to see if it's an identifier and search for its end.
// This is necessary as elements of an enumeration might have
// "+x" appended, where x is an integer literal.
//
while ( idx < len ) {
c = value.charAt(idx++);
if ( !( ((c >= 'A') && (c <= 'Z'))
|| ((c >= 'a') && (c <= 'z'))
|| (c == '_')
|| ((c >= '0') && (c <= '9') && (idx > 0))
) ) {
--idx; // back up to the char not belonging to the identifier.
break;
}
}
if ( idx > 0 ) {
return value.substring(0, idx);
}
return null;
}
/**
* Dumps the constant as well as its value to <code>System.out</code>.
*/
public void dump() {
System.out.println(identifier + " = " + value);
}
/**
* Flag indicating whether this constant and its dependencies should be
* traversed any more.
*/
public boolean dontTraverseAnyMore = false;
}
// End of JrpcgenConst.java
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenDeclaration.java,v 1.2 2003/08/14 08:08:34 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
/**
* The <code>JrpcgenDeclaration</code> class represents a single declaration
* from an rpcgen "x"-file.
*
* @version $Revision: 1.2 $ $Date: 2003/08/14 08:08:34 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public class JrpcgenDeclaration implements Cloneable {
/**
* Identifier.
*/
public String identifier;
/**
* Type specifier.
*/
public String type;
/**
* Kind of declaration (scalar, fixed size vector, dynamic vector).
*
* @see JrpcgenDeclaration#SCALAR
* @see JrpcgenDeclaration#FIXEDVECTOR
* @see JrpcgenDeclaration#DYNAMICVECTOR
* @see JrpcgenDeclaration#INDIRECTION
*/
public int kind;
/**
* Fixed size or upper limit for size of vector.
*/
public String size;
/**
* Indicates that a scalar is declared.
*/
public static final int SCALAR = 0;
/**
* Indicates that a vector (an array) with fixed size is declared.
*/
public static final int FIXEDVECTOR = 1;
/**
* Indicates that a vector (an array) with dynamic (or unknown) size
* is declared.
*/
public static final int DYNAMICVECTOR = 2;
/**
* Indicates that an indirection (reference, pointer, whatever you like
* to call it nowadays) is declared.
*/
public static final int INDIRECTION = 3;
/**
* Returns the identifier.
*/
public String toString() {
return identifier;
}
/**
* Constructs a <code>JrpcgenDeclaration</code> and sets the identifier
* and its data type. The {@link JrpcgenDeclaration#kind} of the
* declaration is assumed to be {@link JrpcgenDeclaration#SCALAR}.
*
* @param identifier Identifier to be declared.
* @param type Data type the identifier is declared of.
*/
public JrpcgenDeclaration(String identifier, String type) {
this.identifier = identifier;
this.type = type;
this.kind = SCALAR;
}
/**
* Constructs a <code>JrpcgenDeclaration</code> and sets the identifier,
* its data type, kind and size of vector. This constructur is typically
* used when declaring either fixed-size or dynamic arrays.
*
* @param identifier Identifier to be declared.
* @param type Data type the identifier is declared of.
* @param kind Kind of declaration (scalar, vector, indirection).
* @param size Size of array (if fixed-sized, otherwise <code>null</code>).
*/
public JrpcgenDeclaration(String identifier, String type, int kind, String size) {
this.identifier = identifier;
this.type = type;
this.kind = kind;
this.size = size;
}
/**
* Dumps the declaration to <code>System.out</code>.
*/
public void dump() {
System.out.print(type);
System.out.print(kind == JrpcgenDeclaration.INDIRECTION ? " *" : " ");
System.out.print(identifier);
switch ( kind ) {
case JrpcgenDeclaration.FIXEDVECTOR:
System.out.print("[" + size + "]");
break;
case JrpcgenDeclaration.DYNAMICVECTOR:
if ( size != null ) {
System.out.print("<" + size + ">");
} else {
System.out.print("<>");
}
break;
}
System.out.println();
}
/**
* Clones declaration object.
*/
public Object clone()
throws CloneNotSupportedException {
return super.clone();
}
}
// End of JrpcgenDeclaration.java
\ No newline at end of file
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenEnum.java,v 1.1.1.1 2003/08/13 12:03:45 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
import java.util.Vector;
/**
* The <code>JrpcgenEnum</code> class represents a single enumeration
* from an rpcgen "x"-file. It is a "container" for the elements (constants)
* belonging to this enumeration.
*
* @version $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:45 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public class JrpcgenEnum {
/**
* Enumeration identifier.
*/
public String identifier;
/**
* Contains enumeration elements as well as their values. The elements
* are of class {@link JrpcgenConst}.
*/
public Vector enums;
/**
* Returns the fully qualified identifier.
*
* return fully qualified identifier.
*/
public String toString() {
return identifier;
}
/**
* Constructs a <code>JrpcgenEnum</code> and sets the identifier and all
* its enumeration elements.
*
* @param identifier Identifier to be declared.
* @param enums Vector of enumeration elements of class {@link JrpcgenConst}.
*/
public JrpcgenEnum(String identifier, Vector enums) {
this.identifier = identifier;
this.enums = enums;
}
/**
* Dumps the enumeration together with its elements to
* <code>System.out</code>.
*/
public void dump() {
System.out.println("ENUM " + identifier);
int size = enums.size();
for ( int idx = 0; idx < size; ++idx ) {
JrpcgenConst c = (JrpcgenConst) enums.elementAt(idx);
System.out.print(" ");
c.dump();
}
System.out.println();
}
}
// End of JrpcgenEnum.java
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenParamInfo.java,v 1.2 2003/08/14 08:09:59 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
/**
* The <code>JrpcgenParamInfo</code> class contains information about the
* data type of a procedure's parameter, as well as the parameter's optional
* name.
*
* @version $Revision: 1.2 $ $Date: 2003/08/14 08:09:59 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
class JrpcgenParamInfo {
/**
*
*/
public String parameterType;
/**
*
*/
public String parameterName;
/**
* Constructs a new <code>JrpcgenParamInfo</code> object containing
* information about ...
*
*/
public JrpcgenParamInfo(String parameterType, String parameterName) {
this.parameterType = parameterType;
this.parameterName = parameterName;
}
}
// End of JrpcgenParamInfo.java
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenParserException.java,v 1.1.1.1 2003/08/13 12:03:46 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
/**
* The <code>JrpcgenParserException</code> class represents a parser
* exception indicating to abort parsing the x-file.
*
* @version $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:46 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
class JrpcgenParserException extends RuntimeException {
/**
* Constructs a <code>JrpcgenParserException</code> with no detail message.
*/
public JrpcgenParserException() {
super();
}
}
// End of JrpcgenParserException.java
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenProcedureInfo.java,v 1.3 2003/08/14 11:26:50 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.acplt.oncrpc.apps.jrpcgen;
import java.util.Vector;
/**
* The <code>JrpcgenProcedureInfo</code> class contains information about a
* specific version of an ONC/RPC program as defined in an rpcgen "x"-file.
*
* @version $Revision: 1.3 $ $Date: 2003/08/14 11:26:50 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
class JrpcgenProcedureInfo {
/**
* Procedure number assigned to the procedure of a particular verions of
* an ONC/RPC program. This attribute contains either an integer literal
* or an identifier (which must resolve to an integer).
*/
public String procedureNumber;
/**
* Identifier assigned to the procedure number of an a particular
* procedure of a particular version of an ONC/RPC program.
*/
public String procedureId;