1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.xml.internal.ws.resources;
  27 



  28 import com.sun.istack.internal.localization.Localizable;
  29 import com.sun.istack.internal.localization.LocalizableMessageFactory;

  30 import com.sun.istack.internal.localization.Localizer;
  31 
  32 import java.util.Locale;
  33 import java.util.ResourceBundle;
  34 
  35 
  36 /**
  37  * Defines string formatting method for each constant in the resource file
  38  *
  39  */

  40 public final class ClientMessages {

  41     private final static String BUNDLE_NAME = "com.sun.xml.internal.ws.resources.client";
  42     private final static LocalizableMessageFactory messageFactory =
  43         new LocalizableMessageFactory(BUNDLE_NAME, ClientMessages::getResourceBundle);
  44     private final static Localizer localizer = new Localizer();
  45 
  46     private static ResourceBundle getResourceBundle(Locale locale) {
  47         return ResourceBundle.getBundle(BUNDLE_NAME, locale);
  48     }
  49 
  50     public static Localizable localizableFAILED_TO_PARSE(Object arg0, Object arg1) {
  51         return messageFactory.getMessage("failed.to.parse", arg0, arg1);








  52     }
  53 
  54     /**
  55      * Failed to access the WSDL at: {0}. It failed with:
  56      *  {1}.
  57      *
  58      */
  59     public static String FAILED_TO_PARSE(Object arg0, Object arg1) {
  60         return localizer.localize(localizableFAILED_TO_PARSE(arg0, arg1));
  61     }
  62 
  63     public static Localizable localizableINVALID_BINDING_ID(Object arg0, Object arg1) {
  64         return messageFactory.getMessage("invalid.binding.id", arg0, arg1);
  65     }
  66 
  67     /**
  68      * Invalid binding id: {0}. Must be: {1}
  69      *
  70      */
  71     public static String INVALID_BINDING_ID(Object arg0, Object arg1) {
  72         return localizer.localize(localizableINVALID_BINDING_ID(arg0, arg1));
  73     }
  74 
  75     public static Localizable localizableEPR_WITHOUT_ADDRESSING_ON() {
  76         return messageFactory.getMessage("epr.without.addressing.on");
  77     }
  78 
  79     /**
  80      * EPR is specified without enabling WS-Addressing support.
  81      *
  82      */
  83     public static String EPR_WITHOUT_ADDRESSING_ON() {
  84         return localizer.localize(localizableEPR_WITHOUT_ADDRESSING_ON());
  85     }
  86 
  87     public static Localizable localizableINVALID_SERVICE_NO_WSDL(Object arg0) {
  88         return messageFactory.getMessage("invalid.service.no.wsdl", arg0);
  89     }
  90 
  91     /**
  92      * No wsdl metadata for service: {0}, can't create proxy! Try creating Service by providing a WSDL URL



  93      *
  94      */
  95     public static String INVALID_SERVICE_NO_WSDL(Object arg0) {
  96         return localizer.localize(localizableINVALID_SERVICE_NO_WSDL(arg0));
  97     }
  98 
  99     public static Localizable localizableINVALID_SOAP_ROLE_NONE() {
 100         return messageFactory.getMessage("invalid.soap.role.none");
 101     }
 102 
 103     /**
 104      * Cannot set SOAP 1.2 role "none"
 105      *
 106      */
 107     public static String INVALID_SOAP_ROLE_NONE() {
 108         return localizer.localize(localizableINVALID_SOAP_ROLE_NONE());
 109     }
 110 
 111     public static Localizable localizableUNDEFINED_BINDING(Object arg0) {
 112         return messageFactory.getMessage("undefined.binding", arg0);
 113     }
 114 
 115     /**
 116      * Undefined binding: {0}
 117      *
 118      */
 119     public static String UNDEFINED_BINDING(Object arg0) {
 120         return localizer.localize(localizableUNDEFINED_BINDING(arg0));
 121     }
 122 
 123     public static Localizable localizableHTTP_NOT_FOUND(Object arg0) {
 124         return messageFactory.getMessage("http.not.found", arg0);
 125     }
 126 
 127     /**
 128      * HTTP Status-Code 404: Not Found - {0}
 129      *
 130      */
 131     public static String HTTP_NOT_FOUND(Object arg0) {
 132         return localizer.localize(localizableHTTP_NOT_FOUND(arg0));
 133     }
 134 
 135     public static Localizable localizableINVALID_EPR_PORT_NAME(Object arg0, Object arg1) {
 136         return messageFactory.getMessage("invalid.epr.port.name", arg0, arg1);
 137     }
 138 
 139     /**
 140      * EndpointName specified in EPR {0}  is not a WSDL port QName, valid Ports are {1}
 141      *
 142      */
 143     public static String INVALID_EPR_PORT_NAME(Object arg0, Object arg1) {
 144         return localizer.localize(localizableINVALID_EPR_PORT_NAME(arg0, arg1));
 145     }
 146 
 147     public static Localizable localizableFAILED_TO_PARSE_WITH_MEX(Object arg0, Object arg1, Object arg2) {
 148         return messageFactory.getMessage("failed.to.parseWithMEX", arg0, arg1, arg2);
 149     }
 150 
 151     /**
 152      * Failed to access the WSDL at: {0}. It failed with:
 153      *  {1}.
 154      * Retrying with MEX gave:
 155      *  {2}
 156      *
 157      */
 158     public static String FAILED_TO_PARSE_WITH_MEX(Object arg0, Object arg1, Object arg2) {
 159         return localizer.localize(localizableFAILED_TO_PARSE_WITH_MEX(arg0, arg1, arg2));
 160     }
 161 
 162     public static Localizable localizableHTTP_STATUS_CODE(Object arg0, Object arg1) {
 163         return messageFactory.getMessage("http.status.code", arg0, arg1);
 164     }
 165 
 166     /**
 167      * The server sent HTTP status code {0}: {1}
 168      *
 169      */
 170     public static String HTTP_STATUS_CODE(Object arg0, Object arg1) {
 171         return localizer.localize(localizableHTTP_STATUS_CODE(arg0, arg1));
 172     }
 173 
 174     public static Localizable localizableINVALID_ADDRESS(Object arg0) {
 175         return messageFactory.getMessage("invalid.address", arg0);
 176     }
 177 
 178     /**
 179      * Invalid address: {0}
 180      *
 181      */
 182     public static String INVALID_ADDRESS(Object arg0) {
 183         return localizer.localize(localizableINVALID_ADDRESS(arg0));
 184     }
 185 
 186     public static Localizable localizableUNDEFINED_PORT_TYPE(Object arg0) {
 187         return messageFactory.getMessage("undefined.portType", arg0);
 188     }
 189 
 190     /**
 191      * Undefined port type: {0}

 192      *
 193      */
 194     public static String UNDEFINED_PORT_TYPE(Object arg0) {
 195         return localizer.localize(localizableUNDEFINED_PORT_TYPE(arg0));
 196     }
 197 
 198     public static Localizable localizableWSDL_CONTAINS_NO_SERVICE(Object arg0) {
 199         return messageFactory.getMessage("wsdl.contains.no.service", arg0);
 200     }
 201 
 202     /**
 203      * WSDL {0} contains no service definition.
 204      *
 205      */
 206     public static String WSDL_CONTAINS_NO_SERVICE(Object arg0) {
 207         return localizer.localize(localizableWSDL_CONTAINS_NO_SERVICE(arg0));
 208     }
 209 
 210     public static Localizable localizableINVALID_SOAP_ACTION() {
 211         return messageFactory.getMessage("invalid.soap.action");
 212     }
 213 
 214     /**
 215      * A valid SOAPAction should be set in the RequestContext when Addressing is enabled, Use BindingProvider.SOAPACTION_URI_PROPERTY to set it.
 216      *
 217      */
 218     public static String INVALID_SOAP_ACTION() {
 219         return localizer.localize(localizableINVALID_SOAP_ACTION());
 220     }
 221 
 222     public static Localizable localizableNON_LOGICAL_HANDLER_SET(Object arg0) {
 223         return messageFactory.getMessage("non.logical.handler.set", arg0);
 224     }
 225 
 226     /**
 227      * Cannot set {0} on binding. Handler must be a LogicalHandler.
 228      *
 229      */
 230     public static String NON_LOGICAL_HANDLER_SET(Object arg0) {
 231         return localizer.localize(localizableNON_LOGICAL_HANDLER_SET(arg0));
 232     }
 233 
 234     public static Localizable localizableLOCAL_CLIENT_FAILED(Object arg0) {
 235         return messageFactory.getMessage("local.client.failed", arg0);
 236     }
 237 
 238     /**
 239      * local transport error: {0}
 240      *
 241      */
 242     public static String LOCAL_CLIENT_FAILED(Object arg0) {
 243         return localizer.localize(localizableLOCAL_CLIENT_FAILED(arg0));
 244     }
 245 
 246     public static Localizable localizableRUNTIME_WSDLPARSER_INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
 247         return messageFactory.getMessage("runtime.wsdlparser.invalidWSDL", arg0, arg1, arg2, arg3);
 248     }
 249 
 250     /**
 251      * Invalid WSDL {0}, expected {1} found {2} at (line{3})
 252      *
 253      */
 254     public static String RUNTIME_WSDLPARSER_INVALID_WSDL(Object arg0, Object arg1, Object arg2, Object arg3) {
 255         return localizer.localize(localizableRUNTIME_WSDLPARSER_INVALID_WSDL(arg0, arg1, arg2, arg3));
 256     }
 257 
 258     public static Localizable localizableWSDL_NOT_FOUND(Object arg0) {
 259         return messageFactory.getMessage("wsdl.not.found", arg0);
 260     }
 261 
 262     /**
 263      * WSDL url {0} is not accessible.
 264      *
 265      */
 266     public static String WSDL_NOT_FOUND(Object arg0) {
 267         return localizer.localize(localizableWSDL_NOT_FOUND(arg0));
 268     }
 269 
 270     public static Localizable localizableHTTP_CLIENT_FAILED(Object arg0) {
 271         return messageFactory.getMessage("http.client.failed", arg0);
 272     }
 273 
 274     /**
 275      * HTTP transport error: {0}
 276      *
 277      */
 278     public static String HTTP_CLIENT_FAILED(Object arg0) {
 279         return localizer.localize(localizableHTTP_CLIENT_FAILED(arg0));
 280     }
 281 
 282     public static Localizable localizableINVALID_SERVICE_NAME_NULL(Object arg0) {
 283         return messageFactory.getMessage("invalid.service.name.null", arg0);
 284     }
 285 
 286     /**
 287      * {0} is not a valid service
 288      *
 289      */
 290     public static String INVALID_SERVICE_NAME_NULL(Object arg0) {
 291         return localizer.localize(localizableINVALID_SERVICE_NAME_NULL(arg0));
 292     }
 293 
 294     public static Localizable localizableINVALID_WSDL_URL(Object arg0) {
 295         return messageFactory.getMessage("invalid.wsdl.url", arg0);
 296     }
 297 
 298     /**
 299      * Invalid WSDL URL: {0}
 300      *
 301      */
 302     public static String INVALID_WSDL_URL(Object arg0) {
 303         return localizer.localize(localizableINVALID_WSDL_URL(arg0));
 304     }
 305 
 306     public static Localizable localizableINVALID_PORT_NAME(Object arg0, Object arg1) {
 307         return messageFactory.getMessage("invalid.port.name", arg0, arg1);
 308     }
 309 
 310     /**
 311      * {0} is not a valid port. Valid ports are: {1}
 312      *
 313      */
 314     public static String INVALID_PORT_NAME(Object arg0, Object arg1) {
 315         return localizer.localize(localizableINVALID_PORT_NAME(arg0, arg1));
 316     }
 317 
 318     public static Localizable localizableINVALID_SERVICE_NAME(Object arg0, Object arg1) {
 319         return messageFactory.getMessage("invalid.service.name", arg0, arg1);
 320     }
 321 
 322     /**
 323      * {0} is not a valid service. Valid services are: {1}
 324      *
 325      */
 326     public static String INVALID_SERVICE_NAME(Object arg0, Object arg1) {
 327         return localizer.localize(localizableINVALID_SERVICE_NAME(arg0, arg1));
 328     }
 329 
 330     public static Localizable localizableUNSUPPORTED_OPERATION(Object arg0, Object arg1, Object arg2) {
 331         return messageFactory.getMessage("unsupported.operation", arg0, arg1, arg2);
 332     }
 333 
 334     /**
 335      * {0} not supported with {1}. Must be: {2}
 336      *
 337      */
 338     public static String UNSUPPORTED_OPERATION(Object arg0, Object arg1, Object arg2) {
 339         return localizer.localize(localizableUNSUPPORTED_OPERATION(arg0, arg1, arg2));
 340     }
 341 
 342     public static Localizable localizableFAILED_TO_PARSE_EPR(Object arg0) {
 343         return messageFactory.getMessage("failed.to.parse.epr", arg0);





 344     }
 345 
 346     /**
 347      * Failed to parse EPR: {0}
 348      *
 349      */
 350     public static String FAILED_TO_PARSE_EPR(Object arg0) {
 351         return localizer.localize(localizableFAILED_TO_PARSE_EPR(arg0));
 352     }
 353 
 354 }
--- EOF ---