You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by mf...@apache.org on 2014/04/29 03:36:55 UTC

[02/11] git commit: Removed extraneous classes

Removed extraneous classes


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/d14ebfa8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/d14ebfa8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/d14ebfa8

Branch: refs/heads/master
Commit: d14ebfa8536f64085a79e2b3e344e5bc55ffa5a5
Parents: 9d18c11
Author: mfranklin <mf...@apache.org>
Authored: Mon Apr 28 10:30:16 2014 -0400
Committer: mfranklin <mf...@apache.org>
Committed: Mon Apr 28 10:30:16 2014 -0400

----------------------------------------------------------------------
 .../streams/sysomos/SysomosJacksonResponse.java | 109 -------------------
 .../apache/streams/sysomos/SysomosResponse.java |  39 -------
 2 files changed, 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d14ebfa8/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosJacksonResponse.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosJacksonResponse.java b/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosJacksonResponse.java
deleted file mode 100644
index a14e882..0000000
--- a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosJacksonResponse.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.streams.sysomos;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sysomos.xml.BeatApi;
-import com.sysomos.xml.BeatApi.BeatResponse.Beat;
-import com.sysomos.xml.ObjectFactory;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-import java.io.StringReader;
-import java.util.List;
-
-/**
- * Created with IntelliJ IDEA.
- * User: rebanks
- * Date: 11/19/13
- * Time: 3:11 PM
- * To change this template use File | Settings | File Templates.
- */
-public class SysomosJacksonResponse implements SysomosResponse {
-
-    private int numResponses = 0;
-    private List<Beat> beats;
-    private boolean hasError = false;
-    private String xmlString;
-    private int index;
-    private ObjectMapper mapper;
-    private String errorMessage;
-
-    public SysomosJacksonResponse(String xmlString) {
-        try {
-            this.xmlString = xmlString;
-            JAXBContext context = JAXBContext.newInstance(new Class[] {ObjectFactory.class});
-//            JAXBContext context = JAXBContext.newInstance(BeatApi.class.getName(), ObjectFactory.class.getClassLoader());
-            Unmarshaller unmarshaller = context.createUnmarshaller();
-            BeatApi beatApi = (BeatApi) unmarshaller.unmarshal(new StringReader(xmlString));
-            this.beats = beatApi.getBeatResponse().getBeat();
-            this.numResponses = beatApi.getBeatResponse().getCount();
-            this.index = 0;
-            this.hasError = xmlString.contains("<errors>") && xmlString.contains("<error>") && xmlString.contains("<errorMessage>");
-            if(this.hasError) {
-                this.errorMessage = xmlString.substring(xmlString.lastIndexOf("<errorMessage>"), xmlString.lastIndexOf("</errorMessage>"));
-            }
-            this.mapper = new ObjectMapper();
-//            System.out.println(mapper.writeValueAsString(beatApi));
-        } catch (Exception e) {
-            this.hasError = true;
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    public int getNumResults() {
-        return this.numResponses;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean hasError() {
-        return this.hasError;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getErrorMessage() {
-        return this.errorMessage;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getXMLResponseString() {
-        return this.xmlString;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean hasNext() {
-        return this.index < this.numResponses;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String next() {
-        try {
-            return this.mapper.writeValueAsString(this.beats.get(index++));
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    @Override
-    public void remove() {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d14ebfa8/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosResponse.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosResponse.java b/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosResponse.java
deleted file mode 100644
index a373a1f..0000000
--- a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/SysomosResponse.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- */
-
-package org.apache.streams.sysomos;
-
-import java.util.Iterator;
-
-/**
- * Created with IntelliJ IDEA.
- * User: rebanks
- * Date: 11/19/13
- * Time: 4:42 PM
- * To change this template use File | Settings | File Templates.
- */
-public interface SysomosResponse extends Iterator<String> {
-
-
-    public int getNumResults();
-    public boolean hasError();
-    public String getErrorMessage();
-    public String getXMLResponseString();
-
-}