All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.easywsdl.extensions.wsdl4bpel.impl.RoleImpl Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2008-2012 EBM WebSourcing, 2012-2018 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the New BSD License (3-clause license).
 *
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the New BSD License (3-clause license)
 * for more details.
 *
 * You should have received a copy of the New BSD License (3-clause license)
 * along with this program/library; If not, see http://directory.fsf.org/wiki/License:BSD_3Clause/
 * for the New BSD License (3-clause license).
 */
 
package org.ow2.easywsdl.extensions.wsdl4bpel.impl;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import javax.xml.namespace.QName;

import org.ow2.easywsdl.extensions.wsdl4bpel.api.PartnerLinkType;
import org.ow2.easywsdl.extensions.wsdl4bpel.api.Role;
import org.ow2.easywsdl.extensions.wsdl4bpel.org.oasis_open.docs.wsbpel._2_0.plnktype.TRole;
import org.ow2.easywsdl.wsdl.api.InterfaceType;
import org.ow2.easywsdl.wsdl.api.WSDLException;
import org.ow2.easywsdl.wsdl.api.abstractElmt.AbstractWSDLElementImpl;

/** 
 * @author Nicolas Salatge - EBM WebSourcing
 */
public class RoleImpl extends AbstractWSDLElementImpl implements Role {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static Logger log = Logger.getLogger(RoleImpl.class.getName());


	private PartnerLinkType pltParent = null;

	public RoleImpl(final TRole role, final PartnerLinkType pltParent) {
		super(role, (AbstractWSDLElementImpl) pltParent);
		this.pltParent = pltParent;
	}

	public InterfaceType getInterface() {
		InterfaceType itf = ((PartnerLinkTypeImpl)this.pltParent).getDescription().getInterface(this.model.getPortType());
		if(itf == null) {
			log.finest("No interface correspond to:" + this.model.getPortType());
		}
		return itf;
	}

	public void setInterface(InterfaceType itf){
		if( itf != null ){
			this.model.setPortType(itf.getQName());
		}else{
			this.model.setPortType(null);
		}

	}


	public String getName() {
		return this.model.getName();
	}

	public void setName(String name) {
		this.model.setName(name);
	}

	@Override
	public Map getOtherAttributes() throws WSDLException {
		return this.model.getOtherAttributes();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy