#-------------------------------------------------------------------------------
# Broker Config for the HMS "Nice Job" feature set.
#-------------------------------------------------------------------------------

target      = __P4PORT__;
listen      = __P4BROKERPORT__;
directory   = __P4BINDIR__;
logfile     = "__LOGS__/p4broker.log";
debug-level = server=__BROKER_LOG_LEVEL__,net.autotune=1;
admin-name  = "Perforce Admins";
admin-phone = 999/911;
admin-email = "__MAILTO__";

compress = false;

redirection  = selective;

#------------------------------------------------------------------------------
# Show Broker Input - Utility for developing broker filter scripts.
#------------------------------------------------------------------------------
command: ^sbi$
{
   action = filter;
   execute = /p4/common/site/hms/scripts/sbi.pl;
}

#------------------------------------------------------------------------------
# Version check for NJ.
command: ^nj$
{
   action = reject;
   message = "\nThe HMS Nice Job (NJ) feature set is enabled on this server.\nVersion: __NJ_VERSION__\n\nRun 'p4 njh' for help.\n";
}

# Make certain users, such as Swarm, exempt from this integration.
command: .*
{
   user = __SWARM_USER__;
   action = pass;
}

#------------------------------------------------------------------------------
# Bypass for the automation super user.
command: .*
{
   user = __P4USER__;
   action = pass;
}

#------------------------------------------------------------------------------
# This filter script displays help ifno
command: ^njh$
{
   action = filter;
   checkauth = true;
   execute = /p4/common/site/hms/nj/nj_help.sh;
}

#------------------------------------------------------------------------------
# This filter script creates a new job.
command: ^njob$
{
   action = filter;
   checkauth = true;
   execute = /p4/common/site/hms/nj/broker_njob.pl;
}

#------------------------------------------------------------------------------
# This filter script requires displays a list of jobs that match the
# user's JobView.
command: ^mkproj$
{
   action = filter;
   checkauth = true;
   execute = /p4/common/site/hms/nj/broker_mkproj.pl;
}

#------------------------------------------------------------------------------
# This filter script requires displays a list of jobs that match the
# user's JobView.
command: ^jr$
{
   action = filter;
   checkauth = true;
   execute = /p4/common/site/hms/nj/broker_jr.pl;
}
