public void removeEntries() {

    boolean isEmailEntryExist = false;
    boolean isPasswordEntryExist = false;
    try {
      String entrySet = stub.getEntryNamesString();
      isEmailEntryExist = entrySet.contains("[Entry]-email");
      isPasswordEntryExist = entrySet.contains("[Entry]-password");
    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (LocalEntryAdminException e) {
      e.printStackTrace();
    }

    try {

      if (isEmailEntryExist) {
        stub.deleteEntry("email");
      }
      if (isPasswordEntryExist) {
        stub.deleteEntry("password");
      }
    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (LocalEntryAdminException e) {
      e.printStackTrace();
    }
  }
Ejemplo n.º 2
0
 public void addLocalEntry(String sessionCookie, DataHandler dh)
     throws LocalEntryAdminException, IOException, XMLStreamException {
   AuthenticateStub.authenticateStub(sessionCookie, localEntryAdminServiceStub);
   XMLStreamReader parser =
       XMLInputFactory.newInstance().createXMLStreamReader(dh.getInputStream());
   // create the builder
   StAXOMBuilder builder = new StAXOMBuilder(parser);
   OMElement localEntryElem = builder.getDocumentElement();
   localEntryAdminServiceStub.addEntry(localEntryElem.toString());
 }
  public void addLocalEntry(
      String userName, String password, String mailUserNAme, String mailPassword)
      throws EmailMonitorServiceException {
    CarbonUtils.setBasicAccessSecurityHeaders(userName, password, stub._getServiceClient());

    boolean isEmailEntryExist = false;
    boolean isPasswordEntryExist = false;
    try {
      String entrySet = stub.getEntryNamesString();
      isEmailEntryExist = entrySet.contains("[Entry]-email");
      isPasswordEntryExist = entrySet.contains("[Entry]-password");
    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (LocalEntryAdminException e) {
      e.printStackTrace();
    }

    CryptographyManager cryptographyManager = new CryptographyManager();

    try {

      if (isEmailEntryExist) {
        stub.deleteEntry("email");
      }
      if (isPasswordEntryExist) {
        stub.deleteEntry("password");
      }
      stub.addEntry(
          "<localEntry key=\"email\"><email>"
              + mailUserNAme
              + "</email><description/></localEntry>");
      stub.addEntry(
          "<localEntry key=\"password\"><password>"
              + cryptographyManager.encryptAndBase64Encode(mailPassword)
              + "</password><description/></localEntry>");

    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (LocalEntryAdminException e) {
      e.printStackTrace();
    }
  }
Ejemplo n.º 4
0
 public OMElement getLocalEntry(String sessionCookie, String localEntryKey)
     throws LocalEntryAdminException, RemoteException {
   AuthenticateStub.authenticateStub(sessionCookie, localEntryAdminServiceStub);
   return (OMElement) localEntryAdminServiceStub.getEntry(localEntryKey);
 }
Ejemplo n.º 5
0
 public void deleteLocalEntry(String sessionCookie, String localEntryKey)
     throws LocalEntryAdminException, RemoteException {
   AuthenticateStub.authenticateStub(sessionCookie, localEntryAdminServiceStub);
   localEntryAdminServiceStub.deleteEntry(localEntryKey);
 }