public class Utils extends Object
Modifier | Constructor and Description |
---|---|
protected |
Utils()
Construct a Utils.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAuditTypestoDefinition(LibrarySession ls,
AuditTypeListDefinition atlDef,
NamedValue[] auditTypesNamedValues)
Populates the AuditTypeListDefinition with the given Audit Types.
|
static void |
checkInvalidAttributes(Map attrMap)
If any attributes remain, then they are invalid.
|
static NamedValue[] |
convertValuesToSimpleTypeArrays(NamedValue[] source,
long longNull,
int intNull,
boolean boolNull)
Converts any values of a NamedValue array that are Java type wrapper
arrays (such as Long[], Double[], or Boolean[]) to their simple type
array counterparts (such as long[], double[], or boolean[]), replacing
null elements in the source arrays with default values.
|
static int |
getAuditOperationType(LibrarySession session,
String opTypeKey)
Returns the audit op type (int) corresponding to a audit op type key
(String).
|
static AuditTypeList |
getAuditTypeList(LibrarySession ls,
Long id)
Returns an AuditTypeList from a given ID or throws an exception if
the item cannot be found or it is not an AuditTypeList.
|
static String |
getAuditTypeOperationKey(LibrarySession session,
int opType)
Returns the audit operation key (String) for the given audit operation
type.
|
static DefinitionObject |
getDefinitionObject(LibrarySession ls,
long id)
Returns a DefinitionObject from a given ID or throws an exception if
the item cannot be found or it is not a DefinitionObject.
|
static DefinitionObject |
getDefinitionObject(LibrarySession ls,
Long id)
Returns a DefinitionObject from a given ID or throws an exception if
the item cannot be found or it is not a DefinitionObject.
|
static DirectoryGroup |
getDirectoryGroup(LibrarySession ls,
Long id)
Returns a DirectoryGroup from a given ID or throws an exception if
the item cannot be found or it is not a DirectoryGroup.
|
static DirectoryObject |
getDirectoryObject(LibrarySession ls,
Long id)
Returns a DirectoryObject from a given ID or throws an exception if
the item cannot be found or it is not a DirectoryObject.
|
static Document |
getDocument(LibrarySession ls,
long id)
Returns the Document from a given ID or throws an exception if
the item cannot be found or it is not a Document.
|
static Document |
getDocument(LibrarySession ls,
Long id)
Returns the Document from a given ID or throws an exception if
the item cannot be found or it is not a Document.
|
static Folder |
getFolder(LibrarySession ls,
AttributeValue av)
Returns the Folder from a given AttributeValue or throws an exception if
the item cannot be found or it is not a Folder.
|
static Folder |
getFolder(LibrarySession ls,
long id)
Returns the Folder from a given ID or throws an exception if
the item cannot be found or it is not a Folder.
|
static Folder |
getFolder(LibrarySession ls,
Long id)
Returns the Folder from a given ID or throws an exception if
the item cannot be found or it is not a Folder.
|
static Long |
getId(LibraryObject reposObject)
Returns the ID of a repository object, ignoring any exceptions.
|
static NamedValue[] |
getIdErrorInfo(long id)
Returns an NamedValue[] info filled in with the ID of the object where the
error occured.
|
static NamedValue[] |
getIdErrorInfo(Long id)
Returns an NamedValue[] info filled in with the ID of the object where the
error occured.
|
static LifecyclePolicy |
getLifecyclePolicy(LibrarySession ls,
Long id)
Returns the LifecyclePolicy for the given ID.
|
static Link |
getLink(LibrarySession ls,
long id)
Returns the Link from a given ID or throws an exception if
the item cannot be found or it is not a Link.
|
static Link |
getLink(LibrarySession ls,
Long id)
Returns the Link from a given ID or throws an exception if
the item cannot be found or it is not a Link.
|
static Media |
getMedia(LibrarySession ls,
Long id)
Returns the Media from a given ID or throws an exception if
the item cannot be found or it is not a Media object.
|
static Media |
getMedia(LibrarySession ls,
String mediaName)
Returns the Media given its name or throws an exception if
the item cannot be found.
|
static PublicObject |
getPublicObject(LibrarySession ls,
long id)
Returns the PublicObject from a given ID or throws an exception if
the item cannot be found or it is not a PublicObject.
|
static PublicObject |
getPublicObject(LibrarySession ls,
Long id)
Returns the PublicObject from a given ID or throws an exception if
the item cannot be found or it is not a PublicObject.
|
static DirectoryUser |
getUser(LibrarySession ls,
Long id)
Returns a DirectoryUser from a given ID or throws an exception if
the item cannot be found or it is not a DirectoryUser.
|
static VersionDescription |
getVersionDescription(LibrarySession ls,
long id)
Returns the VersionDescription from a given ID or throws an exception if
the item cannot be found or it is not a VersionDescription.
|
static VersionDescription |
getVersionDescription(LibrarySession ls,
Long id)
Returns the VersionDescription from a given ID or throws an exception if
the item cannot be found or it is not a VersionDescription.
|
static NamedValue[] |
mergeAttributeArrays(NamedValue[] master,
NamedValue[] slave)
Merges two arrays of attributes.
|
static AttributeValue |
toAttributeValue(NamedValue nv)
Convert a NamedValue to an AttributeValue.
|
static AttributeValue[] |
toAttributeValues(NamedValue[] nvs)
Convert a NamedValue array to an AttributeValue array.
|
static NamedValue |
toNamedValue(AttributeValue av)
Converts an AttributeValue to a NamedValue.
|
static NamedValue[] |
toNamedValues(AttributeValue[] avs)
Converts an AttributeValue array to a NamedValue array.
|
public static NamedValue[] mergeAttributeArrays(NamedValue[] master, NamedValue[] slave)
NOTE: This method may return the master or slave array references if
one or the other is null
. Calling code should be
careful if it needs to make any changes to the resulting array.
Also note that the actual references to the individual arrays
entries will be used, no deep cloning is being done.
master
- The master array of attributes. Can be null
.slave
- The slave array of attributes. Can be null
.public static NamedValue[] getIdErrorInfo(Long id)
public static NamedValue[] getIdErrorInfo(long id)
public static NamedValue[] toNamedValues(AttributeValue[] avs) throws FdkException
Returns null if the specified AttributeValue array is null or empty.
avs
- the AttributeValue array to convert.FdkException
- if the operation fails.public static NamedValue toNamedValue(AttributeValue av) throws FdkException
Returns null if the specified AttributeValue is null.
av
- the AttributeValue to convert.FdkException
- if the operation fails.public static AttributeValue toAttributeValue(NamedValue nv) throws FdkException
Returns null if the specified NamedValue is null.
nv
- the NamedValue instance to convert.FdkException
- if the operation fails.public static AttributeValue[] toAttributeValues(NamedValue[] nvs) throws FdkException
Returns null if the specified NamedValue array is null or empty.
nvs
- the NamedValue array to convert.FdkException
- if the operation fails.public static NamedValue[] convertValuesToSimpleTypeArrays(NamedValue[] source, long longNull, int intNull, boolean boolNull)
source
- the source NamedValue array whose Java type wrapper
array values should be replaced with simple type array
valueslongNull
- the null value for long[] and double[] valuesintNull
- the null value for int[] valuesboolNull
- the null value for boolean[] valuespublic static void addAuditTypestoDefinition(LibrarySession ls, AuditTypeListDefinition atlDef, NamedValue[] auditTypesNamedValues) throws FdkException
ls
- library sessionauditTypesNamedValues
- array of NamedValue representing audit
types; Name of the NamedValue should be
audit operation type key string and the
value should be the Integer object for
audit operation success mode.FdkException
- if the operation failspublic static String getAuditTypeOperationKey(LibrarySession session, int opType) throws FdkException
session
- library sessionopType
- audit opTypeFdkException
- if the operation failspublic static int getAuditOperationType(LibrarySession session, String opTypeKey) throws FdkException
session
- library sessionopTypeKey
- audit operation type keyFdkException
- if the operation failspublic static Long getId(LibraryObject reposObject)
null
if the the ID cannot be obtained.reposObject
- The repository object.public static DefinitionObject getDefinitionObject(LibrarySession ls, long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the defininitionObject to retrieve.FdkException
- if the operation fails.public static DefinitionObject getDefinitionObject(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the defininitionObject to retrieve.FdkException
- if the operation fails.public static Document getDocument(LibrarySession ls, long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the Document to retrieve.FdkException
- if the operation fails.public static Document getDocument(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the Document to retrieve.FdkException
- if the operation fails.public static PublicObject getPublicObject(LibrarySession ls, long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the PublicObject to retrieve.FdkException
- if the operation fails.public static PublicObject getPublicObject(LibrarySession ls, Long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the PublicObject to retrieve.FdkException
- if the operation fails.public static Folder getFolder(LibrarySession ls, long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the folder to retrieve.FdkException
- if the operation fails.public static Folder getFolder(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the folder to retrieve.FdkException
- if the operation fails.public static Folder getFolder(LibrarySession ls, AttributeValue av) throws FdkException
ls
- the LibrarySession to use.av
- the AttributeValue holding the folder to retrieve.FdkException
- if the operation fails.public static Link getLink(LibrarySession ls, long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the link to retrieve.FdkException
- if the operation fails.public static Link getLink(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the link to retrieve.FdkException
- if the operation fails.public static DirectoryUser getUser(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the user to retrieve.FdkException
- if the operation fails.public static DirectoryGroup getDirectoryGroup(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the group to retrieve.FdkException
- if the operation fails.public static DirectoryObject getDirectoryObject(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the DO to retrieve.FdkException
- if the operation fails.public static AuditTypeList getAuditTypeList(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to useid
- The ID of the AuditTypeList to retrieveFdkException
- if the operation fails.public static VersionDescription getVersionDescription(LibrarySession ls, long id) throws FdkException
ls
- the LibrarySession to use.id
- the ID of the VersionDescription to retrieve.FdkException
- if the operation fails.public static VersionDescription getVersionDescription(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the VersionDescription to retrieve.FdkException
- if the operation fails.public static LifecyclePolicy getLifecyclePolicy(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the LifecyclePolicy.FdkException
- if the operation fails.public static Media getMedia(LibrarySession ls, Long id) throws FdkException
ls
- The LibrarySession to use.id
- The ID of the Media to retrieve.FdkException
- if the operation fails.public static Media getMedia(LibrarySession ls, String mediaName) throws IfsException, FdkException
ls
- The LibrarySession to use.mediaName
- The name of the Media to retrieve.IfsException
- if the operation fails.FdkException
- if the media is not found.public static void checkInvalidAttributes(Map attrMap) throws FdkException
attrMap
- the attributesFdkException
- if the operation fails.Copyright © 2023. All rights reserved.