public boolean updateRange(ReadGraph g, IForwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" UpdateMethodFactory.updateRange");
+ LOGGER.trace(" UpdateMethodFactory.updateRange");
try {
return (Boolean)method.invoke(rangeElement, g, domainElement);
} catch (Exception e) {
}
private void createDomain(WriteGraph g, Link<Domain,Range> link) throws MappingException {
- LOGGER.info(" createDomain for " + link.rangeElement);
+ LOGGER.trace(" createDomain for " + link.rangeElement);
ILinkType<Domain,Range> type = schema.linkTypeOfRangeElement(link.rangeElement);
Domain domainElement = type.createDomainElement(g, link.rangeElement);
link.type = type;
@Override
public synchronized Collection<Domain> updateDomain(WriteGraph g) throws MappingException {
- LOGGER.info("Mapping.updateDomain");
+ LOGGER.trace("Mapping.updateDomain");
RangeToDomain map = new RangeToDomain(g);
ArrayList<Domain> updated = new ArrayList<Domain>();
while(!modifiedRangeLinks.isEmpty()) {
- LOGGER.info(" modifiedRangeLinks.size() = " + modifiedRangeLinks.size());
+ LOGGER.trace(" modifiedRangeLinks.size() = " + modifiedRangeLinks.size());
Link<Domain,Range> link = modifiedRangeLinks.remove(modifiedRangeLinks.size()-1);
link.rangeModified = false;
@Override
public synchronized Collection<Range> updateRange(ReadGraph g) throws MappingException {
- LOGGER.info("Mapping.updateRange");
+ LOGGER.trace("Mapping.updateRange");
DomainToRange map = new DomainToRange(g);
ArrayList<Range> updated = new ArrayList<Range>();
while(!modifiedDomainLinks.isEmpty()) {
- LOGGER.info(" modifiedDomainLinks.size() = " + modifiedDomainLinks.size());
+ LOGGER.trace(" modifiedDomainLinks.size() = " + modifiedDomainLinks.size());
Link<Domain,Range> link = modifiedDomainLinks.remove(modifiedDomainLinks.size()-1);
link.domainModified = false;
void domainModified(Link<Domain,Range> link) {
if(!link.domainModified) {
synchronized(modifiedDomainLinks) {
- LOGGER.info(" domainModified for " + link.rangeElement);
+ LOGGER.trace(" domainModified for " + link.rangeElement);
link.domainModified = true;
modifiedDomainLinks.add(link);
if(modifiedDomainLinks.size() == 1) {
public boolean updateDomain(WriteGraph g, IBackwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" MappedElementRule.updateDomain");
+ LOGGER.trace(" MappedElementRule.updateDomain");
Range value = rangeAccessor.get(rangeElement);
Domain mappedValue = value == null ? null : map.inverseMap(g, value);//map.inverseGet(value);
return domainAccessor.set(g, domainElement, mappedValue);
public boolean updateRange(ReadGraph g, IForwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" MappedElementRule.updateRange");
+ LOGGER.trace(" MappedElementRule.updateRange");
Domain value = domainAccessor.get(g, domainElement);
Range mappedValue = value == null ? null : map.map(g, value);////map.get(value);
return rangeAccessor.set(rangeElement, mappedValue);
public boolean updateDomain(WriteGraph g, IBackwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" MappedElementsRule.updateDomain");
+ LOGGER.trace(" MappedElementsRule.updateDomain");
// Snapshot the accessed range value for concurrency safety.
// NOTE: still assumes that the accessed collection is concurrent or
// synchronized for toArray to be atomic.
public boolean updateRange(ReadGraph g, IForwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" MappedElementsRule.updateRange");
+ LOGGER.trace(" MappedElementsRule.updateRange");
Collection<Domain> value = domainAccessor.get(g, domainElement);
ArrayList<Range> mappedValue = new ArrayList<Range>(value.size());
for(Domain r : value)
public boolean updateDomain(WriteGraph g, IBackwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" ValueRule.updateDomain");
+ LOGGER.trace(" ValueRule.updateDomain");
Object value = rangeAccessor.get(rangeElement);
return domainAccessor.set(g, domainElement, value);
}
public boolean updateRange(ReadGraph g, IForwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" ValueRule.updateRange");
+ LOGGER.trace(" ValueRule.updateRange");
Object value = domainAccessor.get(g, domainElement);
return rangeAccessor.set(rangeElement, value);
}
public Object get(ReadGraph g, Resource element) throws MappingException {
try {
Layer0 l0 = Layer0.getInstance(g);
- LOGGER.info(" CompoundValueAccessor.get");
+ LOGGER.trace(" CompoundValueAccessor.get");
Collection<Statement> coll = g.getStatements(element, objRelation);
Map<String,Object> map = new HashMap<String, Object>();
for (Statement c : coll) {
throws MappingException {
try {
Layer0 l0 = Layer0.getInstance(g);
- LOGGER.info(" CompoundValueAccessor.set");
+ LOGGER.trace(" CompoundValueAccessor.set");
@SuppressWarnings("unchecked")
Map<String,Object> values = (Map<String, Object>)v;
@Override
public Collection<Resource> get(ReadGraph g, Resource element) throws MappingException {
try {
- LOGGER.info(" LinkdedListAccessor.get");
+ LOGGER.trace(" LinkdedListAccessor.get");
return ListUtils.toList(g, g.getPossibleObject(element, relation));
} catch (DatabaseException e) {
throw new MappingException(e);
public boolean set(WriteGraph g, Resource element, Collection<Resource> value)
throws MappingException {
try {
- LOGGER.info(" LinkdedListAccessor.set");
+ LOGGER.trace(" LinkdedListAccessor.set");
return MappingUtils.synchronizeList(g, element, relation, listType, new ArrayList<Resource>(value), deleteExtraObjects);
} catch (DatabaseException e) {
throw new MappingException(e);
while(true) {
int cmp = currentObjects[i].compareTo(objects[j]);
if(cmp < 0) {
- LOGGER.info(" remove statement");
+ LOGGER.trace(" remove statement");
if(deleteExtraObjects)
g.deny(currentObjects[i]);
else
break;
}
else if(cmp > 0) {
- LOGGER.info(" add statement");
+ LOGGER.trace(" add statement");
g.claim(subject, predicate, objects[j]);
modified = true;
++j;
@Override
public Resource get(ReadGraph g, Resource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.get");
+ LOGGER.trace(" RelatedObjectAccessor.get");
return g.getPossibleObject(element, relation);
} catch (DatabaseException e) {
throw new MappingException(e);
public boolean set(WriteGraph g, Resource element, Resource value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.set");
+ LOGGER.trace(" RelatedObjectAccessor.set");
Resource resource = g.getPossibleObject(element, relation);
if(resource == null) {
if(value == null)
@Override
public Collection<Resource> get(ReadGraph g, Resource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.get");
+ LOGGER.trace(" RelatedObjectsAccessor.get");
return g.getObjects(element, relation);
} catch (DatabaseException e) {
throw new MappingException(e);
public boolean set(WriteGraph g, Resource element, Collection<Resource> value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.set");
+ LOGGER.trace(" RelatedObjectsAccessor.set");
return MappingUtils.synchronizeStatements(g, element, relation,
value.toArray(new Resource[value.size()]), deleteExtraObjects);
} catch (DatabaseException e) {
@Override
public Collection<Resource> get(ReadGraph g, Resource element) throws MappingException {
try {
- LOGGER.info(" RelatedOrderedSetElementsAccessor.get");
+ LOGGER.trace(" RelatedOrderedSetElementsAccessor.get");
return OrderedSetUtils.toList(g, element);
} catch (DatabaseException e) {
throw new MappingException(e);
public boolean set(WriteGraph g, Resource element, Collection<Resource> value)
throws MappingException {
try {
- LOGGER.info(" RelatedOrderedSetElementsAccessor.set");
+ LOGGER.trace(" RelatedOrderedSetElementsAccessor.set");
return OrderedSetUtils.set(g, element, value);
// FIXME Implement deleteExtraObjects
} catch (DatabaseException e) {
@Override
public Object get(ReadGraph g, Resource element) throws MappingException {
try {
- LOGGER.info(" RelatedValueAccessor.get");
+ LOGGER.trace(" RelatedValueAccessor.get");
Resource valueResource = g.getPossibleObject(element, relation);
if(valueResource == null)
return null;
public boolean set(WriteGraph g, Resource element, Object value)
throws MappingException {
try {
- LOGGER.info(" RelatedValueAccessor.set");
+ LOGGER.trace(" RelatedValueAccessor.set");
Statement valueStatement = g.getPossibleStatement(element, relation);
if(valueStatement == null) {
if(value == null)
@SuppressWarnings("unchecked")
T result = (T)field.get(element);
- if(LOGGER.isInfoEnabled())
- LOGGER.info(" FieldAccessor.get " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace(" FieldAccessor.get " +
field.getName() + " -> " + result
);
try {
Object currentValue = field.get(element);
- if(LOGGER.isInfoEnabled())
- LOGGER.info(" FieldAccessor.set " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace(" FieldAccessor.set " +
field.getName() + " " + currentValue +
" -> " + value
);
throws MappingException {
try {
String typeUri = (String)typeGetter.invoke(rangeElement, (Object[]) null);
- if(LOGGER.isInfoEnabled())
- LOGGER.info("SimpleLinkType.createDomainElement " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace("SimpleLinkType.createDomainElement " +
rangeElement.toString()
);
Resource actualDomainType = g.getResource(typeUri);
public Range createRangeElement(ReadGraph g, Resource domainElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.createRangeElement " +
+ LOGGER.trace("SimpleLinkType.createRangeElement " +
NameUtils.getSafeName(g, domainElement)
);
} catch(DatabaseException e) {
public Resource createDomainElement(org.simantics.db.WriteGraph g, Range rangeElement) throws org.simantics.objmap.exceptions.MappingException {
try {
- if(LOGGER.isInfoEnabled())
- LOGGER.info("SimpleLinkType.createDomainElement " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace("SimpleLinkType.createDomainElement " +
rangeElement.toString()
);
Resource result = OrderedSetUtils.create(g, domainType);
public Resource createDomainElement(WriteGraph g, Range rangeElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
- LOGGER.info("SimpleLinkType.createDomainElement " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace("SimpleLinkType.createDomainElement " +
rangeElement.toString()
);
Resource result = g.newResource();
public Range createRangeElement(ReadGraph g, Resource domainElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.createRangeElement " +
+ LOGGER.trace("SimpleLinkType.createRangeElement " +
NameUtils.getSafeName(g, domainElement)
);
} catch(DatabaseException e) {
};
public boolean updateDomain(WriteGraph g, IBackwardMapping<Resource,Range> map, Resource domainElement, Range rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateDomain " +
+ LOGGER.trace("SimpleLinkType.updateDomain " +
NameUtils.getSafeName(g, domainElement) + " " +
rangeElement.toString()
);
public boolean updateRange(ReadGraph g, IForwardMapping<Resource,Range> map, Resource domainElement, Range rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateRange " +
+ LOGGER.trace("SimpleLinkType.updateRange " +
NameUtils.getSafeName(g, domainElement) + " " +
(rangeElement.getClass().getName() + "@" + Integer.toHexString(rangeElement.hashCode()))
);
public boolean updateRange(ReadGraph g, IForwardMapping<Domain, Range> map,
Domain domainElement, Range rangeElement)
throws MappingException {
- LOGGER.info(" UpdateMethodFactory.updateRange");
+ LOGGER.trace(" UpdateMethodFactory.updateRange");
try {
return (Boolean)method.invoke(rangeElement, g, domainElement);
} catch (Exception e) {
@Override
public StructuralResource get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.get");
+ LOGGER.trace(" RelatedObjectAccessor.get");
Resource res = getServiceResource(g, element);
if (res == null)
return null;
public boolean set(WriteGraph g, StructuralResource selement, StructuralResource value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.set");
+ LOGGER.trace(" RelatedObjectAccessor.set");
Resource element = getServiceResource(g, selement);
if (element == null)
return false;
@Override
public Collection<StructuralResource> get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.get");
+ LOGGER.trace(" RelatedObjectsAccessor.get");
Resource res = getServiceResource(g, element);
public boolean set(WriteGraph g, StructuralResource element, Collection<StructuralResource> value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.set");
+ LOGGER.trace(" RelatedObjectsAccessor.set");
Resource res = getServiceResource(g, element);
if (res == null)
return false;
@Override
public Collection<StructuralResource> get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedOrderedSetElementsAccessor.get");
+ LOGGER.trace(" RelatedOrderedSetElementsAccessor.get");
Resource res = getServiceResource(g, element);
if (res == null)
return Collections.emptyList();
public boolean set(WriteGraph g, StructuralResource element, Collection<StructuralResource> value)
throws MappingException {
try {
- LOGGER.info(" RelatedOrderedSetElementsAccessor.set");
+ LOGGER.trace(" RelatedOrderedSetElementsAccessor.set");
Resource res = getServiceResource(g, element);
if (res == null)
return false;
@Override
public Object get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedValueAccessor.get");
+ LOGGER.trace(" RelatedValueAccessor.get");
Resource res = getServiceResource(g, element);
if (res == null)
return null;
public boolean set(WriteGraph g, StructuralResource relement, Object value)
throws MappingException {
try {
- LOGGER.info(" RelatedValueAccessor.set");
+ LOGGER.trace(" RelatedValueAccessor.set");
Resource element = getServiceResource(g, relement);
if (element == null)
public StructuralResource get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.get");
+ LOGGER.trace(" RelatedObjectAccessor.get");
if (!element.isStructural())
return null;
public boolean set(WriteGraph g, StructuralResource element, StructuralResource value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectAccessor.set");
+ LOGGER.trace(" RelatedObjectAccessor.set");
Resource instance = StructuralUtils.getContainingInstance(element);
Resource publicRelation = null;
if (instance == null)
@Override
public Collection<StructuralResource> get(ReadGraph g, StructuralResource element) throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.get");
+ LOGGER.trace(" RelatedObjectsAccessor.get");
if (!element.isStructural())
return Collections.emptyList();
public boolean set(WriteGraph g, StructuralResource element, Collection<StructuralResource> value)
throws MappingException {
try {
- LOGGER.info(" RelatedObjectsAccessor.set");
+ LOGGER.trace(" RelatedObjectsAccessor.set");
if (!element.isStructural())
return false;
public StructuralResource createDomainElement(WriteGraph g, IStructuralObject rangeElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
- LOGGER.info("SimpleLinkType.createDomainElement " +
+ if(LOGGER.isTraceEnabled())
+ LOGGER.trace("SimpleLinkType.createDomainElement " +
rangeElement.toString()
);
if (rangeElement.getContext().size() == 0) {
public IStructuralObject createRangeElement(ReadGraph g, StructuralResource domainElement)
throws MappingException {
try {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.createRangeElement " + NameUtils.getSafeName(g, domainElement.getResource()));
+ LOGGER.trace("SimpleLinkType.createRangeElement " + NameUtils.getSafeName(g, domainElement.getResource()));
} catch(DatabaseException e) {
throw new MappingException(e);
}
}
public boolean updateDomain(WriteGraph g, IBackwardMapping<StructuralResource,IStructuralObject> map, StructuralResource domainElement, IStructuralObject rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateDomain " +
+ LOGGER.trace("SimpleLinkType.updateDomain " +
NameUtils.getSafeName(g, domainElement.getResource()) + " " +
rangeElement.toString()
);
public boolean updateRange(ReadGraph g, IForwardMapping<StructuralResource, IStructuralObject> map, StructuralResource domainElement, IStructuralObject rangeElement) throws MappingException {
- if(LOGGER.isInfoEnabled())
+ if(LOGGER.isTraceEnabled())
try {
- LOGGER.info("SimpleLinkType.updateRange " +
+ LOGGER.trace("SimpleLinkType.updateRange " +
NameUtils.getSafeName(g, domainElement.getResource()) + " " +
rangeElement.toString()
);