(empty log message)
@@ -124,6 +124,12 @@ | ||
124 | 124 | |
125 | 125 | if (execMethods[i].equals("getmultitagkeys")) |
126 | 126 | retMap.put("getmultitagkeys", execGetMultiTagKeys(okuyamaClient, start, count)); |
127 | + | |
128 | + if (execMethods[i].equals("gettagkeysresult")) | |
129 | + retMap.put("gettagkeysresult", execGetTagKeysResult(okuyamaClient, start, count)); | |
130 | + | |
131 | + if (execMethods[i].equals("getmultitagkeysresult")) | |
132 | + retMap.put("getmultitagkeysresult", execMultiGetTagKeysResult(okuyamaClient, start, count)); | |
127 | 133 | } |
128 | 134 | |
129 | 135 | System.out.println("ErrorMap=" + retMap.toString()); |
@@ -1669,4 +1675,375 @@ | ||
1669 | 1675 | |
1670 | 1676 | return errorFlg; |
1671 | 1677 | } |
1678 | + | |
1679 | + | |
1680 | + private boolean execGetTagKeysResult(OkuyamaClient client, int start, int count) throws Exception { | |
1681 | + OkuyamaClient okuyamaClient = null; | |
1682 | + OkuyamaResultSet okuyamaResultSet = null; | |
1683 | + boolean errorFlg = false; | |
1684 | + try { | |
1685 | + System.out.println("execGetTagKeysResult - Start"); | |
1686 | + | |
1687 | + if (client != null) { | |
1688 | + okuyamaClient = client; | |
1689 | + } else { | |
1690 | + int port = masterNodePort; | |
1691 | + | |
1692 | + // クライアントインスタンスを作成 | |
1693 | + okuyamaClient = new OkuyamaClient(); | |
1694 | + | |
1695 | + // マスタサーバに接続 | |
1696 | + okuyamaClient.connect(masterNodeName, port); | |
1697 | + } | |
1698 | + | |
1699 | + | |
1700 | + | |
1701 | + String[] tag1 = {start+"_" + this.nowCount + "_tag1_reslut"}; | |
1702 | + String[] tag2 = {start+"_" + this.nowCount + "_tag1_reslut",start+"_" + this.nowCount + "_tag2_reslut"}; | |
1703 | + String[] tag3 = {start+"_" + this.nowCount + "_tag1_reslut",start+"_" + this.nowCount + "_tag2_reslut",start+"_" + this.nowCount + "_tag3_reslut"}; | |
1704 | + String[] tag4 = {start+"_" + this.nowCount + "_tag4_reslut"}; | |
1705 | + String[] setTag = null; | |
1706 | + | |
1707 | + int counter = 0; | |
1708 | + for (int i = start; i < count; i++) { | |
1709 | + if (counter == 0) { | |
1710 | + setTag = tag1; | |
1711 | + counter++; | |
1712 | + } else if (counter == 1) { | |
1713 | + setTag = tag2; | |
1714 | + counter++; | |
1715 | + } else if (counter == 2) { | |
1716 | + setTag = tag3; | |
1717 | + counter++; | |
1718 | + } else if (counter == 3) { | |
1719 | + setTag = tag4; | |
1720 | + counter = 0; | |
1721 | + } | |
1722 | + | |
1723 | + if (!okuyamaClient.setValue(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString(), setTag, this.nowCount + "tagsamplesavedata_reslut_" + new Integer(i).toString())) { | |
1724 | + System.out.println("Tag GetResult Set - Error=[" + this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString() + ", " + this.nowCount + "tagsamplesavedata_reslut_" + new Integer(i).toString()); | |
1725 | + errorFlg = true; | |
1726 | + } | |
1727 | + } | |
1728 | + | |
1729 | + | |
1730 | + ArrayList tag1RetList = new ArrayList(); | |
1731 | + ArrayList tag2RetList = new ArrayList(); | |
1732 | + ArrayList tag3RetList = new ArrayList(); | |
1733 | + ArrayList tag4RetList = new ArrayList(); | |
1734 | + counter = 0; | |
1735 | + for (int i = start; i < count; i++) { | |
1736 | + if (counter == 0) { | |
1737 | + | |
1738 | + tag1RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1739 | + counter++; | |
1740 | + } else if (counter == 1) { | |
1741 | + | |
1742 | + tag1RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1743 | + tag2RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1744 | + counter++; | |
1745 | + } else if (counter == 2) { | |
1746 | + | |
1747 | + tag1RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1748 | + tag2RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1749 | + tag3RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1750 | + counter++; | |
1751 | + } else if (counter == 3) { | |
1752 | + | |
1753 | + tag4RetList.add(this.nowCount + "tagsampledatakey_reslut_" + new Integer(i).toString()); | |
1754 | + counter = 0; | |
1755 | + } | |
1756 | + } | |
1757 | + | |
1758 | + HashMap getResult1 = new HashMap(); | |
1759 | + HashMap getResult2 = new HashMap(); | |
1760 | + HashMap getResult3 = new HashMap(); | |
1761 | + HashMap getResult4 = new HashMap(); | |
1762 | + String[] keys = null; | |
1763 | + long startTime = new Date().getTime(); | |
1764 | + okuyamaResultSet = okuyamaClient.getTagKeysResult(start+"_" + this.nowCount + "_tag1_reslut"); | |
1765 | + | |
1766 | + if (okuyamaResultSet != null) { | |
1767 | + // データ有り | |
1768 | + while (okuyamaResultSet.next()) { | |
1769 | + getResult1.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1770 | + } | |
1771 | + okuyamaResultSet.close(); | |
1772 | + } else { | |
1773 | + System.out.println(start+"tag1_reslut=データなし"); | |
1774 | + errorFlg = true; | |
1775 | + } | |
1776 | + | |
1777 | + | |
1778 | + okuyamaResultSet = okuyamaClient.getTagKeysResult(start+"_" + this.nowCount + "_tag2_reslut"); | |
1779 | + if (okuyamaResultSet != null) { | |
1780 | + // データ有り | |
1781 | + while (okuyamaResultSet.next()) { | |
1782 | + getResult2.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1783 | + } | |
1784 | + okuyamaResultSet.close(); | |
1785 | + } else { | |
1786 | + System.out.println(start+"tag2_reslut=データなし"); | |
1787 | + errorFlg = true; | |
1788 | + } | |
1789 | + | |
1790 | + | |
1791 | + okuyamaResultSet = okuyamaClient.getTagKeysResult(start+"_" + this.nowCount + "_tag3_reslut"); | |
1792 | + if (okuyamaResultSet != null) { | |
1793 | + // データ有り | |
1794 | + while (okuyamaResultSet.next()) { | |
1795 | + getResult3.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1796 | + } | |
1797 | + okuyamaResultSet.close(); | |
1798 | + } else { | |
1799 | + System.out.println(start+"tag3_reslut=データなし"); | |
1800 | + errorFlg = true; | |
1801 | + } | |
1802 | + | |
1803 | + | |
1804 | + okuyamaResultSet = okuyamaClient.getTagKeysResult(start+"_" + this.nowCount + "_tag4_reslut"); | |
1805 | + if (okuyamaResultSet != null) { | |
1806 | + // データ有り | |
1807 | + while (okuyamaResultSet.next()) { | |
1808 | + getResult4.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1809 | + } | |
1810 | + okuyamaResultSet.close(); | |
1811 | + } else { | |
1812 | + System.out.println(start+"tag4_reslut=データなし"); | |
1813 | + errorFlg = true; | |
1814 | + } | |
1815 | + | |
1816 | + okuyamaResultSet = okuyamaClient.getTagKeysResult(start+"_" + this.nowCount + "_tag5_reslut"); | |
1817 | + if (okuyamaResultSet != null) { | |
1818 | + // データ有り | |
1819 | + while (okuyamaResultSet.next()) { | |
1820 | + System.out.println(start+"tag5_reslut=データあり"); | |
1821 | + errorFlg = true; | |
1822 | + } | |
1823 | + okuyamaResultSet.close(); | |
1824 | + } else { | |
1825 | + System.out.println(start+"tag5_reslut=OkuyamaResultSet取得できず"); | |
1826 | + errorFlg = true; | |
1827 | + } | |
1828 | + | |
1829 | + | |
1830 | + | |
1831 | + // 検証 | |
1832 | + // Tag1 | |
1833 | + for (int idx = 0; idx < tag1RetList.size(); idx++) { | |
1834 | + if (!getResult1.containsKey((String)tag1RetList.get(idx))) { | |
1835 | + System.out.println(start+"_tag1_result=該当データなし Key=[" + (String)tag1RetList.get(idx) +"]"); | |
1836 | + errorFlg = true; | |
1837 | + } | |
1838 | + } | |
1839 | + | |
1840 | + // Tag2 | |
1841 | + for (int idx = 0; idx < tag2RetList.size(); idx++) { | |
1842 | + if (!getResult2.containsKey((String)tag2RetList.get(idx))) { | |
1843 | + System.out.println(start+"_tag2_result=該当データなし Key=[" + (String)tag2RetList.get(idx) +"]"); | |
1844 | + errorFlg = true; | |
1845 | + } | |
1846 | + } | |
1847 | + | |
1848 | + // Tag3 | |
1849 | + for (int idx = 0; idx < tag3RetList.size(); idx++) { | |
1850 | + if (!getResult3.containsKey((String)tag3RetList.get(idx))) { | |
1851 | + System.out.println(start+"_tag3_result=該当データなし Key=[" + (String)tag3RetList.get(idx) +"]"); | |
1852 | + errorFlg = true; | |
1853 | + } | |
1854 | + } | |
1855 | + | |
1856 | + // Tag4 | |
1857 | + for (int idx = 0; idx < tag4RetList.size(); idx++) { | |
1858 | + if (!getResult4.containsKey((String)tag4RetList.get(idx))) { | |
1859 | + System.out.println(start+"_tag4_result=該当データなし Key=[" + (String)tag4RetList.get(idx) +"]"); | |
1860 | + errorFlg = true; | |
1861 | + } | |
1862 | + } | |
1863 | + | |
1864 | + long endTime = new Date().getTime(); | |
1865 | + System.out.println("Tag Get Result Method= " + (endTime - startTime) + " milli second"); | |
1866 | + | |
1867 | + if (client == null) { | |
1868 | + okuyamaClient.close(); | |
1869 | + } | |
1870 | + } catch (Exception e) { | |
1871 | + throw e; | |
1872 | + } | |
1873 | + System.out.println("execGetTagKeysResult - End"); | |
1874 | + return errorFlg; | |
1875 | + } | |
1876 | + | |
1877 | + | |
1878 | + private boolean execMultiGetTagKeysResult(OkuyamaClient client, int start, int count) throws Exception { | |
1879 | + OkuyamaClient okuyamaClient = null; | |
1880 | + OkuyamaResultSet okuyamaResultSet = null; | |
1881 | + boolean errorFlg = false; | |
1882 | + try { | |
1883 | + System.out.println("execMultiGetTagKeysResult - Start"); | |
1884 | + | |
1885 | + if (client != null) { | |
1886 | + okuyamaClient = client; | |
1887 | + } else { | |
1888 | + int port = masterNodePort; | |
1889 | + | |
1890 | + // クライアントインスタンスを作成 | |
1891 | + okuyamaClient = new OkuyamaClient(); | |
1892 | + | |
1893 | + // マスタサーバに接続 | |
1894 | + okuyamaClient.connect(masterNodeName, port); | |
1895 | + } | |
1896 | + | |
1897 | + | |
1898 | + String[] tag1 = {start+"_" + this.nowCount + "_tag1_m_reslut"}; | |
1899 | + String[] tag2 = {start+"_" + this.nowCount + "_tag1_m_reslut",start+"_" + this.nowCount + "_tag2_m_reslut"}; | |
1900 | + String[] tag3 = {start+"_" + this.nowCount + "_tag1_m_reslut",start+"_" + this.nowCount + "_tag2_m_reslut",start+"_" + this.nowCount + "_tag3_m_reslut"}; | |
1901 | + String[] tag4 = {start+"_" + this.nowCount + "_tag4_m_reslut"}; | |
1902 | + String[] setTag = null; | |
1903 | + | |
1904 | + int counter = 0; | |
1905 | + for (int i = start; i < count; i++) { | |
1906 | + if (counter == 0) { | |
1907 | + setTag = tag1; | |
1908 | + counter++; | |
1909 | + } else if (counter == 1) { | |
1910 | + setTag = tag2; | |
1911 | + counter++; | |
1912 | + } else if (counter == 2) { | |
1913 | + setTag = tag3; | |
1914 | + counter++; | |
1915 | + } else if (counter == 3) { | |
1916 | + setTag = tag4; | |
1917 | + counter = 0; | |
1918 | + } | |
1919 | + | |
1920 | + if (!okuyamaClient.setValue(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString(), setTag, this.nowCount + "tagsamplesavedata_m_reslut_" + new Integer(i).toString())) { | |
1921 | + System.out.println("Tag GetResult Set - Error=[" + this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString() + ", " + this.nowCount + "tagsamplesavedata_m_reslut_" + new Integer(i).toString()); | |
1922 | + errorFlg = true; | |
1923 | + } | |
1924 | + } | |
1925 | + | |
1926 | + | |
1927 | + ArrayList tag1RetList = new ArrayList(); | |
1928 | + ArrayList tag2RetList = new ArrayList(); | |
1929 | + counter = 0; | |
1930 | + for (int i = start; i < count; i++) { | |
1931 | + if (counter == 0) { | |
1932 | + | |
1933 | + tag2RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1934 | + counter++; | |
1935 | + } else if (counter == 1) { | |
1936 | + | |
1937 | + tag1RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1938 | + tag2RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1939 | + counter++; | |
1940 | + } else if (counter == 2) { | |
1941 | + | |
1942 | + tag1RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1943 | + tag2RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1944 | + counter++; | |
1945 | + } else if (counter == 3) { | |
1946 | + | |
1947 | + tag2RetList.add(this.nowCount + "tagsampledatakey_m_reslut_" + new Integer(i).toString()); | |
1948 | + counter = 0; | |
1949 | + } | |
1950 | + } | |
1951 | + | |
1952 | + HashMap getResult1 = new HashMap(); | |
1953 | + HashMap getResult2 = new HashMap(); | |
1954 | + HashMap getResult3 = new HashMap(); | |
1955 | + HashMap getResult4 = new HashMap(); | |
1956 | + String[] keys = null; | |
1957 | + long startTime = new Date().getTime(); | |
1958 | + String[] andTestTag1 = {start+"_" + this.nowCount + "_tag1_m_reslut", start+"_" + this.nowCount + "_tag2_m_reslut"}; | |
1959 | + okuyamaResultSet = okuyamaClient.getMultiTagKeysResult(andTestTag1); | |
1960 | + | |
1961 | + if (okuyamaResultSet != null) { | |
1962 | + // データ有り | |
1963 | + while (okuyamaResultSet.next()) { | |
1964 | + getResult1.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1965 | + } | |
1966 | + okuyamaResultSet.close(); | |
1967 | + if (getResult1.size() != tag1RetList.size()) { | |
1968 | + System.out.println(start+"tag1&tag2_reslut=データ数異常"); | |
1969 | + errorFlg = true; | |
1970 | + } | |
1971 | + } else { | |
1972 | + System.out.println(start+"tag1&tag2_reslut=データなし"); | |
1973 | + errorFlg = true; | |
1974 | + } | |
1975 | + | |
1976 | + | |
1977 | + String[] orTestTag2 = {start+"_" + this.nowCount + "_tag1_m_reslut", start+"_" + this.nowCount + "_tag2_m_reslut", start+"_" + this.nowCount + "_tag4_m_reslut"}; | |
1978 | + okuyamaResultSet = okuyamaClient.getMultiTagKeysResult(orTestTag2, false); | |
1979 | + | |
1980 | + if (okuyamaResultSet != null) { | |
1981 | + // データ有り | |
1982 | + while (okuyamaResultSet.next()) { | |
1983 | + getResult2.put(okuyamaResultSet.getKey(), okuyamaResultSet.getValue()); | |
1984 | + } | |
1985 | + okuyamaResultSet.close(); | |
1986 | + if (getResult2.size() != tag2RetList.size()) { | |
1987 | + System.out.println(start+"tag1&tag2&tag4_reslut=データ数異常"); | |
1988 | + errorFlg = true; | |
1989 | + } | |
1990 | + | |
1991 | + } else { | |
1992 | + System.out.println(start+"tag1&tag2&tag4_reslut=データなし"); | |
1993 | + errorFlg = true; | |
1994 | + } | |
1995 | + | |
1996 | + | |
1997 | + | |
1998 | + String[] andTestTag3 = {start+"_" + this.nowCount + "_tag2_m_reslut", start+"_" + this.nowCount + "_tag3_m_reslut", start+"_" + this.nowCount + "_tag4_m_reslut"}; | |
1999 | + okuyamaResultSet = okuyamaClient.getMultiTagKeysResult(andTestTag3, true); | |
2000 | + | |
2001 | + if (okuyamaResultSet != null) { | |
2002 | + // データ有り | |
2003 | + | |
2004 | + errorFlg = true; | |
2005 | + while (okuyamaResultSet.next()) { | |
2006 | + System.out.println(start+"tag2_tag3_tag4_reslut=データあり"); | |
2007 | + System.out.println(okuyamaResultSet.getKey()); | |
2008 | + } | |
2009 | + okuyamaResultSet.close(); | |
2010 | + } | |
2011 | + | |
2012 | + | |
2013 | + | |
2014 | + | |
2015 | + // 検証 | |
2016 | + // Andの1番目 | |
2017 | + for (int idx = 0; idx < tag1RetList.size(); idx++) { | |
2018 | + if (!getResult1.containsKey((String)tag1RetList.get(idx))) { | |
2019 | + System.out.println(start+"AND_1=該当データなし Key=[" + (String)tag1RetList.get(idx) +"]"); | |
2020 | + errorFlg = true; | |
2021 | + } | |
2022 | + } | |
2023 | + | |
2024 | + // Tag2 | |
2025 | + // Orの1番目 | |
2026 | + for (int idx = 0; idx < tag2RetList.size(); idx++) { | |
2027 | + if (!getResult2.containsKey((String)tag2RetList.get(idx))) { | |
2028 | + System.out.println(start+"Or_1=該当データなし Key=[" + (String)tag2RetList.get(idx) +"]"); | |
2029 | + errorFlg = true; | |
2030 | + } | |
2031 | + } | |
2032 | + | |
2033 | + | |
2034 | + long endTime = new Date().getTime(); | |
2035 | + System.out.println("Tag Get Result Method= " + (endTime - startTime) + " milli second"); | |
2036 | + | |
2037 | + if (client == null) { | |
2038 | + okuyamaClient.close(); | |
2039 | + } | |
2040 | + } catch (Exception e) { | |
2041 | + throw e; | |
2042 | + } | |
2043 | + System.out.println("execMultiGetTagKeysResult - End"); | |
2044 | + return errorFlg; | |
2045 | + } | |
2046 | + | |
2047 | + | |
2048 | + | |
1672 | 2049 | } |
\ No newline at end of file |
@@ -5854,7 +5854,7 @@ | ||
5854 | 5854 | * Tagは打たれているが実際は既に存在しないValueが紐付くKey値は取得出来ない.<br> |
5855 | 5855 | * |
5856 | 5856 | * @param tagStr Tag値 |
5857 | - * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合はnullが返る | |
5857 | + * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合もOkuyamaResultSetは返るのでOkuyamaResultSetのnextメソッドを呼び出してデータの有無を確認する必要がある | |
5858 | 5858 | * @throws OkuyamaClientException |
5859 | 5859 | */ |
5860 | 5860 | public OkuyamaResultSet getTagKeysResult(String tagStr) throws OkuyamaClientException { |
@@ -5868,7 +5868,7 @@ | ||
5868 | 5868 | * |
5869 | 5869 | * @param tagStr Tag値 |
5870 | 5870 | * @param encoding エンコーディング指定 |
5871 | - * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合はnullが返る | |
5871 | + * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合もOkuyamaResultSetは返るのでOkuyamaResultSetのnextメソッドを呼び出してデータの有無を確認する必要がある | |
5872 | 5872 | * @throws OkuyamaClientException |
5873 | 5873 | */ |
5874 | 5874 | public OkuyamaResultSet getTagKeysResult(String tagStr, String encoding) throws OkuyamaClientException { |
@@ -5943,11 +5943,11 @@ | ||
5943 | 5943 | } else if(serverRet[1].equals("false")) { |
5944 | 5944 | |
5945 | 5945 | // データなし |
5946 | - okuyamaResultSet = null; | |
5946 | + okuyamaResultSet = new OkuyamaTagKeysResultSet(); | |
5947 | 5947 | } else if(serverRet[1].equals("error")) { |
5948 | 5948 | |
5949 | 5949 | // エラー発生 |
5950 | - okuyamaResultSet = null; | |
5950 | + okuyamaResultSet = new OkuyamaTagKeysResultSet(); | |
5951 | 5951 | } |
5952 | 5952 | } else { |
5953 | 5953 |
@@ -5995,11 +5995,6 @@ | ||
5995 | 5995 | |
5996 | 5996 | |
5997 | 5997 | |
5998 | - | |
5999 | - | |
6000 | - | |
6001 | - | |
6002 | - | |
6003 | 5998 | /** |
6004 | 5999 | * MasterNodeからTagを複数を指定することで紐付くKeyが取得可能な、OkuyamaResultSetを取得する.<br> |
6005 | 6000 | * Tagは打たれているが実際は既に存在しないValueが紐付くKey値は取得出来ない.<br> |
@@ -6007,7 +6002,7 @@ | ||
6007 | 6002 | * 大量のTagに紐付くデータを対象にする場合に向いている。少量のデータに対して複数Tagで取得したい場合は、従来通りgetMultiTagKeysを使うことを推奨する.<br> |
6008 | 6003 | * |
6009 | 6004 | * @param tagList Tag値の配列 |
6010 | - * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合はnullが返る | |
6005 | + * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合もOkuyamaResultSetは返るのでOkuyamaResultSetのnextメソッドを呼び出してデータの有無を確認する必要がある | |
6011 | 6006 | * @throws OkuyamaClientException |
6012 | 6007 | */ |
6013 | 6008 | public OkuyamaResultSet getMultiTagKeysResult(String[] tagList) throws OkuyamaClientException { |
@@ -6023,7 +6018,7 @@ | ||
6023 | 6018 | * |
6024 | 6019 | * @param tagList Tag値の配列 |
6025 | 6020 | * @param margeType 取得方法指定(true = AND、false=OR) |
6026 | - * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合はnullが返る | |
6021 | + * @return OkuyamaResultSet 結果のOkuyamaResultSet Tagがそもそも存在しない場合もOkuyamaResultSetは返るのでOkuyamaResultSetのnextメソッドを呼び出してデータの有無を確認する必要がある | |
6027 | 6022 | * @throws OkuyamaClientException |
6028 | 6023 | */ |
6029 | 6024 | public OkuyamaResultSet getMultiTagKeysResult(String[] tagList, boolean margeType) throws OkuyamaClientException { |
@@ -6030,7 +6025,7 @@ | ||
6030 | 6025 | OkuyamaResultSet okuyamaResultSet = null; |
6031 | 6026 | String serverRetStr = null; |
6032 | 6027 | String[] serverRet = null; |
6033 | - | |
6028 | + boolean dataNull = true; | |
6034 | 6029 | StringBuilder serverRequestBuf = null; |
6035 | 6030 | |
6036 | 6031 | try { |
@@ -6088,6 +6083,7 @@ | ||
6088 | 6083 | |
6089 | 6084 | String[] indexList = indexListStr.split(ImdstDefine.imdstTagKeyAppendSep); |
6090 | 6085 | resultSetParameterMap.put(tagList[idx], indexList); |
6086 | + dataNull = false; | |
6091 | 6087 | } |
6092 | 6088 | } else if(serverRet[1].equals("false")) { |
6093 | 6089 |
@@ -6112,7 +6108,11 @@ | ||
6112 | 6108 | } else { |
6113 | 6109 | retSetClient.connect(this.initParamServer, this.initParamPort, this.initParamEncoding, this.initParamOpenTimeout, this.initParamConnectionTimeout); |
6114 | 6110 | } |
6115 | - okuyamaResultSet = new OkuyamaMultiTagKeysResultSet(retSetClient, tagList, resultSetParameterMap, encoding, margeType); | |
6111 | + if (!dataNull) { | |
6112 | + okuyamaResultSet = new OkuyamaMultiTagKeysResultSet(retSetClient, tagList, resultSetParameterMap, encoding, margeType); | |
6113 | + } else { | |
6114 | + okuyamaResultSet = new OkuyamaMultiTagKeysResultSet(); | |
6115 | + } | |
6116 | 6116 | |
6117 | 6117 | } catch (OkuyamaClientException ice) { |
6118 | 6118 | throw ice; |
@@ -56,7 +56,16 @@ | ||
56 | 56 | |
57 | 57 | private String nowValue = null; |
58 | 58 | |
59 | + private boolean dataNull = false; | |
59 | 60 | |
61 | + /** | |
62 | + * コンストラクタ.<br> | |
63 | + * データなし.<br> | |
64 | + * | |
65 | + */ | |
66 | + public OkuyamaMultiTagKeysResultSet() { | |
67 | + this.dataNull = true; | |
68 | + } | |
60 | 69 | |
61 | 70 | /** |
62 | 71 | * コンストラクタ.<br> |
@@ -117,6 +126,7 @@ | ||
117 | 126 | |
118 | 127 | public boolean next() throws OkuyamaClientException { |
119 | 128 | |
129 | + if (this.dataNull) return false; | |
120 | 130 | try { |
121 | 131 | while (true) { |
122 | 132 | if (this.keyValueQueue.size() > 0) { |
@@ -48,11 +48,23 @@ | ||
48 | 48 | |
49 | 49 | private String nowValue = null; |
50 | 50 | |
51 | + private boolean dataNull = false; | |
51 | 52 | |
52 | 53 | |
53 | 54 | /** |
54 | 55 | * コンストラクタ.<br> |
56 | + * データが存在しない場合 | |
55 | 57 | * |
58 | + */ | |
59 | + public OkuyamaTagKeysResultSet() { | |
60 | + this.dataNull = true; | |
61 | + } | |
62 | + | |
63 | + | |
64 | + /** | |
65 | + * コンストラクタ.<br> | |
66 | + * データが存在する場合 | |
67 | + * | |
56 | 68 | * @param client |
57 | 69 | * @param tagStr |
58 | 70 | * @param indexList |
@@ -77,6 +89,7 @@ | ||
77 | 89 | |
78 | 90 | public boolean next() throws OkuyamaClientException { |
79 | 91 | |
92 | + if (this.dataNull) return false; | |
80 | 93 | try { |
81 | 94 | while (true) { |
82 | 95 |