1818
1919
2020import org .ros .internal .node .response .BooleanResultFactory ;
21+ import org .ros .internal .node .response .GraphNameListResultFactory ;
2122import org .ros .internal .node .response .IntegerResultFactory ;
2223import org .ros .internal .node .response .ObjectResultFactory ;
2324import org .ros .internal .node .response .Response ;
25+ import org .ros .internal .node .response .ResultFactory ;
2426import org .ros .internal .node .response .StringListResultFactory ;
2527import org .ros .internal .node .response .StringResultFactory ;
2628import org .ros .internal .node .response .VoidResultFactory ;
4042import java .util .Map ;
4143
4244/**
43- * Provide access to the XML- RPC API for a ROS {@link ParameterServer}.
45+ * Provide access to the RPC API for a ROS {@link ParameterServer}.
4446 *
4547 * @author kwc@willowgarage.com (Ken Conley)
4648 * @author damonkohler@google.com (Damon Kohler)
49+ * @author jg
4750 */
4851public class ParameterClient extends Client <ParameterServerRpcEndpoint > {
4952 private static final boolean DEBUG = true ;
@@ -52,10 +55,11 @@ public class ParameterClient extends Client<ParameterServerRpcEndpoint> {
5255
5356 /**
5457 * Create a new {@link ParameterClient} connected to the specified
55- * {@link ParameterServer} URI.
58+ * {@link ParameterServer} Address.
59+ * @param nodeIdentifier The identifier of our currently executing node
5660 *
5761 * @param uri
58- * the {@link URI } of the {@link ParameterServer} to connect to
62+ * the {@link address } of the {@link ParameterServer} to connect to
5963 * @throws IOException
6064 * @throws UnknownHostException
6165 */
@@ -72,35 +76,11 @@ public Response<Object> getParam(GraphName parameterName) {
7276 new ObjectResultFactory ());
7377 }
7478
75- public Response <Void > setParam (GraphName parameterName , Boolean parameterValue ) {
79+ public Response <Void > setParam (GraphName parameterName , Object parameterValue ) {
7680 return Response .fromListChecked (
7781 rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
7882 }
7983
80- public Response <Void > setParam (GraphName parameterName , Integer parameterValue ) {
81- return Response .fromListChecked (
82- rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
83- }
84-
85- public Response <Void > setParam (GraphName parameterName , Double parameterValue ) {
86- return Response .fromListChecked (
87- rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
88- }
89-
90- public Response <Void > setParam (GraphName parameterName , String parameterValue ) {
91- return Response .fromListChecked (
92- rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
93- }
94-
95- public Response <Void > setParam (GraphName parameterName , List <?> parameterValue ) {
96- return Response .fromListChecked (
97- rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
98- }
99-
100- public Response <Void > setParam (GraphName parameterName , Map <?, ?> parameterValue ) {
101- return Response .fromListChecked (
102- rpcEndpoint .setParam (nodeName , parameterName .toString (), parameterValue ), new VoidResultFactory ());
103- }
10484
10585 public Response <GraphName > searchParam (GraphName parameterName ) {
10686 Response <String > response =
@@ -134,13 +114,10 @@ public Response<Void> deleteParam(GraphName parameterName) {
134114 }
135115
136116 public Response <List <GraphName >> getParamNames () {
137- Response <List <String >> response =
138- Response .fromListChecked (rpcEndpoint .getParamNames (nodeName ), new StringListResultFactory ());
139- List <GraphName > graphNames = new ArrayList <GraphName >();
140- //for (String name : response.getResult()) {
141- graphNames .add (GraphName .of (response .getResult ().toString ()));
142- //}
143- return new Response <List <GraphName >>(response .getStatusCode (), response .getStatusMessage (),
144- graphNames );
117+ Response <List <GraphName >> response =
118+ Response .fromListChecked (rpcEndpoint .getParamNames (nodeName ), new GraphNameListResultFactory ());
119+ return response ;
145120 }
121+
122+
146123}
0 commit comments