public List<AdminObject> getAdminObjectsByClass(String adminObjectClass) { List<AdminObject> adminObjects = new ArrayList<AdminObject>(); Iterator i = getAdminObjects().iterator(); while (i.hasNext()) { AdminObject ao = (AdminObject) i.next(); if (adminObjectClass.equals(ao.getAdminObjectClass())) adminObjects.add(ao); } return adminObjects; }
public List<AdminObject> getAdminObjectsByType(String type) { List<AdminObject> adminObjects = new ArrayList<AdminObject>(); Iterator i = getAdminObjects().iterator(); while (i.hasNext()) { AdminObject ao = (AdminObject) i.next(); if (type.equals(ao.getAdminObjectInterface())) adminObjects.add(ao); } return adminObjects; }
public List<AdminObject> getAdminObjectsByType(String type) { List<AdminObject> adminObjects = new ArrayList<AdminObject>(); Iterator i = getAdminObjects().iterator(); while (i.hasNext()) { AdminObject ao = (AdminObject) i.next(); if (type.equals(ao.getAdminObjectInterface())) adminObjects.add(ao); } return adminObjects; }
private boolean isAdminObjectJavaBean(Class adminObjectClass, ConnectorDescriptor desc) { boolean isAdminObject = false; Set adminObjects = desc.getAdminObjects(); Iterator adminObjectsItr = adminObjects.iterator(); while(adminObjectsItr.hasNext()){ AdminObject adminObject = (AdminObject)adminObjectsItr.next(); if(adminObject.getAdminObjectClass().equals(adminObjectClass.getName())){ isAdminObject = true; break; } } return isAdminObject; }
public AdminObject getAdminObject(String adminObjectInterface, String adminObjectClass){ Iterator i = getAdminObjects().iterator(); while (i.hasNext()) { AdminObject ao = (AdminObject) i.next(); if (adminObjectInterface.equals(ao.getAdminObjectInterface()) && adminObjectClass.equals(ao.getAdminObjectClass())) return ao; } return null; }
public AdminObject getAdminObject(String adminObjectInterface, String adminObjectClass){ Iterator i = getAdminObjects().iterator(); while (i.hasNext()) { AdminObject ao = (AdminObject) i.next(); if (adminObjectInterface.equals(ao.getAdminObjectInterface()) && adminObjectClass.equals(ao.getAdminObjectClass())) return ao; } return null; }
/** * gets the adminObjectInterfaceNames pertaining to a rar. * * @param desc ConnectorDescriptor pertaining to rar. * @return Array of AdminObjectInterface names as Strings * @throws ConnectorRuntimeException if parsing fails */ public String[] getAdminObjectInterfaceNames(ConnectorDescriptor desc) throws ConnectorRuntimeException { if (desc == null) { throw new ConnectorRuntimeException("Invalid arguments"); } Set adminObjectSet = desc.getAdminObjects(); if (adminObjectSet == null || adminObjectSet.size() == 0) { return null; } String[] adminObjectInterfaceNames = new String[adminObjectSet.size()]; Iterator it = adminObjectSet.iterator(); AdminObject aor = null; for (int i = 0; it.hasNext(); ++i) { aor = (AdminObject) it.next(); adminObjectInterfaceNames[i] = aor.getAdminObjectInterface(); } return adminObjectInterfaceNames; }
/** * {@inheritDoc} */ public boolean hasAdminObject(ConnectorDescriptor desc, String intfName, String className) throws ConnectorRuntimeException { if (desc == null || intfName == null || className == null) { throw new ConnectorRuntimeException("Invalid arguments"); } Set adminObjectSet = desc.getAdminObjects(); if (adminObjectSet == null || adminObjectSet.size() == 0) { return false; } Iterator it = adminObjectSet.iterator(); AdminObject aor = null; for (int i = 0; it.hasNext(); ++i) { aor = (AdminObject) it.next(); if(aor.getAdminObjectInterface().equals(intfName) && aor.getAdminObjectClass().equals(className)){ return true; } } return false; }
Set adminObjectSet = desc.getAdminObjects(); if (adminObjectSet == null || adminObjectSet.size() == 0) { return null;
private void processAdminObjectInterface(String adminObjectClassName, String adminObjectInterfaceName, ConnectorDescriptor desc) { Set ddAdminObjects = desc.getAdminObjects(); //merge DD and annotation values of admin-objects //merge involves simple union boolean ignore = false; for (Object o : ddAdminObjects) { AdminObject ddAdminObject = (AdminObject) o; if (ddAdminObject.getAdminObjectInterface().equals(adminObjectInterfaceName) && ddAdminObject.getAdminObjectClass().equals(adminObjectClassName)) { ignore = true; break; } } if (!ignore) { AdminObject ao = new AdminObject(adminObjectInterfaceName, adminObjectClassName); desc.addAdminObject(ao); }else{ if(logger.isLoggable(Level.FINEST)){ logger.log(Level.FINEST,"Ignoring administered object annotation " + "[ "+adminObjectInterfaceName+"," + adminObjectClassName + "] as it is already defined "); } } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, Descriptor descriptor) { if (! (descriptor instanceof ConnectorDescriptor)) { throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass()); } //adminObject info for (Iterator adminObjects = ((ConnectorDescriptor)descriptor).getAdminObjects().iterator(); adminObjects.hasNext();) { AdminObject adminObject = (AdminObject) adminObjects.next(); Node adminObjectNode = appendChild(parent, ConnectorTagNames.ADMIN_OBJECT); appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_INTERFACE, adminObject.getAdminObjectInterface()); appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_CLASS, adminObject.getAdminObjectClass()); ConfigPropertyNode config = new ConfigPropertyNode(); adminObjectNode = config.writeDescriptor(adminObjectNode, adminObject); } return parent; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, Descriptor descriptor) { if (! (descriptor instanceof ConnectorDescriptor)) { throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass()); } //adminObject info for (Iterator adminObjects = ((ConnectorDescriptor)descriptor).getAdminObjects().iterator(); adminObjects.hasNext();) { AdminObject adminObject = (AdminObject) adminObjects.next(); Node adminObjectNode = appendChild(parent, ConnectorTagNames.ADMIN_OBJECT); appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_INTERFACE, adminObject.getAdminObjectInterface()); appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_CLASS, adminObject.getAdminObjectClass()); ConfigPropertyNode config = new ConfigPropertyNode(); adminObjectNode = config.writeDescriptor(adminObjectNode, adminObject); } return parent; } }
/** * {@inheritDoc} */ public boolean handles(ConnectorDescriptor cd, String moduleName) { boolean canHandle = false; boolean adminObjectsDefined = false; Set adminObjects = cd.getAdminObjects(); if (adminObjects != null && adminObjects.size() > 0) { adminObjectsDefined = true; } /* this class can handle Connector 1.0 Spec. compliant RAR criteria for 1.0 RAR : * No inbound artifacts * No admin-objects * There should be only one connection-definition * RA Class should not be present (equivalent to "") */ if(!cd.getInBoundDefined() && !adminObjectsDefined && (cd.getOutBoundDefined() && cd.getOutboundResourceAdapter().getConnectionDefs().size() < 2 && "".equals(cd.getResourceAdapterClass())) ){ canHandle = true; } return canHandle; }
/** * {@inheritDoc} */ public boolean handles(ConnectorDescriptor cd, String moduleName) { boolean adminObjectsDefined = false; Set adminObjects = cd.getAdminObjects(); if (adminObjects != null && adminObjects.size() > 0) { adminObjectsDefined = true; } /* this class can handle Connector 1.5 Spec. compliant RAR that has no inbound artifacts criteria for 1.5 RAR : * No inbound artifacts * Any one of the following conditions hold true : * -> admin object is defined or * -> resource-adapter-class is defined or * -> more than one connection-definition is defined. */ boolean canHandle = false; if(!cd.getInBoundDefined()){ if(cd.getOutBoundDefined() && cd.getOutboundResourceAdapter().getConnectionDefs().size() > 1){ canHandle = true; }else if (adminObjectsDefined){ canHandle = true; }else if(!cd.getResourceAdapterClass().equals("")){ canHandle = true; } } return canHandle; }
Set adminObjectSet = desc.getAdminObjects(); if (adminObjectSet == null || adminObjectSet.size() == 0) { return null;
Set adminObjects = desc.getAdminObjects(); Iterator adminObjectItr = adminObjects.iterator(); while(adminObjectItr.hasNext()){
Set adminObjects = desc.getAdminObjects(); Iterator it = adminObjects.iterator(); while (it.hasNext()) {