private static String getConfigId(OMElement configEl) { String configId = configEl.getAttributeValue(new QName(DBSFields.ID)); if (configId == null) { configId = DBConstants.DEFAULT_CONFIG_ID; } return configId; }
/** * {@inheritDoc} */ protected String getArtifactName(OMElement artifactDefinition) { return artifactDefinition.getAttributeValue(new QName("name")); }
/** * {@inheritDoc} */ protected String getArtifactName(OMElement artifactDefinition) { return artifactDefinition.getAttributeValue(new QName("name")); }
/** * This method will check the given OMElement represent either a static property or not * * @param property - OMElement to be checked for the static property * @return boolean true if the elemet represents a static property element false otherwise */ public static boolean isStaticProperty(OMElement property) { return "property".equals(property.getLocalName().toLowerCase()) && (property.getAttributeValue(new QName("expression")) == null); }
private void setParameter(Endpoint endpoint, OMElement paramEle) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { String name = paramEle.getAttributeValue(new QName("name")); String value = paramEle.getText(); PropertyHelper.setInstanceProperty(name, value, endpoint); } }
/** * Get the HREF ID from the givem element if exists. * * @param element * to get HREF id from * @return id or empty string if not found */ public static String getHrefId(OMElement element) { return ((element != null) && (element.getAttribute(HREF) != null)) ? element .getAttributeValue(HREF).substring(1) : ""; }
private static PatternValidator getPatternValidator(OMElement valEl) { String regEx = valEl.getAttributeValue(new QName(DBSFields.PATTERN)); PatternValidator validator = new PatternValidator(regEx); return validator; }
public void setStates(OMElement locationConfiguration) throws RegistryException { Iterator confElements = locationConfiguration.getChildElements(); while (confElements.hasNext()) { OMElement confElement = (OMElement)confElements.next(); if (confElement.getQName().equals(new QName("state"))) { states.put(confElement.getAttributeValue(new QName("key")), confElement.getText()); } } }
public static PermissionsBean createPermissionBean(OMElement permChild) { PermissionsBean permBean = new PermissionsBean(); permBean.setForEvent(permChild.getAttributeValue(new QName(LifecycleConstants.FOR_EVENT))); if (permChild.getAttributeValue(new QName("roles")) != null) permBean.setRoles(Arrays.asList(permChild.getAttributeValue(new QName("roles")) .split(","))); return permBean; }
public static EventTrigger createEventTrigger(DataService dataService, OMElement eventEl) throws DataServiceFault { String language = eventEl.getAttributeValue(new QName(DBSFields.LANGUAGE)); /* default language is 'XPath' */ if (language == null || language.equals(EventTriggerLanguages.XPATH)) { return createXPathEventTrigger(dataService, eventEl); } else { return null; } }
/** * This method will check the given OMElement represent either a static property or not * * @param property - OMElement to be checked for the static property * @return boolean true if the elemet represents a static property element false otherwise */ public static boolean isStaticProperty(OMElement property) { return "property".equals(property.getLocalName().toLowerCase()) && (property.getAttributeValue(new QName("expression")) == null); }
HandlerDescription makeHandler(OMElement handlerElement) { String name = handlerElement.getAttributeValue(new QName("name")); QName qname = handlerElement.resolveQName(name); HandlerDescription desc = new HandlerDescription(qname.getLocalPart()); String className = handlerElement.getAttributeValue(new QName("class")); desc.setClassName(className); return desc; }
public static AcknowledgmentRange fromOM(OMElement omElement) throws RMMessageBuildingException { String rmNamespace = omElement.getNamespace().getNamespaceURI(); long upperLimit = Long.parseLong(omElement.getAttributeValue(new QName(null, MercuryConstants.UPPER))); long lowerLimit = Long.parseLong(omElement.getAttributeValue(new QName(null, MercuryConstants.LOWER))); AcknowledgmentRange acknowledgmentRange = new AcknowledgmentRange(rmNamespace); acknowledgmentRange.setUpper(upperLimit); acknowledgmentRange.setLower(lowerLimit); return acknowledgmentRange; }
private void populatePropertyName(BeanMediator mediator, OMElement elem) { String attributeValue; attributeValue = elem.getAttributeValue(new QName(BeanConstants.PROPERTY)); if (attributeValue != null) { mediator.setPropertyName(attributeValue); } else { handleException("'property' attribute of Bean mediator is required when " + "SET/GET_PROPERTY action is set."); } }
@Override public final String getAttributeValue(QName name) { try { return getAxiomElement().getAttributeValue(name); } catch (OMException ex) { throw new AxiomSoapElementException(ex); } }
public static void addEndpoint(String backEndUrl, String sessionCookie, OMElement endpointConfig) throws Exception { EndPointAdminClient endPointAdminClient = new EndPointAdminClient(backEndUrl, sessionCookie); endPointAdminClient.addEndPoint(endpointConfig); String ep = endpointConfig.getAttributeValue(new QName(NAME)); assertTrue(isEndpointDeployed(backEndUrl, sessionCookie, ep), ep + "Endpoint deployment not found or time out"); }
public static void addScheduleTask(String backEndUrl, String sessionCookie, OMElement taskDescription) throws TaskManagementException, RemoteException { TaskAdminClient taskAdminClient = new TaskAdminClient(backEndUrl, sessionCookie); taskAdminClient.addTask(taskDescription); assertTrue(isScheduleTaskDeployed(backEndUrl, sessionCookie, taskDescription.getAttributeValue(new QName("name"))), "ScheduleTask deployment failed" ); }
public Phase makePhase(OMElement phaseElement) throws PhaseException { String phaseName = phaseElement.getAttributeValue(new QName("name")); Phase phase = new Phase(phaseName); Iterator children = phaseElement.getChildElements(); while (children.hasNext()) { OMElement handlerElement = (OMElement) children.next(); HandlerDescription handlerDesc = makeHandler(handlerElement); phase.addHandler(handlerDesc); } return phase; }
private void populateGetPropertyCase(BeanMediator mediator, OMElement elem) { mediator.setAction(BeanMediator.Action.GET_PROPERTY); populatePropertyName(mediator, elem); if (elem.getAttributeValue(new QName(BeanConstants.TARGET)) != null) { mediator.setTarget(new Target(BeanConstants.TARGET, elem)); } else { handleException("'target' attribute of Bean mediator is required when 'GET_PROPERTY' " + "action is set."); } }
private void populateSetPropertyCase(BeanMediator mediator, OMElement elem) { mediator.setAction(BeanMediator.Action.SET_PROPERTY); populatePropertyName(mediator, elem); if (elem.getAttributeValue(ATT_VALUE) != null) { mediator.setValue(new ValueFactory().createValue(BeanConstants.VALUE, elem)); } else { handleException("'value' attribute of Bean mediator is required when 'SET_PROPERTY' " + "action is set."); } }