return Integer.valueOf(id);
}
/** @return the publisher data and updates it if necessary. */
private BasePublisher getPublisher(PublisherData pData) {
BasePublisher publisher = pData.getCachedPublisher();
if (publisher == null) {
java.beans.XMLDecoder decoder;
try {
decoder = new java.beans.XMLDecoder(new java.io.ByteArrayInputStream(pData.getData().getBytes("UTF8")));
} catch (UnsupportedEncodingException e) {
throw new EJBException(e);
}
HashMap h = (HashMap) decoder.readObject();
decoder.close();
// Handle Base64 encoded string values
HashMap data = new Base64GetHashMap(h);
switch (((Integer) (data.get(BasePublisher.TYPE))).intValue()) {
case PublisherConst.TYPE_LDAPPUBLISHER:
publisher = new LdapPublisher();
break;
case PublisherConst.TYPE_LDAPSEARCHPUBLISHER:
publisher = new LdapSearchPublisher();
break;
case PublisherConst.TYPE_ADPUBLISHER:
publisher = new ActiveDirectoryPublisher();
break;
case PublisherConst.TYPE_CUSTOMPUBLISHERCONTAINER:
publisher = new CustomPublisherContainer();
break;
case PublisherConst.TYPE_VAPUBLISHER:
publisher = new ValidationAuthorityPublisher();
break;
}
publisher.loadData(data);
}
return publisher;
}