Search in sources :

Example 1 with TypedItemMapper

use of org.platformlayer.TypedItemMapper in project platformlayer by platformlayer.

the class FederatedPlatformLayerClient method build.

// public static PlatformLayerClient build(TypedPlatformLayerClient localClient, TypedItemMapper mapper)
// throws OpsException {
// FederationMap federationMap = buildFederationMap(localClient, mapper);
// 
// ForkJoinStrategy forkJoinPool = new FakeForkJoinStrategy();
// 
// return new FederatedPlatformLayerClient(federationMap, forkJoinPool);
// }
public static PlatformLayerClient build(ProjectId defaultProject, FederationMap federationMap) throws OpsException {
    ForkJoinStrategy forkJoinPool = new FakeForkJoinStrategy();
    TypedItemMapper mapper = null;
    return new FederatedPlatformLayerClient(mapper, defaultProject, federationMap, forkJoinPool);
}
Also used : TypedItemMapper(org.platformlayer.TypedItemMapper) FakeForkJoinStrategy(org.platformlayer.forkjoin.FakeForkJoinStrategy) FakeForkJoinStrategy(org.platformlayer.forkjoin.FakeForkJoinStrategy) ForkJoinStrategy(org.platformlayer.forkjoin.ForkJoinStrategy)

Example 2 with TypedItemMapper

use of org.platformlayer.TypedItemMapper in project platformlayer by platformlayer.

the class OpsContextBuilder method buildClient.

private TypedPlatformLayerClient buildClient(ProjectAuthorization project) throws OpsException {
    ProjectId projectId = new ProjectId(project.getName());
    DirectAuthenticator directAuthenticator = buildDirectAuthenticator(project);
    // TODO: Introduce a direct client for "loopback" (normal) calls?
    String platformLayerUrl = OpsSystem.getPlatformLayerUrlBase();
    List<String> trustKeys = opsSystem.getServerTrustKeys();
    PlatformLayerClient client;
    // client = HttpPlatformLayerClient.build(httpStrategy, platformLayerUrl,
    // directAuthenticator, projectId, trustKeys);
    DirectAuthentication auth = new DirectAuthentication(project);
    TypedItemMapper mapper = null;
    client = new DirectPlatformLayerClient(mapper, opsSystem, projectId, auth);
    return new PlatformLayerHelpers(client, serviceProviderHelpers);
}
Also used : DirectPlatformLayerClient(org.platformlayer.ops.DirectPlatformLayerClient) FederatedPlatformLayerClient(org.platformlayer.federation.FederatedPlatformLayerClient) PlatformLayerClient(org.platformlayer.PlatformLayerClient) TypedPlatformLayerClient(org.platformlayer.TypedPlatformLayerClient) PlatformLayerHelpers(org.platformlayer.ops.machines.PlatformLayerHelpers) DirectPlatformLayerClient(org.platformlayer.ops.DirectPlatformLayerClient) ProjectId(org.platformlayer.ids.ProjectId) DirectAuthenticator(org.platformlayer.auth.DirectAuthenticator) PlatformLayerTypedItemMapper(org.platformlayer.ops.machines.PlatformLayerTypedItemMapper) TypedItemMapper(org.platformlayer.TypedItemMapper) DirectAuthentication(org.platformlayer.ops.DirectAuthentication)

Aggregations

TypedItemMapper (org.platformlayer.TypedItemMapper)2 PlatformLayerClient (org.platformlayer.PlatformLayerClient)1 TypedPlatformLayerClient (org.platformlayer.TypedPlatformLayerClient)1 DirectAuthenticator (org.platformlayer.auth.DirectAuthenticator)1 FederatedPlatformLayerClient (org.platformlayer.federation.FederatedPlatformLayerClient)1 FakeForkJoinStrategy (org.platformlayer.forkjoin.FakeForkJoinStrategy)1 ForkJoinStrategy (org.platformlayer.forkjoin.ForkJoinStrategy)1 ProjectId (org.platformlayer.ids.ProjectId)1 DirectAuthentication (org.platformlayer.ops.DirectAuthentication)1 DirectPlatformLayerClient (org.platformlayer.ops.DirectPlatformLayerClient)1 PlatformLayerHelpers (org.platformlayer.ops.machines.PlatformLayerHelpers)1 PlatformLayerTypedItemMapper (org.platformlayer.ops.machines.PlatformLayerTypedItemMapper)1