Coder Social home page Coder Social logo

witsml-client's Introduction

Hashmap, Inc Tempus

License Build Status

Java WITSML 1.3.1.1 and 1.4.1.1 Client

The WITSML client utilizes the WITSML Objects Library SDK to allow a Java application to query a WITSML server. It has support for WITSML 1.3.1.1 and 1.4.1.1 Servers. This inital implementation allows for basic queries to be executed but will feature a customizeable query builder and full featured growing object trackers for Logs, Trajectories, and MudLogs. The intention is that this will be used within another framework such as Apache NiFi or Apache Spark to communicate with WITSML STORE API's. This data can then be processed by Spark, Storm, Flink or persisted in HBase or Hive.

Table of Contents

Features

This library aims to provide a few key features:

  • Utilizing the WITSML Object Library to generate POJO or string server responses
  • Querying 1.3.1.1 or 1.4.1.1 WITSML STORE API's
  • A Helper tracker library that keeps track of paginating large responses from open queries
  • FUTURE - An interactive query builder to dynamically query for requested elements

Requirements

  • JDK 1.8 at a minimum
  • Maven 3.1 or newer
  • Git client (to build locally)

Getting Started

To build the library and get started first off clone the GitHub repository

git clone https://github.com/hashmapinc/witsml-client.git

Change directory into the WitsmlObjectsLibrary

cd witsml0client

Execute a maven clean install

mvn clean install

A Build success message should appear

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.271 s
[INFO] Finished at: 2017-06-30T15:14:58-05:00
[INFO] Final Memory: 20M/377M
[INFO] ------------------------------------------------------------------------

Usage

Initalization

    Client c = new Client("https://testwitsmlserver.com");
        c.setUserName("username");
        c.setPassword("secret");
        c.setVersion(WitsmlVersion.VERSION_1411);
        c.connect();
        try {
            System.out.println("Supported Caps:");
            System.out.println(prettyPrint(c.getCapabilities(), true));
        }

Well Requests

    ObjWells wells = null;
        try {
            wells = c.getWellsAsObj();
        } catch (FileNotFoundException | RemoteException | JAXBException e) {
            System.out.println("Error executing get wells as obj: " + e.getMessage());
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (wells != null) {
            System.out.println("Found " + wells.getWell().size() + " wells.");
            wells.getWell().forEach(well -> {
                System.out.println("Well Name: " + well.getName());
                System.out.println("Well Legal: " + well.getNameLegal());
                PrintWellbores(c, well.getUid());
            });
        }

Wellbore Requets

    private static void PrintWellbores(Client c, String wellId){
        try {
            ObjWellbores wellbores = c.getWellboresForWellAsObj(wellId);
            wellbores.getWellbore().forEach(wellbore -> {
                System.out.println("Wellbore Name: " + wellbore.getName());
                System.out.println("Wellbore Id: " + wellbore.getUid());
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Log Requests

private static void PrintLogs(Client c, String wellId, String wellboreId){
        try {
            ObjLogs logs = c.getLogMetadataAsObj(wellId, wellboreId);
            logs.getLog().forEach(log -> {
                System.out.println("Log Name: " + log.getName());
                System.out.println("Log Id: " + log.getUid());
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Maven

Can be used with the following maven dependancy

         <dependency>
            <groupId>com.hashmapinc.tempus</groupId>
            <artifactId>witsml-client</artifactId>
            <version>1.0.1</version>
        </dependency>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.