#-*-perl-*-
#
# $Id: RequestParameterRequired.in,v 37.1 2011/05/19 18:39:29 anbrown Exp $
#
# (c) 1999-2011 Morgan Stanley & Co. Incorporated
# See ..../src/LICENSE for terms of distribution.
#

package MQSeries::Command::PCF;

#
# Since PCF commands have to list the required parameters *before* any
# optional ones, MQSeries::Command::Request::_TranslatePCF uses this
# hash to indicate which parameters are required and in which order
# they must be specified.
#
# NOTE: You only have to list a command and its required parameters
# here if the command has *both* required and optional parameters, or
# if the parameter order is significant.  If the command's parameters
# are either all required or all optional, and order does not matter,
# it can be omitted entirely.
#

%RequestParameterRequired =
  (

   ChangeAuthority		=>
   {
    ObjectName			=> 1,
    ObjectType			=> 1,
    EntityName			=> 1,
    EntityType			=> 1,
   },

   ClearQueue			=>
   {
    QName			=> 1,
   },

   ClearTopicString		=>
   {
    TopicString			=> 1,
    ClearType			=> 2,
    #Scope			=> 3,
   },

   CopyAuthInfo			=>
   {
    AuthInfoType		=> 3,
    FromAuthInfoName		=> 1,
    ToAuthInfoName		=> 2,
   },

   CopyCFStruc			=>
   {
    FromCFStrucName		=> 1,
    ToCFStrucName		=> 2,
   },

   CopyChannel			=>
   {
    ChannelType			=> 3,
    FromChannelName		=> 1,
    ToChannelName		=> 2,
   },

   CopyChannelListener		=>
   {
    FromListenerName		=> 1,
    ToListenerName		=> 2,
   },

   CopyNamelist			=>
   {
    FromNamelistName		=> 1,
    ToNamelistName		=> 2,
   },

   CopyProcess			=>
   {
    FromProcessName		=> 1,
    ToProcessName		=> 2,
   },

   CopyQueue			=>
   {
    FromQName			=> 1,
    QType			=> 3,
    ToQName			=> 2,
   },

   CopyService			=>
   {
    FromServiceName		=> 1,
    ToServiceName		=> 2,
   },

   CopyStorageClass		=>
   {
    FromStorageClassName	=> 1,
    ToStorageClassName		=> 2,
   },

   CopyTopic			=>
   {
    FromTopicName		=> 1,
    TopicString			=> 3,
    ToTopicName			=> 2,
   },

   CreateTopic			=>
   {
    TopicName			=> 1,
    TopicString			=> 2,
   },

   DeleteAuthorityRecord	=>
   {
    ObjectType			=> 2,
    ProfileName			=> 1,
   },

   Escape			=>
   {
    EscapeType			=> 1,
    EscapeText			=> 2,
   },

   InquireAuthorityRecords	=>
   {
    ObjectType			=> 1,
    Options			=> 2,
    ProfileName			=> 3,
   },

   InquireAuthorityService	=>
   {
    AuthServiceAttrs		=> 1,
   },

   InquireClusterQueueManager	=>
   {
    ClusterQMgrName		=> 1,
   },

#   InquireConnection		=>
#   {
#    GenericConnectionId		=> 1,
#   },

   MoveQueue			=>
   {
    FromQName			=> 1,
   },

   RefreshQueueManager		=>
   {
    RefreshType			=> 1,
   },

# This is actually optional and is only applicable to z/OS.
#   RefreshSecurity		=>
#   {
#    SecurityItem		=> 1,
#   },

   ResetCluster			=>
   {
    ClusterName			=> 1,
    QMgrName			=> 2,
    Action			=> 3,
   },

   ReverifySecurity		=>
   {
    UserId			=> 1,
   },

   SetAuthorityRecord		=>
   {
    ProfileName			=> 1,
    ObjectType			=> 2,
   },

   SuspendQueueManagerCluster	=>
   {
    ClusterName			=> 1,
    ClusterNamelist		=> 1,
   },

   #
   # InquireAuthority is a Morgan Stanley extension
   #
   InquireAuthority		=>
   {
    ObjectType			=> 1,
    ObjectName			=> 1,
   },
  );

#
# This *greatly* shrinks the size of this file...
#
$RequestParameterRequired{CreateAuthInfo} =
  {
   AuthInfoName		=> 1,
   AuthInfoType		=> 2,
  };

$RequestParameterRequired{ChangeAuthInfo} =
  {
   AuthInfoName		=> 1,
   AuthInfoType		=> sub { return $_[0] >= 700 ? 2 : undef; },
  };

$RequestParameterRequired{InquireAuthInfo} =
  $RequestParameterRequired{InquireAuthInfoNames} =
  $RequestParameterRequired{DeleteAuthInfo} =
  {
   AuthInfoName		=> 1,
  };

$RequestParameterRequired{InquireCFStruc} =
  $RequestParameterRequired{InquireCFStrucNames} =
  $RequestParameterRequired{InquireCFStrucStatus} =
  $RequestParameterRequired{ChangeCFStruc} =
  $RequestParameterRequired{DeleteCFStruc} =
  $RequestParameterRequired{BackupCFStruc} =
  $RequestParameterRequired{RecoverCFStruc} =
  {
   CFStrucName		=> 1,
  };

#
# NOTE: CFStruct is for backwards compatibility with pre-1.24 MQSC
#	New code should use CFStruc (no final 't')
#
$RequestParameterRequired{InquireCFStruct} =
  $RequestParameterRequired{InquireCFStructNames} =
  $RequestParameterRequired{ChangeCFStruct} =
  $RequestParameterRequired{DeleteCFStruct} =
  {
   CFStructName		=> 1,
  };

$RequestParameterRequired{CreateChannelListener} =
  $RequestParameterRequired{ChangeChannelListener} =
  {
   ListenerName		       => 1,
   TransportType	       => 2,
  };

$RequestParameterRequired{DeleteChannelListener} =
  $RequestParameterRequired{InquireChannelListener} =
  $RequestParameterRequired{InquireChannelListenerStatus} =
  {
   ListenerName		       => 1,
  };

$RequestParameterRequired{InquireNamelist} =
  $RequestParameterRequired{CreateNamelist} =
  $RequestParameterRequired{ChangeNamelist} =
  $RequestParameterRequired{DeleteNamelist} =
  {
   NamelistName		=> 1,
  };

$RequestParameterRequired{InquireProcess} =
  $RequestParameterRequired{CreateProcess} =
  $RequestParameterRequired{ChangeProcess} =
  $RequestParameterRequired{DeleteProcess} =
  {
   ProcessName		=> 1,
  };

$RequestParameterRequired{CreateQueue} =
  $RequestParameterRequired{ChangeQueue} =
  {
   QName		=> 1,
   QType		=> 2,
  };

$RequestParameterRequired{InquireQueueNames} =
  $RequestParameterRequired{InquireQueue} =
  $RequestParameterRequired{InquireQueueStatus} =
  $RequestParameterRequired{DeleteQueue} =
  {
   QName		=> 1,
  };

$RequestParameterRequired{CreateChannel} =
  $RequestParameterRequired{ChangeChannel} =
  {
   ChannelName		=> 1,
   ChannelType		=> 2,
  };

$RequestParameterRequired{StopChannel} =
  $RequestParameterRequired{ResetChannel} =
  $RequestParameterRequired{PingChannel} =
  $RequestParameterRequired{InquireChannelStatus} =
  $RequestParameterRequired{InquireChannelNames} =
  $RequestParameterRequired{InquireChannel} =
  $RequestParameterRequired{DeleteChannel} =
  {
   ChannelName		=> 1,
  };

$RequestParameterRequired{InquireService} =
  $RequestParameterRequired{InquireServiceStatus} =
  $RequestParameterRequired{CreateService} =
  $RequestParameterRequired{ChangeService} =
  $RequestParameterRequired{DeleteService} =
  $RequestParameterRequired{StartService} =
  $RequestParameterRequired{StopService} =
  {
   ServiceName		=> 1,
  };

$RequestParameterRequired{InquireStorageClass} =
  $RequestParameterRequired{InquireStorageClassNames} =
  $RequestParameterRequired{CreateStorageClass} =
  $RequestParameterRequired{ChangeStorageClass} =
  $RequestParameterRequired{DeleteStorageClass} =
  {
   StorageClassName	=> 1,
  };

#
# Subscriptions can be keyed off SubName or SubID.  We'll use the name
# for now, but that may change.	 MQSeries::Command doesn't support
# alternate required options.
#
$RequestParameterRequired{InquireSubscription} =
  $RequestParameterRequired{InquireSubscriptionStatus} =
  $RequestParameterRequired{CreateSubscription} =
  $RequestParameterRequired{ChangeSubscription} =
  $RequestParameterRequired{DeleteSubscription} =
  {
   SubName		=> 1,
  };

$RequestParameterRequired{InquireTopic} =
  $RequestParameterRequired{InquireTopicNames} =
  $RequestParameterRequired{ChangeTopic} =
  $RequestParameterRequired{DeleteTopic} =
  {
   TopicName		=> 1,
  };

$RequestParameterRequired{InquireTopicStatus} =
  {
   TopicString		=> 1,
  };

1;
