Search in sources :

Example 21 with Node

use of org.openhab.binding.mqtt.homie.internal.homie300.Node in project osmosis by openstreetmap.

the class PostgreSqlDatasetContext method initialize.

/**
 * Initialises the database connection and associated data access objects.
 */
private void initialize() {
    if (dbCtx == null) {
        ActionDao actionDao;
        dbCtx = new DatabaseContext(loginCredentials);
        new SchemaVersionValidator(dbCtx, preferences).validateVersion(PostgreSqlVersionConstants.SCHEMA_VERSION);
        capabilityChecker = new DatabaseCapabilityChecker(dbCtx);
        actionDao = releasableContainer.add(new ActionDao(dbCtx));
        userDao = releasableContainer.add(new UserDao(dbCtx, actionDao));
        nodeDao = releasableContainer.add(new NodeDao(dbCtx, actionDao));
        wayDao = releasableContainer.add(new WayDao(dbCtx, actionDao));
        relationDao = releasableContainer.add(new RelationDao(dbCtx, actionDao));
        nodeManager = new PostgreSqlEntityManager<Node>(nodeDao, userDao);
        wayManager = new PostgreSqlEntityManager<Way>(wayDao, userDao);
        relationManager = new PostgreSqlEntityManager<Relation>(relationDao, userDao);
    }
    initialized = true;
}
Also used : Node(org.openstreetmap.osmosis.core.domain.v0_6.Node) Way(org.openstreetmap.osmosis.core.domain.v0_6.Way) DatabaseContext(org.openstreetmap.osmosis.pgsimple.common.DatabaseContext) Relation(org.openstreetmap.osmosis.core.domain.v0_6.Relation) SchemaVersionValidator(org.openstreetmap.osmosis.pgsimple.common.SchemaVersionValidator)

Example 22 with Node

use of org.openhab.binding.mqtt.homie.internal.homie300.Node in project osmosis by openstreetmap.

the class NodeMapper method parseRecord.

/**
 * {@inheritDoc}
 */
@Override
public Node parseRecord(ResultSet resultSet) {
    try {
        PGgeometry geom;
        Point point;
        geom = (PGgeometry) resultSet.getObject("geom");
        point = (Point) geom.getGeometry();
        return new Node(new CommonEntityData(resultSet.getLong("id"), resultSet.getInt("version"), new Date(resultSet.getTimestamp("tstamp").getTime()), buildUser(resultSet), resultSet.getLong("changeset_id")), point.y, point.x);
    } catch (SQLException e) {
        throw new OsmosisRuntimeException("Unable to build a node from the current recordset row.", e);
    }
}
Also used : CommonEntityData(org.openstreetmap.osmosis.core.domain.v0_6.CommonEntityData) SQLException(java.sql.SQLException) Node(org.openstreetmap.osmosis.core.domain.v0_6.Node) Point(org.postgis.Point) Date(java.util.Date) OsmosisRuntimeException(org.openstreetmap.osmosis.core.OsmosisRuntimeException) PGgeometry(org.postgis.PGgeometry)

Example 23 with Node

use of org.openhab.binding.mqtt.homie.internal.homie300.Node in project yakc by manusa.

the class AuthIT method performTokenAuthInNewClient.

@Test
void performTokenAuthInNewClient() throws IOException {
    // Given
    final Secret secret = retrieveSecretForServiceAccount();
    final Configuration configuration = Configuration.builder().server(KC.getConfiguration().getServer()).certificateAuthorityData(secret.getData().get("ca.crt")).token(() -> secret.getData().get("token")).build();
    // When
    final Node node = new KubernetesClient(configuration).create(CoreV1Api.class).listNode().stream().findFirst().orElse(null);
    // Then
    assertThat(node).isNotNull().hasFieldOrPropertyWithValue("metadata.name", nodeName);
}
Also used : Secret(com.marcnuri.yakc.model.io.k8s.api.core.v1.Secret) Configuration(com.marcnuri.yakc.config.Configuration) Node(com.marcnuri.yakc.model.io.k8s.api.core.v1.Node) Test(org.junit.jupiter.api.Test)

Example 24 with Node

use of org.openhab.binding.mqtt.homie.internal.homie300.Node in project LinkedGeoData by GeoKnow.

the class LGDVocabDefault method createEntity.

@Override
public Entity createEntity(Resource res) {
    if (res.toString().startsWith(NODE)) {
        String idStr = res.toString().substring(NODE.length());
        Long id = Long.parseLong(idStr);
        CommonEntityData data = new CommonEntityData(id, 0, new Date(), new OsmUser(0, ""), 0);
        return new Node(data, 0.0, 0.0);
    }
    return null;
}
Also used : CommonEntityData(org.openstreetmap.osmosis.core.domain.v0_6.CommonEntityData) OsmUser(org.openstreetmap.osmosis.core.domain.v0_6.OsmUser) Node(org.openstreetmap.osmosis.core.domain.v0_6.Node) Date(java.util.Date)

Example 25 with Node

use of org.openhab.binding.mqtt.homie.internal.homie300.Node in project JavaProgrames by srv-shivam.

the class ReverseKNodes method add.

public void add(int data) {
    Node newNode = new Node(data);
    if (head == null) {
        head = newNode;
        tail = newNode;
        ++length;
    } else {
        tail.next = newNode;
        tail = newNode;
        ++length;
    }
}
Also used : Node(dsa450List.PracticeLinkedList2.Node)

Aggregations

Node (org.openstreetmap.osmosis.core.domain.v0_6.Node)52 Test (org.junit.Test)27 CommonEntityData (org.openstreetmap.osmosis.core.domain.v0_6.CommonEntityData)26 WayNode (org.openstreetmap.osmosis.core.domain.v0_6.WayNode)21 Date (java.util.Date)18 NodeContainer (org.openstreetmap.osmosis.core.container.v0_6.NodeContainer)17 Tag (org.openstreetmap.osmosis.core.domain.v0_6.Tag)16 Node (org.flyte.api.v1.Node)15 Test (org.junit.jupiter.api.Test)15 ArrayList (java.util.ArrayList)14 OsmUser (org.openstreetmap.osmosis.core.domain.v0_6.OsmUser)14 Way (org.openstreetmap.osmosis.core.domain.v0_6.Way)13 TaskNode (org.flyte.api.v1.TaskNode)10 Bound (org.openstreetmap.osmosis.core.domain.v0_6.Bound)10 List (java.util.List)9 Map (java.util.Map)9 Node (org.eclipse.smarthome.binding.mqtt.generic.internal.convention.homie300.Node)9 Node (org.openhab.binding.mqtt.homie.internal.homie300.Node)9 EntityContainer (org.openstreetmap.osmosis.core.container.v0_6.EntityContainer)9 Node (ch.ethz.globis.phtree.v16.Node)8