FileDocCategorySizeDatePackage
ConnectorDescriptor.javaAPI DocGlassfish v2 API27931Fri May 04 22:31:20 BST 2007None

ConnectorDescriptor

public class ConnectorDescriptor extends BundleDescriptor
Deployment Information for connector
author
Tony Ng
author
Qingqing Ouyang

Fields Summary
private boolean
isDirty
private String
displayName
private String
connectorDescription
private String
largeIcon
private String
smallIcon
private String
vendorName
private String
eisType
private String
resourceAdapterVersion
private LicenseDescriptor
licenseDescriptor
private Set
configProperties
private Set
authMechanisms
private Set
securityPermissions
private String
managedConnectionFactoryImpl
private int
transactionSupport
private boolean
reauthenticationSupport
private String
connectionInterface
private String
connectionClass
private String
connectionFactoryInterface
private String
connectionFactoryClass
private String
resourceAdapterClass
private EnvironmentProperty
configProperty
private OutboundResourceAdapter
outboundRA
private InboundResourceAdapter
inboundRA
private Set
adminObjects
private String
inboundResourceAdapterClass
private Set
messageListeners
private com.sun.enterprise.deployment.runtime.connector.SunConnector
sunConnector
START Deployment Consolidation to Suppport Multiple Deployment API Clients Member Variable: sunConnector Methods: setSunDescriptor, getSunDescriptor
Constructors Summary
public ConnectorDescriptor()

    //connector1.5 end
    
    // following are all the get and set methods for the 
    // various variables listed above

      
        this.configProperties = new OrderedSet();
	this.authMechanisms = new OrderedSet();
	this.securityPermissions = new OrderedSet();
	this.adminObjects = new OrderedSet();

        //FIXME.  need to remove the following
	this.messageListeners = new OrderedSet();
    
Methods Summary
public voidaddAdminObject(AdminObject admin)
set admin object

        this.adminObjects.add(admin);
        this.setDirty();
        this.changed();
    
public booleanaddAuthMechanism(AuthMechanism mech)

deprecated

        throw new UnsupportedOperationException();
    
public booleanaddAuthMechanism(int mech)

deprecated

        throw new UnsupportedOperationException();
    
public voidaddConfigProperty(EnvironmentProperty configProperty)
add a configProperty to the set

	this.configProperties.add(configProperty);
        this.setDirty();
        this.changed();
    
public voidaddSecurityPermission(SecurityPermission permission)
Add a SecurityPermission object to the set

	this.securityPermissions.add(permission);
	this.setDirty();
	this.changed();
    
private java.lang.StringBufferappendConfigProperties(java.util.Set props, java.lang.StringBuffer buf)

        buf.append("\n------------");
        for (Iterator i = props.iterator(); i.hasNext();)
        {
            EnvironmentProperty config = (EnvironmentProperty) i.next();
            buf.append("[Name : " + config.getName() + "], ");
            buf.append("[Value: " + config.getValue() + "], ");
            buf.append("[Type : " + config.getType() + "]");
        }
        buf.append("\n------------");
        return buf;
    
voiddoneOpening()

	this.isDirty = false;
	this.changed();
    
voiddoneSaving()

	this.isDirty = false;
	this.changed();
    
public AdminObjectgetAdminObjectByType(java.lang.String type)

        Iterator i = getAdminObjects().iterator();
        while (i.hasNext())
        {
            AdminObject ao = (AdminObject) i.next();
            if (type.equals(ao.getAdminObjectInterface()))
                return ao;
        }
        
        return null;
    
public java.util.SetgetAdminObjects()

return
admin objects

        return this.adminObjects;
    
public java.util.SetgetAuthMechanisms()

deprecated

        throw new UnsupportedOperationException();
    
public java.util.SetgetConfigProperties()
Set of EnvironmentProperty

        return configProperties;
    
public ConnectionDefDescriptorgetConnectionDefinitionByCFType(java.lang.String type)

        return getConnectionDefinitionByCFType(type, true);
    
public ConnectionDefDescriptorgetConnectionDefinitionByCFType(java.lang.String type, boolean useDefault)

        Iterator it = this.outboundRA.getConnectionDefs().iterator();
        while (it.hasNext())
        {
            ConnectionDefDescriptor desc = (ConnectionDefDescriptor) it.next();
            
            if (type == null)
            {
                if (useDefault 
                        && this.outboundRA.getConnectionDefs().size() == 1)
                    return desc;
                else
                    return null;
            }
                    
            if (desc.getConnectionFactoryIntf().equals(type))
                return desc;
        }
        return null;
    
public java.lang.StringgetConnectionFactoryImpl()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetConnectionFactoryInterface()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetConnectionImpl()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetConnectionInterface()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetConnectorDescription()
get the connector description

        return connectorDescription;
    
public java.lang.StringgetDefaultSpecVersion()

return
the default version of the deployment descriptor loaded by this descriptor

        return ConnectorNode.SPEC_VERSION;
    
public java.lang.StringgetDeployName()
return name used for deployment

	return getModuleDescriptor().getArchiveUri();
    
public java.lang.StringgetEisType()
get eisType

        return eisType;
    
public booleangetInBoundDefined()

        return inboundRA != null;
    
public InboundResourceAdaptergetInboundResourceAdapter()

        return this.inboundRA;
    
public LicenseDescriptorgetLicenseDescriptor()

        return licenseDescriptor;
    
public java.lang.StringgetManagedConnectionFactoryImpl()

deprecated

        throw new UnsupportedOperationException();
    
public javax.enterprise.deploy.shared.ModuleTypegetModuleType()

return
the module type for this bundle descriptor

        return ModuleType.RAR;
    
public intgetNumOfSupportedCFs()

        return outboundRA.getConnectionDefs().size();
    
public booleangetOutBoundDefined()

	return outboundRA != null;
    
public OutboundResourceAdaptergetOutboundResourceAdapter()

        return this.outboundRA;
    
public java.lang.StringgetReauthenticationSupport()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetResourceAdapterClass()

        return resourceAdapterClass;
    
public java.lang.StringgetResourceAdapterVersion()
get value for resourceadapter version (1.5 schema

        return resourceAdapterVersion;
    
public java.util.SetgetSecurityPermissions()
Set of SecurityPermission objects

        if (securityPermissions == null) {
            securityPermissions = new OrderedSet();
        }
        return securityPermissions;
    
public java.util.SetgetServiceReferenceDescriptors()

return
a set of service-ref from this bundle or null if none

        return new OrderedSet();
    
public com.sun.enterprise.deployment.runtime.connector.SunConnectorgetSunDescriptor()
This returns the extra ejb sun specific info not in the RI DID.

return
object representation of connector deployment descriptor

 
    
                               
      
        return sunConnector;
    
public MessageListenergetSupportedMessageListener(java.lang.String type)

param
type message listener type

        if (this.inboundRA == null) {
            return null; 
        }
        
        Iterator i = this.inboundRA.getMessageListeners().iterator();
        while (i.hasNext()) {
            MessageListener l = (MessageListener) i.next();
            if ((l.getMessageListenerType()).equals(type)) {
                return l;
            }
        }
        return null;
    
public java.lang.StringgetTransSupport()

deprecated

        throw new UnsupportedOperationException();
    
public intgetTransactionSupport()

deprecated

        throw new UnsupportedOperationException();
    
public java.lang.StringgetVendorName()
get value for vendorName

        return vendorName;
    
public java.lang.StringgetVersion()
get value for version

        //return version;
        throw new UnsupportedOperationException();
    
public booleanhasAdminObjects()

        return adminObjects.size() > 0;
    
public booleanisDirty()
A flag to indicate that my data has changed since the last save.

	return this.isDirty;
    
public booleanisMessageListenerSupported(java.lang.String type)

deprecated

        throw new UnsupportedOperationException();
    
public voidprint(java.lang.StringBuffer toStringBuffer)
A formatted string representing my state.

        StringBuffer buf = toStringBuffer;
        super.print(buf);
        
	buf.append("\n displayName : " + super.getName());
	buf.append("\n connector_description : " + connectorDescription);
	buf.append("\n smallIcon : " + super.getSmallIconUri());
	buf.append("\n largeIcon : " + super.getLargeIconUri());
	buf.append("\n vendorName : " + vendorName);
	buf.append("\n eisType : " + eisType);
	//buf.append("\n version : " + version);
	buf.append("\n resourceadapter version : " + resourceAdapterVersion);

        //license info
        if (getLicenseDescriptor() != null) {
 	    buf.append("\n license_description : " + getLicenseDescriptor().getDescription());
       	    buf.append("\n licenseRequired : " + getLicenseDescriptor().getLicenseRequiredValue());
        }

	buf.append("\n resourceAdapterClass : " + resourceAdapterClass);

	buf.append("\n resourceAdapterClass [" + resourceAdapterClass 
                + "] config properties :");
        appendConfigProperties(this.configProperties, buf);
            
        if (this.outboundRA == null)
            buf.append("\n Outbound Resource Adapter NOT available");
        else
        {
            buf.append("\n Outbound Resource Adapter Info : ");

            buf.append("\n connection-definitions: ");
            for (Iterator i = this.outboundRA.getConnectionDefs().iterator(); 
                 i.hasNext();)
            {
                buf.append("\n------------\n");

                ConnectionDefDescriptor conDef = 
                    (ConnectionDefDescriptor) i.next();
                buf.append("MCF : " 
                        + conDef.getManagedConnectionFactoryImpl() + ", ");
                buf.append("\n MCF [" + 
                        conDef.getManagedConnectionFactoryImpl() 
                        + "] config properties :");
                appendConfigProperties(conDef.getConfigProperties(), buf);
                
                buf.append("[CF Interface : " 
                        + conDef.getConnectionFactoryIntf() + "], ");
                buf.append("[CF Class : " 
                        + conDef.getConnectionFactoryImpl() + "], ");
                buf.append("[Connection Interface : " 
                        + conDef.getConnectionIntf() + "], ");
                buf.append("[Connection Class : " 
                        + conDef.getConnectionImpl() + "] ");
                
                buf.append("\n------------\n");
            }

            buf.append("\n transaction-support : " 
                    + this.outboundRA.getTransSupport());
            
            buf.append("\n authentication-mechanism: ");
            for (Iterator i = this.outboundRA.getAuthMechanisms().iterator(); 
                 i.hasNext();) 
            {
                AuthMechanism conf = (AuthMechanism) i.next(); 
                buf.append("\n------------\n");
                buf.append("[Type : " + conf.getAuthMechType() + "], ");
                buf.append("[Interface : " 
                        + conf.getCredentialInterface() + "]");
                buf.append("\n------------" );
            }

            buf.append("\n reauthenticate-support : " 
                    + this.outboundRA.getReauthenticationSupport());

            buf.append("\n security-permission : "); 
            for (Iterator i = 
                     getSecurityPermissions().iterator(); 
                 i.hasNext();) 
            {
                SecurityPermission conf = (SecurityPermission) i.next(); 
                buf.append("\n------------\n");
                buf.append("[persmission : " + conf.getPermission() + "], ");
                buf.append("[discription : " + conf.getDescription() + "]");
                buf.append("\n------------" );
            }

        } //outbound resourceadapter

        if (this.inboundRA == null)
            buf.append("\n Inbound Resource Adapter NOT available");
        else
        {
            buf.append("\n Inbound Resource Adapter Info : ");
            
            buf.append("\n Message Listeners Info : ");
            for (Iterator i = this.inboundRA.getMessageListeners().iterator();
                 i.hasNext();)
            {
                buf.append("\n------------\n");
                MessageListener l = (MessageListener) i.next();
                buf.append("[Type : " + l.getMessageListenerType() + "], ");
                buf.append("[AS Class : " + l.getActivationSpecClass() + "]");
                buf.append("\n------------ ");
            }
            
        } //inbound resourceadapter
        
        
        if (this.adminObjects.size() == 0)
            buf.append("\n Admin Objects NOT available");
        else
        {
            buf.append("\n Admin Objects Info : ");
            for (Iterator i = this.adminObjects.iterator(); i.hasNext();)
            {
                buf.append("\n------------\n");
                AdminObject a = (AdminObject) i.next();
                buf.append("[Type : " + a.getAdminObjectInterface() + "], ");
                buf.append("[Class : " + a.getAdminObjectClass() + "]");
                appendConfigProperties(a.getConfigProperties(), buf);
                buf.append("\n------------ ");
            }
            
        } //admin objects
        
    
private static voidprintEntry(java.util.zip.ZipEntry e)

        DOLUtils.getDefaultLogger().log(Level.FINE, e.getName());
    
public voidremoveAdminObject(AdminObject admin)

        this.adminObjects.remove(admin);
        this.setDirty();
        this.changed();
    
public booleanremoveAuthMechanism(AuthMechanism mech)

deprecated

        throw new UnsupportedOperationException();
    
public booleanremoveAuthMechanism(int mech)

deprecated

        throw new UnsupportedOperationException();
    
public voidremoveConfigProperty(EnvironmentProperty configProperty)
remove a configProperty from the set

	this.configProperties.remove(configProperty);
        this.setDirty();
        this.changed();
    
public voidremoveSecurityPermission(SecurityPermission permission)
Remove a SecurityPermission object to the set

	this.securityPermissions.remove(permission);
	this.setDirty();
	this.changed();
    
public voidsetConnectionFactoryImpl(java.lang.String connectionFactoryImpl)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetConnectionFactoryInterface(java.lang.String connectionFactoryInterface)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetConnectionImpl(java.lang.String connectionImpl)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetConnectionInterface(java.lang.String connectionInterface)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetConnectorDescription(java.lang.String description)
set the connector description

        this.connectorDescription = description;
	this.setDirty();
        this.changed();
    
public voidsetDescription(java.lang.String description)
override 'setDescription' to set 'dirty' flag

	this.setDirty();
	super.setDescription(description);
    
private voidsetDirty()

        this.isDirty = true;
    
public voidsetEisType(java.lang.String eisType)
set eisType

        this.eisType = eisType;
	this.setDirty();
        this.changed();
    
public voidsetInboundResourceAdapter(InboundResourceAdapter inboundRA)

        this.inboundRA = inboundRA;
    
public voidsetLargeIconUri(java.lang.String largeIconUri)
override 'setLargeIconUri' to set 'dirty' flag

	this.setDirty();
	super.setLargeIconUri(largeIconUri);
    
public voidsetLicenseDescriptor(LicenseDescriptor licenseDescriptor)

        this.licenseDescriptor = licenseDescriptor;
        this.setDirty();
        this.changed();
    
public voidsetManagedConnectionFactoryImpl(java.lang.String managedConnectionFactoryImpl)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetName(java.lang.String name)
override 'setName' to set 'dirty' flag

	if (!this.getName().equals(name)) {
	    this.setDirty();
	    super.setName(name);
	}
    
public voidsetOutboundResourceAdapter(OutboundResourceAdapter outboundRA)

        this.outboundRA = outboundRA;
    
public voidsetReauthenticationSupport(boolean reauthenticationSupport)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetReauthenticationSupport(java.lang.String reauthSupport)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetResourceAdapterClass(java.lang.String raClass)

        this.resourceAdapterClass = raClass;
        this.setDirty();
        this.changed();
    
public voidsetResourceAdapterVersion(java.lang.String resourceAdapterVersion)
set value for resourceadater version (1.5 schema)

        this.resourceAdapterVersion = resourceAdapterVersion;
	this.setDirty();
        this.changed();
    
public voidsetSmallIconUri(java.lang.String smallIconUri)
override 'setSmallIconUri' to set 'dirty' flag

	this.setDirty();
	super.setSmallIconUri(smallIconUri);
    
public voidsetSpecVersion(java.lang.String specVersion)
set value for specVersion

        super.setSpecVersion(specVersion);
	this.setDirty();
        this.changed();        

    
public voidsetSunDescriptor(com.sun.enterprise.deployment.runtime.connector.SunConnector connector)
This sets the extra connector sun specific info not in the RI DID.

param
connector SunConnector object representation of connector deployment descriptor

        this.sunConnector = connector;
    
public voidsetTransactionSupport(int transactionSupport)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetTransactionSupport(java.lang.String support)

deprecated

        throw new UnsupportedOperationException();
    
public voidsetVendorName(java.lang.String vendorName)
set value for vendorName

        this.vendorName = vendorName;
	this.setDirty();
        this.changed();
    
public voidsetVersion(java.lang.String version)
set value for version

        /*this.version = version;
	this.setDirty();
        this.changed();*/
        throw new UnsupportedOperationException();
    
public booleansupportsReauthentication()

deprecated

        throw new UnsupportedOperationException();
    
public voidvisit(com.sun.enterprise.deployment.util.DescriptorVisitor aVisitor)
visit the descriptor and all sub descriptors with a DOL visitor implementation

param
a visitor to traverse the descriptors

        if (aVisitor instanceof ConnectorVisitor) {
            visit((ConnectorVisitor) aVisitor);
        } else {
            super.visit(aVisitor);
        }
    
public voidvisit(com.sun.enterprise.deployment.util.ConnectorVisitor aVisitor)
visit the descriptor and all sub descriptors with a DOL visitor implementation

param
a visitor to traverse the descriptors

        aVisitor.accept(this);