# Custom Class

## Custom authentication

&#x20;

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><pre><code>package com.xnarum.custom;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.commons.codec.binary.Base64;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MyAuthenticator {

```
public List execute(HashMap map, String id, String password, String authUrl) throws Exception {
    ArrayList rtn = new ArrayList();
        
        
    rtn.add(new BasicNameValuePair("X-Auth-Token", getToken(id, password, authUrl)));
    return rtn;
}
            
public String getToken(String id, String password, String url) throws Exception {
                
    return new String(Base64.encodeBase64(String.format("%s.%s", id, password).getBytes()));
}
        
```

}

</code></pre></td></tr></tbody></table>

&#x20;

&#x20;

## Mapping Function

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><pre><code>import com.ism.common.exception.ErrorCode;
import com.ism.transformer.converter.IConverter;
import com.ism.transformer.converter.IConverterListener;
import com.ism.transformer.converter.IConverterLocker;
import com.ism.transformer.exception.ConvertException;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ToLower implements IConverter {

```
@Override
public void initialize(IConverterLocker converterlocker,
		IConverterListener converterlistener) {
	// TODO Auto-generated method stub

}

@Override
public Object execute(Object[] inputs) throws ConvertException {
	// TODO Auto-generated method stub
	
	if ( inputs == null || inputs.length &#x3C; 1 ) {
		throw new ConvertException( ErrorCode.TRNS_CUSTOMFUNCTION_CONVERT_FAIL, "Not enough parameters. 1 parameter is required.");
	}
	String input = inputs[0].toString();
	String lower = input.toLowerCase();
	log.info("Converted input {} to {}", input, lower);
	return lower;
}

@Override
public void terminate() {
	// TODO Auto-generated method stub

}
```

} </code></pre></td></tr></tbody></table>

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ism-docs.xnarum.com/custom-class.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
