public static ConnectorSchemaImpl parse(Element element, String shortDesc, PrismContext prismContext) throws SchemaException { return new ConnectorSchemaImpl(element, shortDesc, prismContext); }
@Override public Collection<ObjectClassComplexTypeDefinition> getObjectClassDefinitions() { return getDefinitions(ObjectClassComplexTypeDefinition.class); }
private ConnectorSchemaImpl(Element element, String shortDesc, PrismContext prismContext) throws SchemaException { super(prismContext); parseThis(element, true, shortDesc, prismContext); }
public static ConnectorSchema getConnectorSchema(PrismObject<ConnectorType> connector, PrismContext prismContext) throws SchemaException { Element connectorXsdSchema = ConnectorTypeUtil.getConnectorXsdSchema(connector); if (connectorXsdSchema == null) { return null; } Object userDataEntry = connector.getUserData(USER_DATA_KEY_PARSED_CONNECTOR_SCHEMA); if (userDataEntry != null) { if (userDataEntry instanceof ConnectorSchema) { return (ConnectorSchema)userDataEntry; } else { throw new IllegalStateException("Expected ConnectorSchema under user data key "+ USER_DATA_KEY_PARSED_CONNECTOR_SCHEMA + "in "+connector+", but got "+userDataEntry.getClass()); } } else { //InternalMonitor.recordConnectorSchemaParse(); ConnectorSchemaImpl parsedSchema = ConnectorSchemaImpl.parse(connectorXsdSchema, "connector schema of "+connector, prismContext); if (parsedSchema == null) { throw new IllegalStateException("Parsed schema is null: most likely an internall error"); } parsedSchema.setUsualNamespacePrefix(ConnectorSchemaImpl.retrieveUsualNamespacePrefix(connector.asObjectable())); connector.setUserData(USER_DATA_KEY_PARSED_CONNECTOR_SCHEMA, parsedSchema); return parsedSchema; } }
@Override public ObjectClassComplexTypeDefinition findObjectClassDefinition(QName qName) { ComplexTypeDefinition complexTypeDefinition = findComplexTypeDefinition(qName); if (complexTypeDefinition == null) { return null; } if (complexTypeDefinition instanceof ObjectClassComplexTypeDefinition) { return (ObjectClassComplexTypeDefinition)complexTypeDefinition; } else { throw new IllegalStateException("Expected the definition "+qName+" to be of type "+ ObjectClassComplexTypeDefinition.class+" but it was "+complexTypeDefinition.getClass()); } }