Codota Logo
DeployExecutionImpl
Code IndexAdd Codota to your IDE (free)

How to use
DeployExecutionImpl
in
com.gs.obevo.api.appdata

Best Java code snippets using com.gs.obevo.api.appdata.DeployExecutionImpl (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: com.goldmansachs.obevo/obevo-db

  @Override
  public DeployExecution valueOf(Map<String, Object> result) {
    long id = platform.getLongValue(result.get(idColName)).longValue();
    DeployExecutionStatus status = DeployExecutionStatus.IN_PROGRESS.valueOfStatusCode(((String) result.get(statusColName)).charAt(0));
    Timestamp deployTime = platform.getTimestampValue(result.get(deployTimeColName));
    String executorId = (String) result.get(executorIdColName);
    String toolVersion = (String) result.get(toolVersionColName);
    boolean init = platform.getIntegerValue(result.get(initCommandColName)).intValue() == 1;
    boolean rollback = platform.getIntegerValue(result.get(rollbackCommandColName)).intValue() == 1;
    String requesterId = (String) result.get(requesterIdColName);
    String reason = (String) result.get(reasonColName);
    String productVersion = (String) result.get(productVersionColName);
    ImmutableSet<DeployExecutionAttribute> deployExecutionAttributes = attrsById.get(id).toSet().toImmutable();
    DeployExecutionImpl deployExecution = new DeployExecutionImpl(requesterId, executorId, schema, toolVersion, deployTime, init, rollback, productVersion, reason, deployExecutionAttributes);
    deployExecution.setId(id);
    deployExecution.setStatus(status);
    return deployExecution;
  }
}).toImmutable();
origin: goldmansachs/obevo

  @Test
  public void test() {
    ChangeType changeType = mock(ChangeType.class);
    when(changeType.getName()).thenReturn("type");

    Platform platform = mock(Platform.class);
    when(platform.getChangeType(Mockito.anyString())).thenReturn(changeType);

    MongoDbEnvironment env = mock(MongoDbEnvironment.class);
    when(env.getPhysicalSchema("mydb")).thenReturn(new PhysicalSchema("mydb"));
    when(env.getPhysicalSchemas()).thenReturn(Sets.immutable.of(new PhysicalSchema("mydb")));

    MongoDbChangeAuditDao changeAuditDao = new MongoDbChangeAuditDao(mongoClient, env, platform, "test");

    DeployExecutionImpl exec = new DeployExecutionImpl("requester", "executor", "schema", "1.0.0", new Timestamp(new Date().getTime()), false, false, "1.0.0", "reason", Sets.immutable.<DeployExecutionAttribute>empty());
    exec.setId(1L);

    Change change = new ChangeIncremental(changeType, "mydb", "obj1", "c1", 0, "hash", "content");

    changeAuditDao.insertNewChange(change, exec);
    assertEquals(1, changeAuditDao.getDeployedChanges().size());
  }
}
origin: com.goldmansachs.obevo/obevo-mongodb

@Override
public void persistNew(DeployExecution deployExecution, PhysicalSchema physicalSchema) {
  MongoDatabase database = mongoClient.getDatabase(physicalSchema.getPhysicalName());
  MongoCollection<Document> auditCollection = database.getCollection(deployExecutionTableName);
  MutableInt mutableInt = nextIdBySchema.get(physicalSchema);
  mutableInt.increment();
  ((DeployExecutionImpl) deployExecution).setId(mutableInt.longValue());
  Document doc = getDocumentFromDeployExecution(deployExecution, false);
  auditCollection.insertOne(doc);
}
origin: com.goldmansachs.obevo/obevo-mongodb

  @Test
  public void test() {
    ChangeType changeType = mock(ChangeType.class);
    when(changeType.getName()).thenReturn("type");

    MongoDbPlatform platform = mock(MongoDbPlatform.class);
    when(platform.getChangeType(Mockito.anyString())).thenReturn(changeType);
    when(platform.convertDbObjectName()).thenReturn(StringFunctions.toUpperCase());

    MongoDbEnvironment env = mock(MongoDbEnvironment.class);
    when(env.getPlatform()).thenReturn(platform);
    when(env.getPhysicalSchemas()).thenReturn(Sets.immutable.of(new PhysicalSchema("mydb")));
    when(env.getPhysicalSchema("schema")).thenReturn(new PhysicalSchema("mydb"));

    MongoDbDeployExecutionDao deployExecDao = new MongoDbDeployExecutionDao(mongoClient, env);

    DeployExecutionImpl exec = new DeployExecutionImpl("requester", "executor", "schema", "1.0.0", new Timestamp(new Date().getTime()), false, false, "1.0.0", "reason", Sets.immutable.<DeployExecutionAttribute>empty());

    when(env.getPhysicalSchema("mydb")).thenReturn(new PhysicalSchema("mydb"));

    deployExecDao.persistNew(exec, new PhysicalSchema("mydb"));

    ImmutableCollection<DeployExecution> execs = deployExecDao.getDeployExecutions("mydb");
    assertEquals(1, execs.size());

    deployExecDao.update(execs.getFirst());
  }
}
origin: com.goldmansachs.obevo/obevo-mongodb

  @Test
  public void test() {
    ChangeType changeType = mock(ChangeType.class);
    when(changeType.getName()).thenReturn("type");

    Platform platform = mock(Platform.class);
    when(platform.getChangeType(Mockito.anyString())).thenReturn(changeType);

    MongoDbEnvironment env = mock(MongoDbEnvironment.class);
    when(env.getPhysicalSchema("mydb")).thenReturn(new PhysicalSchema("mydb"));
    when(env.getPhysicalSchemas()).thenReturn(Sets.immutable.of(new PhysicalSchema("mydb")));

    MongoDbChangeAuditDao changeAuditDao = new MongoDbChangeAuditDao(mongoClient, env, platform, "test");

    DeployExecutionImpl exec = new DeployExecutionImpl("requester", "executor", "schema", "1.0.0", new Timestamp(new Date().getTime()), false, false, "1.0.0", "reason", Sets.immutable.<DeployExecutionAttribute>empty());
    exec.setId(1L);

    Change change = new ChangeIncremental(changeType, "mydb", "obj1", "c1", 0, "hash", "content");

    changeAuditDao.insertNewChange(change, exec);
    assertEquals(1, changeAuditDao.getDeployedChanges().size());
  }
}
origin: goldmansachs/obevo

@Override
public void persistNew(DeployExecution deployExecution, PhysicalSchema physicalSchema) {
  MongoDatabase database = mongoClient.getDatabase(physicalSchema.getPhysicalName());
  MongoCollection<Document> auditCollection = database.getCollection(deployExecutionTableName);
  MutableInt mutableInt = nextIdBySchema.get(physicalSchema);
  mutableInt.increment();
  ((DeployExecutionImpl) deployExecution).setId(mutableInt.longValue());
  Document doc = getDocumentFromDeployExecution(deployExecution, false);
  auditCollection.insertOne(doc);
}
origin: goldmansachs/obevo

  @Test
  public void test() {
    ChangeType changeType = mock(ChangeType.class);
    when(changeType.getName()).thenReturn("type");

    MongoDbPlatform platform = mock(MongoDbPlatform.class);
    when(platform.getChangeType(Mockito.anyString())).thenReturn(changeType);
    when(platform.convertDbObjectName()).thenReturn(StringFunctions.toUpperCase());

    MongoDbEnvironment env = mock(MongoDbEnvironment.class);
    when(env.getPlatform()).thenReturn(platform);
    when(env.getPhysicalSchemas()).thenReturn(Sets.immutable.of(new PhysicalSchema("mydb")));
    when(env.getPhysicalSchema("schema")).thenReturn(new PhysicalSchema("mydb"));

    MongoDbDeployExecutionDao deployExecDao = new MongoDbDeployExecutionDao(mongoClient, env);

    DeployExecutionImpl exec = new DeployExecutionImpl("requester", "executor", "schema", "1.0.0", new Timestamp(new Date().getTime()), false, false, "1.0.0", "reason", Sets.immutable.<DeployExecutionAttribute>empty());

    when(env.getPhysicalSchema("mydb")).thenReturn(new PhysicalSchema("mydb"));

    deployExecDao.persistNew(exec, new PhysicalSchema("mydb"));

    ImmutableCollection<DeployExecution> execs = deployExecDao.getDeployExecutions("mydb");
    assertEquals(1, execs.size());

    deployExecDao.update(execs.getFirst());
  }
}
origin: com.goldmansachs.obevo/obevo-mongodb

  @Override
  public DeployExecution valueOf(Document doc) {
    MutableList<Document> attrsList = ListAdapter.adapt(doc.get("attrs", List.class));
    MutableList<DeployExecutionAttribute> attrs = attrsList.collect(new Function<Document, DeployExecutionAttribute>() {
      @Override
      public DeployExecutionAttribute valueOf(Document object) {
        return new DeployExecutionAttributeImpl(
            object.getString(attrNameColName),
            object.getString(attrValueColName)
        );
      }
    });
    DeployExecutionImpl exec = new DeployExecutionImpl(
        doc.getString(requesterIdColName),
        doc.getString(deployExecutionIdColName),
        doc.getString(dbSchemaColName),
        doc.getString(toolVersionColName),
        new Timestamp(doc.getDate(deployTimeColName).getTime()),
        doc.getBoolean(initCommandColName),
        doc.getBoolean(rollbackCommandColName),
        doc.getString(productVersionColName),
        doc.getString(reasonColName),
        attrs.toSet().toImmutable()
    );
    exec.setId(doc.getLong(idColName));
    return exec;
  }
}).toImmutable();
origin: goldmansachs/obevo

  @Override
  public DeployExecution valueOf(Map<String, Object> result) {
    long id = platform.getLongValue(result.get(idColName)).longValue();
    DeployExecutionStatus status = DeployExecutionStatus.IN_PROGRESS.valueOfStatusCode(((String) result.get(statusColName)).charAt(0));
    Timestamp deployTime = platform.getTimestampValue(result.get(deployTimeColName));
    String executorId = (String) result.get(executorIdColName);
    String toolVersion = (String) result.get(toolVersionColName);
    boolean init = platform.getIntegerValue(result.get(initCommandColName)).intValue() == 1;
    boolean rollback = platform.getIntegerValue(result.get(rollbackCommandColName)).intValue() == 1;
    String requesterId = (String) result.get(requesterIdColName);
    String reason = (String) result.get(reasonColName);
    String productVersion = (String) result.get(productVersionColName);
    ImmutableSet<DeployExecutionAttribute> deployExecutionAttributes = attrsById.get(id).toSet().toImmutable();
    DeployExecutionImpl deployExecution = new DeployExecutionImpl(requesterId, executorId, schema, toolVersion, deployTime, init, rollback, productVersion, reason, deployExecutionAttributes);
    deployExecution.setId(id);
    deployExecution.setStatus(status);
    return deployExecution;
  }
}).toImmutable();
origin: com.goldmansachs.obevo/obevo-db

final String attrInsertValueString = Interval.oneTo(allAttrColumns.size()).collect(Functions.getFixedValue("?")).makeString("(", ", ", ")");
((DeployExecutionImpl) entry).setId(nextIdBySchema.get(physicalSchema).longValue());
jdbc.update(conn, "INSERT INTO " + platform.getSchemaPrefix(physicalSchema) + deployExecutionTableName + " " +
        insertColumnString + " " +
origin: com.goldmansachs.obevo/obevo-db

DeployExecution deployExecution = new DeployExecutionImpl("backfill", "backfill", schema, "0.0.0", getCurrentTimestamp(), false, false, null, "backfill", Sets.immutable.<DeployExecutionAttribute>empty());
deployExecution.setStatus(DeployExecutionStatus.SUCCEEDED);
deployExecutionDao.persistNewSameContext(conn, deployExecution, physicalSchema);
origin: goldmansachs/obevo

  @Override
  public DeployExecution valueOf(Document doc) {
    MutableList<Document> attrsList = ListAdapter.adapt(doc.get("attrs", List.class));
    MutableList<DeployExecutionAttribute> attrs = attrsList.collect(new Function<Document, DeployExecutionAttribute>() {
      @Override
      public DeployExecutionAttribute valueOf(Document object) {
        return new DeployExecutionAttributeImpl(
            object.getString(attrNameColName),
            object.getString(attrValueColName)
        );
      }
    });
    DeployExecutionImpl exec = new DeployExecutionImpl(
        doc.getString(requesterIdColName),
        doc.getString(deployExecutionIdColName),
        doc.getString(dbSchemaColName),
        doc.getString(toolVersionColName),
        new Timestamp(doc.getDate(deployTimeColName).getTime()),
        doc.getBoolean(initCommandColName),
        doc.getBoolean(rollbackCommandColName),
        doc.getString(productVersionColName),
        doc.getString(reasonColName),
        attrs.toSet().toImmutable()
    );
    exec.setId(doc.getLong(idColName));
    return exec;
  }
}).toImmutable();
origin: goldmansachs/obevo

final String attrInsertValueString = Interval.oneTo(allAttrColumns.size()).collect(Functions.getFixedValue("?")).makeString("(", ", ", ")");
((DeployExecutionImpl) entry).setId(nextIdBySchema.get(physicalSchema).longValue());
jdbc.update(conn, "INSERT INTO " + platform.getSchemaPrefix(physicalSchema) + deployExecutionTableName + " " +
        insertColumnString + " " +
origin: goldmansachs/obevo

DeployExecution deployExecution = new DeployExecutionImpl("backfill", "backfill", schema, "0.0.0", getCurrentTimestamp(), false, false, null, "backfill", Sets.immutable.<DeployExecutionAttribute>empty());
deployExecution.setStatus(DeployExecutionStatus.SUCCEEDED);
deployExecutionDao.persistNewSameContext(conn, deployExecution, physicalSchema);
com.gs.obevo.api.appdataDeployExecutionImpl

Javadoc

Represents the invocation of a db deployment job execution. Tracks who requested it and the attributes of the request.

Most used methods

  • <init>
  • setId
  • setStatus

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JTextField (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now