/******************************************************************************* * Copyright (c) 2004, 2007-2008 IBM Corporation and Cambridge Semantics Incorporated. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * File: $Source$ * Created by: Generated Source from org.openanzo.jdbc.utils.opgen.jet * Created on: Generated Source from org.openanzo.jdbc.utils.opgen.jet * Revision: $Id$ * * Contributors: * IBM Corporation - initial API and implementation * Cambridge Semantics Incorporated - Fork to Anzo *******************************************************************************/ package org.openanzo.ontologies.system; /** * Implementation of {@link org.openanzo.ontologies.system.Datasource} * Use the org.openanzo.ontologies.system.SystemFactory to create instances of this class. * <p>(URI: http://openanzo.org/ontologies/2008/07/System#Datasource)</p> * <br> */ public class DatasourceImpl extends org.openanzo.rdf.jastor.ThingImpl implements org.openanzo.ontologies.system.Datasource { private ThingStatementListener _listener = null; protected static final org.openanzo.rdf.URI credentialsProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#credentials"); protected static final org.openanzo.rdf.URI classNameProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#className"); protected static final org.openanzo.rdf.URI enabledProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#enabled"); protected static final org.openanzo.rdf.URI initOrderProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#initOrder"); protected static final org.openanzo.rdf.URI dependencyProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#dependency"); protected static final org.openanzo.rdf.URI uriPatternProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#uriPattern"); protected static final org.openanzo.rdf.URI enableCachingProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#enableCaching"); protected static final org.openanzo.rdf.URI enableIndexingProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#enableIndexing"); protected static final org.openanzo.rdf.URI isPrimaryProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#isPrimary"); protected static final org.openanzo.rdf.URI resetEnabledProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#resetEnabled"); protected static final org.openanzo.rdf.URI authorizationRuleProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#authorizationRule"); protected static final org.openanzo.rdf.URI datasourceCapabilityProperty = org.openanzo.rdf.jastor.ThingFactory.valueFactory.createURI("http://openanzo.org/ontologies/2008/07/System#datasourceCapability"); DatasourceImpl(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { super(resource, namedGraphUri, dataset); _listener = new ThingStatementListener(); } static DatasourceImpl getDatasource(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { if(namedGraphUri==null||!dataset.containsNamedGraph(namedGraphUri) ){ namedGraphUri=null; for(org.openanzo.rdf.Statement stmt:dataset.find(resource, org.openanzo.rdf.vocabulary.RDF.TYPE, Datasource.TYPE)){ namedGraphUri=stmt.getNamedGraphUri(); } if(namedGraphUri==null)return null; } return new DatasourceImpl(resource, namedGraphUri, dataset); } static DatasourceImpl createDatasource(org.openanzo.rdf.Resource resource,org.openanzo.rdf.URI namedGraphUri, org.openanzo.rdf.IDataset dataset) throws org.openanzo.rdf.jastor.JastorException { DatasourceImpl impl = new DatasourceImpl(resource, namedGraphUri,dataset); if (!impl._dataset.contains(impl._resource, org.openanzo.rdf.vocabulary.RDF.TYPE, Datasource.TYPE, namedGraphUri)) impl._dataset.add(impl._resource, org.openanzo.rdf.vocabulary.RDF.TYPE, Datasource.TYPE, namedGraphUri); impl.addSuperTypes(); impl.addHasValueValues(); return impl; } void addSuperTypes() { if (!_dataset.contains(_resource, org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.ontologies.system.Component.TYPE,_graph.getNamedGraphUri())) _dataset.add(_resource, org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.ontologies.system.Component.TYPE,_graph.getNamedGraphUri()); } void addHasValueValues() { } public java.util.Collection<org.openanzo.rdf.Statement> listStatements() { java.util.Collection<org.openanzo.rdf.Statement> list = new java.util.HashSet<org.openanzo.rdf.Statement>(); list.addAll(_dataset.find(_resource, credentialsProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, classNameProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, enabledProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, initOrderProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, dependencyProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, uriPatternProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, enableCachingProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, enableIndexingProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, isPrimaryProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, resetEnabledProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, authorizationRuleProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, datasourceCapabilityProperty, null, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.ontologies.system.Datasource.TYPE, _graph.getNamedGraphUri())); list.addAll(_dataset.find(_resource, org.openanzo.rdf.vocabulary.RDF.TYPE, org.openanzo.ontologies.system.Component.TYPE, _graph.getNamedGraphUri())); return list; } /** * Clears all values for 'credentials'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearCredentials(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, credentialsProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#credentials public org.openanzo.ontologies.system.Credentials getCredentials(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> result = null; result=_dataset.find(includeEntireDataset, _resource, credentialsProperty, null,_graph.getNamedGraphUri()); if(result.isEmpty()) return null; org.openanzo.rdf.Statement statement = result.iterator().next(); if (statement == null) return null; if (!((statement.getObject() instanceof org.openanzo.rdf.URI)||(statement.getObject() instanceof org.openanzo.rdf.BlankNode))) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": credentials getProperty() in org.openanzo.ontologies.system.Datasource model not Resource", statement.getObject()); org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); return org.openanzo.ontologies.system.SystemFactory.getCredentials(resource,(includeEntireDataset)?null:_graph.getNamedGraphUri(),_dataset); } public org.openanzo.ontologies.system.Credentials getCredentials() throws org.openanzo.rdf.jastor.JastorException { return getCredentials(false); } public void setCredentials(org.openanzo.ontologies.system.Credentials credentials) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, credentialsProperty, null,_graph.getNamedGraphUri()); if (credentials != null) { _dataset.add(_resource, credentialsProperty, credentials.resource(),_graph.getNamedGraphUri()); } } public org.openanzo.ontologies.system.Credentials setCredentials() throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, credentialsProperty, null,_graph.getNamedGraphUri()); org.openanzo.ontologies.system.Credentials credentials = org.openanzo.ontologies.system.SystemFactory.createCredentials(org.openanzo.rdf.jastor.ThingFactory.valueFactory.createBNode(),_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, credentialsProperty, credentials.resource(),_graph.getNamedGraphUri()); return credentials; } public org.openanzo.ontologies.system.Credentials setCredentials(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { if (_dataset.contains(_resource, credentialsProperty, null,_graph.getNamedGraphUri())) { _dataset.remove(_resource, credentialsProperty, null,_graph.getNamedGraphUri()); } org.openanzo.ontologies.system.Credentials credentials = org.openanzo.ontologies.system.SystemFactory.getCredentials(resource,_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, credentialsProperty, credentials.resource(),_graph.getNamedGraphUri()); return credentials; } /** * Clears all values for 'className'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearClassName(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, classNameProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#className public java.lang.String getClassName(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, classNameProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": className getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#string"); if (!(obj instanceof java.lang.String)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal className in Datasource is not of type java.lang.String", literal); return (java.lang.String)obj; } public java.lang.String getClassName() throws org.openanzo.rdf.jastor.JastorException { return getClassName(false); } public void setClassName(java.lang.String className) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, classNameProperty, null,_graph.getNamedGraphUri()); if (className != null) { org.openanzo.rdf.Literal _literal = getLiteral(className,"http://www.w3.org/2001/XMLSchema#string"); _dataset.add(_resource, classNameProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'enabled'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearEnabled(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, enabledProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#enabled public java.lang.Boolean getEnabled(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, enabledProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": enabled getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#boolean"); if (!(obj instanceof java.lang.Boolean)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal enabled in Datasource is not of type java.lang.Boolean", literal); return (java.lang.Boolean)obj; } public java.lang.Boolean getEnabled() throws org.openanzo.rdf.jastor.JastorException { return getEnabled(false); } public void setEnabled(java.lang.Boolean enabled) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, enabledProperty, null,_graph.getNamedGraphUri()); if (enabled != null) { org.openanzo.rdf.Literal _literal = getLiteral(enabled,"http://www.w3.org/2001/XMLSchema#boolean"); _dataset.add(_resource, enabledProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'initOrder'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearInitOrder(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, initOrderProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#initOrder public java.lang.Integer getInitOrder(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, initOrderProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": initOrder getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#int"); if (!(obj instanceof java.lang.Integer)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal initOrder in Datasource is not of type java.lang.Integer", literal); return (java.lang.Integer)obj; } public java.lang.Integer getInitOrder() throws org.openanzo.rdf.jastor.JastorException { return getInitOrder(false); } public void setInitOrder(java.lang.Integer initOrder) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, initOrderProperty, null,_graph.getNamedGraphUri()); if (initOrder != null) { org.openanzo.rdf.Literal _literal = getLiteral(initOrder,"http://www.w3.org/2001/XMLSchema#int"); _dataset.add(_resource, initOrderProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'dependency'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearDependency(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, dependencyProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#dependency // generating range: http://jastor.adtech.ibm.com/defaultRange org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.Component> propertyCollectionDependency = new org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.Component>() { public org.openanzo.ontologies.system.Component getPropertyValue(org.openanzo.rdf.Value resource) { try { return org.openanzo.ontologies.system.SystemFactory.getComponent((org.openanzo.rdf.Resource)resource,_graph.getNamedGraphUri(),dataset()); } catch (org.openanzo.rdf.jastor.JastorException e) { throw new java.util.NoSuchElementException(e.getMessage()); } } }; /** * * @param includeEntireDataset * @return collection of org.openanzo.ontologies.system.Component * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.Component> getDependency(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { return propertyCollectionDependency.getPropertyCollection(_dataset, _graph, _resource,dependencyProperty, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/System#Component"), includeEntireDataset); } /** * * @return collection of org.openanzo.ontologies.system.Component not including entire dataset during search * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.Component> getDependency() throws org.openanzo.rdf.jastor.JastorException { return getDependency(false); } /** * * @param dependency value to add * @throws org.openanzo.rdf.jastor.JastorException */ public void addDependency(org.openanzo.ontologies.system.Component dependency) throws org.openanzo.rdf.jastor.JastorException { _dataset.add(_resource, dependencyProperty,dependency.resource(),_graph.getNamedGraphUri()); } /** * Add anonymous object * @return generated object * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.Component addDependency() throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.Component dependency = org.openanzo.ontologies.system.SystemFactory.createComponent(org.openanzo.rdf.jastor.ThingFactory.valueFactory.createBNode(),_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, dependencyProperty,dependency.resource(),_graph.getNamedGraphUri()); return dependency; } /** * Add resource * @param resource resource to add * @return jastor object for resource * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.Component addDependency(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.Component dependency = org.openanzo.ontologies.system.SystemFactory.getComponent(resource,_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, dependencyProperty,dependency.resource(),_graph.getNamedGraphUri()); return dependency; } /** * Remove object * @param dependency object to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeDependency(org.openanzo.ontologies.system.Component dependency) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, dependencyProperty, dependency.resource(),_graph.getNamedGraphUri())) return; _dataset.remove(_resource, dependencyProperty, dependency.resource(),_graph.getNamedGraphUri()); } /** * Remove resource * @param resource resource to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeDependency(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, dependencyProperty, resource,_graph.getNamedGraphUri())) return; _dataset.remove(_resource, dependencyProperty, resource,_graph.getNamedGraphUri()); } /** * Clears all values for 'uriPattern'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearUriPattern(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, uriPatternProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#uriPattern org.openanzo.rdf.jastor.PropertyCollection<java.lang.String> propertyCollectionUriPattern = new org.openanzo.rdf.jastor.PropertyCollection<java.lang.String>() { public java.lang.String getPropertyValue(org.openanzo.rdf.Value value) { if(value instanceof org.openanzo.rdf.Literal){ org.openanzo.rdf.Literal literal = (org.openanzo.rdf.Literal)value; return getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#string"); }else{ throw new org.openanzo.rdf.jastor.InvalidNodeException (uri() + ": One of the http://openanzo.org/ontologies/2008/07/System#uriPattern properties in Datasource model not a Literal",value); } } }; public java.util.Collection<java.lang.String> getUriPattern(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { return propertyCollectionUriPattern.getPropertyCollection(_dataset, _graph, _resource,uriPatternProperty, org.openanzo.rdf.MemURI.create("http://www.w3.org/2001/XMLSchema#string"), includeEntireDataset); } public java.util.Collection<java.lang.String> getUriPattern() throws org.openanzo.rdf.jastor.JastorException { return getUriPattern(false); } public void addUriPattern(java.lang.String uriPattern) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.Literal _literal = getLiteral(uriPattern,"http://www.w3.org/2001/XMLSchema#string"); //if (_dataset.contains(_resource, uriPatternProperty,_literal,_graph.getNamedGraphUri())) // return; if (uriPattern != null) { _dataset.add(_resource, uriPatternProperty,_literal,_graph.getNamedGraphUri()); } } public void removeUriPattern(java.lang.String uriPattern) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.rdf.Literal _literal = getLiteral(uriPattern,"http://www.w3.org/2001/XMLSchema#string"); if (!_dataset.contains(_resource, uriPatternProperty, _literal,_graph.getNamedGraphUri())) return; _dataset.remove(_resource, uriPatternProperty, _literal,_graph.getNamedGraphUri()); } /** * Clears all values for 'enableCaching'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearEnableCaching(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, enableCachingProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#enableCaching public java.lang.Boolean getEnableCaching(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, enableCachingProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": enableCaching getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#boolean"); if (!(obj instanceof java.lang.Boolean)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal enableCaching in Datasource is not of type java.lang.Boolean", literal); return (java.lang.Boolean)obj; } public java.lang.Boolean getEnableCaching() throws org.openanzo.rdf.jastor.JastorException { return getEnableCaching(false); } public void setEnableCaching(java.lang.Boolean enableCaching) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, enableCachingProperty, null,_graph.getNamedGraphUri()); if (enableCaching != null) { org.openanzo.rdf.Literal _literal = getLiteral(enableCaching,"http://www.w3.org/2001/XMLSchema#boolean"); _dataset.add(_resource, enableCachingProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'enableIndexing'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearEnableIndexing(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, enableIndexingProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#enableIndexing public java.lang.Boolean getEnableIndexing(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, enableIndexingProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": enableIndexing getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#boolean"); if (!(obj instanceof java.lang.Boolean)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal enableIndexing in Datasource is not of type java.lang.Boolean", literal); return (java.lang.Boolean)obj; } public java.lang.Boolean getEnableIndexing() throws org.openanzo.rdf.jastor.JastorException { return getEnableIndexing(false); } public void setEnableIndexing(java.lang.Boolean enableIndexing) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, enableIndexingProperty, null,_graph.getNamedGraphUri()); if (enableIndexing != null) { org.openanzo.rdf.Literal _literal = getLiteral(enableIndexing,"http://www.w3.org/2001/XMLSchema#boolean"); _dataset.add(_resource, enableIndexingProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'isPrimary'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearIsPrimary(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, isPrimaryProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#isPrimary public java.lang.Boolean getIsPrimary(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, isPrimaryProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": isPrimary getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#boolean"); if (!(obj instanceof java.lang.Boolean)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal isPrimary in Datasource is not of type java.lang.Boolean", literal); return (java.lang.Boolean)obj; } public java.lang.Boolean getIsPrimary() throws org.openanzo.rdf.jastor.JastorException { return getIsPrimary(false); } public void setIsPrimary(java.lang.Boolean isPrimary) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, isPrimaryProperty, null,_graph.getNamedGraphUri()); if (isPrimary != null) { org.openanzo.rdf.Literal _literal = getLiteral(isPrimary,"http://www.w3.org/2001/XMLSchema#boolean"); _dataset.add(_resource, isPrimaryProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'resetEnabled'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearResetEnabled(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, resetEnabledProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#resetEnabled public java.lang.Boolean getResetEnabled(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { java.util.Collection<org.openanzo.rdf.Statement> __valIter =null; __valIter =_dataset.find(includeEntireDataset, _resource, resetEnabledProperty, null,_graph.getNamedGraphUri()); if(__valIter.isEmpty()) return null; org.openanzo.rdf.Statement statement = __valIter.iterator().next(); if (statement == null) return null; if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) throw new org.openanzo.rdf.jastor.InvalidNodeException(uri() + ": resetEnabled getProperty() in org.openanzo.ontologies.system.Datasource model not Literal", statement.getObject()); org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = getLiteralValue(literal, "http://www.w3.org/2001/XMLSchema#boolean"); if (!(obj instanceof java.lang.Boolean)) throw new org.openanzo.rdf.jastor.InvalidLiteralException (this.uri() + ": Literal resetEnabled in Datasource is not of type java.lang.Boolean", literal); return (java.lang.Boolean)obj; } public java.lang.Boolean getResetEnabled() throws org.openanzo.rdf.jastor.JastorException { return getResetEnabled(false); } public void setResetEnabled(java.lang.Boolean resetEnabled) throws org.openanzo.rdf.jastor.JastorException { _dataset.remove(_resource, resetEnabledProperty, null,_graph.getNamedGraphUri()); if (resetEnabled != null) { org.openanzo.rdf.Literal _literal = getLiteral(resetEnabled,"http://www.w3.org/2001/XMLSchema#boolean"); _dataset.add(_resource, resetEnabledProperty, _literal,_graph.getNamedGraphUri()); } } /** * Clears all values for 'authorizationRule'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearAuthorizationRule(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, authorizationRuleProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#authorizationRule // generating range: http://jastor.adtech.ibm.com/defaultRange org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.AuthorizationRule> propertyCollectionAuthorizationRule = new org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.AuthorizationRule>() { public org.openanzo.ontologies.system.AuthorizationRule getPropertyValue(org.openanzo.rdf.Value resource) { try { return org.openanzo.ontologies.system.SystemFactory.getAuthorizationRule((org.openanzo.rdf.Resource)resource,_graph.getNamedGraphUri(),dataset()); } catch (org.openanzo.rdf.jastor.JastorException e) { throw new java.util.NoSuchElementException(e.getMessage()); } } }; /** * * @param includeEntireDataset * @return collection of org.openanzo.ontologies.system.AuthorizationRule * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.AuthorizationRule> getAuthorizationRule(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { return propertyCollectionAuthorizationRule.getPropertyCollection(_dataset, _graph, _resource,authorizationRuleProperty, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/System#AuthorizationRule"), includeEntireDataset); } /** * * @return collection of org.openanzo.ontologies.system.AuthorizationRule not including entire dataset during search * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.AuthorizationRule> getAuthorizationRule() throws org.openanzo.rdf.jastor.JastorException { return getAuthorizationRule(false); } /** * * @param authorizationRule value to add * @throws org.openanzo.rdf.jastor.JastorException */ public void addAuthorizationRule(org.openanzo.ontologies.system.AuthorizationRule authorizationRule) throws org.openanzo.rdf.jastor.JastorException { _dataset.add(_resource, authorizationRuleProperty,authorizationRule.resource(),_graph.getNamedGraphUri()); } /** * Add anonymous object * @return generated object * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.AuthorizationRule addAuthorizationRule() throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.AuthorizationRule authorizationRule = org.openanzo.ontologies.system.SystemFactory.createAuthorizationRule(org.openanzo.rdf.jastor.ThingFactory.valueFactory.createBNode(),_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, authorizationRuleProperty,authorizationRule.resource(),_graph.getNamedGraphUri()); return authorizationRule; } /** * Add resource * @param resource resource to add * @return jastor object for resource * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.AuthorizationRule addAuthorizationRule(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.AuthorizationRule authorizationRule = org.openanzo.ontologies.system.SystemFactory.getAuthorizationRule(resource,_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, authorizationRuleProperty,authorizationRule.resource(),_graph.getNamedGraphUri()); return authorizationRule; } /** * Remove object * @param authorizationRule object to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeAuthorizationRule(org.openanzo.ontologies.system.AuthorizationRule authorizationRule) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, authorizationRuleProperty, authorizationRule.resource(),_graph.getNamedGraphUri())) return; _dataset.remove(_resource, authorizationRuleProperty, authorizationRule.resource(),_graph.getNamedGraphUri()); } /** * Remove resource * @param resource resource to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeAuthorizationRule(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, authorizationRuleProperty, resource,_graph.getNamedGraphUri())) return; _dataset.remove(_resource, authorizationRuleProperty, resource,_graph.getNamedGraphUri()); } /** * Clears all values for 'datasourceCapability'. * @param includeEntireDataset Delete the properties from the entire dataset, and not just the namedgraph * @throws org.openanzo.rdf.jastor.JastorException */ @SuppressWarnings("all") public void clearDatasourceCapability(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException{ _dataset.remove(_resource, datasourceCapabilityProperty, null,(includeEntireDataset)?null:_graph.getNamedGraphUri()); } // generating for property: http://openanzo.org/ontologies/2008/07/System#datasourceCapability // generating range: http://jastor.adtech.ibm.com/defaultRange org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.DatasourceCapability> propertyCollectionDatasourceCapability = new org.openanzo.rdf.jastor.PropertyCollection<org.openanzo.ontologies.system.DatasourceCapability>() { public org.openanzo.ontologies.system.DatasourceCapability getPropertyValue(org.openanzo.rdf.Value resource) { try { return org.openanzo.ontologies.system.SystemFactory.getDatasourceCapability((org.openanzo.rdf.Resource)resource,_graph.getNamedGraphUri(),dataset()); } catch (org.openanzo.rdf.jastor.JastorException e) { throw new java.util.NoSuchElementException(e.getMessage()); } } }; /** * * @param includeEntireDataset * @return collection of org.openanzo.ontologies.system.DatasourceCapability * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.DatasourceCapability> getDatasourceCapability(boolean includeEntireDataset) throws org.openanzo.rdf.jastor.JastorException { return propertyCollectionDatasourceCapability.getPropertyCollection(_dataset, _graph, _resource,datasourceCapabilityProperty, org.openanzo.rdf.MemURI.create("http://openanzo.org/ontologies/2008/07/System#DatasourceCapability"), includeEntireDataset); } /** * * @return collection of org.openanzo.ontologies.system.DatasourceCapability not including entire dataset during search * @throws org.openanzo.rdf.jastor.JastorException */ public java.util.Collection<org.openanzo.ontologies.system.DatasourceCapability> getDatasourceCapability() throws org.openanzo.rdf.jastor.JastorException { return getDatasourceCapability(false); } /** * * @param datasourceCapability value to add * @throws org.openanzo.rdf.jastor.JastorException */ public void addDatasourceCapability(org.openanzo.ontologies.system.DatasourceCapability datasourceCapability) throws org.openanzo.rdf.jastor.JastorException { _dataset.add(_resource, datasourceCapabilityProperty,datasourceCapability.resource(),_graph.getNamedGraphUri()); } /** * Add anonymous object * @return generated object * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.DatasourceCapability addDatasourceCapability() throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.DatasourceCapability datasourceCapability = org.openanzo.ontologies.system.SystemFactory.createDatasourceCapability(org.openanzo.rdf.jastor.ThingFactory.valueFactory.createBNode(),_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, datasourceCapabilityProperty,datasourceCapability.resource(),_graph.getNamedGraphUri()); return datasourceCapability; } /** * Add resource * @param resource resource to add * @return jastor object for resource * @throws org.openanzo.rdf.jastor.JastorException */ public org.openanzo.ontologies.system.DatasourceCapability addDatasourceCapability(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { org.openanzo.ontologies.system.DatasourceCapability datasourceCapability = org.openanzo.ontologies.system.SystemFactory.getDatasourceCapability(resource,_graph.getNamedGraphUri(),_dataset); _dataset.add(_resource, datasourceCapabilityProperty,datasourceCapability.resource(),_graph.getNamedGraphUri()); return datasourceCapability; } /** * Remove object * @param datasourceCapability object to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeDatasourceCapability(org.openanzo.ontologies.system.DatasourceCapability datasourceCapability) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, datasourceCapabilityProperty, datasourceCapability.resource(),_graph.getNamedGraphUri())) return; _dataset.remove(_resource, datasourceCapabilityProperty, datasourceCapability.resource(),_graph.getNamedGraphUri()); } /** * Remove resource * @param resource resource to remove * @throws org.openanzo.rdf.jastor.JastorException */ public void removeDatasourceCapability(org.openanzo.rdf.Resource resource) throws org.openanzo.rdf.jastor.JastorException { if (!_dataset.contains(_resource, datasourceCapabilityProperty, resource,_graph.getNamedGraphUri())) return; _dataset.remove(_resource, datasourceCapabilityProperty, resource,_graph.getNamedGraphUri()); } protected java.util.concurrent.CopyOnWriteArraySet<DatasourceListener> listeners = new java.util.concurrent.CopyOnWriteArraySet<DatasourceListener>(); public void registerListener(org.openanzo.rdf.jastor.ThingListener listener) { if (!(listener instanceof DatasourceListener)) { throw new org.openanzo.rdf.jastor.JastorException("Listener class not of proper type"); } if(listeners.size()==0){ _dataset.registerListener(_listener); } DatasourceListener list = (DatasourceListener)listener; if(!listeners.contains(list)){ listeners.add(list); } } public void unregisterListener(org.openanzo.rdf.jastor.ThingListener listener) { if (!(listener instanceof DatasourceListener)) { throw new org.openanzo.rdf.jastor.JastorException("Listener class not of proper type"); } DatasourceListener list = (DatasourceListener)listener; if(listeners.contains(list)){ listeners.remove(list); } if(listeners.size()==0){ _dataset.unregisterListener(_listener); } } protected class ThingStatementListener implements org.openanzo.rdf.IStatementListener<org.openanzo.rdf.IDataset> { public void statementsAdded(org.openanzo.rdf.IDataset dataset, org.openanzo.rdf.Statement...statements) { for(org.openanzo.rdf.Statement statement:statements){ if (statement.getSubject().equals(resource())){ if (statement.getPredicate().equals(credentialsProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; for(DatasourceListener listener : listeners){ listener.credentialsChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(classNameProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.classNameChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(enabledProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.enabledChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(initOrderProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.initOrderChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(dependencyProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.Component _dependency = org.openanzo.ontologies.system.SystemFactory.getComponent(resource,_graph.getNamedGraphUri(),dataset()); if (_dependency != null) { for(DatasourceListener listener : listeners){ listener.dependencyAdded(org.openanzo.ontologies.system.DatasourceImpl.this,_dependency); } } } if (statement.getPredicate().equals(uriPatternProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = org.openanzo.rdf.utils.StatementUtils.getNativeValue(literal); if (obj instanceof java.lang.String) { for(DatasourceListener listener : listeners){ listener.uriPatternAdded(org.openanzo.ontologies.system.DatasourceImpl.this,(java.lang.String)obj); } } } if (statement.getPredicate().equals(enableCachingProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.enableCachingChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(enableIndexingProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.enableIndexingChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(isPrimaryProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.isPrimaryChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(resetEnabledProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners){ listener.resetEnabledChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } } if (statement.getPredicate().equals(authorizationRuleProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.AuthorizationRule _authorizationRule = org.openanzo.ontologies.system.SystemFactory.getAuthorizationRule(resource,_graph.getNamedGraphUri(),dataset()); if (_authorizationRule != null) { for(DatasourceListener listener : listeners){ listener.authorizationRuleAdded(org.openanzo.ontologies.system.DatasourceImpl.this,_authorizationRule); } } } if (statement.getPredicate().equals(datasourceCapabilityProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.DatasourceCapability _datasourceCapability = org.openanzo.ontologies.system.SystemFactory.getDatasourceCapability(resource,_graph.getNamedGraphUri(),dataset()); if (_datasourceCapability != null) { for(DatasourceListener listener : listeners){ listener.datasourceCapabilityAdded(org.openanzo.ontologies.system.DatasourceImpl.this,_datasourceCapability); } } } }} } public void statementsRemoved(org.openanzo.rdf.IDataset dataset, org.openanzo.rdf.Statement...statements) { for(org.openanzo.rdf.Statement statement:statements){ if (statement.getSubject().equals(resource())){ if (statement.getPredicate().equals(credentialsProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; for(DatasourceListener listener : listeners){ listener.credentialsChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(classNameProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.classNameChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(enabledProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.enabledChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(initOrderProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.initOrderChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(dependencyProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.Component _dependency = org.openanzo.ontologies.system.SystemFactory.getComponent(resource,_graph.getNamedGraphUri(),dataset()); if (_dependency != null) { for(DatasourceListener listener : listeners){ listener.dependencyRemoved(org.openanzo.ontologies.system.DatasourceImpl.this,_dependency); } } return; } if (statement.getPredicate().equals(uriPatternProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; org.openanzo.rdf.Literal literal=(org.openanzo.rdf.Literal)statement.getObject(); Object obj = org.openanzo.rdf.utils.StatementUtils.getNativeValue(literal); if (obj instanceof java.lang.String) { for(DatasourceListener listener : listeners){ listener.uriPatternRemoved(org.openanzo.ontologies.system.DatasourceImpl.this,(java.lang.String)obj); } } return; } if (statement.getPredicate().equals(enableCachingProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.enableCachingChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(enableIndexingProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.enableIndexingChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(isPrimaryProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.isPrimaryChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(resetEnabledProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Literal)) return; for(DatasourceListener listener : listeners) { listener.resetEnabledChanged(org.openanzo.ontologies.system.DatasourceImpl.this); } return; } if (statement.getPredicate().equals(authorizationRuleProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.AuthorizationRule _authorizationRule = org.openanzo.ontologies.system.SystemFactory.getAuthorizationRule(resource,_graph.getNamedGraphUri(),dataset()); if (_authorizationRule != null) { for(DatasourceListener listener : listeners){ listener.authorizationRuleRemoved(org.openanzo.ontologies.system.DatasourceImpl.this,_authorizationRule); } } return; } if (statement.getPredicate().equals(datasourceCapabilityProperty)) { if (!(statement.getObject() instanceof org.openanzo.rdf.Resource)) return; org.openanzo.rdf.Resource resource = (org.openanzo.rdf.Resource)statement.getObject(); org.openanzo.ontologies.system.DatasourceCapability _datasourceCapability = org.openanzo.ontologies.system.SystemFactory.getDatasourceCapability(resource,_graph.getNamedGraphUri(),dataset()); if (_datasourceCapability != null) { for(DatasourceListener listener : listeners){ listener.datasourceCapabilityRemoved(org.openanzo.ontologies.system.DatasourceImpl.this,_datasourceCapability); } } return; } } }} } }