Connect to Apache Accumulo via .NET - java

Currently I succeed to create an Ubuntu virtual machine and install Hadoop, Zookeeper and Accumulo.
Now I need to create a test ASP.NET MVC application that reads and writes data to the Accumulo.
I've been looking around for .NET clients or some kind of rest API but my searches where unsuccessful. Any snippet I could find was in Java.
So one of the options I am considering at the moment is to convert Java client into .NET library using IKVM.NET.
So my question are
Is there any .NET provider for Apache Accumulo?
If no provider, does it expose some kind of REST API to program against?
If no REST what is the endpoint that I could use (and documentation links if possible) to create .NET provider myself?
Is converting Java lib a good idea?

Accumulo has a couple of ways to connect through Thrift, which you should be able to use .NET.
In 1.5, there is something called Proxy, a separate service that handles connections, that handles connections and has a thrift interface.
There is some code for using Thrift against 1.4, but I don't think it is well documented. It's there somewhere, though!

Related

How to create objects in server application and be able to call them from client application

I am learning to program Java. My objective is to create client server application based on Java and MySQL.
That would have following.
Server Application where all admin controls would be available to configure.
server application will be the only to have access rights to MySQL.
Server will have all functions and objects that clients will require and call and get that functionality. (Reason for that is "I don't want to share MySQL credentials to client apps or rather i don't want MySQL credentials to be transmitted on the network to clients"). As it would increase maintenance tough and it could be a security loop hole.
An analogy of functionality could be: client calls to server telling to add an Order such addOrder(order_id, payment,..,...,..) and so on.
What are the method in practice for such kind of application these days? A example code/or material to get in right direction would suffice
These days the universal way to expose a service remotely is via a web service. This solution was preferred by the industry over time due to its simplicity and ease of integration to the point that binary based protocols like CORBA are now seldom used.
Take the example of Android applications, they are native application mostly using REST web services.
A REST web service can be easilly integrated in the same way with a desktop application, a mobile application or a web application, even if the clients are written in different native platforms and languages.
As sample code, have a look at tutorials on the Spring stack. For the server see this tutorial for building an hello word REST web service. For the client, consider the REST template.
For security, see this Spring security hello world example. Using the Spring stack in Java will likelly give you the largest number of tutorials and online support.
This sounds like a good place to use RMI, which Java has built in support for. RMI will allow your client to call server-side methods on a local object that corresponds to the server, where all messages/commands get transparently sent to the actual server, where you have your DB access stuff and logic.

MS Project Server 2010 Java API

I'm looking for a way to write a Java application interacting with an MS Project Server 2010. I've read that a web API exists for MS Project Server, but could find no documentation on it. All the examples I've found so far use some C# library hiding all the API calls.
I'll be thankful for your advice on what tech to use to make this interaction possible.
There is no Java API for Project Server.
Project Server API is based on SOAP web services, but it uses non-standard data structure .NET DataSets to exchange data with clients. And actually the only problem - there is no implementation of the DataSets for Java.
The most common solution is to write a proxy web service using .NET which converts the DataSets to something supported by Java and write a Java client which works with the proxy.

communication between jruby app and java app that are on different servers

Anyone has expirience on having Jruby project running on Jboss (using torquebox or whatever) with an ability to communicate with another "japps" not on the same jboss where jruby app is, i.e. some java project on another jboss?
I know there is an torque-messanging but dunno if it's possible to communicate with external(out of jruby-app's jboss) app?
Best practices are welcomed.
Thanks in advance.
P.S. placing that other app on the jboss where jruby app is not acceptible solution.
I can recommend you to use Thrift and build communication via them.
Thrift have generator for both your needed languages (Java and JRuby) and provide good and fast communication.
UPDATED:
Thrift is RPC (remote procedure call) framework developed at Facebook. In detail you can read about it in Wiki.
In few word to save you time, what it is and how to use it:
You describe you data structures and service interface in .thrift file(files). And generate from this file all needed source files(with all need serialization) for one or few languages(what you need). Than you can simple create server and client in few lines
Using it inside client will be looks like you just use simple class.
With Thrift you can use what protocol and transport used.
In most cases uses Binary or Compact protocol via Blocked or Not-blocked transport. So network communication will be light and fast + with fast serialization.
SOAP(based on XML on HTTP) packages, its in few times bigger, and inappropriate for sending binary data, but not only this. Also XML-serialization is very slow. So with SOAP you receive big overhead. Also with soap you need to write (or use third-party) lib for calling server(tiny network layer), thrift already made it for you.
SMTP and basically JMS is inappropriate for realtime and question-answer communication.
I mean if you need just to put some message in queue and someone sometime give this message and process it — you can (and should) use JMS or any other MQ services(Thrift can do this to, but MQ architecture is better for this issue).
But if you need realtime query-answer calls, you should use RPC, as protocol it can be HTTP(REST, SOAP), binary(Thrift, ProtoBuf, JDBC, etc) or any other.
Thrift (and ProtoBuf) provide framework for generate client and server, so it incapsulate you from low level issues.
P.S:
I made some example in past https://github.com/imysak/using-thrift (communication via Thrift Java server + Java Client or node.js client), maybe it will be useful for someone . But you can found more simple and better examples.
Torquebox supports JMS. The gem you specified torquebox-messaging allows for publishing and processing of HornetQ messages on the local JBoss AS server/cluster that the JRuby app is running in. I don't think it currently supports connecting to remote servers.
Using this functionality in your JRuby app you could then configure your Java app on another server to communicate with HornetQ running in the JBoss AS that the JRuby app is running on.
Alternatively you could always implement your own communication protocol or use another Java library - you have access to anything Java you want to run from JRuby.
You can use Web Services or JMS for that

How does a Swing client communicate with a Java EE backend?

I want to develop a Swing client application that will use a Java EE 6 backend. How does the Swing client communicate with the server? Do I have to make a web service that the communication go through or are there other ways?
There are other ways also in addition to web services.
One very common approach is RMI or Remote Method Invocation. It is a native extension of the Java platform that allows server-side objects to be directly accessible inside client-side code.
If you have no experience with RMI then take a look at the official Java Remote Method Invocation Tutorial
I think this might be a very useful document for you, complete with diagrams to demonstrate the architecture and communication modal.
There are to many communication types:
sockets gives to you the max communication speed.
a little communication overhead, you can use XML / SOAP
(plain)webservices too : fastest to implement. a HTTP GET, POST
RMI: I think is deprecated, but others are using. If you want only with Java backend from Java, you can use it
Yes, you can either create a web service (SOAP or RESTful), but since your client is a java application you can use jndi lookup to call EJB3 beans, it will work through rmi or soap, depending or your configuration. Something like here.

WCF & Java Interop using WSHttpBinding,

I’m trying to get a simple WCF application work with Java Client. Service exposes few simple operations using WSHttpBinding, which it does perfectly.
Now, due to some reason (probably due to incomplete WS-* specifications at Java side) it seems impossible to generate a Java Client for this WCF service hosted on remote system.
However, everything works fine when used with basicHttpBinding.
If you successfully use or have implemented WCF (wsHttpBinding) where it was interoperable with Java/Non WCF client?
What are you using in Java to generate the client? Not all frameworks are created equal. :) According to this post here, you will need to use WSIT.
We have seen issues related to WCF/Java. Basic binding in WCF creates WSDL ver 1.1 while other bindings use 1.2 if my memory servers me correctly.
We have also seen issues that can occur if you reuse the message contract.
Testing the WCF service from XML Spy is a good way to catch such errors.

Categories

Resources