Class PolicySet


  • public class PolicySet
    extends Object
    Was Hack/Tool to set policies for items, bundles, and bitstreams. Now has helpful method, setPolicies();
    Version:
    $Revision$
    Author:
    dstuve
    • Method Detail

      • main

        public static void main​(String[] argv)
                         throws Exception
        Command line interface to setPolicies - run to see arguments
        Parameters:
        argv - the command line arguments given
        Throws:
        Exception - if error
      • setPolicies

        public static void setPolicies​(Context c,
                                       int containerType,
                                       UUID containerID,
                                       int contentType,
                                       int actionID,
                                       UUID groupID,
                                       boolean isReplace,
                                       boolean clearOnly)
                                throws SQLException,
                                       AuthorizeException
        Useful policy wildcard tool. Can set entire collections' contents' policies
        Parameters:
        c - current context
        containerType - type, Constants.ITEM or Constants.COLLECTION
        containerID - ID of container (DB primary key)
        contentType - type (BUNDLE, ITEM, or BITSTREAM)
        actionID - action ID
        groupID - group ID (database key)
        isReplace - if true, existing policies are removed first, otherwise add to existing policies
        clearOnly - if true, just delete policies for matching objects
        Throws:
        SQLException - if database error if database problem
        AuthorizeException - if authorization error if current user is not authorized to change these policies
      • setPolicies

        public static void setPolicies​(Context c,
                                       int containerType,
                                       UUID containerID,
                                       int contentType,
                                       int actionID,
                                       UUID groupID,
                                       boolean isReplace,
                                       boolean clearOnly,
                                       String name,
                                       String description,
                                       Date startDate,
                                       Date endDate)
                                throws SQLException,
                                       AuthorizeException
        Parameters:
        c - current context
        containerType - type, Constants.ITEM or Constants.COLLECTION
        containerID - ID of container (DB primary key)
        contentType - ID of container (DB primary key)
        actionID - action ID (e.g. Constants.READ)
        groupID - group ID (database key)
        isReplace - if true, existing policies are removed first, otherwise add to existing policies
        clearOnly - if non-null, only process bitstreams whose names contain filter
        name - policy name
        description - policy descrption
        startDate - policy start date
        endDate - policy end date
        Throws:
        SQLException - if database error
        AuthorizeException - if authorization error
      • setPoliciesFilter

        public static void setPoliciesFilter​(Context c,
                                             int containerType,
                                             UUID containerID,
                                             int contentType,
                                             int actionID,
                                             UUID groupID,
                                             boolean isReplace,
                                             boolean clearOnly,
                                             String filter)
                                      throws SQLException,
                                             AuthorizeException
        Useful policy wildcard tool. Can set entire collections' contents' policies
        Parameters:
        c - current context
        containerType - type, Constants.ITEM or Constants.COLLECTION
        containerID - ID of container (DB primary key)
        contentType - type (BUNDLE, ITEM, or BITSTREAM)
        actionID - action ID (e.g. Constants.READ)
        groupID - group ID (database key)
        isReplace - if true, existing policies are removed first, otherwise add to existing policies
        clearOnly - if true, just delete policies for matching objects
        filter - if non-null, only process bitstreams whose names contain filter
        Throws:
        SQLException - if database error if database problem
        AuthorizeException - if authorization error if current user is not authorized to change these policies
      • setPoliciesFilter

        public static void setPoliciesFilter​(Context c,
                                             int containerType,
                                             UUID containerID,
                                             int contentType,
                                             int actionID,
                                             UUID groupID,
                                             boolean isReplace,
                                             boolean clearOnly,
                                             String filter,
                                             String name,
                                             String description,
                                             Date startDate,
                                             Date endDate)
                                      throws SQLException,
                                             AuthorizeException
        Useful policy wildcard tool. Can set entire collections' contents' policies
        Parameters:
        c - current context
        containerType - type, Constants.ITEM or Constants.COLLECTION
        containerID - ID of container (DB primary key)
        contentType - type (BUNDLE, ITEM, or BITSTREAM)
        actionID - action ID
        groupID - group ID (database key)
        isReplace - if true, existing policies are removed first, otherwise add to existing policies
        clearOnly - if true, just delete policies for matching objects
        filter - if non-null, only process bitstreams whose names contain filter
        name - policy name
        description - policy description
        startDate - policy start date
        endDate - policy end date
        Throws:
        SQLException - if database error if database problem
        AuthorizeException - if authorization error if current user is not authorized to change these policies