use of com.iplanet.am.sdk.AMException in project OpenAM by OpenRock.
the class RemoteServicesImpl method removeEntry.
/**
* Remove an entry from the directory.
*
* @param token
* SSOToken
* @param entryDN
* dn of the profile to be removed
* @param objectType
* profile type
* @param recursive
* if true, remove all sub entries & the object
* @param softDelete
* Used to let pre/post callback plugins know that this delete is
* either a soft delete (marked for deletion) or a purge/hard
* delete itself, otherwise, remove the object only
*/
public void removeEntry(SSOToken token, String entryDN, int objectType, boolean recursive, boolean softDelete) throws AMException, SSOException {
try {
String tokenID = token.getTokenID().toString();
Object[] objs = { tokenID, entryDN, new Integer(objectType), Boolean.valueOf(recursive), Boolean.valueOf(softDelete) };
client.send(client.encodeMessage("removeEntry", objs), sessionCookies.getLBCookie(tokenID), null);
} catch (AMRemoteException amrex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.removeEntry: entryDN=" + entryDN + "; AMRemoteException caught exception=", amrex);
}
throw convertException(amrex);
} catch (RemoteException rex) {
getDebug().error("RemoteServicesImpl.removeEntry: caught " + "exception=", rex);
throw new AMException(AMSDKBundle.getString("1000"), "1000");
} catch (SSOException ssoe) {
getDebug().error("RemoteServicesImpl.removeEntry: caught SSOException=", ssoe);
throw ssoe;
} catch (Exception ex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.removeEntry: entryDN=" + entryDN + "; caught exception=", ex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
}
}
use of com.iplanet.am.sdk.AMException in project OpenAM by OpenRock.
the class RemoteServicesImpl method createAMTemplate.
/**
* Create an AMTemplate (COSTemplate)
*
* @param token
* token
* @param entryDN
* DN of the profile whose template is to be set
* @param objectType
* object type
* @param serviceName
* Service Name
* @param attributes
* attributes to be set
* @param priority
* template priority
* @return String DN of the newly created template
*/
public String createAMTemplate(SSOToken token, String entryDN, int objectType, String serviceName, Map attributes, int priority) throws AMException {
try {
String tokenID = token.getTokenID().toString();
Object[] objs = { tokenID, entryDN, new Integer(objectType), serviceName, attributes, new Integer(priority) };
return ((String) client.send(client.encodeMessage("createAMTemplate", objs), sessionCookies.getLBCookie(tokenID), null));
} catch (AMRemoteException amrex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.createAMTemplate : entryDN=" + entryDN + "; AMRemoteException caught exception=", amrex);
}
throw convertException(amrex);
} catch (RemoteException rex) {
getDebug().error("RemoteServicesImpl.createAMTemplate: caught exception=", rex);
throw new AMException(AMSDKBundle.getString("1000"), "1000");
} catch (Exception ex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.createAMTemplate : entryDN=" + entryDN + "; caught exception=", ex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
}
}
use of com.iplanet.am.sdk.AMException in project OpenAM by OpenRock.
the class RemoteServicesImpl method getMembers.
/**
* Get members for roles, dynamic group or static group
*
* @param token
* SSOToken
* @param entryDN
* DN of the role or group
* @param objectType
* objectType of the target object, AMObject.ROLE or
* AMObject.GROUP
* @return Set Member DNs
*/
public Set getMembers(SSOToken token, String entryDN, int objectType) throws AMException {
try {
String tokenID = token.getTokenID().toString();
Object[] objs = { tokenID, entryDN, new Integer(objectType) };
return ((Set) client.send(client.encodeMessage("getMembers", objs), sessionCookies.getLBCookie(tokenID), null));
} catch (AMRemoteException amrex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getMembers : entryDN" + entryDN + "; AMRemoteException caught exception=", amrex);
}
throw convertException(amrex);
} catch (RemoteException rex) {
getDebug().error("RemoteServicesImpl.getMembers: caught exception=", rex);
throw new AMException(AMSDKBundle.getString("1000"), "1000");
} catch (Exception ex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getMembers : entryDN=" + entryDN + "; caught exception=", ex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
}
}
use of com.iplanet.am.sdk.AMException in project OpenAM by OpenRock.
the class RemoteServicesImpl method getObjectType.
/**
* Gets the type of the object given its DN.
*
* @param token
* token a valid SSOToken
* @param dn
* DN of the object whose type is to be known.
*
* @throws AMException
* if the data store is unavailable or if the object type is
* unknown
* @throws SSOException
* if ssoToken is invalid or expired.
*/
public int getObjectType(SSOToken token, String dn) throws AMException, SSOException {
try {
String tokenID = token.getTokenID().toString();
Object[] objs = { tokenID, dn };
Integer res = ((Integer) client.send(client.encodeMessage("getObjectType", objs), sessionCookies.getLBCookie(tokenID), null));
return res.intValue();
} catch (AMRemoteException amrex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getObjectType: dn=" + dn + "; AMRemoteException caught exception=", amrex);
}
throw convertException(amrex);
} catch (RemoteException rex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getObjectType: dn=" + dn + "; AMRemoteException caught exception=", rex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
} catch (SSOException ssoe) {
getDebug().error("RemoteServicesImpl.getObjectType: dn=" + dn + "; caught SSOException=", ssoe);
throw ssoe;
} catch (Exception ex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getObjectType: dn=" + dn + "; caught exception=", ex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
}
}
use of com.iplanet.am.sdk.AMException in project OpenAM by OpenRock.
the class RemoteServicesImpl method getAttributes.
public Map getAttributes(SSOToken token, String entryDN, Set attrNames, int profileType) throws AMException, SSOException {
try {
String tokenID = token.getTokenID().toString();
Object[] objs = { tokenID, entryDN, attrNames, new Integer(profileType) };
Map map = (Map) client.send(client.encodeMessage("getAttributes2", objs), sessionCookies.getLBCookie(tokenID), null);
AMHashMap res = new AMHashMap();
res.copy(map);
return res;
} catch (AMRemoteException amrex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getAttributes 2: entryDN=" + entryDN + "; AMRemoteException caught exception=", amrex);
}
throw convertException(amrex);
} catch (RemoteException rex) {
getDebug().error("RemoteServicesImpl.getAttributes: caught exception=", rex);
throw new AMException(AMSDKBundle.getString("1000"), "1000");
} catch (SSOException ssoe) {
getDebug().error("RemoteServicesImpl.getAttributes: caught SSOException=", ssoe);
throw ssoe;
} catch (Exception ex) {
if (getDebug().messageEnabled()) {
getDebug().message("RemoteServicesImpl.getAttributes2: entryDN=" + entryDN + "; caught exception=", ex);
}
throw new AMException(AMSDKBundle.getString("1000"), "1000");
}
}
Aggregations