Search in sources :

Example 16 with MethodArgument

use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.

the class RemoteRuntimeStoreHandler method addWorkflowNodeState.

@POST
@Path("/addWorkflowNodeState")
public void addWorkflowNodeState(FullHttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramRunId workflowRunId = deserializeNext(arguments);
    WorkflowNodeStateDetail nodeStateDetail = deserializeNext(arguments);
    store.addWorkflowNodeState(workflowRunId, nodeStateDetail);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramRunId(co.cask.cdap.proto.id.ProgramRunId) WorkflowNodeStateDetail(co.cask.cdap.proto.WorkflowNodeStateDetail) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 17 with MethodArgument

use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.

the class RemoteUsageRegistryHandler method registerStream.

@POST
@Path("/registerStream")
public void registerStream(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramId programId = deserializeNext(arguments);
    StreamId streamId = deserializeNext(arguments);
    usageRegistry.register(programId, streamId);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : StreamId(co.cask.cdap.proto.id.StreamId) MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramId(co.cask.cdap.proto.id.ProgramId) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 18 with MethodArgument

use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.

the class RemotePrivilegesHandler method listPrivileges.

@POST
@Path("/listPrivileges")
public void listPrivileges(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    Principal principal = deserializeNext(arguments);
    LOG.trace("Listing privileges for principal {}", principal);
    Set<Privilege> privileges = privilegesManager.listPrivileges(principal);
    LOG.debug("Returning privileges for principal {} as {}", principal, privileges);
    responder.sendJson(HttpResponseStatus.OK, privileges);
}
Also used : MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) AuthorizationPrivilege(co.cask.cdap.proto.security.AuthorizationPrivilege) Privilege(co.cask.cdap.proto.security.Privilege) Principal(co.cask.cdap.proto.security.Principal) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 19 with MethodArgument

use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.

the class RemoteRuntimeStoreHandler method setStop.

@POST
@Path("/setStop")
public void setStop(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramId program = deserializeNext(arguments);
    String pid = deserializeNext(arguments);
    long endTime = deserializeNext(arguments);
    ProgramRunStatus runStatus = deserializeNext(arguments);
    BasicThrowable failureCause = deserializeNext(arguments);
    store.setStop(program, pid, endTime, runStatus, failureCause);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : ProgramRunStatus(co.cask.cdap.proto.ProgramRunStatus) MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramId(co.cask.cdap.proto.id.ProgramId) BasicThrowable(co.cask.cdap.proto.BasicThrowable) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Example 20 with MethodArgument

use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.

the class RemoteRuntimeStoreHandler method setStart.

@POST
@Path("/setStart")
public void setStart(HttpRequest request, HttpResponder responder) throws Exception {
    Iterator<MethodArgument> arguments = parseArguments(request);
    ProgramId program = deserializeNext(arguments);
    String pid = deserializeNext(arguments);
    long startTime = deserializeNext(arguments);
    String twillRunId = deserializeNext(arguments);
    Map<String, String> runtimeArgs = deserializeNext(arguments);
    Map<String, String> systemArgs = deserializeNext(arguments);
    store.setStart(program, pid, startTime, twillRunId, runtimeArgs, systemArgs);
    responder.sendStatus(HttpResponseStatus.OK);
}
Also used : MethodArgument(co.cask.cdap.common.internal.remote.MethodArgument) ProgramId(co.cask.cdap.proto.id.ProgramId) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST)

Aggregations

MethodArgument (co.cask.cdap.common.internal.remote.MethodArgument)25 POST (javax.ws.rs.POST)24 Path (javax.ws.rs.Path)24 ProgramId (co.cask.cdap.proto.id.ProgramId)8 ProgramRunId (co.cask.cdap.proto.id.ProgramRunId)8 EntityId (co.cask.cdap.proto.id.EntityId)6 Principal (co.cask.cdap.proto.security.Principal)6 AccessType (co.cask.cdap.data2.metadata.lineage.AccessType)4 DatasetId (co.cask.cdap.proto.id.DatasetId)4 NamespacedEntityId (co.cask.cdap.proto.id.NamespacedEntityId)4 StreamId (co.cask.cdap.proto.id.StreamId)4 Action (co.cask.cdap.proto.security.Action)4 WorkflowToken (co.cask.cdap.api.workflow.WorkflowToken)2 WorkflowNodeStateDetail (co.cask.cdap.proto.WorkflowNodeStateDetail)2 AuthorizationPrivilege (co.cask.cdap.proto.security.AuthorizationPrivilege)2 Privilege (co.cask.cdap.proto.security.Privilege)2 BadRequestException (co.cask.cdap.common.BadRequestException)1 BasicThrowable (co.cask.cdap.proto.BasicThrowable)1 ProgramRunStatus (co.cask.cdap.proto.ProgramRunStatus)1 JsonElement (com.google.gson.JsonElement)1