Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Getting the User Name of the Current User

In the TIBCO Enterprise Administrator, when the current user invokes an operation on the product through its agent, the name of the current user who is invoking this operation can be made available to the Agent.

This can be done by adding a parameter whose type is com.tibco.tea.agent.api.TeaPrincipal. No `TeaParam` annotation is needed for this method parameter. In the method code, the `getName()` method of the `TeaPrincipal` class can be invoked to get the name of the user who invoked the operation.

Procedure Pass the `TeaPrincipal` as a parameter in the `uploadFile()` method:

    @TeaOperation(name = "upload", description = "Upload File")
    public void uploadFile(
    @TeaParam(name = "filepath", description = "File to Upload")
    final DataSource fileDataSource, TeaPrincipal teaPrincipal)
    throws IOException
    { String userName = teaPrincipal.getName(); ... }

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO® Enterprise Administrator

Copyright © 1996-2025. Cloud Software Group, Inc. All Rights Reserved.