/** * Verifies the URN scheme. * * @param inURN the URN to verify * * @throws InvalidURNException if the URN has an invalid scheme. */ private static void verifyScheme(ModuleURN inURN) throws InvalidURNException { if(!ModuleURN.SCHEME.equals(inURN.scheme())) { throw new InvalidURNException(new I18NBoundMessage3P( Messages.INVALID_URN_SCHEME, inURN.scheme(), inURN.toString(), ModuleURN.SCHEME)); } }
new Attribute(inInfo.getName(), value)); } catch (JMException e) { throw new BeanAttributeSetException(e, new I18NBoundMessage3P( Messages.UNABLE_SET_ATTRIBUTE, inInfo.getName(), inValue, inName)); } catch (IllegalArgumentException e) { throw new BeanAttributeSetException(e, new I18NBoundMessage3P( Messages.UNABLE_SET_ATTRIBUTE, inInfo.getName(), inValue, inName));
for(String key: inProperties.keySet()) { if(!EDITABLE_STRATEGY_PROPERTIES.contains(key)) { throw new I18NException(new I18NBoundMessage3P(Messages.UNEDITABLE_STRATEGY_PROPERTY, key, inInstance,
throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 1, String.class.getName(), throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 2, String.class.getName(), throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 3, Language.class.getName(), throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 4, File.class.getName(), parameters = (Properties)inParameters[4]; } else { throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 5, Properties.class.getName(), routeOrdersToORS = (Boolean)inParameters[5]; } else { throw new ModuleCreationException(new I18NBoundMessage3P(PARAMETER_TYPE_ERROR, 6, Boolean.class.getName(), outputInstance = (ModuleURN)inParameters[6];
/** * Validates the tag spec and tag value. * * @throws CoreException if a validation error occurs */ public void validate() { String pattern = tagSpec.getPattern(); if(pattern != null) { //Allow validation of empty string String valueToCompare = (value == null)? "" : value; if(!Pattern.compile(pattern).matcher(valueToCompare).matches()) { throw new CoreException(new I18NBoundMessage3P(Messages.ALGO_TAG_VALUE_PATTERN_MISMATCH, tagSpec.getLabel(), valueToCompare, tagSpec.getAdvice())); } } if(tagSpec.getIsMandatory() && value == null) { throw new CoreException(new I18NBoundMessage1P(Messages.ALGO_TAG_VALUE_REQUIRED, tagSpec.getLabel())); } Validator<BrokerAlgoTag> tagValidator = tagSpec.getValidator(); if(tagValidator != null) { tagValidator.validate(this); } } /* (non-Javadoc)
@Override protected void doStart() { try { mServiceClient = new Client(parameters.getHostname(), parameters.getPort(), SAClientVersion.APP_ID, parameters.getContextClassProvider()); mServiceClient.login(parameters.getUsername(), parameters.getPassword()); mSAService = mServiceClient.getService(SAService.class); } catch (Exception e) { throw new ConnectionException(e, new I18NBoundMessage3P(Messages.ERROR_WS_CONNECT, parameters.getHostname(), String.valueOf(parameters.getPort()), parameters.getUsername())); } } /**
@Override public boolean shouldAllow(StatelessClientContext inContext, String inUser, char[] inPassword) throws I18NException { // Verify client version VersionInfo serverVersion = ApplicationVersion.getVersion(); VersionInfo clientVersion = VersionInfo.DEFAULT_VERSION; String version = Util.getVersion(inContext.getAppId()); if(version != null) { clientVersion = new VersionInfo(Util.getVersion(inContext.getAppId())); } if(!compatibleVersions(clientVersion, serverVersion)) { throw new I18NException(new I18NBoundMessage3P(Messages.VERSION_MISMATCH, clientVersion, serverVersion, inUser)); } // Use client to carry out authentication. return ClientManager.getInstance().isCredentialsMatch(inUser, inPassword); } /**
paramTypes.length != inParameters.length))) { throw new ModuleCreationException(new I18NBoundMessage3P( Messages.CANNOT_CREATE_MODULE_WRONG_PARAM_NUM, inProviderURN.toString(), paramTypes.length,
returnValue = get(i); } else { throw new ModuleNotFoundException(new I18NBoundMessage3P( Messages.MULTIPLE_MODULES_MATCH_URN, inURN.getValue(),
parameters[1]); case 3 : return new I18NBoundMessage3P((I18NMessage3P)message, parameters[0], parameters[1],
throw new FeedException(new I18NBoundMessage3P(Messages.UNSUPPORTED_ASSET_CLASS, String.valueOf(this), inTokenSpec.getDataRequest().getAssetClass(),
throw new ModuleStateException(new I18NBoundMessage3P( Messages.MODULE_NOT_STOPPED_STATE_INCORRECT, inModule.getURN().toString(), state,
throw new ModuleStateException(new I18NBoundMessage3P( Messages.DELETE_FAILED_MODULE_STATE_INCORRECT, inModuleURN.toString(), module.getState(),
ModuleState state = inRequester.getState(); if (!(state.canRequestFlows())) { throw new ModuleStateException(new I18NBoundMessage3P( Messages.DATAFLOW_FAILED_REQ_MODULE_STATE_INCORRECT, inRequester.getURN().toString(), state, throw new ModuleStateException(new I18NBoundMessage3P( Messages.DATAFLOW_FAILED_PCPT_MODULE_STATE_INCORRECT, module.getURN().toString(),
throw new ModuleStateException(new I18NBoundMessage3P( Messages.MODULE_NOT_STARTED_STATE_INCORRECT, inModule.getURN().toString(), state,