Search in sources :

Example 71 with Object

use of com.google.storage.v2.Object in project act-platform by mnemonic-no.

the class TraverseGraphHandlerTest method testTraverseGraphReturnVertices.

@Test
public void testTraverseGraphReturnVertices() throws Exception {
    ObjectRecord source = mockObjectRecord(mockObjectType(), "someValue");
    ObjectRecord destination = mockObjectRecord(mockObjectType(), "someOther");
    mockFact(source, destination);
    ResultSet<?> resultSet = handler.traverse(set(source.getId()), "g.out()", TraverseParams.builder().build());
    List<?> result = ListUtils.list(resultSet.iterator());
    assertEquals(1, result.size());
    assertTrue(result.get(0) instanceof Object);
    assertEquals(destination.getId(), ((Object) result.get(0)).getId());
}
Also used : ObjectRecord(no.mnemonic.act.platform.dao.api.record.ObjectRecord) Object(no.mnemonic.act.platform.api.model.v1.Object) Test(org.junit.Test)

Example 72 with Object

use of com.google.storage.v2.Object in project act-platform by mnemonic-no.

the class TraverseGraphDelegateTest method testTraverseGraphReturnVertices.

private void testTraverseGraphReturnVertices(TestMethod method) throws Exception {
    ObjectRecord startObject = mockFullTraversal();
    List<?> result = ListUtils.list(method.execute(startObject, "g.out()").iterator());
    assertEquals(1, result.size());
    assertTrue(result.get(0) instanceof Object);
}
Also used : ObjectRecord(no.mnemonic.act.platform.dao.api.record.ObjectRecord) Object(no.mnemonic.act.platform.api.model.v1.Object)

Example 73 with Object

use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.

the class AsyncComposeObject method asyncComposeObject.

public static void asyncComposeObject() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        ComposeObjectRequest request = ComposeObjectRequest.newBuilder().setDestination(Object.newBuilder().build()).addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>()).setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setIfGenerationMatch(-1086241088).setIfMetagenerationMatch(1043427781).setKmsKey(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<Object> future = storageClient.composeObjectCallable().futureCall(request);
        // Do something.
        Object response = future.get();
    }
}
Also used : ComposeObjectRequest(com.google.storage.v2.ComposeObjectRequest) ArrayList(java.util.ArrayList) StorageClient(com.google.storage.v2.StorageClient) Object(com.google.storage.v2.Object)

Example 74 with Object

use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.

the class SyncDeleteObject method syncDeleteObject.

public static void syncDeleteObject() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        DeleteObjectRequest request = DeleteObjectRequest.newBuilder().setBucket("bucket-1378203158").setObject("object-1023368385").setUploadId("uploadId1563990780").setGeneration(305703192).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        storageClient.deleteObject(request);
    }
}
Also used : DeleteObjectRequest(com.google.storage.v2.DeleteObjectRequest) StorageClient(com.google.storage.v2.StorageClient)

Example 75 with Object

use of com.google.storage.v2.Object in project gapic-generator-java by googleapis.

the class SyncDeleteObjectStringString method syncDeleteObjectStringString.

public static void syncDeleteObjectStringString() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        String bucket = "bucket-1378203158";
        String object = "object-1023368385";
        storageClient.deleteObject(bucket, object);
    }
}
Also used : StorageClient(com.google.storage.v2.StorageClient)

Aggregations

Object (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object)33 ArrayList (java.util.ArrayList)25 Object (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object)18 StorageClient (com.google.storage.v2.StorageClient)16 Object (com.google.storage.v2.Object)12 Test (org.junit.Test)12 PCEPDeserializerException (org.opendaylight.protocol.pcep.spi.PCEPDeserializerException)12 VendorInformationObject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.objects.VendorInformationObject)12 Object (no.mnemonic.act.platform.api.model.v1.Object)8 Preconditions (com.google.common.base.Preconditions)6 ObjectRecord (no.mnemonic.act.platform.dao.api.record.ObjectRecord)6 Metrics (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.lsp.attributes.Metrics)6 Metrics (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.lsp.attributes.Metrics)5 Ero (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.Ero)5 AbstractMessage (com.google.protobuf.AbstractMessage)4 ByteString (com.google.protobuf.ByteString)4 PCEPErrors (org.opendaylight.protocol.pcep.spi.PCEPErrors)4 UnknownObject (org.opendaylight.protocol.pcep.spi.UnknownObject)4 Lsp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.object.Lsp)4 ListObjectsPagedResponse (com.google.storage.v2.StorageClient.ListObjectsPagedResponse)3