Examples of IdentifierMap


Examples of com.opengamma.engine.cache.IdentifierMap

@Test(groups = TestGroup.UNIT)
public class CalculationJobResultTest {
  private static final FudgeContext s_fudgeContext = OpenGammaFudgeContext.getInstance();
 
  public void fudge() {
    IdentifierMap identifierMap = new InMemoryIdentifierMap ();
    CalculationJobSpecification spec = new CalculationJobSpecification(UniqueId.of("Test", "ViewCycle"), "config", Instant.now(), 1L);
   
    CalculationJobResultItem item1 = CalculationJobResultItem.success();
   
    MutableExecutionLog executionLog = new MutableExecutionLog(ExecutionLogMode.INDICATORS);
View Full Code Here

Examples of org.apache.chemistry.opencmis.jcr.query.IdentifierMap

        };
    }

    public IdentifierMap getIdentifierMap(String typeId) {
        JcrTypeHandler typeHandler = getTypeHandler(typeId);
        IdentifierMap identifierMap = typeHandler.getIdentifierMap();
        if (identifierMap == null) {
            throw new CmisRuntimeException("Not supported: query for type " + typeId);
        }
        return identifierMap;
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.jcr.query.IdentifierMap

     * Return a {@link IdentifierMap} for the given CMIS type.
     * @param fromType  CMIS type
     * @return  <code>IdentifierMap</code>
     */
    public IdentifierMap getIdentifierMap(TypeDefinition fromType) {
        IdentifierMap identifierMap = ID_MAPS.get(fromType.getId());
        if (identifierMap == null) {
            throw new CmisRuntimeException("Not supported: query for type " + fromType.getId());
        }
        else {
            return identifierMap;
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

            if (reason != null) {
                reference = reason.toString();
            }
        }
        if (metadata instanceof IdentifiedObject) {
            final IdentifierMap map = ((IdentifiedObject) metadata).getIdentifierMap();
            XLink  link = map.getSpecialized(IdentifierSpace.XLINK);
            UUID   uuid = map.getSpecialized(IdentifierSpace.UUID);
            String anyUUID = (uuid != null) ? uuid.toString() : map.get(IdentifierSpace.UUID);
            if (anyUUID != null || link != null) {
                final Context           context  = Context.current();
                final ReferenceResolver resolver = Context.resolver(context);
                final Class<BoundType>  type     = getBoundType();
                if (uuid == null) {
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

            }
        } else {
            // In principle, the XML should contain a full metadata object OR a uuidref attribute.
            // However if both are present, assign the identifiers to that instance.
            if (metadata instanceof IdentifiedObject) {
                final IdentifierMap map = ((IdentifiedObject) metadata).getIdentifierMap();
                putInto(context, map, IdentifierSpace.UUID,  uuid);
                putInto(context, map, IdentifierSpace.XLINK, xlink);
            }
        }
        return metadata;
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

            otherCitationDetails    = object.getOtherCitationDetails();
            collectiveTitle         = object.getCollectiveTitle();
            final String id1        = object.getISBN();
            final String id2        = object.getISSN();
            if (id1 != null || id2 != null) {
                final IdentifierMap map = super.getIdentifierMap();
                if (id1 != null) map.putSpecialized(ISBN, id1);
                if (id2 != null) map.putSpecialized(ISSN, id2);
            }
        }
    }
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

     *
     * @param wrapped An instance of a GeoAPI interface to be wrapped.
     */
    protected GMLAdapter(final Object wrapped) {
        if (wrapped instanceof IdentifiedObject) {
            final IdentifierMap map = ((IdentifiedObject) wrapped).getIdentifierMap();
            if (map != null) { // Should not be null, but let be safe.
                id = map.get(IdentifierSpace.ID);
            }
        }
    }
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

     *
     * @param wrapped The GeoAPI implementation for which to assign the ID.
     */
    public final void copyIdTo(final Object wrapped) {
        if (id != null && wrapped instanceof IdentifiedObject) {
            final IdentifierMap map = ((IdentifiedObject) wrapped).getIdentifierMap();
            if (map != null) { // Should not be null, but let be safe.
                map.put(IdentifierSpace.ID, id);
            }
        }
    }
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

            otherCitationDetails    = object.getOtherCitationDetails();
            collectiveTitle         = object.getCollectiveTitle();
            final String id1        = object.getISBN();
            final String id2        = object.getISSN();
            if (id1 != null || id2 != null) {
                final IdentifierMap map = super.getIdentifierMap();
                if (id1 != null) map.putSpecialized(ISBN, id1);
                if (id2 != null) map.putSpecialized(ISSN, id2);
            }
        }
    }
View Full Code Here

Examples of org.apache.sis.xml.IdentifierMap

     * Tests write operations on an {@link IdentifierMap} using specific API.
     */
    @Test
    public void testPutSpecialized() {
        final List<Identifier> identifiers = new ArrayList<Identifier>();
        final IdentifierMap map = create(identifiers);
        final String myID = "myID";
        final java.util.UUID myUUID = fromString("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7");
        final URI myURI = URI.create("http://mylink");

        assertNull(map.putSpecialized(ID,   myID));
        assertNull(map.putSpecialized(UUID, myUUID));
        assertNull(map.putSpecialized(HREF, myURI));
        assertMapEquals("{gml:id=“myID”,"
                + " gco:uuid=“a1eb6e53-93db-4942-84a6-d9e7fb9db2c7”,"
                + " xlink:href=“http://mylink”}", map);

        assertSame(myID,   map.getSpecialized(ID));
        assertSame(myUUID, map.getSpecialized(UUID));
        assertSame(myURI,  map.getSpecialized(HREF));
        assertEquals("myID",                                 map.get(ID));
        assertEquals("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7", map.get(UUID));
        assertEquals("http://mylink",                        map.get(HREF));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.